RMAN备份旧文件删除问题

[复制链接]
查看11 | 回复3 | 2008-1-2 17:35:53 | 显示全部楼层 |阅读模式
环境:
1.每天采用rman进行一次全备份.
备份脚本如下:
#!/bin/sh
export ORACLE_SID=ora9
export ORACLE_HOME=/oracle/product
export NLS_LANG='SIMPLIFIED CHINESE_CHINA.ZHS16GBK'
DATE=`date +%Y%m%d`
$ORACLE_HOME/bin/rmanshow 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; # 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 SNAPSHOT CONTROLFILE NAME TO '/oracle/product/dbs/snapcf_ora9.f'; # default
RMAN configuration has no stored or default parameters
RMAN> exit

Recovery Manager complete.
问题背景:
1,昨天采用rman进行一次全备份,日志如下:

Recovery Manager: Release 9.2.0.1.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation.All rights reserved.
RMAN>
connected to target database: ORA9 (DBID=405623623)
RMAN>
connected to recovery catalog database
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11>
allocated channel: c1
channel c1: sid=29 devtype=DISK
allocated channel: c2
channel c2: sid=24 devtype=DISK
allocated channel: c3
channel c3: sid=30 devtype=DISK
Starting backup at 24-4月 -08
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
channel c2: starting full datafile backupset
channel c2: specifying datafile(s) in backupset
input datafile fno=00012 name=/oracle/product/oradata/gdca/TSKMKEYFORUSE.dbf
input datafile fno=00002 name=/oracle/product/oradata/ora9/undotbs01.dbf
input datafile fno=00006 name=/oracle/product/oradata/ora9/indx01.dbf
input datafile fno=00003 name=/oracle/product/oradata/ora9/cwmlite01.dbf
input datafile fno=00008 name=/oracle/product/oradata/ora9/tools01.dbf
channel c2: starting piece 1 at 24-4月 -08
channel c3: starting full datafile backupset
channel c3: specifying datafile(s) in backupset
input datafile fno=00014 name=/oracle/product/oradata/gdca/TSKMKEYNOTUSE.dbf
input datafile fno=00005 name=/oracle/product/oradata/ora9/example01.dbf
input datafile fno=00011 name=/oracle/product/oradata/gdca/TSKMADMIN.dbf
input datafile fno=00010 name=/oracle/product/oradata/ora9/xdb01.dbf
input datafile fno=00007 name=/oracle/product/oradata/ora9/odm01.dbf
channel c3: starting piece 1 at 24-4月 -08
including current SPFILE in backupset
including current controlfile in backupset
input datafile fno=00013 name=/oracle/product/oradata/gdca/TSKMKEYINUSE.dbf
input datafile fno=00015 name=/oracle/product/oradata/gdca/TSKMLOG.dbf
input datafile fno=00009 name=/oracle/product/oradata/ora9/users01.dbf
input datafile fno=00004 name=/oracle/product/oradata/ora9/drsys01.dbf
input datafile fno=00001 name=/oracle/product/oradata/ora9/system01.dbf
channel c1: starting piece 1 at 24-4月 -08
channel c2: finished piece 1 at 24-4月 -08
piece handle=/rman/full1cjek5ag_44_1 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:46
channel c3: finished piece 1 at 24-4月 -08
piece handle=/rman/full1djek5ag_45_1 comment=NONE
channel c3: backup set complete, elapsed time: 00:01:01
channel c1: finished piece 1 at 24-4月 -08
piece handle=/rman/full1bjek5ag_43_1 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:26
Finished backup at 24-4月 -08
sql statement: alter system archive log current
released channel: c1
released channel: c2
released channel: c3
RMAN>
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=29 devtype=DISK
no obsolete backups found
RMAN>
Recovery Manager complete.
2.今天采用rman进行一次全备份,日志如下:

