pub 上的一个帖子,分享一下:
环境介绍:
数据库版本为9201。原操作系统是solaris8,原备份方式是rman通过tsm备份到磁带。由于原服务器不能满足生产需要更新了服务器,将数据库迁移至新的数据库服务器,操作系统是solaris10,rman备份到磁盘。迁移的方式是tar过去的。原服务器rman实际是是有一个catalog库的,新服务器rman使用的是控制文件。
问题:由于整个数据库都是tar过来的,控制文件保存着过去的备份信息(不知为啥控制文件怎么会保持了一次rman的备份信息,因为备份走的是资料库),因为过去是备份到磁带使用的是sbt_tape通道。现在是盘使用的是disk通道。所以删除不掉控制文件里的过去备份信息。
具体现象:
RMAN> DELETE NOPROMPT OBSOLETE;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 4 days
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 4943 11-APR-10
Backup Piece 4943 11-APR-10 arch_20100411_4970_1
Backup Set 4948 12-APR-10
Backup Piece 4948 12-APR-10 arch_20100412_4976_1
Backup Set 4949 12-APR-10
Backup Piece 4949 12-APR-10 arch_20100412_4975_1
Backup Set 4954 13-APR-10
Backup Piece 4954 13-APR-10 arch_20100413_4982_1
Backup Set 4955 13-APR-10
Backup Piece 4955 13-APR-10 arch_20100413_4981_1
Backup Set 4960 14-APR-10
Backup Piece 4960 14-APR-10 arch_20100414_4987_1
Backup Set 4961 14-APR-10
Backup Piece 4961 14-APR-10 arch_20100414_4988_1
Backup Set 4966 15-APR-10
Backup Piece 4966 15-APR-10 arch_20100415_4994_1
Backup Set 4967 15-APR-10
Backup Piece 4967 15-APR-10 arch_20100415_4993_1
Backup Set 4972 16-APR-10
Backup Piece 4972 16-APR-10 arch_20100416_5000_1
Backup Set 4973 16-APR-10
Backup Piece 4973 16-APR-10 arch_20100416_4999_1
Backup Set 5114 28-APR-10
Backup Piece 5114 28-APR-10 /DMCDBS01/rman/31lc914d_1_1
Backup Set 5115 28-APR-10
Backup Piece 5115 28-APR-10 /DMCDBS01/rman/32lc914d_1_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of delete command at 05/03/2010 15:04:50
RMAN-06091: no channel allocated for maintenance (of an appropriate type)
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 4 days
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 4943 11-APR-10
Backup Piece 4943 11-APR-10 arch_20100411_4970_1
Backup Set 4948 12-APR-10
Backup Piece 4948 12-APR-10 arch_20100412_4976_1
Backup Set 4949 12-APR-10
Backup Piece 4949 12-APR-10 arch_20100412_4975_1
Backup Set 4954 13-APR-10
Backup Piece 4954 13-APR-10 arch_20100413_4982_1
Backup Set 4955 13-APR-10
Backup Piece 4955 13-APR-10 arch_20100413_4981_1
Backup Set 4960 14-APR-10
Backup Piece 4960 14-APR-10 arch_20100414_4987_1
Backup Set 4961 14-APR-10
Backup Piece 4961 14-APR-10 arch_20100414_4988_1
Backup Set 4966 15-APR-10
Backup Piece 4966 15-APR-10 arch_20100415_4994_1
Backup Set 4967 15-APR-10
Backup Piece 4967 15-APR-10 arch_20100415_4993_1
Backup Set 4972 16-APR-10
Backup Piece 4972 16-APR-10 arch_20100416_5000_1
Backup Set 4973 16-APR-10
Backup Piece 4973 16-APR-10 arch_20100416_4999_1Backup Set 5114 28-APR-10
Backup Piece 5114 28-APR-10 /DMCDBS01/rman/31lc914d_1_1
Backup Set 5115 28-APR-10
Backup Piece 5115 28-APR-10 /DMCDBS01/rman/32lc914d_1_1
Backup Set 5116 28-APR-10
Backup Piece 5116 28-APR-10 /DMCDBS01/rman/33lc925m_1_1
Backup Set 5117 28-APR-10
Backup Piece 5117 28-APR-10 /DMCDBS01/rman/34lc92rt_1_1
Backup Set 5119 29-APR-10
Backup Piece 5119 29-APR-10 /DMCDBS01/rman/full_20100429_5223_1
Backup Set 5120 29-APR-10
Backup Piece 5120 29-APR-10 /DMCDBS01/rman/full_20100429_5222_1
RMAN>
红色字的部分无法删除
RMAN> list backupset of archivelog all;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
4943 838M SBT_TAPE 00:00:35 11-APR-10
BP Key: 4943 Status: UNAVAILABLE Tag: TAG20100411T004252
Piece Name: arch_20100411_4970_1
List of Archived Logs in backup set 4943
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 16014 4006475789091 10-APR-10 4006475846928 10-APR-10
1 16015 4006475846928 10-APR-10 4006475885650 10-APR-10
1 16016 4006475885650 10-APR-10 4006475943776 10-APR-10
1 16017 4006475943776 10-APR-10 4006475979118 10-APR-10
1 16018 4006475979118 10-APR-10 4006476023785 10-APR-10
1 16019 4006476023785 10-APR-10 4006476071180 10-APR-10
1 16020 4006476071180 10-APR-10 4006476158466 10-APR-10
1 16021 4006476158466 10-APR-10 4006476250848 10-APR-10
1 16022 4006476250848 10-APR-10 4006525513941 11-APR-10
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
4948 517M SBT_TAPE 00:00:29 12-APR-10
BP Key: 4948 Status: AVAILABLE Tag: TAG20100412T002657
Piece Name: arch_20100412_4976_1
List of Archived Logs in backup set 4948
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 16030 4006527200207 11-APR-10 4006527247642 11-APR-10
1 16031 4006527247642 11-APR-10 4006527316362 11-APR-10
1 16032 4006527316362 11-APR-10 4006527374966 11-APR-10
1 16033 4006527374966 11-APR-10 4006527472280 11-APR-10
1 16034 4006527472280 11-APR-10 4006528044006 11-APR-10
1 16035 4006528044006 11-APR-10 4006576257046 12-APR-10
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
4949 699M SBT_TAPE 00:00:34 12-APR-10
BP Key: 4949 Status: AVAILABLE Tag: TAG20100412T002657
Piece Name: arch_20100412_4975_1
List of Archived Logs in backup set 4949
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 16023 4006525513941 11-APR-10 4006526965047 11-APR-10
1 16024 4006526965047 11-APR-10 4006527011565 11-APR-10
1 16025 4006527011565 11-APR-10 4006527053186 11-APR-10
1 16026 4006527053186 11-APR-10 4006527088851 11-APR-10
1 16027 4006527088851 11-APR-10 4006527134651 11-APR-10
1 16028 4006527134651 11-APR-10 4006527173324 11-APR-10
1 16029 4006527173324 11-APR-10 4006527200207 11-APR-10
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
4954 591M SBT_TAPE 00:00:28 13-APR-10
BP Key: 4954 Status: AVAILABLE Tag: TAG20100413T004133
Piece Name: arch_20100413_4982_1
List of Archived Logs in backup set 4954
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 16043 4006577315888 12-APR-10 4006577356109 12-APR-10
1 16044 4006577356109 12-APR-10 4006577411421 12-APR-10
1 16045 4006577411421 12-APR-10 4006577476948 12-APR-10
1 16046 4006577476948 12-APR-10 4006577555193 12-APR-10
1 16047 4006577555193 12-APR-10 4006603910220 12-APR-10
1 16048 4006603910220 12-APR-10 4006629912732 13-APR-10
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
4955 699M SBT_TAPE 00:00:50 13-APR-10
BP Key: 4955 Status: AVAILABLE Tag: TAG20100413T004133
Piece Name: arch_20100413_4981_1
List of Archived Logs in backup set 4955
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 16036 4006576257046 12-APR-10 4006577063714 12-APR-10
1 16037 4006577063714 12-APR-10 4006577104776 12-APR-10
1 16038 4006577104776 12-APR-10 4006577149346 12-APR-10
1 16039 4006577149346 12-APR-10 4006577197593 12-APR-10
1 16040 4006577197593 12-APR-10 4006577231743 12-APR-10
1 16041 4006577231743 12-APR-10 4006577284073 12-APR-10
1 16042 4006577284073 12-APR-10 4006577315888 12-APR-10
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
4960 699M SBT_TAPE 00:00:38 14-APR-10
BP Key: 4960 Status: AVAILABLE Tag: TAG20100414T002627
Piece Name: arch_20100414_4987_1
List of Archived Logs in backup set 4960
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 16049 4006629912732 13-APR-10 4006630718989 13-APR-10
1 16050 4006630718989 13-APR-10 4006630767891 13-APR-10
1 16051 4006630767891 13-APR-10 4006630818858 13-APR-10
1 16052 4006630818858 13-APR-10 4006630866098 13-APR-10
1 16053 4006630866098 13-APR-10 4006630920332 13-APR-10
1 16054 4006630920332 13-APR-10 4006630961115 13-APR-10
1 16055 4006630961115 13-APR-10 4006631015429 13-APR-10
可见设备类型都是磁带
我的目的是如何能把这部分信息删除掉我能够正常的DELETE NOPROMPT OBSOLETE;
解决方法:
Suppose your current backup strategy uses only disk, but you have several old tape
backups you want to get rid of. You can allocate a maintenance channel for performing the
deletion of the tape backups by using the dummy sbt API (because the media manager isn’t
available any longer). You can then use the delete obsolete command to remove the tape
backups. Here’s an example showing how to do those things:
RMAN> allocate channel for maintenance device type sbt
parms 'SBT_LIBRARY=oracle.disksbt,
ENV=(BACKUP_DIR=/tmp)';
RMAN> delete obsolete;
Although the media manager isn’t available any longer, RMAN simulates a callout to the
media management layer (MML) and successfully initiates the maintenance command to
delete the old tape backups you want toget rid of.