1 问题描述
执行脚本时,发生错误,脚本如下
#!/bin/bash
source /home/oracle/.bash_profile
rman target / log=/u01/app/bash/full_backup.log<<EOF
run
{
allocate channel ch1 device type disk;
sql 'alter system archive log current';
backup device type disk tag '%TAG' database;
sql 'alter system archive log current';
backup device type disk tag '%TAG' archivelog all not backed up delete all input;
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt obsolete;
delete noprompt backup of database completed before 'sysdate-31';
delete noprompt archivelog all;
delete noprompt backup of archivelog all completed before 'sysdate-31';
release channel ch1;
}
EOF
执行失败:
[oracle@db3 bash]$ cat full_backup.log
恢复管理器: Release 11.2.0.4.0 - Production on 星期三 9月 25 08:40:13 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
已连接到目标数据库: ORA11G (DBID=4269755158)
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16>
使用目标数据库控制文件替代恢复目录
分配的通道: ch1
通道 ch1: SID=2275 设备类型=DISK
sql 语句: alter system archive log current
启动 backup 于 25-9月 -2019 08:40:21
释放的通道: ch1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: backup 命令 (在 09/25/2019 08:40:21 上) 失败
RMAN-06470: 仅当使用自动通道时, 才支持 DEVICE TYPE
RMAN>
恢复管理器完成。
2 原因与解决
Error Description:
DEVICE TYPE is supported only when automatic channels are used
Error Cause:
The DEVICE TYPE option was specified with a BACKUP, RESTORE, RECOVER, DUPLICATE, CHANGE, VALIDATE, CROSSCHECK, or DELETE EXPIRED command. This option is allowed only when automatically allocated channels are used.
Action:
Remove the DEVICE TYPE option and re-run the command. Or Remove all ALLOCATE commands and re-run the script so that channels are automatically allocated.
RMAN备份脚本错误解析

本文详细解析了在执行RMAN备份脚本时遇到的错误,错误信息提示在使用手动分配通道时指定了设备类型,而设备类型仅在自动分配通道时受支持。文章提供了详细的错误描述、原因分析及解决方法,建议移除设备类型选项并重新运行命令,或移除所有分配命令,使通道自动分配。
3984

被折叠的 条评论
为什么被折叠?



