먼저 Tablespace가 위치할 Directory 생성
-- 데이터용 테이블스페이스 생성
CREATE TABLESPACE TBS_DATA01
datafile 'C:\oraclexe\app\oracle\oradata\data01\TBS_DATA01_01.dbf' size 50M REUSE
extent management local autoallocate
segment space management auto;
-- 인덱스용 테이블스페이스 생성
CREATE TABLESPACE TBS_IDX01
datafile 'C:\oraclexe\app\oracle\oradata\data01\TBS_IDX01_01.dbf' size 50M REUSE
extent management local autoallocate
segment space management auto;
-- 응용프로그램 접속 계정(최소권한) : RTMS_CLIENT
DROP USER RTMS_USER CASCADE;
CREATE USER RTMS_USER
IDENTIFIED BY <password>
DEFAULT TABLESPACE TBS_DATA01
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK;
-- 2 Roles for RTMS_USER
GRANT CONNECT TO RTMS_USER;
GRANT RESOURCE TO RTMS_USER;
ALTER USER RTMS_USER DEFAULT ROLE NONE;
-- 5 System Privileges for RTMS_USER
GRANT ALTER SESSION TO RTMS_USER;
GRANT CREATE SESSION TO RTMS_USER;
GRANT CREATE SYNONYM TO RTMS_USER;
GRANT CREATE TABLE TO RTMS_USER;
GRANT UNLIMITED TABLESPACE TO RTMS_USER;
-- 1 Tablespace Quota for RTMS_USER
ALTER USER RTMS_USER QUOTA UNLIMITED ON TBS_DATA01;
ALTER TABLE RTMS_USER.RTMS_FILE_TRANS_HIST
DROP PRIMARY KEY CASCADE;
DROP TABLE RTMS_USER.RTMS_FILE_TRANS_HIST CASCADE CONSTRAINTS;
CREATE TABLE RTMS_USER.RTMS_FILE_TRANS_HIST
(
ID INTEGER NOT NULL,
IP_ADDR VARCHAR2(20 BYTE) NOT NULL,
PATH_LOC VARCHAR2(200 BYTE) NOT NULL,
FNAME VARCHAR2(100 BYTE) NOT NULL,
FEXT VARCHAR2(5 BYTE),
FLENGTH INTEGER NOT NULL,
PATH_SRV VARCHAR2(200 BYTE) NOT NULL,
AUTO_YN CHAR(1 BYTE) NOT NULL,
DEL_YN CHAR(1 BYTE) NOT NULL,
TRANSED_DATE VARCHAR2(8 BYTE) NOT NULL,
TRANSED_TIME VARCHAR2(6 BYTE) NOT NULL,
INS_DATE VARCHAR2(8 BYTE) NOT NULL,
INS_TIME VARCHAR2(6 BYTE) NOT NULL,
UPD_DATE VARCHAR2(8 BYTE),
UPD_TIME VARCHAR2(6 BYTE)
)
TABLESPACE TBS_DATA01
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
MONITORING;
CREATE INDEX RTMS_USER.IDX_TRNAS_HIST_FNAME ON RTMS_USER.RTMS_FILE_TRANS_HIST
(FNAME)
LOGGING
TABLESPACE TBS_DATA01
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
);
CREATE UNIQUE INDEX RTMS_USER.RTMS_FILE_TRANS_HIST_PK ON RTMS_USER.RTMS_FILE_TRANS_HIST
(ID)
LOGGING
TABLESPACE TBS_DATA01
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
);
ALTER TABLE RTMS_USER.RTMS_FILE_TRANS_HIST ADD (
CONSTRAINT RTMS_FILE_TRANS_HIST_PK
PRIMARY KEY
(ID)
USING INDEX RTMS_USER.RTMS_FILE_TRANS_HIST_PK
ENABLE VALIDATE);
CREATE SEQUENCE RTMS_USER.SEQ_FILE_ID
START WITH 10000000
INCREMENT BY 1
MINVALUE 10000000
MAXVALUE 99999999
NOCACHE
NOCYCLE
NOORDER;
IIS 응용프로그램 풀 에서 32bit 사용을 true 로
'Database' 카테고리의 다른 글
Oracle DB 초기 설정 (0) | 2017.08.20 |
---|---|
Oracle XE 11g 설치 (0) | 2017.08.20 |