归档日志的备份
RMAN> list archivelog all; show archivelog deletion policy; configure archivelog deletion policy; configure archivelog deletion policy to backed up 1 times to disk; 配置归档删除策略,只要求归档备份一次到磁盘,之后归档就允许被删除。 backup archivelog all delete all input; 备份归档的同时删除所有输入的归档日志文件。 查看时已经没有归档日志。 RMAN> list archivelog all; specification does not match any archived log in the repository RMAN> list backup;List of Backup Sets===================BS Key Size Device Type Elapsed Time Completion Time------- ---------- ----------- ------------ ---------------1 822.00M DISK 00:00:43 07-APR-17 BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20170407T092004 Piece Name: /u01/app/oracle/fast_recovery_area/TESTDB/backupset/2017_04_07/o1_mf_annnn_TAG20170407T092004_dgftb4lp_.bkp List of Archived Logs in backup set 1 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- ---------- --------- 1 1070 15073605 02-APR-17 15078206 02-APR-17 1 1071 15078206 02-APR-17 15078265 02-APR-17 1 1072 15078265 02-APR-17 15083471 02-APR-17 1 1073 15083471 02-APR-17 15108445 02-APR-17 1 1074 15108445 02-APR-17 15130090 02-APR-17 1 1075 15130090 02-APR-17 15148372 03-APR-17 1 1076 15148372 03-APR-17 15161574 03-APR-17 1 1077 15161574 03-APR-17 15181830 03-APR-17 1 1078 15181830 03-APR-17 15207352 03-APR-17 1 1079 15207352 03-APR-17 15224200 04-APR-17 1 1080 15224200 04-APR-17 15240128 04-APR-17 1 1081 15240128 04-APR-17 15240604 04-APR-17 1 1082 15240604 04-APR-17 15261618 04-APR-17 1 1083 15261618 04-APR-17 15290623 04-APR-17 1 1084 15290623 04-APR-17 15292478 04-APR-17 1 1085 15292478 04-APR-17 15317260 05-APR-17 1 1086 15317260 05-APR-17 15321811 05-APR-17 1 1087 15321811 05-APR-17 15336693 05-APR-17 1 1088 15336693 05-APR-17 15360955 05-APR-17 1 1089 15360955 05-APR-17 15371603 05-APR-17 1 1090 15371603 05-APR-17 15391219 06-APR-17 1 1091 15391219 06-APR-17 15403303 06-APR-17 1 1092 15403303 06-APR-17 15415725 06-APR-17 1 1093 15415725 06-APR-17 15438932 06-APR-17 1 1094 15438932 06-APR-17 15454209 06-APR-17 1 1095 15454209 06-APR-17 15464675 07-APR-17 1 1096 15464675 07-APR-17 15485971 07-APR-17 1 1097 15485971 07-APR-17 15489695 07-APR-17 查看归档的操作系统文件时,已经被删除 [oracle@cn-111-testdb archivelog]$ ls -R .: 2017_04_02 2017_04_03 2017_04_04 2017_04_05 2017_04_06 2017_04_07 ./2017_04_02: ./2017_04_03: ./2017_04_04: ./2017_04_05: ./2017_04_06: ./2017_04_07: 将归档日志文件变成了备份集 [oracle@cn-111-testdb 2017_04_07]$ ll total 841740 -rw-r----- 1 oracle oinstall 861935104 Apr 7 09:20 o1_mf_annnn_TAG20170407T092004_dgftb4lp_.bkp [oracle@cn-111-testdb 2017_04_07]$ pwd /u01/app/oracle/fast_recovery_area/TESTDB/backupset/2017_04_07
RMAN> list backup summary;
using target database control file instead of recovery catalogList of Backups===============Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag------- -- -- - ----------- --------------- ------- ------- ---------- ---1 B F A DISK 23-OCT-16 1 1 NO TAG20161023T1115502 B F A DISK 23-OCT-16 1 1 NO TAG20161023T1115503 B F A DISK 25-OCT-16 1 1 NO TAG20161025T1506474 B F A DISK 25-OCT-16 1 1 NO TAG20161025T1506475 B F A DISK 01-NOV-16 1 1 NO TAG20161101T1452076 B F A DISK 01-NOV-16 1 1 NO TAG20161101T1452077 B F A DISK 05-DEC-16 1 1 NO TAG20161205T1713278 B F A DISK 03-JAN-17 1 1 NO TAG20170103T1333459 B F A DISK 03-JAN-17 1 1 NO TAG20170103T13334510 B F A DISK 21-JAN-17 1 1 NO TAG20170121T19251411 B F A DISK 21-JAN-17 1 1 NO TAG20170121T19251412 B F A DISK 23-JAN-17 1 1 NO TAG20170123T09130813 B F A DISK 23-JAN-17 1 1 NO TAG20170123T09130814 B F A DISK 25-JAN-17 1 1 NO TAG20170125T21152915 B F A DISK 25-JAN-17 1 1 NO TAG20170125T21152916 B F A DISK 28-JAN-17 1 1 NO TAG20170128T19420517 B F A DISK 28-JAN-17 1 1 NO TAG20170128T19420518 B F A DISK 01-FEB-17 1 1 NO TAG20170201T11025619 B F A DISK 01-FEB-17 1 1 NO TAG20170201T11025620 B F A DISK 03-FEB-17 1 1 NO TAG20170203T20151321 B F A DISK 03-FEB-17 1 1 NO TAG20170203T201513RMAN> list db_unique_name all;List of DatabasesDB Key DB Name DB ID Database Role Db_unique_name------- ------- ----------------- --------------- ------------------1 BAOKA 3484596173 PHYSICAL STANDBY STBAOKARMAN> list incarnation;List of Database IncarnationsDB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time------- ------- -------- ---------------- --- ---------- ----------1 1 BAOKA 3484596173 CURRENT 1 18-OCT-16
父化身(parent),当前化身(current),祖先化身(anc),孤儿化身(orphan)
RMAN> list incarnation;
List of Database IncarnationsDB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time------- ------- -------- ---------------- --- ---------- ----------1 1 KYC 111003738 PARENT 1 26-JAN-176 6 KYC 111003738 CURRENT 988210 28-APR-175 5 KYC 111003738 ORPHAN 989509 28-APR-174 4 KYC 111003738 ORPHAN 989509 27-APR-172 2 KYC 111003738 ORPHAN 989509 27-APR-173 3 KYC 111003738 ORPHAN 989509 27-APR-17
RMAN> validate database;Starting validate at 30-APR-17using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=21 device type=DISKchannel ORA_DISK_1: starting validation of datafilechannel ORA_DISK_1: specifying datafile(s) for validationinput datafile file number=00001 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_system_d8m6of7w_.dbfinput datafile file number=00002 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_sysaux_d8m6pc11_.dbfinput datafile file number=00003 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_undotbs1_d8m6q4z2_.dbfinput datafile file number=00016 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_archi_dj5thsgt_.dbfinput datafile file number=00005 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_test_tbs_dh36clvr_.dbfinput datafile file number=00008 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_acct_dh42xjyw_.dbfinput datafile file number=00009 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_pay_dh43060y_.dbfinput datafile file number=00010 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_user1_dh432c5p_.dbfinput datafile file number=00011 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_vehicle_dh432w22_.dbfinput datafile file number=00012 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_privs1_dh5tw8pg_.dbfinput datafile file number=00013 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_freight_dh5txxoj_.dbfinput datafile file number=00014 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_message_dh5tzyr9_.dbfinput datafile file number=00015 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_settleme_dh5v1ch1_.dbfinput datafile file number=00006 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_test_und_dh36lb5q_.dbfinput datafile file number=00007 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_test_ind_dh36lzdk_.dbfinput datafile file number=00004 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_users_d8m6sv13_.dbfchannel ORA_DISK_1: validation complete, elapsed time: 00:00:01List of Datafiles=================File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------1 OK 0 35896 89600 1076879 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_system_d8m6of7w_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 42203 Index 0 8308 Other 0 3193File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------2 OK 0 39973 76800 1076859 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_sysaux_d8m6pc11_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 14486 Index 0 13320 Other 0 9021File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------3 OK 0 666 43520 1076879 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_undotbs1_d8m6q4z2_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 42854File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------4 OK 0 505 640 482125 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_users_d8m6sv13_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 5 Index 0 0 Other 0 130File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------5 OK 0 1216 2560 998771 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_tbs_dh36clvr_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 433 Index 0 175 Other 0 736File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------6 OK 0 1143 1280 518623 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_und_dh36lb5q_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 137File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------7 OK 0 1153 1280 481790 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_ind_dh36lzdk_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 127File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------8 OK 0 2433 2560 498843 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_acct_dh42xjyw_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 127File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------9 OK 0 2433 2560 499148 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_pay_dh43060y_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 127File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------10 OK 0 2433 2560 499442 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_user1_dh432c5p_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 127File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------11 OK 0 2433 2560 499715 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_vehicle_dh432w22_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 127File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------12 OK 0 2433 2560 530905 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_privs1_dh5tw8pg_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 127File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------13 OK 0 2433 2560 531202 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_freight_dh5txxoj_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 127File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------14 OK 0 2433 2560 531504 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_message_dh5tzyr9_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 127File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------15 OK 0 2433 2560 531799 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_settleme_dh5v1ch1_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 127File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------16 OK 0 12673 12800 990727 File Name: /u01/app/oracle/oradata/KYC/datafile/o1_mf_archi_dj5thsgt_.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 127channel ORA_DISK_1: starting validation of datafilechannel ORA_DISK_1: specifying datafile(s) for validationincluding current control file for validationincluding current SPFILE in backup setchannel ORA_DISK_1: validation complete, elapsed time: 00:00:01List of Control File and SPFILE===============================File Type Status Blocks Failing Blocks Examined------------ ------ -------------- ---------------SPFILE OK 0 2Control File OK 0 594Finished validate at 30-APR-17RMAN> report schema;Report of database schema for database with db_unique_name KYCList of Permanent Datafiles===========================File Size(MB) Tablespace RB segs Datafile Name---- -------- -------------------- ------- ------------------------1 700 SYSTEM *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_system_d8m6of7w_.dbf2 600 SYSAUX *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_sysaux_d8m6pc11_.dbf3 340 UNDOTBS1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_undotbs1_d8m6q4z2_.dbf4 5 USERS *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_users_d8m6sv13_.dbf5 20 TEST_TBS1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_tbs_dh36clvr_.dbf6 10 TEST_UNDO1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_und_dh36lb5q_.dbf7 10 TEST_INDEX1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_ind_dh36lzdk_.dbf8 20 ACCT *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_acct_dh42xjyw_.dbf9 20 PAY *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_pay_dh43060y_.dbf10 20 USER1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_user1_dh432c5p_.dbf11 20 VEHICLE *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_vehicle_dh432w22_.dbf12 20 PRIVS1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_privs1_dh5tw8pg_.dbf13 20 FREIGHT *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_freight_dh5txxoj_.dbf14 20 MESSAGE *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_message_dh5tzyr9_.dbf15 20 SETTLEMENT *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_settleme_dh5v1ch1_.dbf16 100 ARCHI *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_archi_dj5thsgt_.dbf17 10 TEST_TBS1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_tbs_djbo7s7m_.dbfList of Temporary Files=======================File Size(MB) Tablespace Maxsize(MB) Tempfile Name---- -------- -------------------- ----------- --------------------1 20 TEMP 32767 /u01/app/oracle/oradata/KYC/datafile/o1_mf_temp_d8m6qwlr_.tmp2 10 TEST_TEMP1 32767 /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_tem_dh36km36_.tmp