【RMAN】Run Allocate Channel For Maintenance From Script Fails
生產庫的備庫在做rman備份到磁帶的時候,總是失敗。
查詢原因時發現:
crosscheck archivelog all;
delete noprompt expired archivelog all;
##allocate channel for maintenance type 'sbt_tape';
crosscheck backup;
crosscheck copy;
delete noprompt expired backup;
delete noprompt expired copy;
delete noprompt obsolete;
for maintenance 關鍵字在run{}中執行時會報錯
下面介紹一下
ALLOCATE CHANNEL FOR MAINTENANCE命令。
ALLOCATE CHANNEL FOR MAINTENANCE命令是用來分配通道的,專用於CHANGE、DELETE、CROSSCHECK命令,並且也不需要(而且也不能)包含在RUN塊中。
預設配置下CONFIGURE已經分配了一個指定 DISK 的通道,因此也可以不需要執行ALLOCATE CHANNEL FOR MAINTENANCE命令,Oracle也建議透過CONFIGURE分配通道,來替代使用該命令維護管理用的專用通道,這可能會增強備份指令碼的複雜度。
=================================metalink 官方文件解釋======================================
RMAN Run Allocate Channel For Maintenance From Script. Fails With Syntax Error [ID 224353.1]
fact: Oracle Server - Enterprise Edition
fact: Recovery Manager (RMAN)
symptom: Allocate Channel For Maintenance fails
symptom: RMAN-01005: syntax error: found "for": expecting one of:
"channel_id, double-quoted-string, identifier, single-quoted-string"
symptom: RMAN-01007: at line %d column %d file: %s
symptom: allocate channel for maintenance type disk;
原因: Cannot Run RMAN Allocate Channel For Maintenance From An RMAN Script.
Must Be Run Direct From The RMAN Prompt.
現象:
Running the following will fail.
RMAN> run {
3> allocate channel for maintenance type disk;
執行報錯~~~!
解決:
Run direct from RMAN prompt.
RMAN> allocate channel for maintenance type disk;
RMAN> crosscheck backup of database;
=========================測試例子如下=====================
測試環境:
oracle版本:11.2.0.1.0
rman 版本:11.2.0.1.0
=========================二備庫=======================
正確的方式:
RMAN> run {
2> allocate channel ch00 type 'SBT_TAPE';
3> RELEASE CHANNEL ch00;
4> }
allocated channel: ch00
channel ch00: SID=678 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 6.5 (2010042404)
released channel: ch00
RMAN>
錯誤的方式:
RMAN> run {
2> allocate channel ch00 for maintenance type 'sbt_tape';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "for": expecting one of: "device, type"
RMAN-01007: at line 2 column 23 file: standard input
=====================rac測試環境 =========================
--------------------下面是錯誤的例子-------------------------
RMAN> run {
2> allocate channel ch00 for maintenance type disk;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "for": expecting one of: "device, type"
RMAN-01007: at line 2 column 23 file: standard input
RMAN> run {
2> allocate channel ch00 for maintenance device type disk;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "for": expecting one of: "device, type"
RMAN-01007: at line 2 column 23 file: standard input
RMAN> run {
2> allocate channel ch00 for type disk;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "for": expecting one of: "device, type"
RMAN-01007: at line 2 column 23 file: standard input
RMAN> allocate channel ch00 device type disk for maintenance;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "for"
RMAN-01008: the bad identifier was: ch00
RMAN-01007: at line 1 column 18 file: standard input
RMAN> run {
2> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "for": expecting one of: "channel_id, double-quoted-string, identifier, single-quoted-string, "
RMAN-01007: at line 2 column 18 file: standard input
RMAN> run {
2> allocate channel ch00 device type disk ;
3> release channel;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "channel_id, double-quoted-string, identifier, single-quoted-string, "
RMAN-01007: at line 3 column 16 file: standard input
--------------------下面是正確的例子-------------------------
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
allocated channel: ORA_MAINT_DISK_1
channel ORA_MAINT_DISK_1: SID=963 instance=rac1 device type=DISK
RMAN> release channel;
released channel: ORA_MAINT_DISK_1
RMAN> run {
2> allocate channel ch00 device type disk ;
3> release channel ch00;
4> }
allocated channel: ch00
channel ch00: SID=963 instance=rac1 device type=DISK
released channel: ch00
RMAN>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-706195/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ALLOCATE CHANNEL FOR MAINTENANCE 命令AINaN
- Oracle案例03——RMAN-06091: no channel allocated for maintenance (of an appropriate type)OracleAINaNAPP
- oracle10g_rman_語法測試_reset database_allocate channel_OracleDatabase
- 備份時報no channel allocated for maintenance(of an appropriate type)AINaNAPP
- netbackup RMAN-03009: failure of allocate command on XXXX channelAI
- Restore Controlfile from SBT Tape Fails RMAN-6172 (Doc ID 1314134.1)RESTAI
- rman backup script(引用)
- execute shell script from stored procedure
- rman 0.1.2 備份 script
- Get your Windows product key from a scriptWindows
- nohup not working, another way to get the script run in the background
- Script of Narrative Writing from different point of viewView
- oracle 11g rman backup scriptOracle
- Powershell script to install Windows Updates (msu) from folderWindows
- Script to generate AWR report from remote sql clientREMSQLclient
- RMAN 11g Import catalog fails RMAN-6429 (Doc ID 457392.1)ImportAI
- RMAN backup fails with Ora-00245 And Rman-08132 [ID 1365484.1]AI
- Automatic Start GC Agent 10.2.0.5 via gcstartup Script fails with sudo_789363.1GCAI
- Recover Database Fails with RMAN-06558 [ID 1185074.1]DatabaseAI
- Script: To remove Chained Rows from a Table (Doc ID 1019556.6)REMAI
- RMAN Backup Shell Script Example (Doc ID 137181.1)
- Backup And Recovery User's Guide-RMAN架構-RMAN命令列客戶端及RMAN通道(channel)GUIIDE架構命令列客戶端
- RMAN備份中的通道(CHANNEL)相關 - PARALLELISM 、FILESPERSETParallel
- RMAN-06100: no channel to restore a backup or copy of datafileREST
- Oracle OCP IZ0-053 Q88(Rman Channel)Oracle
- $FND_TOP/bin/txkrun.pl -script=DeployForms-c4ws Fails with Fatal ErrorORMAIError
- RMAN RAC Archivelog Restore Fails with RMAN-20242 (Doc ID 180169.1)HiveRESTAI
- [Rman]RMAN-06207 WARNING:2 objects could not be deleted for DISK channel(s) dueObjectdelete
- Oracle 12c系列(八)|RMAN (FROM SERVICE)Oracle
- How to restore and recover a database from an RMAN backup_881395.1RESTDatabase
- Oracle11g RMAN Duplicate from Active DatabaseOracleDatabase
- ps1 is not digitally signed. You cannot run this script解決方案Git
- [Oracle] rman備份channel數量和時間測試.Oracle
- Rman Backup Fails: PLS-00302: component 'GETREQUIREDSCN' must be declaredAIUI
- 報錯:npm ERR! missing script: serve npm ERR! A complete log of this run can be found in:NPM
- RMAN duplicate from active database 複製資料庫Database資料庫
- How to copy a datafile from ASM to a file system not using RMANASM
- RMAN run命令塊中的logseq與sequence的區別Gse