归档日志的备份
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 catalog
List 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 TAG20161023T111550
2 B F A DISK 23-OCT-16 1 1 NO TAG20161023T111550
3 B F A DISK 25-OCT-16 1 1 NO TAG20161025T150647
4 B F A DISK 25-OCT-16 1 1 NO TAG20161025T150647
5 B F A DISK 01-NOV-16 1 1 NO TAG20161101T145207
6 B F A DISK 01-NOV-16 1 1 NO TAG20161101T145207
7 B F A DISK 05-DEC-16 1 1 NO TAG20161205T171327
8 B F A DISK 03-JAN-17 1 1 NO TAG20170103T133345
9 B F A DISK 03-JAN-17 1 1 NO TAG20170103T133345
10 B F A DISK 21-JAN-17 1 1 NO TAG20170121T192514
11 B F A DISK 21-JAN-17 1 1 NO TAG20170121T192514
12 B F A DISK 23-JAN-17 1 1 NO TAG20170123T091308
13 B F A DISK 23-JAN-17 1 1 NO TAG20170123T091308
14 B F A DISK 25-JAN-17 1 1 NO TAG20170125T211529
15 B F A DISK 25-JAN-17 1 1 NO TAG20170125T211529
16 B F A DISK 28-JAN-17 1 1 NO TAG20170128T194205
17 B F A DISK 28-JAN-17 1 1 NO TAG20170128T194205
18 B F A DISK 01-FEB-17 1 1 NO TAG20170201T110256
19 B F A DISK 01-FEB-17 1 1 NO TAG20170201T110256
20 B F A DISK 03-FEB-17 1 1 NO TAG20170203T201513
21 B F A DISK 03-FEB-17 1 1 NO TAG20170203T201513
RMAN> list db_unique_name all;
List of Databases
DB Key DB Name DB ID Database Role Db_unique_name
------- ------- ----------------- --------------- ------------------
1 BAOKA 3484596173 PHYSICAL STANDBY STBAOKA
RMAN> list incarnation;
List of Database Incarnations
DB 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 Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 KYC 111003738 PARENT 1 26-JAN-17
6 6 KYC 111003738 CURRENT 988210 28-APR-17
5 5 KYC 111003738 ORPHAN 989509 28-APR-17
4 4 KYC 111003738 ORPHAN 989509 27-APR-17
2 2 KYC 111003738 ORPHAN 989509 27-APR-17
3 3 KYC 111003738 ORPHAN 989509 27-APR-17
RMAN> validate database; Starting validate at 30-APR-17 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=21 device type=DISK channel ORA_DISK_1: starting validation of datafile channel ORA_DISK_1: specifying datafile(s) for validation input datafile file number=00001 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_system_d8m6of7w_.dbf input datafile file number=00002 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_sysaux_d8m6pc11_.dbf input datafile file number=00003 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_undotbs1_d8m6q4z2_.dbf input datafile file number=00016 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_archi_dj5thsgt_.dbf input datafile file number=00005 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_test_tbs_dh36clvr_.dbf input datafile file number=00008 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_acct_dh42xjyw_.dbf input datafile file number=00009 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_pay_dh43060y_.dbf input datafile file number=00010 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_user1_dh432c5p_.dbf input datafile file number=00011 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_vehicle_dh432w22_.dbf input datafile file number=00012 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_privs1_dh5tw8pg_.dbf input datafile file number=00013 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_freight_dh5txxoj_.dbf input datafile file number=00014 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_message_dh5tzyr9_.dbf input datafile file number=00015 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_settleme_dh5v1ch1_.dbf input datafile file number=00006 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_test_und_dh36lb5q_.dbf input datafile file number=00007 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_test_ind_dh36lzdk_.dbf input datafile file number=00004 name=/u01/app/oracle/oradata/KYC/datafile/o1_mf_users_d8m6sv13_.dbf channel ORA_DISK_1: validation complete, elapsed time: 00:00:01 List 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 3193 File 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 9021 File 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 42854 File 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 130 File 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 736 File 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 137 File 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 127 File 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 127 File 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 127 File 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 127 File 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 127 File 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 127 File 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 127 File 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 127 File 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 127 File 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 127 channel ORA_DISK_1: starting validation of datafile channel ORA_DISK_1: specifying datafile(s) for validation including current control file for validation including current SPFILE in backup set channel ORA_DISK_1: validation complete, elapsed time: 00:00:01 List of Control File and SPFILE =============================== File Type Status Blocks Failing Blocks Examined ------------ ------ -------------- --------------- SPFILE OK 0 2 Control File OK 0 594 Finished validate at 30-APR-17 RMAN> report schema; Report of database schema for database with db_unique_name KYC List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 700 SYSTEM *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_system_d8m6of7w_.dbf 2 600 SYSAUX *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_sysaux_d8m6pc11_.dbf 3 340 UNDOTBS1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_undotbs1_d8m6q4z2_.dbf 4 5 USERS *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_users_d8m6sv13_.dbf 5 20 TEST_TBS1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_tbs_dh36clvr_.dbf 6 10 TEST_UNDO1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_und_dh36lb5q_.dbf 7 10 TEST_INDEX1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_ind_dh36lzdk_.dbf 8 20 ACCT *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_acct_dh42xjyw_.dbf 9 20 PAY *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_pay_dh43060y_.dbf 10 20 USER1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_user1_dh432c5p_.dbf 11 20 VEHICLE *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_vehicle_dh432w22_.dbf 12 20 PRIVS1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_privs1_dh5tw8pg_.dbf 13 20 FREIGHT *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_freight_dh5txxoj_.dbf 14 20 MESSAGE *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_message_dh5tzyr9_.dbf 15 20 SETTLEMENT *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_settleme_dh5v1ch1_.dbf 16 100 ARCHI *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_archi_dj5thsgt_.dbf 17 10 TEST_TBS1 *** /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_tbs_djbo7s7m_.dbf List 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_.tmp 2 10 TEST_TEMP1 32767 /u01/app/oracle/oradata/KYC/datafile/o1_mf_test_tem_dh36km36_.tmp