Recovery Manager: Release 9.2.0.1.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation.All rights reserved.
RMAN>
connected to target database: ORA9 (DBID=405623623)
RMAN>
connected to recovery catalog database
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11>
allocated channel: c1
channel c1: sid=30 devtype=DISK
allocated channel: c2
channel c2: sid=28 devtype=DISK
allocated channel: c3
channel c3: sid=24 devtype=DISK
Starting backup at 25-4月 -08
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
channel c2: starting full datafile backupset
channel c2: specifying datafile(s) in backupset
input datafile fno=00012 name=/oracle/product/oradata/gdca/TSKMKEYFORUSE.dbf
input datafile fno=00002 name=/oracle/product/oradata/ora9/undotbs01.dbf
input datafile fno=00006 name=/oracle/product/oradata/ora9/indx01.dbf
input datafile fno=00003 name=/oracle/product/oradata/ora9/cwmlite01.dbf
input datafile fno=00008 name=/oracle/product/oradata/ora9/tools01.dbf
channel c2: starting piece 1 at 25-4月 -08
channel c3: starting full datafile backupset
channel c3: specifying datafile(s) in backupset
input datafile fno=00014 name=/oracle/product/oradata/gdca/TSKMKEYNOTUSE.dbf
input datafile fno=00005 name=/oracle/product/oradata/ora9/example01.dbf
input datafile fno=00011 name=/oracle/product/oradata/gdca/TSKMADMIN.dbf
input datafile fno=00010 name=/oracle/product/oradata/ora9/xdb01.dbf
input datafile fno=00007 name=/oracle/product/oradata/ora9/odm01.dbf
channel c3: starting piece 1 at 25-4月 -08
including current SPFILE in backupset
including current controlfile in backupset
input datafile fno=00013 name=/oracle/product/oradata/gdca/TSKMKEYINUSE.dbf
input datafile fno=00015 name=/oracle/product/oradata/gdca/TSKMLOG.dbf
input datafile fno=00009 name=/oracle/product/oradata/ora9/users01.dbf
input datafile fno=00004 name=/oracle/product/oradata/ora9/drsys01.dbf
input datafile fno=00001 name=/oracle/product/oradata/ora9/system01.dbf
channel c1: starting piece 1 at 25-4月 -08
channel c2: finished piece 1 at 25-4月 -08
piece handle=/rman/full1fjem4fi_47_1 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:46
channel c3: finished piece 1 at 25-4月 -08
piece handle=/rman/full1gjem4fj_48_1 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:48
channel c1: finished piece 1 at 25-4月 -08
piece handle=/rman/full1ejem4fi_46_1 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:14
Finished backup at 25-4月 -08
sql statement: alter system archive log current
released channel: c1
released channel: c2
released channel: c3
RMAN>
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=30 devtype=DISK
Deleting the following obsolete backups and copies:
Type
KeyCompletion TimeFilename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 2273 24-4月 -08
Backup Piece 2276 24-4月 -08 /rman/full1bjek5ag_43_1
deleted backup piece
backup piece handle=/rman/full1bjek5ag_43_1 recid=45 stamp=652875089
Deleted 1 objects

RMAN>
Recovery Manager complete.

问题:
个人觉得delete noprompt obsolete命令应该删除7天前产生的备份文件,但是,今天采用rman进行全备份时,delete noprompt obsolete命令却把昨天备份产生的一个备份文件删除了.
请各位朋友帮忙看看.
小弟先谢了!
回复

使用道具 举报

千问 | 2008-1-2 17:35:53 | 显示全部楼层
显示得不一定是全删的,你需要看一看,如果包含不想删的,运行下crosscheck标记下要删嘚备份集!之后再删!
回复

使用道具 举报

千问 | 2008-1-2 17:35:53 | 显示全部楼层
保存7天的备份记录,不代表你用手工删除的时候都能自动不会删除7天内的。
所以手动删除的时候就需要指定清楚要删除的记录了。
回复

使用道具 举报

千问 | 2008-1-2 17:35:53 | 显示全部楼层
删除的那个应该是控制文件的备份吧, 这是对的.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行