From: XIE WEN-MFK346 <wenxie at motorola.com>
Date: Thu, Dec 18, 2008 at 18:06
Subject: recovery window
To: wen xie <xiewenxiewen at googlemail.com>
recovery window
4.
60. You defined the Recovery Manager (RMAN) retention policy to recovery window
of 7 days by executing the following command:
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
When a backup is performed, what would be the status of this backup after seven days?
A. The backup would be marked as invalid.
(B). The backup would be marked as obsolete.
C. The backup would be removed from the media.
D. The backup would be removed from the RMAN repository.
12.
179. The backup retention policy is configured as RECOVERY WINDOW 2.
You executed the following command in Recovery Manager (RMAN) against your database:
RMAN> REPORT OBSOLETE;
What would you see in the output?
A. a list of all those files that have been deleted in the last two days
B. a list of all those files that have been recovered within the last two days
C. a list of all the expired backups and copies
(D). a list of backups and copies that are outside the range covered by the current retention policy
还是1z0-043的考题, 在下认为出的不好, 没有对的
第1题后来没再做备份, 所以第一个备份肯定留着, 不会被标记为过期
应该是, 恢复窗口外(<=(今天-恢复窗口))保留最新一个, 窗口内(>(今天-恢复窗口))都保留
第2题D说的不严谨, 但是唯一接近正确的
测试如下:
1. 设置恢复窗口, 创建数据库备份
sqlplus -s /nolog <<EOF
conn / as sysdba
show parameter control_file_record_keep_time
exit
EOF
[oracle@Perf-pxy-2 ~]$ sqlplus -s /nolog <<EOF
> conn / as sysdba
> show parameter control_file_record_keep_time
> exit
> EOF
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 30
[oracle@Perf-pxy-2 ~]$
> conn / as sysdba
> show parameter control_file_record_keep_time
> exit
> EOF
NAME TYPE VALUE
------------------------------
control_file_record_keep_time integer 30
[oracle@Perf-pxy-2 ~]$
恢复窗口设置为7天
rman target /
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
show all;
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
new RMAN configuration parameters are successfully stored
RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
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 ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/app/oracle/product/10.2/dbs/snapcf_s10.f'; # default
RMAN>
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
new RMAN configuration parameters are successfully stored
RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
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 ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/app/oracle/
RMAN>
备份数据库
backup device type disk format '/home/oracle/backup/s10/rman/
RMAN> backup device type disk format '/home/oracle/backup/s10/rman/db_%d_%I_%T_%s_%p_%U' database;
Starting backup at 2008-12-18 08:21:00
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1632 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/home/oracle/app/oracle/oradata/s10/system01.dbf
input datafile fno=00002 name=/home/oracle/app/oracle/oradata/s10/undotbs01.dbf
input datafile fno=00003 name=/home/oracle/app/oracle/oradata/s10/sysaux01.dbf
input datafile fno=00004 name=/home/oracle/app/oracle/oradata/s10/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2008-12-18 08:21:01
channel ORA_DISK_1: finished piece 1 at 2008-12-18 08:21:26
piece handle=/home/oracle/backup/s10/rman/db_S10_1127563272_20081218_1_1_01k2i1jd_1_1 tag=TAG20081218T082101 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 2008-12-18 08:21:28
channel ORA_DISK_1: finished piece 1 at 2008-12-18 08:21:29
piece handle=/home/oracle/backup/s10/rman/db_S10_1127563272_20081218_2_1_02k2i1k6_1_1 tag=TAG20081218T082101 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2008-12-18 08:21:29
RMAN>
Starting backup at 2008-12-18 08:21:00
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1632 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/home/oracle/app/oracle/
input datafile fno=00002 name=/home/oracle/app/oracle/
input datafile fno=00003 name=/home/oracle/app/oracle/
input datafile fno=00004 name=/home/oracle/app/oracle/
channel ORA_DISK_1: starting piece 1 at 2008-12-18 08:21:01
channel ORA_DISK_1: finished piece 1 at 2008-12-18 08:21:26
piece handle=/home/oracle/backup/
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 2008-12-18 08:21:28
channel ORA_DISK_1: finished piece 1 at 2008-12-18 08:21:29
piece handle=/home/oracle/backup/
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 2008-12-18 08:21:29
RMAN>
备份是18号的
list backup summary;
report obsolete;
RMAN> list backup summary;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
1 B F A DISK 2008-12-18 08:21:21 1 1 NO TAG20081218T082101
2 B F A DISK 2008-12-18 08:21:28 1 1 NO TAG20081218T082101
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
no obsolete backups found
RMAN>
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
1 B F A DISK 2008-12-18 08:21:21 1 1 NO TAG20081218T082101
2 B F A DISK 2008-12-18 08:21:28 1 1 NO TAG20081218T082101
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
no obsolete backups found
RMAN>
2. 修改系统时间到7天后(25号), 查看备份状态
停数据库,系统时间修改为7天后,重启数据库
service ntpd stop
date && date $( date '+%m%d%H%M' --date='7 days' )
[root@Perf-pxy-2 ~]# service ntpd stop
Shutting down ntpd: [ OK ]
[root@Perf-pxy-2 ~]# date && date $( date '+%m%d%H%M' --date='7 days' )
Thu Dec 18 08:27:34 GMT 2008
Thu Dec 25 08:27:00 GMT 2008
[root@Perf-pxy-2 ~]#
Shutting down ntpd: [ OK ]
[root@Perf-pxy-2 ~]# date && date $( date '+%m%d%H%M' --date='7 days' )
Thu Dec 18 08:27:34 GMT 2008
Thu Dec 25 08:27:00 GMT 2008
[root@Perf-pxy-2 ~]#
查看备份状态
report obsolete;
RMAN> report obsolete;
using target database control file instead of recovery catalog
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/oradata/s10/archive/1_5_673773960.arc
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/oradata/s10/archive/1_6_673773960.arc
RMAN>
没有过期using target database control file instead of recovery catalog
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/
RMAN>
3. 改成10天后(28号), 再查看备份状态
date && date $( date '+%m%d%H%M' --date='3 days' )
[root@Perf-pxy-2 ~]# date && date $( date '+%m%d%H%M' --date='3 days' )
Thu Dec 25 08:38:36 GMT 2008
Sun Dec 28 08:38:00 GMT 2008
[root@Perf-pxy-2 ~]#
Thu Dec 25 08:38:36 GMT 2008
Sun Dec 28 08:38:00 GMT 2008
[root@Perf-pxy-2 ~]#
RMAN> report obsolete;
using target database control file instead of recovery catalog
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/oradata/s10/archive/1_5_673773960.arc
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/oradata/s10/archive/1_6_673773960.arc
RMAN>
同样没有过期, 证明第1题是错的using target database control file instead of recovery catalog
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/
RMAN>
4. 修改系统时间, 创建19,25,28号的备份
过程略
date $( date '+%m%d%H%M' --date='10 days ago' )
date $( date '+%m%d%H%M' --date='1 day' )
backup device type disk format '/home/oracle/backup/s10/rman/
date $( date '+%m%d%H%M' --date='6 day' )
backup device type disk format '/home/oracle/backup/s10/rman/
date $( date '+%m%d%H%M' --date='3 day' )
backup device type disk format '/home/oracle/backup/s10/rman/
5. 查看备份状态
现在是28号, 恢复窗口是7天
date
[root@Perf-pxy-2 ~]# date
Sun Dec 28 08:55:48 GMT 2008
[root@Perf-pxy-2 ~]#
Sun Dec 28 08:55:48 GMT 2008
[root@Perf-pxy-2 ~]#
显示过期状态的备份
list backup summary;
show retention policy;
report obsolete;
RMAN> list backup summary;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
1 B F A DISK 2008-12-18 08:21:21 1 1 NO TAG20081218T082101
2 B F A DISK 2008-12-18 08:21:28 1 1 NO TAG20081218T082101
3 B F A DISK 2008-12-19 08:53:36 1 1 NO TAG20081219T085317
4 B F A DISK 2008-12-19 08:53:44 1 1 NO TAG20081219T085317
5 B F A DISK 2008-12-25 08:54:43 1 1 NO TAG20081225T085425
6 B F A DISK 2008-12-25 08:54:52 1 1 NO TAG20081225T085425
7 B F A DISK 2008-12-28 08:55:44 1 1 NO TAG20081228T085526
8 B F A DISK 2008-12-28 08:55:52 1 1 NO TAG20081228T085526
RMAN> show retention policy;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/oradata/s10/archive/1_5_673773960.arc
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/oradata/s10/archive/1_6_673773960.arc
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_1_1_01k2i1jd_1_1
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_2_1_02k2i1k6_1_1
RMAN>
18号的过期了, 因为28号的7天前是21号, 窗口内的25,28号的都保留, 窗口外保留最新一个,是19号的List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
1 B F A DISK 2008-12-18 08:21:21 1 1 NO TAG20081218T082101
2 B F A DISK 2008-12-18 08:21:28 1 1 NO TAG20081218T082101
3 B F A DISK 2008-12-19 08:53:36 1 1 NO TAG20081219T085317
4 B F A DISK 2008-12-19 08:53:44 1 1 NO TAG20081219T085317
5 B F A DISK 2008-12-25 08:54:43 1 1 NO TAG20081225T085425
6 B F A DISK 2008-12-25 08:54:52 1 1 NO TAG20081225T085425
7 B F A DISK 2008-12-28 08:55:44 1 1 NO TAG20081228T085526
8 B F A DISK 2008-12-28 08:55:52 1 1 NO TAG20081228T085526
RMAN> show retention policy;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/
RMAN>
显示恢复窗口是9天的过期的备份
report obsolete recovery window of 9 days;
RMAN> report obsolete recovery window of 9 days;
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/oradata/s10/archive/1_5_673773960.arc
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/oradata/s10/archive/1_6_673773960.arc
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_1_1_01k2i1jd_1_1
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_2_1_02k2i1k6_1_1
RMAN>
9天前是19号,所以19号以前是过期的Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/
RMAN>
恢复窗口为10天
report obsolete recovery window of 10 days;
RMAN> report obsolete recovery window of 10 days;
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/oradata/s10/archive/1_5_673773960.arc
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/oradata/s10/archive/1_6_673773960.arc
RMAN>
10天前是18号,所以18号的留着,18号后的也留着, 没有过期的Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/
RMAN>
恢复窗口为3,2,1,0天
report obsolete recovery window of 3 days;
RMAN> report obsolete recovery window of 3 days;
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/oradata/s10/archive/1_5_673773960.arc
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/oradata/s10/archive/1_6_673773960.arc
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_1_1_01k2i1jd_1_1
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_2_1_02k2i1k6_1_1
Backup Set 3 2008-12-19 08:53:36
Backup Piece 3 2008-12-19 08:53:36 /home/oracle/backup/s10/rman/db_S10_1127563272_20081219_3_1_03k2knru_1_1
Backup Set 4 2008-12-19 08:53:44
Backup Piece 4 2008-12-19 08:53:44 /home/oracle/backup/s10/rman/db_S10_1127563272_20081219_4_1_04k2knsn_1_1
RMAN>
RMAN> report obsolete recovery window of 2 days;
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/oradata/s10/archive/1_5_673773960.arc
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/oradata/s10/archive/1_6_673773960.arc
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_1_1_01k2i1jd_1_1
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_2_1_02k2i1k6_1_1
Backup Set 3 2008-12-19 08:53:36
Backup Piece 3 2008-12-19 08:53:36 /home/oracle/backup/s10/rman/db_S10_1127563272_20081219_3_1_03k2knru_1_1
Backup Set 4 2008-12-19 08:53:44
Backup Piece 4 2008-12-19 08:53:44 /home/oracle/backup/s10/rman/db_S10_1127563272_20081219_4_1_04k2knsn_1_1
RMAN> report obsolete recovery window of 1 days;
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/oradata/s10/archive/1_5_673773960.arc
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/oradata/s10/archive/1_6_673773960.arc
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_1_1_01k2i1jd_1_1
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_2_1_02k2i1k6_1_1
Backup Set 3 2008-12-19 08:53:36
Backup Piece 3 2008-12-19 08:53:36 /home/oracle/backup/s10/rman/db_S10_1127563272_20081219_3_1_03k2knru_1_1
Backup Set 4 2008-12-19 08:53:44
Backup Piece 4 2008-12-19 08:53:44 /home/oracle/backup/s10/rman/db_S10_1127563272_20081219_4_1_04k2knsn_1_1
RMAN> report obsolete recovery window of 0 days;
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/oradata/s10/archive/1_5_673773960.arc
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/oradata/s10/archive/1_6_673773960.arc
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_1_1_01k2i1jd_1_1
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/db_S10_1127563272_20081218_2_1_02k2i1k6_1_1
Backup Set 3 2008-12-19 08:53:36
Backup Piece 3 2008-12-19 08:53:36 /home/oracle/backup/s10/rman/db_S10_1127563272_20081219_3_1_03k2knru_1_1
Backup Set 4 2008-12-19 08:53:44
Backup Piece 4 2008-12-19 08:53:44 /home/oracle/backup/s10/rman/db_S10_1127563272_20081219_4_1_04k2knsn_1_1
Backup Set 5 2008-12-25 08:54:43
Backup Piece 5 2008-12-25 08:54:43 /home/oracle/backup/s10/rman/db_S10_1127563272_20081225_5_1_05k34i61_1_1
Backup Set 6 2008-12-25 08:54:52
Backup Piece 6 2008-12-25 08:54:52 /home/oracle/backup/s10/rman/db_S10_1127563272_20081225_6_1_06k34i6r_1_1
RMAN>
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/
Backup Set 3 2008-12-19 08:53:36
Backup Piece 3 2008-12-19 08:53:36 /home/oracle/backup/s10/rman/
Backup Set 4 2008-12-19 08:53:44
Backup Piece 4 2008-12-19 08:53:44 /home/oracle/backup/s10/rman/
RMAN>
RMAN> report obsolete recovery window of 2 days;
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/
Backup Set 3 2008-12-19 08:53:36
Backup Piece 3 2008-12-19 08:53:36 /home/oracle/backup/s10/rman/
Backup Set 4 2008-12-19 08:53:44
Backup Piece 4 2008-12-19 08:53:44 /home/oracle/backup/s10/rman/
RMAN> report obsolete recovery window of 1 days;
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/
Backup Set 3 2008-12-19 08:53:36
Backup Piece 3 2008-12-19 08:53:36 /home/oracle/backup/s10/rman/
Backup Set 4 2008-12-19 08:53:44
Backup Piece 4 2008-12-19 08:53:44 /home/oracle/backup/s10/rman/
RMAN> report obsolete recovery window of 0 days;
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log 1 2008-12-18 07:49:10 /home/oracle/app/oracle/
Archive Log 2 2008-12-18 08:18:31 /home/oracle/app/oracle/
Backup Set 1 2008-12-18 08:21:20
Backup Piece 1 2008-12-18 08:21:20 /home/oracle/backup/s10/rman/
Backup Set 2 2008-12-18 08:21:28
Backup Piece 2 2008-12-18 08:21:28 /home/oracle/backup/s10/rman/
Backup Set 3 2008-12-19 08:53:36
Backup Piece 3 2008-12-19 08:53:36 /home/oracle/backup/s10/rman/
Backup Set 4 2008-12-19 08:53:44
Backup Piece 4 2008-12-19 08:53:44 /home/oracle/backup/s10/rman/
Backup Set 5 2008-12-25 08:54:43
Backup Piece 5 2008-12-25 08:54:43 /home/oracle/backup/s10/rman/
Backup Set 6 2008-12-25 08:54:52
Backup Piece 6 2008-12-25 08:54:52 /home/oracle/backup/s10/rman/
RMAN>
6. 恢复系统时间, 恢复保留策略
configure retention policy clear;
RMAN> configure retention policy clear;
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
RMAN configuration parameters are successfully reset to default value
RMAN>
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
RMAN configuration parameters are successfully reset to default value
RMAN>
date && date $( date '+%m%d%H%M' --date='10 days ago' )
[root@Perf-pxy-2 ~]# date && date $( date '+%m%d%H%M' --date='10 days ago' )
Sun Dec 28 09:49:31 GMT 2008
Thu Dec 18 09:49:00 GMT 2008
[root@Perf-pxy-2 ~]#
Sun Dec 28 09:49:31 GMT 2008
Thu Dec 18 09:49:00 GMT 2008
[root@Perf-pxy-2 ~]#
外部链接:
How does REPORT NEED BACKUP RECOVER WINDOW work ?
Delete Obsolete Does Not Delete Obsolete Backups
Rman backup retention policy
Frequently asked questions on Rman backup retention policy
recovery window (这上举的例子好像不对, 实际好像不计算到小时, 只考虑到天数)
Recovery Window
Recovery Window-Based Backup Retention Policy
Xie Wen (谢文)
Network & Operations,
Multimedia Applications & Services (MDB) MOTOROLA Inc.
NO.104 mail box,
8th floor, Motorola Tower,
No. 1 Wang Jing East Road, Chao Yang District,
Beijing 100102 P. R. China
e-mail wenxie at motorola.com
-fin-
No comments:
Post a Comment