10684029
ORCL
3
버전 비교
비교대상
키
- 이 줄이 추가되었습니다.
- 이 줄이 삭제되었습니다.
- 서식이 변경되었습니다.
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
mkdir -p $ORACLE_BASE/admin/[DB_NAME]/scripts cd $ORACLE_BASE/admin/[DB_NAME]/scripts |
펼치기 | ||
---|---|---|
|
스크립트 생성 디렉토리를 $ORACLE_BASE 경로 아래에 생성합니다.
작업할 스크립트를 모두 이곳에 저장합니다.
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
#!/bin/sh OLD_UMASK=`umask` umask 0027 mkdir -p [ORACLE_BASE]/admin/[DB_NAME]/adump mkdir -p [ORACLE_BASE]/admin/[DB_NAME]/dpdump mkdir -p [ORACLE_BASE]/admin/[DB_NAME]/hdump mkdir -p [ORACLE_BASE]/admin/[DB_NAME]/pfile mkdir -p [ORACLE_BASE]/cfgtoollogs/dbca/[DB_NAME] ssh oracle@[HOST_NAME2] "mkdir -p [ORACLE_BASE]/admin/[DB_NAME]/adump" ssh oracle@[HOST_NAME2] "mkdir -p [ORACLE_BASE]/admin/[DB_NAME]/dpdump" ssh oracle@[HOST_NAME2] "mkdir -p [ORACLE_BASE]/admin/[DB_NAME]/hdump" ssh oracle@[HOST_NAME2] "mkdir -p [ORACLE_BASE]/admin/[DB_NAME]/pfile" ssh oracle@[HOST_NAME2] "mkdir -p [ORACLE_BASE]/cfgtoollogs/dbca/[DB_NAME]" umask ${OLD_UMASK} ORACLE_SID=[ORACLE_SID1]; export ORACLE_SID PATH=$ORACLE_HOME/bin:$PATH; export PATH echo You should Add this entry in the /etc/oratab: [ORACLE_SID]:[DB_HOME]:N [DB_HOME]/bin/sqlplus /nolog @[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateRACDB.sql |
펼치기 | ||
---|---|---|
|
데이터베이스 생성을 위해 필요한 디렉토리를 만들고 전체 작업을 수행할 메인 스크립트를 생성합니다.
괄호 [] 안에 표시된 변수 부분은 실제 설치할 환경에 해당되는 내용으로 수정하여 저장하도록 합니다.
[ORACLE_BASE] : 오라클 소프트웨어 설치 베이스 경로
[DB_NAME] : 데이터베이스 명
[HOST_NAME2] : 2번 노드의 서버 명
[ORACLE_SID1] : 1번 인스턴스 명
[ORACLE_SID] : 각 노드의 인스턴스 명
[DB_HOME] : 데이터베이스 소프트웨어 설치 경로
코드 블럭 | ||||
---|---|---|---|---|
| ||||
set verify off ACCEPT sysPassword CHAR PROMPT 'Enter new password for SYS: ' HIDE ACCEPT systemPassword CHAR PROMPT 'Enter new password for SYSTEM: ' HIDE host [DB_HOME]/bin/orapwd file=[DB_HOME]/dbs/orapw[ORACLE_SID1] force=y host ssh oracle@[HOST_NAME2] "host [DB_HOME]/bin/orapwd file=[DB_HOME]/dbs/orapw[ORACLE_SID2] force=y" host [GRID_HOME]/bin/setasmgidwrap o=[DB_HOME]/bin/oracle host [DB_HOME]/bin/srvctl add database -d [DB_NAME] -o [DB_HOME] -p /dev/raw/raw20 -n [DB_NAME] host [DB_HOME]/bin/srvctl add instance -d [DB_NAME] -i [ORACLE_SID1] -n [HOST_NAME1] host [DB_HOME]/bin/srvctl add instance -d [DB_NAME] -i [ORACLE_SID2] -n [HOST_NAME2] host [DB_HOME]/bin/srvctl disable database -d [DB_NAME] @[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateDB.sql @[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateDBFiles.sql @[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateDBCatalog.sql @[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateJVM.sql @[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateClustDBViews.sql --@[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateOracleText.sql --@[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateXDB.sql --@[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateORDSchema.sql --@[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateMultiMedia.sql --@[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateOLAP.sql --@[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateSpatial.sql --@[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateEMRepos.sql --@[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateAPEX.sql --@[ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateOWB.sql host echo "SPFILE='/dev/raw/raw20'" > [DB_HOME]/dbs/init[ORACLE_SID1].ora @[ORACLE_BASE]/admin/[DB_NAME]/scripts/lockAccount.sql @[ORACLE_BASE]/admin/[DB_NAME]/scripts/postDBCreation.sql |
펼치기 | ||
---|---|---|
|
서비스에 등록하고 각각의 SQL 스크립트를 수행할 스크립트를 생성합니다.
괄호 [] 안에 표시된 변수 부분은 실제 설치할 환경에 해당되는 내용으로 수정하여 저장하도록 합니다.
[DB_HOME]
[ORACLE_SID1]
[GRID_HOME]
[DB_NAME]
[ORACLE_SID1]
[HOST_NAME1]
[ORACLE_SID2]
[HOST_NAME2]
[ORACLE_BASE]
코드 블럭 | ||||
---|---|---|---|---|
| ||||
SET VERIFY OFF connect "SYS"/"&&sysPassword" as SYSDBA set echo on spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateDB.log append startup nomount pfile="[ORACLE_BASE]/admin/[DB_NAME]/scripts/init.ora"; CREATE DATABASE "[DB_NAME]" MAXINSTANCES 32 MAXLOGHISTORY 1 MAXLOGFILES 192 MAXLOGMEMBERS 3 MAXDATAFILES 1024 DATAFILE '/dev/raw/raw6' SIZE 699M AUTOEXTEND OFF EXTENT MANAGEMENT LOCAL SYSAUX DATAFILE '/dev/raw/raw7' SIZE 699M AUTOEXTEND OFF SMALLFILE DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/dev/raw/raw9' SIZE 699M AUTOEXTEND OFF SMALLFILE UNDO TABLESPACE "UNDOTBS1" DATAFILE '/dev/raw/raw10' SIZE 699M AUTOEXTEND OFF CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16 LOGFILE GROUP 1 ('/dev/raw/raw14') SIZE 199M, GROUP 2 ('/dev/raw/raw15') SIZE 199M, GROUP 3 ('/dev/raw/raw16') SIZE 199M USER SYS IDENTIFIED BY "&&sysPassword" USER SYSTEM IDENTIFIED BY "&&systemPassword"; spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||
---|---|---|---|---|
| ||||
SET VERIFY OFF connect "SYS"/"&&sysPassword" as SYSDBA set echo on spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateDBFiles.log append CREATE SMALLFILE UNDO TABLESPACE "UNDOTBS2" DATAFILE '/dev/raw/raw11' SIZE 699M AUTOEXTEND OFF; CREATE SMALLFILE TABLESPACE "USERS" LOGGING DATAFILE '/dev/raw/raw8' SIZE 699M AUTOEXTEND OFF EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; ALTER DATABASE DEFAULT TABLESPACE "USERS"; spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||
---|---|---|---|---|
| ||||
SET VERIFY OFF connect "SYS"/"&&sysPassword" as SYSDBA set echo on spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateDBCatalog.log append @[DB_HOME]/rdbms/admin/catalog.sql; @[DB_HOME]/rdbms/admin/catblock.sql; @[DB_HOME]/rdbms/admin/catproc.sql; @[DB_HOME]/rdbms/admin/catoctk.sql; @[DB_HOME]/rdbms/admin/owminst.plb; connect "SYSTEM"/"&&systemPassword" set echo on @[DB_HOME]/sqlplus/admin/pupbld.sql; @[DB_HOME]/sqlplus/admin/help/hlpbld.sql helpus.sql; spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
SET VERIFY OFF connect "SYS"/"&&sysPassword" as SYSDBA set echo on spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateJVM.log append @[DB_HOME]/javavm/install/initjvm.sql; @[DB_HOME]/xdk/admin/initxml.sql; @[DB_HOME]/xdk/admin/xmlja.sql; @[DB_HOME]/rdbms/admin/catjava.sql; @[DB_HOME]/rdbms/admin/catxdbj.sql; spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||
---|---|---|---|---|
| ||||
SET VERIFY OFF connect "SYS"/"&&sysPassword" as SYSDBA set echo on spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateClustDBViews.log append @[DB_HOME]/rdbms/admin/catclust.sql; spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateOracleText.log append
@[DB_HOME]/ctx/admin/catctx change_on_install SYSAUX TEMP NOLOCK;
connect "CTXSYS"/"change_on_install"
@[DB_HOME]/ctx/admin/defaults/dr0defin.sql "KOREAN";
spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateXDB.log append
@[DB_HOME]/rdbms/admin/catqm.sql change_on_install SYSAUX TEMP YES;
connect "SYS"/"&&sysPassword" as SYSDBA
@[DB_HOME]/rdbms/admin/catxdbj.sql;
@[DB_HOME]/rdbms/admin/catrul.sql;
spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateORDSchema.log append
@[DB_HOME]/ord/admin/ordinst.sql SYSAUX SYSAUX;
spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateMultiMedia.log append
@[DB_HOME]/ord/im/admin/iminst.sql;
spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
SET VERIFY OFF
set echo on
spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateOLAP.log append
connect "SYS"/"&&sysPassword" as SYSDBA
@[DB_HOME]/olap/admin/olap.sql SYSAUX TEMP;
spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateSpatial.log append
@[DB_HOME]/md/admin/mdinst.sql;
spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo off
spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateEMRepos.log append
@[DB_HOME]/sysman/admin/emdrep/sql/emreposcre [DB_HOME] SYSMAN &&sysmanPassword TEMP ON;
WHENEVER SQLERROR CONTINUE;
spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateAPEX.log append
@[DB_HOME]/apex/catapx.sql change_on_install SYSAUX SYSAUX TEMP /i/ NONE;
spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/CreateOWB.log append
@[DB_HOME]/owb/UnifiedRepos/cat_owb.sql SYSAUX TEMP;
spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||
---|---|---|---|---|
| ||||
SET VERIFY OFF set echo on spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/lockAccount.log append BEGIN FOR item IN ( SELECT USERNAME FROM DBA_USERS WHERE ACCOUNT_STATUS IN ('OPEN', 'LOCKED', 'EXPIRED') AND USERNAME NOT IN ('SYS','SYSTEM') ) LOOP dbms_output.put_line('Locking and Expiring: ' || item.USERNAME); execute immediate 'alter user ' || sys.dbms_assert.enquote_name( sys.dbms_assert.schema_name( item.USERNAME),false) || ' password expire account lock' ; END LOOP; END; / spool off |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||
---|---|---|---|---|
| ||||
SET VERIFY OFF connect "SYS"/"&&sysPassword" as SYSDBA set echo on spool [ORACLE_BASE]/admin/[DB_NAME]/scripts/postDBCreation.log append execute DBMS_AUTO_TASK_ADMIN.disable(); @[DB_HOME]/rdbms/admin/catbundle.sql psu apply; select 'utl_recomp_begin: ' || to_char(sysdate, 'HH:MI:SS') from dual; execute utl_recomp.recomp_serial(); select 'utl_recomp_end: ' || to_char(sysdate, 'HH:MI:SS') from dual; select group# from v$log where group# =3; select group# from v$log where group# =4; ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 4 ('/dev/raw/raw17') SIZE 199M, GROUP 5 ('/dev/raw/raw18') SIZE 199M, GROUP 6 ('/dev/raw/raw19') SIZE 199M; ALTER DATABASE ENABLE PUBLIC THREAD 2; host echo cluster_database=true >>[ORACLE_BASE]/admin/[DB_NAME]/scripts/init.ora; host echo remote_listener=[SCAN_NAME]:[LISTENER_PORT]>>[ORACLE_BASE]/admin/[DB_NAME]/scripts/init.ora; connect "SYS"/"&&sysPassword" as SYSDBA set echo on create spfile='/dev/raw/raw20' FROM pfile='[ORACLE_BASE]/admin/[DB_NAME]/scripts/init.ora'; shutdown immediate; host [DB_HOME]/bin/srvctl enable database -d [DB_NAME]; host [DB_HOME]/bin/srvctl start database -d [DB_NAME]; connect "SYS"/"&&sysPassword" as SYSDBA set echo on @[DB_HOME]/rdbms/admin/utlrp.sql; spool off exit; |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||
---|---|---|---|---|
| ||||
db_block_size=8192 #cluster_database=true #remote_listener=[SCAN_NAME]:[LISTENER_PORT] open_cursors=300 db_domain="" db_name="[DB_NAME]" control_files=('/dev/raw/raw12','/dev/raw/raw13') compatible=11.2.0.0.0 diagnostic_dest=[ORACLE_BASE] memory_target=834666496 processes=150 audit_file_dest="[ORACLE_BASE]/admin/[DB_NAME]/adump" audit_trail=db remote_login_passwordfile=exclusive [ORACLE_SID1].instance_number=1 [ORACLE_SID2].instance_number=2 [ORACLE_SID1].thread=1 [ORACLE_SID2].thread=2 [ORACLE_SID1].undo_tablespace=UNDOTBS1 [ORACLE_SID2].undo_tablespace=UNDOTBS2 |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
chmod 774 racDB.sh ls -ltra | grep racDB.sh |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
chmod 770 [ORACLE_BASE]/cfgtoollogs |
펼치기 | ||
---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
cd $ORACLE_BASE/admin/[DB_NAME]/scripts sh racDB.sh |
펼치기 | |||||||
---|---|---|---|---|---|---|---|
|
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
[ORACLE_SID]:[DB_HOME]:N |
펼치기 | ||||
---|---|---|---|---|
|
...