rawdevice 설정 및 ASM 삭제
노드 1(root 유저)
# ocrconfig -add /dev/raw/raw1
# ocrconfig -add /dev/raw/raw2
# ocrconfig -delete +DATA
# ocrcheck
crsctl replace votedisk /dev/raw/raw3
# crsctl add css votedisk /dev/raw/raw4
# crsctl add css votedisk /dev/raw/raw5
# crsctl query css votedisk
DB생성
오라클 계정으로 X윈도우화면에서 dbca
“Oracle Real Application Clusters (RAC) database” 체크 → [Next]
“Create a Database” → [Next]
“Custom Database” 체크 → [Next]
Global Database Name, SID Prefix : racdb 입력 →
[Select All] 버튼 클릭하여 모든 노드 선택 → [Next]
[Enterprise Manager] 탭 “Configure Enterprise Manager” 체크 해제
[Automatic Maintenance Tasks] 탭 “Enable automatic maintenance tasks” 체크 해제 → [Next]
“Use the Same Administrativ Password for All Accounts” 체크하여 패스워드 입력 → [Next]
패스워드 유효성 위반 메시지, [Yes] 버튼을 클릭하여 계속 진행
Storage Type : ASM 선택 → “Use Oracle-Managed Files” 체크 →
Database Area : +DATA 입력 → [Next]
“Specify Fast Recovery Area” 체크 해제 → [Next]
데이터베이스 컴퍼넌트 해제를 위해 [Standard Database Components] 클릭
표준 데이터베이스 컴퍼넌트 모두 선택 해제 → [OK]
데이터베이스 컴퍼넌트 선택 해제 확인 후 [Next] 버튼 클릭
[Chracter Sets] 선택 → “Choose from the list of character sets” 체크 →
“KO16MSWIN949” 캐릭터 셋 선택→ [Next]
데이터 저장소 설정은 특이사항 없으므로 [Next] 버튼 클릭
데이터베이스 수동 생성을 위한 스크립트 작성을 위해 “Create Database”는 체크 해제,
“Generate Database Creation Scripts”에 체크 → [Finish]
데이터베이스 생성 요약 정보 확인 후 [OK] 버튼 클릭
데이터베이스 수동 생성을 위한 스크립트 작성 중
스크립트 작성 완료 후 추가 작업이 필요하지 않으므로 [No] 버튼을 클릭하여 종료
임시 DATA 디스크 그룹 삭제
노드 1(root 유저)
# dd if=/dev/zero of=/dev/raw/raw6 bs=8k
# dd if=/dev/zero of=/dev/raw/raw7 bs=8k
# dd if=/dev/zero of=/dev/raw/raw8 bs=8k
데이터베이스 생성 스크립트 수정
노드 1(oracle 유저)
$ cd /app/oracle/admin/racdb/scripts
$ ls -l
$ vi racdb1.sql (6번째 줄, 14번째 줄 수정)
set verify off
ACCEPT sysPassword CHAR PROMPT 'Enter new password for SYS: ' HIDE
ACCEPT systemPassword CHAR PROMPT 'Enter new password for SYSTEM: ' HIDE
host /app/oracle/11g/db/bin/orapwd file=/app/oracle/11g/db/dbs/orapwracdb1 force=y
host /app/11g/grid/bin/setasmgidwrap o=/app/oracle/11g/db/bin/oracle
host /app/oracle/11g/db/bin/srvctl add database -d racdb -o /app/oracle/11g/db -p /dev/raw/raw21 -n racdb
host /app/oracle/11g/db/bin/srvctl add instance -d racdb -i racdb1 -n rac1
host /app/oracle/11g/db/bin/srvctl add instance -d racdb -i racdb2 -n rac2
host /app/oracle/11g/db/bin/srvctl disable database -d racdb
@/app/oracle/admin/racdb/scripts/CreateDB.sql
@/app/oracle/admin/racdb/scripts/CreateDBFiles.sql
@/app/oracle/admin/racdb/scripts/CreateDBCatalog.sql
@/app/oracle/admin/racdb/scripts/CreateClustDBViews.sql
host echo "SPFILE='/dev/raw/raw21'" > /app/oracle/11g/db/dbs/initracdb1.ora
@/app/oracle/admin/racdb/scripts/lockAccount.sql
@/app/oracle/admin/racdb/scripts/postDBCreation.sql
여기서부터 원본내용 지우고 복사 붙여넣으세요
$ vi CreateDB.sql
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool /app/oracle/admin/racdb/scripts/CreateDB.log append
startup nomount pfile="/app/oracle/admin/racdb/scripts/init.ora";
CREATE DATABASE "racdb"
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
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/dev/raw/raw9' SIZE 699M AUTOEXTEND OFF
UNDO TABLESPACE "UNDOTBS1" DATAFILE '/dev/raw/raw10' SIZE 199M AUTOEXTEND OFF
CHARACTER SET KO16MSWIN949
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ('/dev/raw/raw12') SIZE 199M,
GROUP 2 ('/dev/raw/raw13') SIZE 199M,
GROUP 3 ('/dev/raw/raw14') SIZE 199M;
USER SYS IDENTIFIED BY "&&sysPassword" USER SYSTEM IDENTIFIED BY "&&systemPassword";
spool off
$ vi CreateDBFiles.sql
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool /app/oracle/admin/racdb/scripts/CreateDBFiles.log append
CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE '/dev/raw/raw11' SIZE 699M AUTOEXTEND OFF;
CREATE 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
$ vi postDBCreation.sql
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool /app/oracle/admin/racdb/scripts/postDBCreation.log append
execute DBMS_AUTO_TASK_ADMIN.disable();
@/app/oracle/11g/db/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/raw15') SIZE 199M,
GROUP 5 ('/dev/raw/raw16') SIZE 199M,
GROUP 6 ('/dev/raw/raw17') SIZE 199M;
ALTER DATABASE ENABLE PUBLIC THREAD 2;
host echo cluster_database=true >>/app/oracle/admin/racdb/scripts/init.ora;
host echo remote_listener=rac-scan:1521>>/app/oracle/admin/racdb/scripts/init.ora;
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
create spfile='/dev/raw/raw21' FROM pfile='/app/oracle/admin/racdb/scripts/init.ora';
shutdown immediate;
host /app/oracle/11g/db/bin/srvctl enable database -d racdb;
host /app/oracle/11g/db/bin/srvctl start database -d racdb;
connect "SYS"/"&&sysPassword" as SYSDBA
spool off
exit;
$ vi init.ora
수정 전 (30번째 줄) db_create_file_dest="+DATA"
수정 후(30번째 줄) control_files=('/dev/raw/raw18','/dev/raw/raw19','/dev/raw/raw20')
DB생성 쉘 스크립트 실행
노드 1(oracle 유저)
$ sh /app/oracle/admin/racdb/scripts/racdb1.sh (시간이 좀 걸림 참고기다릴것)
노드 2(oracle 유저)
$ sh /app/oracle/admin/racdb/scripts/racdb2.sh
노드 1 또는 2(oracle 유저)
$ srvctl stop database -d racdb
$ srvctl stop diskgroup -g data
$ srvctl stop asm -n rac1 -f
$ srvctl stop asm -n rac2 -f
$ srvctl remove diskgroup -g data -f
$ srvctl remove asm -f
$ srvctl modify database -d racdb -z
$ srvctl start database -d racdb
노드 1(oracle 유저)
$ crs_stat -t
노드 2(oracle 유저)
$ crs_stat -t
$ srvctl stop database -d racdb
$ sqlplus / as sysdba
SQL> startup
SQL> alter system set cluster_database=true scope=spfile sid='*';
SQL> shutdown immediate
SQL> exit
$ srvctl start database -d racdb
노드 1(oracle 유저)
$ sqlplus "/as sysdba"
SQL> select instance_name, status from v$instance;
SQL> exit
노드 2(oracle 유저)
$ sqlplus "/as sysdba"
SQL> select instance_name, status from v$instance;
SQL> exit
'RAC 설치 > OEL5+11g+RAC_Raw' 카테고리의 다른 글
OEL5+Oracle11g+Rac_Raw device (DB엔진설치) (0) | 2014.09.21 |
---|---|
OEL5+Oracle11g+Rac_Raw device (GRID설치) (0) | 2014.09.21 |
OEL5+Oracle11g+Rac_Raw device (Node1_Node2 설정) (0) | 2014.09.21 |
OEL5+Oracle11g+Rac_Raw device (VMware설정+Linux설치) (0) | 2014.09.21 |