OS환경 : Oracle Linux 6.8 (64bit)
DB 환경 : Oracle Database 11.2.0.4
방법 : 오라클 rman에서 show all 정보와 list backup 정보는 어디있을까?
rman 사전 설정
백업 경로 지정
1 2 3 4 5 6 | $ mkdir -p /home/oracle/rman/ $ rman target / RMAN> configure channel device type disk format '/home/oracle/rman/db_%U_%T'; new RMAN configuration parameters: CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/home/oracle/rman/db_%U_%T'; new RMAN configuration parameters are successfully stored |
컨트롤파일 자동 백업 옵션 및 경로 지정
1 2 3 4 5 6 7 8 9 | RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON; new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP ON; new RMAN configuration parameters are successfully stored RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/rman/db_control_%F'; new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/rman/db_control_%F'; new RMAN configuration parameters are successfully stored |
rman 설정 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | RMAN> show all; using target database control file instead of recovery catalog RMAN configuration parameters for database with db_unique_name RACDB are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/rman/db_control_%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/home/oracle/rman/db_%U_%T'; CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/app/oracle/product/11.2.0/db_1/dbs/snapcf_racdb.f'; # default |
백업 실행
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | RMAN> backup database; Starting backup at 22-FEB-20 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=52 instance=racdb1 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00008 name=+ORADATA/racdb/datafile/bokgu.270.1033003033 input datafile file number=00001 name=+ORADATA/racdb/datafile/system.259.970626167 input datafile file number=00002 name=+ORADATA/racdb/datafile/sysaux.260.970626173 input datafile file number=00003 name=+ORADATA/racdb/datafile/undotbs1.261.970626177 input datafile file number=00004 name=+ORADATA/racdb/datafile/undotbs2.263.970626185 input datafile file number=00006 name=+ORADATA/racdb/datafile/users.268.970884085 input datafile file number=00007 name=+ORADATA/racdb/datafile/users.269.970884253 input datafile file number=00005 name=+ORADATA/racdb/datafile/users.264.970626185 channel ORA_DISK_1: starting piece 1 at 22-FEB-20 channel ORA_DISK_1: finished piece 1 at 22-FEB-20 piece handle=/home/oracle/rman/db_01up4p9p_1_1_20200222 tag=TAG20200222T013905 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 Finished backup at 22-FEB-20 Starting Control File and SPFILE Autobackup at 22-FEB-20 piece handle=/home/oracle/rman/db_control_c-968242930-20200222-00 comment=NONE Finished Control File and SPFILE Autobackup at 22-FEB-20 |
백업본 확인
1 2 3 4 5 6 | $ ls -al /home/oracle/rman/ total 296172 drwxr-xr-x 2 oracle dba 80 Feb 22 01:39 . drwxr-xr-x. 11 oracle dba 4096 Feb 22 01:28 .. -rw-r----- 1 oracle dba 284696576 Feb 22 01:39 db_01up4p9p_1_1_20200222 -rw-r----- 1 oracle dba 18579456 Feb 22 01:39 db_control_c-968242930-20200222-00 |
datafile, redo log file, control file 모두 삭제
1 | $ rm -rf /app/oracle/oradata/newdev/* |
nomount 로 startup
1 2 3 4 5 6 7 8 | SQL> startup nomount ORACLE instance started. Total System Global Area 1686925312 bytes Fixed Size 2253864 bytes Variable Size 419433432 bytes Database Buffers 1258291200 bytes Redo Buffers 6946816 bytes |
rman 접속 후 show all 정보 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | $ rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Tue Feb 25 07:55:33 2020 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: RACDB (not mounted) RMAN> show all; using target database control file instead of recovery catalog RMAN configuration parameters for database with db_unique_name RACDB are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default |
모두 default 값임
report schema 명령 확인
1 2 3 4 5 6 7 | RMAN> report schema; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of report command at 02/25/2020 07:56:16 ORA-01507: database not mounted |
db가 mount 상태가 아니어서 나오지 않음
컨트롤파일 백업본 restore
1 2 3 4 5 6 7 8 9 10 11 | RMAN> restore controlfile from '/home/oracle/rman/db_control_c-968242930-20200222-00'; Starting restore at 25-FEB-20 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=20 device type=DISK channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 output file name=/app/oracle/oradata/newdev/control01.ctl output file name=/app/oracle/oradata/newdev/control02.ctl Finished restore at 25-FEB-20 |
show all 과 report schema 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | RMAN> show all; RMAN configuration parameters for database with db_unique_name RACDB are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default RMAN> report schema; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of report command at 02/25/2020 07:58:11 ORA-01507: database not mounted |
show all은 아직 default 값이 나오고 report schema명령은 여전히 db가 mount 상태가 아니어서 나오지 않음
db mount 상태로 변경
1 2 3 4 | RMAN> sql 'alter database mount'; sql statement: alter database mount released channel: ORA_DISK_1 |
show all 과 report schema 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | RMAN> show all; RMAN configuration parameters for database with db_unique_name RACDB are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/rman/db_control_%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/home/oracle/rman/db_%U_%T'; CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/app/oracle/product/11.2.0/db_1/dbs/snapcf_racdb.f'; # default RMAN> report schema; RMAN-06139: WARNING: control file is not current for REPORT SCHEMA Report of database schema for database with db_unique_name RACDB List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 0 SYSTEM *** +ORADATA/racdb/datafile/system.259.970626167 2 0 SYSAUX *** +ORADATA/racdb/datafile/sysaux.260.970626173 3 0 UNDOTBS1 *** +ORADATA/racdb/datafile/undotbs1.261.970626177 4 0 UNDOTBS2 *** +ORADATA/racdb/datafile/undotbs2.263.970626185 5 0 USERS *** +ORADATA/racdb/datafile/users.264.970626185 6 0 USERS *** +ORADATA/racdb/datafile/users.268.970884085 7 0 USERS *** +ORADATA/racdb/datafile/users.269.970884253 8 0 BOKGU *** +ORADATA/racdb/datafile/bokgu.270.1033003033 List of Temporary Files ======================= File Size(MB) Tablespace Maxsize(MB) Tempfile Name ---- -------- -------------------- ----------- -------------------- 1 20 TEMP 32767 +ORADATA/racdb/tempfile/temp.262.970626177 |
show all 값도 정상적으로 가지고오고 report schema도 제대로 가지고옴
list backup 으로 백업현황 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | RMAN> list backup; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 271.50M DISK 00:00:04 22-FEB-20 BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20200222T013905 Piece Name: /home/oracle/rman/db_01up4p9p_1_1_20200222 List of Datafiles in backup set 1 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 241661 22-FEB-20 +ORADATA/racdb/datafile/system.259.970626167 2 Full 241661 22-FEB-20 +ORADATA/racdb/datafile/sysaux.260.970626173 3 Full 241661 22-FEB-20 +ORADATA/racdb/datafile/undotbs1.261.970626177 4 Full 241661 22-FEB-20 +ORADATA/racdb/datafile/undotbs2.263.970626185 5 Full 241661 22-FEB-20 +ORADATA/racdb/datafile/users.264.970626185 6 Full 241661 22-FEB-20 +ORADATA/racdb/datafile/users.268.970884085 7 Full 241661 22-FEB-20 +ORADATA/racdb/datafile/users.269.970884253 8 Full 241661 22-FEB-20 +ORADATA/racdb/datafile/bokgu.270.1033003033 |
정상적으로 나옴
위 테스트로 rman 관련된 정보는 control file에 있다는걸 알수있다.
그렇다면 control file 을 재생성 했을 때도 이 정보가 남아있을까?
db 종료
1 2 3 4 5 6 | SQL> shutdown immediate ORA-01109: database not open Database dismounted. ORACLE instance shut down. |
미리 만들어둔 control file 생성문 recon.sql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | SQL> STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "RACDB" RESETLOGS ARCHIVELOG MAXLOGFILES 192 MAXLOGMEMBERS 3 MAXDATAFILES 1024 MAXINSTANCES 32 MAXLOGHISTORY 292 LOGFILE GROUP 1 ( '/app/oracle/oradata/newdev/redo01.log' ) SIZE 50M BLOCKSIZE 512, GROUP 2 ( '/app/oracle/oradata/newdev/redo02.log' ) SIZE 50M BLOCKSIZE 512, GROUP 3 ( '/app/oracle/oradata/newdev/redo03.log' ) SIZE 50M BLOCKSIZE 512 DATAFILE '/app/oracle/oradata/newdev/system01.dbf', '/app/oracle/oradata/newdev/sysaux01.dbf', '/app/oracle/oradata/newdev/undotbs01.dbf', '/app/oracle/oradata/newdev/undotbs02.dbf', '/app/oracle/oradata/newdev/bokgu01.dbf' CHARACTER SET KO16MSWIN949 ; VARIABLE RECNO NUMBER; EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP','ON'); VARIABLE RECNO NUMBER; EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','DEVICE TYPE DISK FORMAT ''/home/oracle/rman/db_%U_%T'''); VARIABLE RECNO NUMBER; EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE','DISK TO ''/home/oracle/rman/db_control_%F'''); |
실행
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | SQL> @recon.sql ORACLE instance started. Total System Global Area 1686925312 bytes Fixed Size 2253864 bytes Variable Size 419433432 bytes Database Buffers 1258291200 bytes Redo Buffers 6946816 bytes CREATE CONTROLFILE REUSE DATABASE "RACDB" RESETLOGS ARCHIVELOG * ERROR at line 1: ORA-01503: CREATE CONTROLFILE failed ORA-01565: error in identifying file '/app/oracle/oradata/newdev/system01.dbf' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 3 |
데이터파일을 restore 하지 않아 control file이 생성되지 않음
다시 mount 상태로 만든 뒤 데이터파일 restore
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | RMAN> run { allocate channel ch1 device type disk ; allocate channel ch2 device type disk ; set newname for tempfile 1 to '/app/oracle/oradata/newdev/temp01.dbf'; set newname for datafile 1 to '/app/oracle/oradata/newdev/system01.dbf' ; set newname for datafile 2 to '/app/oracle/oradata/newdev/sysaux01.dbf' ; set newname for datafile 3 to '/app/oracle/oradata/newdev/undotbs01.dbf' ; set newname for datafile 4 to '/app/oracle/oradata/newdev/undotbs02.dbf' ; set newname for datafile 8 to '/app/oracle/oradata/newdev/bokgu01.dbf' ; #restore database skip tablespace 'users'; restore datafile 1,2,3,4,8; switch datafile all; switch tempfile all; } <- 이까지 입력 후 엔터 allocated channel: ch1 channel ch1: SID=19 device type=DISK allocated channel: ch2 channel ch2: SID=20 device type=DISK executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting restore at 23-FEB-20 channel ch1: starting datafile backup set restore channel ch1: specifying datafile(s) to restore from backup set channel ch1: restoring datafile 00001 to /app/oracle/oradata/newdev/system01.dbf channel ch1: restoring datafile 00002 to /app/oracle/oradata/newdev/sysaux01.dbf channel ch1: restoring datafile 00003 to /app/oracle/oradata/newdev/undotbs01.dbf channel ch1: restoring datafile 00004 to /app/oracle/oradata/newdev/undotbs02.dbf channel ch1: restoring datafile 00008 to /app/oracle/oradata/newdev/bokgu01.dbf channel ch1: reading from backup piece /home/oracle/rman/db_01up4p9p_1_1_20200222 channel ch1: piece handle=/home/oracle/rman/db_01up4p9p_1_1_20200222 tag=TAG20200222T013905 channel ch1: restored backup piece 1 channel ch1: restore complete, elapsed time: 00:00:26 Finished restore at 23-FEB-20 datafile 1 switched to datafile copy input datafile copy RECID=6 STAMP=1033105122 file name=/app/oracle/oradata/newdev/system01.dbf datafile 2 switched to datafile copy input datafile copy RECID=7 STAMP=1033105122 file name=/app/oracle/oradata/newdev/sysaux01.dbf datafile 3 switched to datafile copy input datafile copy RECID=8 STAMP=1033105122 file name=/app/oracle/oradata/newdev/undotbs01.dbf datafile 4 switched to datafile copy input datafile copy RECID=9 STAMP=1033105122 file name=/app/oracle/oradata/newdev/undotbs02.dbf datafile 8 switched to datafile copy input datafile copy RECID=10 STAMP=1033105122 file name=/app/oracle/oradata/newdev/bokgu01.dbf renamed tempfile 1 to /app/oracle/oradata/newdev/temp01.dbf in control file released channel: ch1 released channel: ch2 |
데이터 파일 확인
1 2 3 4 5 6 7 8 9 10 11 | $ ls -al /app/oracle/oradata/newdev/ total 2825568 drwxr-xr-x. 2 oracle oinstall 4096 Feb 25 08:09 . drwxr-x---. 4 oracle oinstall 4096 Feb 23 02:28 .. -rw-r-----. 1 oracle oinstall 1073750016 Feb 25 08:09 bokgu01.dbf -rw-r-----. 1 oracle oinstall 18497536 Feb 25 08:10 control01.ctl -rw-r-----. 1 oracle oinstall 18497536 Feb 25 08:10 control02.ctl -rw-r-----. 1 oracle oinstall 629153792 Feb 25 08:10 sysaux01.dbf -rw-r-----. 1 oracle oinstall 734011392 Feb 25 08:10 system01.dbf -rw-r-----. 1 oracle oinstall 209723392 Feb 25 08:10 undotbs01.dbf -rw-r-----. 1 oracle oinstall 209723392 Feb 25 08:09 undotbs02.dbf |
control file 재생성을 위해 다시 shutdown
1 2 3 4 5 6 | SQL> shutdown immediate ORA-01109: database not open Database dismounted. ORACLE instance shut down. |
기존 컨트롤파일 삭제 후 재생성
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | $ cd /app/oracle/oradata/newdev/ $ ls bokgu01.dbf control01.ctl control02.ctl sysaux01.dbf system01.dbf undotbs01.dbf undotbs02.dbf $ rm control0* $ ls bokgu01.dbf sysaux01.dbf system01.dbf undotbs01.dbf undotbs02.dbf $ sqlplus / as sysdba SQL> @recon ORACLE instance started. Total System Global Area 1686925312 bytes Fixed Size 2253864 bytes Variable Size 419433432 bytes Database Buffers 1258291200 bytes Redo Buffers 6946816 bytes Control file created. PL/SQL procedure successfully completed. PL/SQL procedure successfully completed. PL/SQL procedure successfully completed. |
show all, report schema, list backup 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | RMAN> show all; using target database control file instead of recovery catalog RMAN configuration parameters for database with db_unique_name RACDB are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/rman/db_control_%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/home/oracle/rman/db_%U_%T'; CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/app/oracle/product/11.2.0/db_1/dbs/snapcf_racdb.f'; # default RMAN> report schema; RMAN-06139: WARNING: control file is not current for REPORT SCHEMA Report of database schema for database with db_unique_name RACDB List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 700 SYSTEM *** /app/oracle/oradata/newdev/system01.dbf 2 600 SYSAUX *** /app/oracle/oradata/newdev/sysaux01.dbf 3 200 UNDOTBS1 *** /app/oracle/oradata/newdev/undotbs01.dbf 4 200 UNDOTBS2 *** /app/oracle/oradata/newdev/undotbs02.dbf 8 1024 BOKGU *** /app/oracle/oradata/newdev/bokgu01.dbf RMAN> list backup; specification does not match any backup in the repository |
show all은 기존과 똑같이 나오고 report schema는 새로 작성한 데이터파일 경로로 표시됨
하지만 list backup는 표시되지 않음
이 말은 컨트롤파일에는 list backup에 대한 백업정보가 들어있지 않다는것을 의미함
다시한번 확실하게 확인해보자면
rman으로 백업한 컨트롤파일 백업본을 다시 읽어들이는 방법으로 catalog start with 명령을 사용해봄
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | RMAN> catalog start with '/home/oracle/rman/control/'; using target database control file instead of recovery catalog searching for all files that match the pattern /home/oracle/rman/control/ List of Files Unknown to the Database ===================================== File Name: /home/oracle/rman/control/db_control_c-968242930-20200222-00 Do you really want to catalog the above files (enter YES or NO)? yes cataloging files... cataloging done List of Cataloged Files ======================= File Name: /home/oracle/rman/control/db_control_c-968242930-20200222-00 |
그리고 다시 list backup 명령 수행
1 2 3 | RMAN> list backup; specification does not match any backup in the repository |
아무것도 나오지 않음
그렇다면 컨트롤파일 백업본이 아닌 backup database명령으로 만들어진 백업본(백업셋)을 읽어들여 보겠음
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | RMAN> catalog start with '/home/oracle/rman/data'; using target database control file instead of recovery catalog searching for all files that match the pattern /home/oracle/rman/data List of Files Unknown to the Database ===================================== File Name: /home/oracle/rman/data/db_01up4p9p_1_1_20200222 Do you really want to catalog the above files (enter YES or NO)? yes cataloging files... cataloging done List of Cataloged Files ======================= File Name: /home/oracle/rman/data/db_01up4p9p_1_1_20200222 |
그리고 다시 list backup 명령 수행
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | MAN> list backup; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 271.50M DISK 00:00:00 22-FEB-20 BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20200222T013905 Piece Name: /home/oracle/rman/data/db_01up4p9p_1_1_20200222 List of Datafiles in backup set 1 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 241661 22-FEB-20 /app/oracle/oradata/newdev/system01.dbf 2 Full 241661 22-FEB-20 /app/oracle/oradata/newdev/sysaux01.dbf 3 Full 241661 22-FEB-20 /app/oracle/oradata/newdev/undotbs01.dbf 4 Full 241661 22-FEB-20 /app/oracle/oradata/newdev/undotbs02.dbf 5 Full 241661 22-FEB-20 6 Full 241661 22-FEB-20 7 Full 241661 22-FEB-20 8 Full 241661 22-FEB-20 /app/oracle/oradata/newdev/bokgu01.dbf |
백업된 정보가 나옴
결론 : rman에서의 show all 정보는 controlfile 에 기록되어 있지만, list backup 정보는 백업셋에 기록되어있다.
참조 : https://positivemh.tistory.com/510
'ORACLE > Backup&Recover' 카테고리의 다른 글
rac db(asm)에서 특정시점의 데이터를 single db(filesystem) 로 dbname 변경 후 복구 테스트2 (0) | 2020.02.28 |
---|---|
rac db(asm)에서 특정시점의 데이터를 single db(filesystem) 로 dbname 변경 후 복구 테스트 (0) | 2020.02.24 |
rac db(asm)에서 특정시점의 데이터를 single db(filesystem) 복구 테스트 (0) | 2020.02.23 |
Oracle partition tablespace, table rman 복구 테스트 (0) | 2019.02.19 |
datapump stop_job 후 재기동 후 start_job (0) | 2019.01.08 |