1. ASM 구성
A) ASM 인스턴스 및 디스크 그룹 생성
ASM 인스턴스 및 디스크 그룹 생성
grid_env asmca -silent -configureASM -sysAsmPassword <SYSASM 암호> -asmsnmpPassword <ASMSNMP 암호> -diskString 'ORCL:*' -diskGroupName CRS -diskList 'ORCL:CRS1,ORCL:CRS2,ORCL:CRS3' -redundancy NORMAL
[racdb1:/home/oracle]> grid_env [+ASM1:/home/oracle]> asmca -silent -configureASM -sysAsmPassword oracle_4U -asmsnmpPassword oracle_4U -diskString 'ORCL:*' -diskGroupName CRS -diskList 'ORCL:CRS1,ORCL:CRS2,ORCL:CRS3' -redundancy NORMAL ASM이 성공적으로 생성되고 시작되었습니다. 디스크 그룹 CRS이(가) 성공적으로 생성되었습니다. [root@rac1 ~]# crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.CRS.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started ora.gsd OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2 ora.net1.network ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.ons ONLINE ONLINE rac1 ONLINE ONLINE rac2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac1 ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac1 ora.cvu 1 ONLINE ONLINE rac1 ora.oc4j 1 ONLINE ONLINE rac1 ora.rac1.vip 1 ONLINE ONLINE rac1 ora.rac2.vip 1 ONLINE ONLINE rac2 ora.racdb.db 1 ONLINE ONLINE rac1 Open 2 ONLINE ONLINE rac2 Open ora.scan1.vip 1 ONLINE ONLINE rac2 ora.scan2.vip 1 ONLINE ONLINE rac1 ora.scan3.vip 1 ONLINE ONLINE rac1
{}
DATA 및 FRA 디스크 그룹 추가 생성
asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName DATA -disk 'ORCL:DATA' -redundancy EXTERNAL asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName FRA -disk 'ORCL:FRA' -redundancy EXTERNAL
[+ASM1:/home/oracle]> asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName DATA -disk 'ORCL:DATA' -redundancy EXTERNAL 디스크 그룹 DATA이(가) 성공적으로 생성되었습니다. [+ASM1:/home/oracle]> asmca -silent -createDiskGroup -diskString 'ORCL:*' -diskGroupName FRA -disk 'ORCL:FRA' -redundancy EXTERNAL 디스크 그룹 FRA이(가) 성공적으로 생성되었습니다. [root@rac2 ~]# crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.CRS.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATA.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.FRA.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started ora.gsd OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2 ora.net1.network ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.ons ONLINE ONLINE rac1 ONLINE ONLINE rac2 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac1 ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac1 ora.cvu 1 ONLINE ONLINE rac1 ora.oc4j 1 ONLINE ONLINE rac1 ora.rac1.vip 1 ONLINE ONLINE rac1 ora.rac2.vip 1 ONLINE ONLINE rac2 ora.racdb.db 1 ONLINE ONLINE rac1 Open 2 ONLINE ONLINE rac2 Open ora.scan1.vip 1 ONLINE ONLINE rac2 ora.scan2.vip 1 ONLINE ONLINE rac1 ora.scan3.vip 1 ONLINE ONLINE rac1
B) CRS 및 Vote 영역 ASM으로 이관
ASM으로 OCR 영역 이관
ocrconfig -add +CRS ocrconfig -delete /dev/raw/raw1 ocrconfig -delete /dev/raw/raw2 ocrcheck
[root@rac1 ~]# ocrcheck Status of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 3020 Available space (kbytes) : 259100 ID : 934357259 Device/File Name : /dev/raw/raw1 Device/File integrity check succeeded Device/File Name : /dev/raw/raw2 Device/File integrity check succeeded Device/File not configured Device/File not configured Device/File not configured Cluster registry integrity check succeeded Logical corruption check succeeded [root@rac1 ~]# ocrconfig -add +CRS [root@rac1 ~]# ocrconfig -delete /dev/raw/raw1 [root@rac1 ~]# ocrconfig -delete /dev/raw/raw2 [root@rac1 ~]# ocrcheck Status of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 3020 Available space (kbytes) : 259100 ID : 934357259 Device/File Name : +CRS Device/File integrity check succeeded Device/File not configured Device/File not configured Device/File not configured Device/File not configured Cluster registry integrity check succeeded Logical corruption check succeeded
ASM으로 Vote 영역 이관
crsctl replace votedisk +CRS crsctl query css votedisk
[root@rac1 ~]# crsctl query css votedisk ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE a4c3ccb126b64f4dbf3d89ae84d163a2 (/dev/raw/raw3) [] 2. ONLINE 31693ea2d7774f83bfd26b71d8173078 (/dev/raw/raw4) [] 3. ONLINE 7527b0194b634f7abfbc3c3501a8a6f4 (/dev/raw/raw5) [] Located 3 voting disk(s). [root@rac1 ~]# crsctl replace votedisk +CRS CRS-4256: Updating the profile Successful addition of voting disk d10cbc0b84bb4fa1bf868c98b6cb9463. Successful addition of voting disk 6d485ec847b34f48bf3cd1462e0ba114. Successful addition of voting disk e42528b7cab34f88bf51951976a27e4a. Successful deletion of voting disk a4c3ccb126b64f4dbf3d89ae84d163a2. Successful deletion of voting disk 31693ea2d7774f83bfd26b71d8173078. Successful deletion of voting disk 7527b0194b634f7abfbc3c3501a8a6f4. Successfully replaced voting disk group with +CRS. CRS-4256: Updating the profile CRS-4266: Voting file(s) successfully replaced [root@rac1 ~]# crsctl query css votedisk ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE d10cbc0b84bb4fa1bf868c98b6cb9463 (ORCL:CRS1) [CRS] 2. ONLINE 6d485ec847b34f48bf3cd1462e0ba114 (ORCL:CRS2) [CRS] 3. ONLINE e42528b7cab34f88bf51951976a27e4a (ORCL:CRS3) [CRS] Located 3 voting disk(s).
C) ASM 호환성 변경
ASM 호환성 변경
asmcmd setattr -G CRS compatible.asm 11.2.0.2.0 asmcmd setattr -G DATA compatible.asm 11.2.0.2.0 asmcmd setattr -G FRA compatible.asm 11.2.0.2.0 asmcmd lsattr -G CRS -lm compatible.asm asmcmd lsattr -G DATA -lm compatible.asm asmcmd lsattr -G FRA -lm compatible.asm
[+ASM1:/home/oracle]> asmcmd lsattr -G CRS -lm compatible.asm Group_Name Name Value RO Sys CRS compatible.asm 11.2.0.0.0 N Y [+ASM1:/home/oracle]> asmcmd lsattr -G DATA -lm compatible.asm Group_Name Name Value RO Sys DATA compatible.asm 11.2.0.0.0 N Y [+ASM1:/home/oracle]> asmcmd lsattr -G FRA -lm compatible.asm Group_Name Name Value RO Sys FRA compatible.asm 11.2.0.0.0 N Y [+ASM1:/home/oracle]> asmcmd setattr -G CRS compatible.asm 11.2.0.2.0 [+ASM1:/home/oracle]> asmcmd setattr -G DATA compatible.asm 11.2.0.2.0 [+ASM1:/home/oracle]> asmcmd setattr -G FRA compatible.asm 11.2.0.2.0 [+ASM1:/home/oracle]> asmcmd lsattr -G CRS -lm compatible.asm Group_Name Name Value RO Sys CRS compatible.asm 11.2.0.2.0 N Y [+ASM1:/home/oracle]> asmcmd lsattr -G DATA -lm compatible.asm Group_Name Name Value RO Sys DATA compatible.asm 11.2.0.2.0 N Y [+ASM1:/home/oracle]> asmcmd lsattr -G FRA -lm compatible.asm Group_Name Name Value RO Sys FRA compatible.asm 11.2.0.2.0 N Y
11g R2의 ASM을 19c로 업그레이드 하기 위해서는 ASM의 최소 호환성은 11.2.0.2 이상이어야 합니다.
2. ASM으로 Database 이관
A) 사전 현황 조사
데이터 파일 현황 조사
select TABLESPACE_NAME, FILE_NAME, BYTES/1024/1024 MB from DBA_DATA_FILES;
SQL> col TABLESPACE_NAME form a20 SQL> col FILE_NAME form a20 SQL> col MB form 999,999 SQL> select TABLESPACE_NAME, FILE_NAME, BYTES/1024/1024 MB from DBA_DATA_FILES; TABLESPACE FILE_NAME MB ---------- -------------------- -------- SYSTEM /dev/raw/raw6 1,000 SYSAUX /dev/raw/raw7 1,000 UNDOTBS1 /dev/raw/raw10 1,000 UNDOTBS2 /dev/raw/raw11 1,000 USERS /dev/raw/raw8 500
임시 파일 현황 조사
select NAME, BYTES/1024/1024 MB from V$TEMPFILE;
SQL> col NAME form a20 SQL> col MB form 999,999 SQL> select NAME, BYTES/1024/1024 MB from V$TEMPFILE; NAME MB -------------------- -------- /dev/raw/raw9 699
컨트롤 파일 현황 조사
select NAME from V$CONTROLFILE;
SQL> col NAME form a20 SQL> select NAME from V$CONTROLFILE; NAME -------------------- /dev/raw/raw12 /dev/raw/raw13
Redo Log 현황 조사
select GROUP#, MEMBER from V$LOGFILE;
SQL> col MEMBER form a20 SQL> select GROUP#, MEMBER from V$LOGFILE; GROUP# MEMBER ---------- -------------------- 1 /dev/raw/raw14 2 /dev/raw/raw15 3 /dev/raw/raw16 4 /dev/raw/raw17 5 /dev/raw/raw18 6 /dev/raw/raw19 6 rows selected.
B) Archive 모드 전환
운영 모드 현황 조사
archive log list;
SQL> archive log list; Database log mode No Archive Mode Automatic archival Disabled Archive destination /u01/app/oracle/product/11.2.0/db_1/dbs/arch Oldest online log sequence 18 Current log sequence 20
테스트를 위해 No Archive 모드로 사용되던 Database를 RMAN을 이용하여 ASM으로 전환하기 위해 Archive 모드로 전환합니다.
아카이브 경로 파라미터 조사
select NAME, DISPLAY_VALUE from V$PARAMETER where NAME like 'db_recovery_file_dest%';
SQL> col NAME form a30 SQL> col DISPLAY_VALUE form a15 SQL> select NAME, DISPLAY_VALUE from V$PARAMETER where NAME like 'db_recovery_file_dest%'; NAME DISPLAY_VALUE ------------------------------ --------------- db_recovery_file_dest db_recovery_file_dest_size 0
Archive 경로 관련 파라미터 변경
alter system set db_recovery_file_dest_size=4G sid='*'; alter system set db_recovery_file_dest='/FRA' sid='*';
SQL> alter system set db_recovery_file_dest_size=4G sid='*'; System altered. SQL> alter system set db_recovery_file_dest='/FRA' sid='*'; System altered.
데이터베이스 중지 및 재기동
host srvctl stop database -d racdb -o immediate conn / as sysdba startup mount
SQL> host srvctl stop database -d racdb -o immediate SQL> conn / as sysdba Connected to an idle instance. SQL> startup mount ORACLE instance started. Total System Global Area 3206836224 bytes Fixed Size 2257520 bytes Variable Size 721423760 bytes Database Buffers 2466250752 bytes Redo Buffers 16904192 bytes Database mounted.
Archive 모드 전환 및 Database Open
alter database archivelog; archive log list; alter database open;
SQL> alter database archivelog; Database altered. SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 18 Next log sequence to archive 20 Current log sequence 20 SQL> alter database open; Database altered.
C) Data File 이관 준비
RMAN으로 Database를 ASM 영역으로 복사
backup as copy database format '+DATA';
[racdb1:/home/oracle]> rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Thu Apr 16 11:32:09 2020 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: RACDB (DBID=1035336379) RMAN> backup as copy database format '+DATA'; Starting backup at 20/04/16 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=23 instance=racdb1 device type=DISK channel ORA_DISK_1: starting datafile copy input datafile file number=00001 name=/dev/raw/raw6 output file name=+DATA/racdb/datafile/system.256.1037878345 tag=TAG20200416T113220 RECID=1 STAMP=1037878349 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15 channel ORA_DISK_1: starting datafile copy input datafile file number=00002 name=/dev/raw/raw7 output file name=+DATA/racdb/datafile/sysaux.257.1037878355 tag=TAG20200416T113220 RECID=2 STAMP=1037878361 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile file number=00003 name=/dev/raw/raw10 output file name=+DATA/racdb/datafile/undotbs1.258.1037878363 tag=TAG20200416T113220 RECID=3 STAMP=1037878368 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile file number=00004 name=/dev/raw/raw11 output file name=+DATA/racdb/datafile/undotbs2.259.1037878371 tag=TAG20200416T113220 RECID=4 STAMP=1037878376 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile file number=00005 name=/dev/raw/raw8 output file name=+DATA/racdb/datafile/users.260.1037878377 tag=TAG20200416T113220 RECID=5 STAMP=1037878380 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy copying current control file output file name=+DATA/racdb/controlfile/backup.261.1037878385 tag=TAG20200416T113220 RECID=6 STAMP=1037878385 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 20/04/16 channel ORA_DISK_1: finished piece 1 at 20/04/16 piece handle=+DATA/racdb/backupset/2020_04_16/nnsnf0_tag20200416t113220_0.262.1037878387 tag=TAG20200416T113220 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 20/04/16 RMAN> exit Recovery Manager complete.
ASM 사용을 위한 Database 파라미터 변경
alter system set db_recovery_file_dest='+FRA' sid='*'; alter system set db_create_file_dest='+DATA' sid='*';
SQL> alter system set db_recovery_file_dest='+FRA' sid='*'; System altered. SQL> alter system set db_create_file_dest='+DATA' sid='*'; System altered.
D) 파라미터 파일 ASM으로 이관
파라미터 파일 ASM 영역으로 이관
create pfile='$ORACLE_HOME/dbs/initracdb.ora' from spfile; create spfile='+DATA/RACDB/spfileracdb.ora' from pfile='$ORACLE_HOME/dbs/initracdb.ora';
SQL> create pfile='$ORACLE_HOME/dbs/initracdb.ora' from spfile; File created. SQL> create spfile='+DATA/RACDB/spfileracdb.ora' from pfile='$ORACLE_HOME/dbs/initracdb.ora'; File created.
ASM 영역의 파라미터 파일 등록
srvctl modify database -d racdb -p +DATA/RACDB/spfileracdb.ora mv $DB_HOME/dbs/initracdb1.ora $DB_HOME/dbs/initracdb1.ora.raw echo "spfile='+DATA/RACDB/spfileracdb.ora'" > $DB_HOME/dbs/initracdb1.ora ssh oracle@rac2 "mv $DB_HOME/dbs/initracdb2.ora $DB_HOME/dbs/initracdb2.ora.raw" ssh oracle@rac2 "echo "spfile='+DATA/RACDB/spfileracdb.ora'" > $DB_HOME/dbs/initracdb2.ora"
SQL> host srvctl modify database -d racdb -p +DATA/RACDB/spfileracdb.ora SQL> host mv $DB_HOME/dbs/initracdb1.ora $DB_HOME/dbs/initracdb1.ora.raw SQL> host echo "spfile='+DATA/RACDB/spfileracdb.ora'" > $DB_HOME/dbs/initracdb1.ora SQL> host ssh oracle@rac2 "mv $DB_HOME/dbs/initracdb2.ora $DB_HOME/dbs/initracdb2.ora.raw" SQL> host ssh oracle@rac2 "echo "spfile='+DATA/RACDB/spfileracdb.ora'" > $DB_HOME/dbs/initracdb2.ora"
이관된 파라미터 파일로 Database 재기동
shutdown immediate; startup nomount;
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup nomount; ORACLE instance started. Total System Global Area 3206836224 bytes Fixed Size 2257520 bytes Variable Size 721423760 bytes Database Buffers 2466250752 bytes Redo Buffers 16904192 bytes
E) 컨트롤 파일 ASM으로 이관
콘트롤 파일 위치 변경 및 No Mount 모드로 기동
alter system set control_files='+DATA','+FRA' sid='*' scope=spfile; startup force nomount;
SQL> alter system set control_files='+DATA','+FRA' sid='*' scope=spfile; System altered. SQL> startup force nomount; ORACLE instance started. Total System Global Area 3206836224 bytes Fixed Size 2257520 bytes Variable Size 721423760 bytes Database Buffers 2466250752 bytes Redo Buffers 16904192 bytes
Raw Device에 있는 컨트롤 파일을 이관하기 위해 컨트롤 파일의 위치 파라미터를 수정하고, 데이터베이스를 No Mount 모드로 전환합니다.
ASM 영역으로 컨트롤 파일 이관 및 적용
restore controlfile from '/dev/raw/raw12'; alter database mount;
[oracle@rac1 ~]$ rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Thu Apr 16 11:37:55 2020 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: RACDB (not mounted) RMAN> restore controlfile from '/dev/raw/raw12'; Starting restore at 20/04/16 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=141 instance=racdb1 device type=DISK channel ORA_DISK_1: copied control file copy output file name=+DATA/racdb/controlfile/current.264.1037878683 output file name=+FRA/racdb/controlfile/current.256.1037878683 Finished restore at 20/04/16 RMAN> alter database mount; database mounted released channel: ORA_DISK_1
F) 데이터 파일 ASM 복제본으로 이관
ASM 영역의 데이터 파일로 이관 및 복구
switch database to copy; recover database; alter database open;
RMAN> switch database to copy; datafile 1 switched to datafile copy "+DATA/racdb/datafile/system.256.1037878345" datafile 2 switched to datafile copy "+DATA/racdb/datafile/sysaux.257.1037878355" datafile 3 switched to datafile copy "+DATA/racdb/datafile/undotbs1.258.1037878363" datafile 4 switched to datafile copy "+DATA/racdb/datafile/undotbs2.259.1037878371" datafile 5 switched to datafile copy "+DATA/racdb/datafile/users.260.1037878377" RMAN> recover database; Starting recover at 20/04/16 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=141 instance=racdb1 device type=DISK starting media recovery media recovery complete, elapsed time: 00:00:00 Finished recover at 20/04/16 RMAN> alter database open; database opened RMAN> exit Recovery Manager complete.
임시 파일 ASM 영역으로 재생성
alter database tempfile '/dev/raw/raw9' drop; alter tablespace TEMP add tempfile size 100m autoextend on maxsize 1G;
SQL> alter database tempfile '/dev/raw/raw9' drop; Database altered. SQL> alter tablespace TEMP add tempfile size 100m autoextend on maxsize 1G; Tablespace altered. SQL> col NAME form a50 SQL> select NAME from V$TEMPFILE; NAME -------------------------------------------------- +DATA/racdb/tempfile/temp.265.1037878839
G) ASM 영역으로 Redo Log 이관
ASM 영역으로 Redo Log 맴버 추가
alter database add logfile member '+DATA' to group 1; alter database add logfile member '+DATA' to group 2; alter database add logfile member '+DATA' to group 3; alter database add logfile member '+DATA' to group 4; alter database add logfile member '+DATA' to group 5; alter database add logfile member '+DATA' to group 6; alter database add logfile member '+FRA' to group 1; alter database add logfile member '+FRA' to group 2; alter database add logfile member '+FRA' to group 3; alter database add logfile member '+FRA' to group 4; alter database add logfile member '+FRA' to group 5; alter database add logfile member '+FRA' to group 6;
SQL> alter database add logfile member '+DATA' to group 1; Database altered. SQL> alter database add logfile member '+DATA' to group 2; Database altered. SQL> alter database add logfile member '+DATA' to group 3; Database altered. SQL> alter database add logfile member '+DATA' to group 4; Database altered. SQL> alter database add logfile member '+DATA' to group 5; Database altered. SQL> alter database add logfile member '+DATA' to group 6; Database altered. SQL> alter database add logfile member '+FRA' to group 1; Database altered. SQL> alter database add logfile member '+FRA' to group 2; Database altered. SQL> alter database add logfile member '+FRA' to group 3; Database altered. SQL> alter database add logfile member '+FRA' to group 4; Database altered. SQL> alter database add logfile member '+FRA' to group 5; Database altered. SQL> alter database add logfile member '+FRA' to group 6; Database altered. SQL> set lines 200 SQL> set pages 100 SQL> col MEMBER form a50 SQL> select a.GROUP#, THREAD#, a.STATUS file_status, b.STATUS log_status, MEMBER 2 from V$LOGFILE a, V$LOG b 3 where a.GROUP# = b.GROUP# 4 order by GROUP#, MEMBER; GROUP# THREAD# FILE_STATUS LOG_STATUS MEMBER ---------- ---------- --------------------- ------------------------------------------------ -------------------------------------------------- 1 1 INVALID INACTIVE +DATA/racdb/onlinelog/group_1.266.1037879561 1 1 INVALID INACTIVE +FRA/racdb/onlinelog/group_1.257.1037879581 1 1 INACTIVE /dev/raw/raw14 2 1 INVALID CURRENT +DATA/racdb/onlinelog/group_2.267.1037879565 2 1 INVALID CURRENT +FRA/racdb/onlinelog/group_2.258.1037879585 2 1 CURRENT /dev/raw/raw15 3 1 INVALID INACTIVE +DATA/racdb/onlinelog/group_3.268.1037879569 3 1 INVALID INACTIVE +FRA/racdb/onlinelog/group_3.259.1037879587 3 1 INACTIVE /dev/raw/raw16 4 2 INVALID INACTIVE +DATA/racdb/onlinelog/group_4.269.1037879571 4 2 INVALID INACTIVE +FRA/racdb/onlinelog/group_4.260.1037879591 4 2 INACTIVE /dev/raw/raw17 5 2 INVALID INACTIVE +DATA/racdb/onlinelog/group_5.270.1037879575 5 2 INVALID INACTIVE +FRA/racdb/onlinelog/group_5.261.1037879593 5 2 INACTIVE /dev/raw/raw18 6 2 INVALID UNUSED +DATA/racdb/onlinelog/group_6.271.1037879579 6 2 INVALID UNUSED +FRA/racdb/onlinelog/group_6.262.1037879597 6 2 UNUSED /dev/raw/raw19 18 rows selected.
1번 노드 Raw Device 영역의 Redo Log 맴버 제거
alter database drop logfile member '/dev/raw/raw14'; alter database drop logfile member '/dev/raw/raw15'; alter database drop logfile member '/dev/raw/raw16';
SQL> alter database drop logfile member '/dev/raw/raw14'; alter database drop logfile member '/dev/raw/raw14' * ERROR at line 1: ORA-00362: member is required to form a valid logfile in group 1 ORA-01517: log member: '/dev/raw/raw14' SQL> alter system switch logfile; System altered. SQL> alter system switch logfile; System altered. SQL> select a.GROUP#, THREAD#, a.STATUS file_status, b.STATUS log_status, MEMBER 2 from V$LOGFILE a, V$LOG b 3 where a.GROUP# = b.GROUP# 4 order by GROUP#, MEMBER; GROUP# THREAD# FILE_STATUS LOG_STATUS MEMBER ---------- ---------- --------------------- ------------------------------------------------ -------------------------------------------------- 1 1 CURRENT +DATA/racdb/onlinelog/group_1.266.1037879561 1 1 CURRENT +FRA/racdb/onlinelog/group_1.257.1037879581 1 1 CURRENT /dev/raw/raw14 2 1 INVALID ACTIVE +DATA/racdb/onlinelog/group_2.267.1037879565 2 1 INVALID ACTIVE +FRA/racdb/onlinelog/group_2.258.1037879585 2 1 ACTIVE /dev/raw/raw15 3 1 ACTIVE +DATA/racdb/onlinelog/group_3.268.1037879569 3 1 ACTIVE +FRA/racdb/onlinelog/group_3.259.1037879587 3 1 ACTIVE /dev/raw/raw16 4 2 INVALID INACTIVE +DATA/racdb/onlinelog/group_4.269.1037879571 4 2 INVALID INACTIVE +FRA/racdb/onlinelog/group_4.260.1037879591 4 2 INACTIVE /dev/raw/raw17 5 2 INVALID INACTIVE +DATA/racdb/onlinelog/group_5.270.1037879575 5 2 INVALID INACTIVE +FRA/racdb/onlinelog/group_5.261.1037879593 5 2 INACTIVE /dev/raw/raw18 6 2 INVALID UNUSED +DATA/racdb/onlinelog/group_6.271.1037879579 6 2 INVALID UNUSED +FRA/racdb/onlinelog/group_6.262.1037879597 6 2 UNUSED /dev/raw/raw19 18 rows selected. SQL> alter database drop logfile member '/dev/raw/raw14'; alter database drop logfile member '/dev/raw/raw14' * ERROR at line 1: ORA-01609: log 1 is the current log for thread 1 - cannot drop members ORA-00312: online log 1 thread 1: '/dev/raw/raw14' ORA-00312: online log 1 thread 1: '+DATA/racdb/onlinelog/group_1.266.1037879561' ORA-00312: online log 1 thread 1: '+FRA/racdb/onlinelog/group_1.257.1037879581' SQL> alter system switch logfile; System altered. SQL> alter database drop logfile member '/dev/raw/raw14'; Database altered. SQL> alter system switch logfile; System altered. SQL> alter system switch logfile; System altered. SQL> alter database drop logfile member '/dev/raw/raw15'; Database altered. SQL> alter database drop logfile member '/dev/raw/raw16'; Database altered. SQL> select a.GROUP#, THREAD#, a.STATUS file_status, b.STATUS log_status, MEMBER 2 from V$LOGFILE a, V$LOG b 3 where a.GROUP# = b.GROUP# 4 order by GROUP#, MEMBER; GROUP# THREAD# FILE_STATUS LOG_STATUS MEMBER ---------- ---------- --------------------- ------------------------------------------------ -------------------------------------------------- 1 1 CURRENT +DATA/racdb/onlinelog/group_1.266.1037879561 1 1 CURRENT +FRA/racdb/onlinelog/group_1.257.1037879581 2 1 ACTIVE +DATA/racdb/onlinelog/group_2.267.1037879565 2 1 ACTIVE +FRA/racdb/onlinelog/group_2.258.1037879585 3 1 ACTIVE +DATA/racdb/onlinelog/group_3.268.1037879569 3 1 ACTIVE +FRA/racdb/onlinelog/group_3.259.1037879587 4 2 INVALID INACTIVE +DATA/racdb/onlinelog/group_4.269.1037879571 4 2 INVALID INACTIVE +FRA/racdb/onlinelog/group_4.260.1037879591 4 2 INACTIVE /dev/raw/raw17 5 2 INVALID INACTIVE +DATA/racdb/onlinelog/group_5.270.1037879575 5 2 INVALID INACTIVE +FRA/racdb/onlinelog/group_5.261.1037879593 5 2 INACTIVE /dev/raw/raw18 6 2 INVALID UNUSED +DATA/racdb/onlinelog/group_6.271.1037879579 6 2 INVALID UNUSED +FRA/racdb/onlinelog/group_6.262.1037879597 6 2 UNUSED /dev/raw/raw19 15 rows selected.
2번 인스턴스 기동
srvctl start instance -d racdb -i racdb2
[racdb2:/home/oracle]> srvctl start instance -d racdb -i racdb2
2번 노드 Raw Device 영역의 Redo Log 맴버 제거
alter database drop logfile member '/dev/raw/raw17'; alter database drop logfile member '/dev/raw/raw18'; alter database drop logfile member '/dev/raw/raw19';
SQL> set lines 200 SQL> set pages 100 SQL> col MEMBER form a50 SQL> select a.GROUP#, THREAD#, a.STATUS file_status, b.STATUS log_status, MEMBER 2 from V$LOGFILE a, V$LOG b 3 where a.GROUP# = b.GROUP# 4 order by GROUP#, MEMBER; GROUP# THREAD# FILE_STATUS LOG_STATUS MEMBER ---------- ---------- --------------------- ------------------------------------------------ -------------------------------------------------- 1 1 CURRENT +DATA/racdb/onlinelog/group_1.266.1037879561 1 1 CURRENT +FRA/racdb/onlinelog/group_1.257.1037879581 2 1 INACTIVE +DATA/racdb/onlinelog/group_2.267.1037879565 2 1 INACTIVE +FRA/racdb/onlinelog/group_2.258.1037879585 3 1 INACTIVE +DATA/racdb/onlinelog/group_3.268.1037879569 3 1 INACTIVE +FRA/racdb/onlinelog/group_3.259.1037879587 4 2 INVALID INACTIVE +DATA/racdb/onlinelog/group_4.269.1037879571 4 2 INVALID INACTIVE +FRA/racdb/onlinelog/group_4.260.1037879591 4 2 INACTIVE /dev/raw/raw17 5 2 INVALID INACTIVE +DATA/racdb/onlinelog/group_5.270.1037879575 5 2 INVALID INACTIVE +FRA/racdb/onlinelog/group_5.261.1037879593 5 2 INACTIVE /dev/raw/raw18 6 2 CURRENT +DATA/racdb/onlinelog/group_6.271.1037879579 6 2 CURRENT +FRA/racdb/onlinelog/group_6.262.1037879597 6 2 CURRENT /dev/raw/raw19 15 rows selected. SQL> alter system switch logfile; System altered. SQL> alter system switch logfile; System altered. SQL> alter database drop logfile member '/dev/raw/raw17'; Database altered. SQL> alter system switch logfile; System altered. SQL> alter database drop logfile member '/dev/raw/raw18'; Database altered. SQL> alter system switch logfile; System altered. SQL> alter database drop logfile member '/dev/raw/raw19'; Database altered. SQL> select a.GROUP#, THREAD#, a.STATUS file_status, b.STATUS log_status, MEMBER 2 from V$LOGFILE a, V$LOG b 3 where a.GROUP# = b.GROUP# 4 order by GROUP#, MEMBER; GROUP# THREAD# FILE_STATUS LOG_STATUS MEMBER ---------- ---------- --------------------- ------------------------------------------------ -------------------------------------------------- 1 1 CURRENT +DATA/racdb/onlinelog/group_1.266.1037879561 1 1 CURRENT +FRA/racdb/onlinelog/group_1.257.1037879581 2 1 INACTIVE +DATA/racdb/onlinelog/group_2.267.1037879565 2 1 INACTIVE +FRA/racdb/onlinelog/group_2.258.1037879585 3 1 INACTIVE +DATA/racdb/onlinelog/group_3.268.1037879569 3 1 INACTIVE +FRA/racdb/onlinelog/group_3.259.1037879587 4 2 CURRENT +DATA/racdb/onlinelog/group_4.269.1037879571 4 2 CURRENT +FRA/racdb/onlinelog/group_4.260.1037879591 5 2 INACTIVE +DATA/racdb/onlinelog/group_5.270.1037879575 5 2 INACTIVE +FRA/racdb/onlinelog/group_5.261.1037879593 6 2 ACTIVE +DATA/racdb/onlinelog/group_6.271.1037879579 6 2 ACTIVE +FRA/racdb/onlinelog/group_6.262.1037879597 12 rows selected.