오라클 설치 하다가 DB생성 부분에서 에러가 나서 자꾸 실패가 된다고, 도와 달라고해서
GUI(dbca)를 사용할 수 없으니, 스크립트로...
오랜만에 해봐서 다음에 또 생길지 몰라 포스팅 해 봄
0. 환경변수 설정
export ORACLE_BASE=/oracle/ORA12102/product/12.1.0
export ORACLE_HOME=/oracle/ORA12102/product/12.1.0/dbhome_1
export ORACLE_SID=ORA12102
1. 파라미터 파일 생성 ( $ORACLE_HOME/dbs/initORA12102.ora )
ORA12102.__db_cache_size=419430400
ORA12102.__java_pool_size=16777216
ORA12102.__large_pool_size=33554432
ORA12102.__pga_aggregate_target=436207616
ORA12102.__sga_target=838860800
ORA12102.__shared_io_pool_size=0
ORA12102.__shared_pool_size=352321536
ORA12102.__streams_pool_size=0
*.audit_file_dest='/oracle/ORA12102/product/12.1.0/admin/ORA12102/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files=('/oracle/ORA12102/data/ctl/con01' , '/oracle/ORA12102/data/ctl/con02')
*.db_block_size=8192
*.db_create_file_dest='/oracle/ORA12102/data'
*.db_domain=''
*.db_name='ORA12102'
*.diagnostic_dest='/oracle/ORA12102/product/12.1.0'
*.memory_target=1265631232
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='exclusive'
ORA12102.undo_tablespace='UNDOTBS1'
2. 사용되는 디렉토리 생성
mkdir /oracle/ORA12102/product/12.1.0/admin/ORA12102/adump
mkdir /oracle/ORA12102/data
mkdir /oracle/ORA12102/data/ctl
mkdir /oracle/ORA12102/data/log
mkdir /oracle/ORA12102/data/data
3. DBA 권한으로 로그인 후 SPFILE 생성 --> DB 생성 --> 생성 후 스크립트 수행
SQL> connect / as sysdba
Connected to an idle instance.
SQL> create spfile from pfile;
File created.
SQL> startup nomount ;
ORACLE instance started.
Total System Global Area 1275068416 bytes
Fixed Size 2946064 bytes
Variable Size 838863856 bytes
Database Buffers 419430400 bytes
Redo Buffers 13828096 bytes
SQL> CREATE DATABASE ORA12102
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 ('/oracle/ORA12102/data/log/redo01.log') SIZE 100M,
GROUP 2 ('/oracle/ORA12102/data/log/redo02.log') SIZE 100M,
GROUP 3 ('/oracle/ORA12102/data/log/redo03.log') SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/oracle/ORA12102/data/data/system01.dbf'
SIZE 325M REUSE
SYSAUX
DATAFILE '/oracle/ORA12102/data/data/sysaux01.dbf'
SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/oracle/ORA12102/data/data/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/oracle/ORA12102/data/data/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE UNDOTBS1
DATAFILE '/oracle/ORA12102/data/data/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
Database created.
SQL> select status from v$instance ;
STATUS
------------
OPEN
SQL> show sga
Total System Global Area 1275068416 bytes
Fixed Size 2946064 bytes
Variable Size 838863856 bytes
Database Buffers 419430400 bytes
Redo Buffers 13828096 bytes
SQL>@?/rdbms/admin/catalog.sql
SQL>@?/rdbms/admin/catproc.sql
SQL>@?/sqlplus/admin/pupbld.sql
4. 리스너 설정 ( $ORACLE_HOME/network/admin/listener.ora )
LISTENER=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=rx3600)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /oracle/ORA12102/product/12.1.0/dbhome_1)
(SID_NAME = ORA12102)
)
)