Sunday, January 17, 2010

RMAN-06091 no channel allocated for maintenance (of an appropriate type)

Problem Description
RMAN DELETE OBSOLETE command fails with following error stack.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of delete command at 01/17/2010 02:15:40
RMAN-06091: no channel allocated for maintenance (of an appropriate type)

Problem Investigation
This error occurs if you attempt to delete obsolete backup from tape but channel had not being allocated on tape. And also these error stacks will appear if you attempt to delete obsolete backup from disk but channel had not being allocation on disk.

Note that if you allocate channel to disk and then attempt to delete obsolete it should work if your backups are in disk. We assume that backups are in disk and let's try to delete it after allocating channel to disk.
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;

allocated channel: ORA_MAINT_DISK_2
channel ORA_MAINT_DISK_2: sid=149 devtype=DISK
RMAN> delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 3739 Dec 24 2009 04:36:02
Backup Piece 6037 Dec 24 2009 04:36:02 lml1m82u_1_2
Backup Set 3738 Dec 24 2009 04:36:02
Backup Piece 6036 Dec 24 2009 04:36:02 lnl1m82u_1_2
Backup Set 3743 Dec 24 2009 04:38:06
Backup Piece 6038 Dec 24 2009 04:38:06 c-3269547898-20091224-01
.
.
.
Backup Set 3857 Jan 11 2010 04:25:21
Backup Piece 6217 Jan 11 2010 04:25:21 /db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-2010 0111-00
Backup Set 3862 Jan 12 2010 04:58:50
Backup Piece 6223 Jan 12 2010 04:58:50 /db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-2010 0112-00
Backup Set 3867 Jan 13 2010 04:40:29
Backup Piece 6228 Jan 13 2010 04:40:29 /db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-2010 0113-00
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of delete command at 01/17/2010 02:15:40
RMAN-06091: no channel allocated for maintenance (of an appropriate type)
But no help. It fails still.

Solution of the Problem
Using show all command check the rman configuration parameter settings.
RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'ora_cf%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
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 '/db/app/oracle/product/10.2.0/db/dbs/snapcf_OMSRPS.f'; # default
From the above configuration we see that channels are allocated to disk.
Using the following command verify that whether the backup sets are on tape or in disk.
RMAN> list backup;

List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ --------------------
3743 Full 7.25M SBT_TAPE 00:01:55 Dec 24 2009 04:38:06
BP Key: 6038 Status: AVAILABLE Compressed: NO Tag: TAG20091224T043611
Handle: c-3269547898-20091224-01 Media:
Standby Control File Included: Ckp SCN: 1318360946 Ckp time: Dec 24 2009 04:32:46
SPFILE Included: Modification time: Aug 25 2009 03:53:48

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ --------------------
3746 Incr 1 228.05M SBT_TAPE 00:08:49 Dec 25 2009 04:18:25
BP Key: 6045 Status: AVAILABLE Compressed: YES Tag: LEVEL_1_122509
Handle: lvl1ot00_1_2 Media:
List of Datafiles in backup set 3746
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- -------------------- ----
1 1 Incr 1320551570 Dec 25 2009 03:40:48 /db/app/oradata/OMSRPS/system01.dbf
2 1 Incr 1320551570 Dec 25 2009 03:40:48 /db/app/oradata/OMSRPS/undotbs01.dbf
3 1 Incr 1320551570 Dec 25 2009 03:40:48 /db/app/oradata/OMSRPS/sysaux01.dbf
7 1 Incr 1320551570 Dec 25 2009 03:40:48 /db/app/oradata/OMSRPS/rman_ts.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ --------------------
3747 Incr 1 136.52M SBT_TAPE 00:17:24 Dec 25 2009 04:27:00
BP Key: 6044 Status: AVAILABLE Compressed: YES Tag: LEVEL_1_122509
Handle: lul1ot00_1_2 Media:
List of Datafiles in backup set 3747
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- -------------------- ----
4 1 Incr 1320551570 Dec 25 2009 03:40:48 /db/app/oradata/OMSRPS/users01.dbf
5 1 Incr 1320551570 Dec 25 2009 03:40:48 /db/app/oradata/OMSRPS/mgmt.dbf
6 1 Incr 1320551570 Dec 25 2009 03:40:48 /db/app/oradata/OMSRPS/mgmt_ecm_depot1.dbf
From the above command we see the backups are on SBT_TAPE. So you have to issue delete command from the tape.

So our command will be as follows.
RMAN> allocate channel for maintenance device type 'sbt_tape' PARMS '...';
Here please change '...' to your actual tape params

RMAN> delete obsolete;

or issue following command to delete obsolete backups from tape.
RMAN> allocate channel for maintenance type sbt_tape;

However if your backups are on disk then your command will look like below.
RMAN> allocate channel for maintenance type disk;

allocated channel: ORA_MAINT_DISK_4
channel ORA_MAINT_DISK_4: sid=79 devtype=DISK
And then,
RMAN> delete obsolete device type disk;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 3792 Jan 01 2010 04:25:18
Backup Piece 6115 Jan 01 2010 04:25:18 /db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-2010 0101-00
Backup Set 3799 Jan 02 2010 04:25:44
Backup Piece 6126 Jan 02 2010 04:25:44 /db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-2010 0102-00
.
.
.
Backup Piece 6217 Jan 11 2010 04:25:21 /db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-2010 0111-00
Backup Set 3862 Jan 12 2010 04:58:50
Backup Piece 6223 Jan 12 2010 04:58:50 /db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-2010 0112-00
Backup Set 3867 Jan 13 2010 04:40:29
Backup Piece 6228 Jan 13 2010 04:40:29 /db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-2010 0113-00

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-20100101-00 recid=6115 stamp=7071 13518
deleted backup piece
backup piece handle=/db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-20100102-00 recid=6126 stamp=7071 99944
deleted backup piece
.
.
.
deleted backup piece
backup piece handle=/db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-20100112-00 recid=6223 stamp=7080 65929
deleted backup piece
backup piece handle=/db/app/oracle/product/10.2.0/db/dbs/ora_cfc-3269547898-20100113-00 recid=6228 stamp=7081 51228
Deleted 13 objects

If you want to delete both obsolete and expired backups from disk then you can issue,
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
RMAN> run
{
report obsolete;
CROSSCHECK BACKUP;
CROSSCHECK COPY;
DELETE EXPIRED BACKUP;
DELETE EXPIRED COPY;
delete obsolete;
}
release channel;
Related Documents
RMAN-06091 no channel allocated for maintenance (of an appropriate type)
RMAN-06429: TARGET database is not compatible with this version of RMAN
How to take RMAN backup on a remote disk/ location
RMAN-00554,RMAN-04005,ORA-0103 when remote connection by rman
Set Date format inside RMAN environment
How to skip a tablespace for restore operation
How to debug Backup, Restore Session in RMAN
Restore operation fails with RMAN-11003 ORA-01511 ORA-01516
Recover database after only lose of all controlfiles
RMAN-04014: startup failed: ORA-07446: sdnfy: bad value
How to restore an Spfile from autobackup older than 7 days
RMAN-06172: no autobackup found
Creating a Duplicate Database on a Remote Host -Part1
Database Duplication Fails Missing Log RMAN-06053 RMAN-06025
How to perform Database Point in time Recovery DBPITR

2 comments:

  1. Thank you! Very useful post.

    ReplyDelete
  2. Mohammad,
    thank a lot for this post, very clear and resolve the issue I have.

    Namaste,

    Stephane

    ReplyDelete