NBU恢复数据库数据文件报错RMAN-06091

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

一、错误信息

报错信息如下
Starting restore at 2019/11/20 12:59:05
Starting implicit crosscheck backup at 2019/11/20 12:59:05
released channel: ch0
released channel: ch1
released channel: ch2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/20/2019 12:59:15
RMAN-06091: no channel allocated for maintenance (of an appropriate type)

RMAN>
Recovery Manager complete.
根据错误日志提示可以判断由于rman备份通道调整为非磁盘通道,而默认我们设置的通道只磁盘通道,所以这里无法直接通过上述命令删除

二、解决方案

通过命令查看当前rman通道设置

RMAN> show all;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

日常备份通过NBU备份,所以需要调整磁盘通道维护状态为磁盘
allocate channel for maintenance type disk;

然后进行上述删除操作:
crosscheck archivelog all;
delete expired archivelog all;

三、操作记录

RMAN> show all;

using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name DBYUN are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
...此处省略

RMAN> allocate channel for maintenance type disk;

allocated channel: ORA_MAINT_DISK_1
channel ORA_MAINT_DISK_1: SID=77 device type=DISK

RMAN> crosscheck archivelog all;

Starting implicit crosscheck backup at 2019/11/20 13:13:02
Crosschecked 2 objects
Finished implicit crosscheck backup at 2019/11/20 13:13:11

Starting implicit crosscheck copy at 2019/11/20 13:13:11
Crosschecked 1 objects
Finished implicit crosscheck copy at 2019/11/20 13:13:12

searching for all files in the recovery area
cataloging files...
no files cataloged

validation failed for archived log
archived log file name=+ARCH/DB/ARCHIVELOG/2019_11_19/thread_2_seq_1111.1111.1023785765 RECID=11111 STAMP=1111111111
...此处省略
Crosschecked 7 objects

RMAN> delete expired archivelog all;

List of Archived Log Copies for database with db_unique_name DB

Key Thrd Seq S Low Time


109683 2 6499 X 2019/11/08 06:56:51
Name: +ARCH/DB/ARCHIVELOG/2019_11_19/thread_2_seq_1111.2347.1023781111

...此处省略
Do you really want to delete the above objects (enter YES or NO)? y
deleted archived log
archived log file name=+ARCH/DB/ARCHIVELOG/2019_11_19/thread_2_seq_1111.1111.1023785765 RECID=11111 STAMP=1111111111
...此处省略
Deleted 7 EXPIRED objects

RMAN>
RMAN> quit

再次执行恢复脚本成功运行:
Starting restore at 2019/11/20 13:14:38

channel ch0: starting datafile backup set restore
channel ch0: specifying datafile(s) to restore from backup set
channel ch0: restoring datafile 00006 to /data/20191120/oradbrest/datafile/users.111.111111111

原文地址:https://www.cnblogs.com/yihr/p/11898472.html