RMAN> 2> 3> 4>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "filesperset": expecting one of: "equal, integer"
RMAN-01007: at line 5 column 27 file: standard inputRMAN>
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=158 devtype=DISKRMAN>
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
no obsolete backups foundRMAN>
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: ";"
RMAN-01008: the bad identifier was: c2
RMAN-01007: at line 1 column 17 file: standard inputRMAN>
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: "allocate, alter, backup, beginline, blockrecover, catalog, change, connect, copy, convert, create, crosscheck, configure, duplicate, debug, delete, drop, exit, endinline, flashback, host, {, library, list, mount, open, print, quit, recover, register, release, replace, report, renormalize, reset, restore, resync, rman, run, rpctest, set, setlimit, sql, switch, spool, startup, shutdown, send, show, test, transport, upgrade, unregister, validate"
RMAN-01007: at line 1 column 1 file: standard input
------------------------------------------------------------------------------------------------------------
以上是错误。
执行脚本:
run{
allocate channel c1 type disk ;
crosscheck backupset of archivelog all ;
backup filesperset 3 format '$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t'(archivelog from time 'sysdate-7' all delete input) ;
delete noprompt expired backupset of archivelog all ;
release channel c1 ;
}run{
allocate channel c2 type disk ;
crosscheck backupset of database ;
backup incremental level $LEVEL filesperset 3 format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'(database include current controlfile) ;
delete noprompt expired backupset of database ;
delete noprompt obsolete ;
release channel c2 ;
} 是不是backup filesperset 和 backup incremental 这2句语法错误造成的?
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "filesperset": expecting one of: "equal, integer"
RMAN-01007: at line 5 column 27 file: standard inputRMAN>
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=158 devtype=DISKRMAN>
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
no obsolete backups foundRMAN>
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: ";"
RMAN-01008: the bad identifier was: c2
RMAN-01007: at line 1 column 17 file: standard inputRMAN>
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: "allocate, alter, backup, beginline, blockrecover, catalog, change, connect, copy, convert, create, crosscheck, configure, duplicate, debug, delete, drop, exit, endinline, flashback, host, {, library, list, mount, open, print, quit, recover, register, release, replace, report, renormalize, reset, restore, resync, rman, run, rpctest, set, setlimit, sql, switch, spool, startup, shutdown, send, show, test, transport, upgrade, unregister, validate"
RMAN-01007: at line 1 column 1 file: standard input
------------------------------------------------------------------------------------------------------------
以上是错误。
执行脚本:
run{
allocate channel c1 type disk ;
crosscheck backupset of archivelog all ;
backup filesperset 3 format '$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t'(archivelog from time 'sysdate-7' all delete input) ;
delete noprompt expired backupset of archivelog all ;
release channel c1 ;
}run{
allocate channel c2 type disk ;
crosscheck backupset of database ;
backup incremental level $LEVEL filesperset 3 format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'(database include current controlfile) ;
delete noprompt expired backupset of database ;
delete noprompt obsolete ;
release channel c2 ;
} 是不是backup filesperset 和 backup incremental 这2句语法错误造成的?
和
release channel c1 ;
这两个可不要,因为Oracle缺省情况下是使用磁盘通道。crosscheck backupset of archivelog all ;
这句没有问题。backup filesperset 3 format '$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t'(archivelog from time 'sysdate-7' all delete input) ;应该不允许出现环境变量,改为绝对路径试试。
backup format='$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t'
archivelog from time='sysdate-7' until time='sysdate'
delete input;
--------------------------------------------------------------------------
backup incremental level $LEVEL
format='$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'
database include current controlfile; 楼主最好把你的脚本完整的发上来看看,并且说明你要做什么,只发个片段,不好理解你的意图啊,而且连你要替换的参数都不知道是什么
backup filesperset 3 format '$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t'(archivelog from time 'sysdate-7' all delete input) ;这句可以的。这句说找不到"$"
backup incremental level $LEVEL filesperset 3 format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'(database include current controlfile) ;
肯定是这句的问题。试了很多次了
if [ $LEVEL = 0 ]; then
$BIN/rman log $BACKUP_PATH/log/level.$TARGET_SID.$LEVEL.$DATE_2.log <<EOF
connect target sys/sys;
connect catalog netkell/netkell;
resync catalog;
run{
allocate channel c1 type disk ;
crosscheck backupset of archivelog all ;
backup filesperset 3 format '$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t'(archivelog from time 'sysdate-7' all delete input) ;
delete noprompt expired backupset of archivelog all ;
release channel c1 ;
}run{
allocate channel c2 type disk ;
crosscheck backupset of database ;
backup incremental level $LEVEL filesperset 3 format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'(database include current controlfile) ;
delete noprompt expired backupset of database ;
delete noprompt obsolete ;
release channel c2 ;
}
exit;
EOFLOOK!
backup incremental level $LEVEL filesperset 3 format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'(database include current controlfile) ;
可以直接写成
backup incremental level 0 filesperset 3 format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'(database include current controlfile) ;
你写这么多变量还以为要复用呢......
archivelog from time='sysdate-7' until time='sysdate'
最好这样写,要不就
archivelog all
别又是from 又是all的
backup incremental level \$LEVEL filesperset 3
format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'
(database include current controlfile) ; 这样也可以
else
$BIN/rman log $BACKUP_PATH/log/level.$TARGET_SID.$LEVEL.$DATE_2.log <<EOF
connect target sys/sys;
connect catalog netkell/netkell;
resync catalog;
run{
allocate channel c1 type disk ;
crosscheck backupset of archivelog all ;
backup filesperset 3 format '$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t' (archivelog from time 'sysdate-1' all) ;
delete noprompt expired backupset of archivelog all ;
release channel c1 ;
}run{
allocate channel c2 type disk ;
crosscheck backupset of database ;
backup incremental level $LEVEL filesperset 3 format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t' (database include current controlfile) ;
delete noprompt expired backupset of database ;
delete noprompt obsolete ;
release channel c2 ;
}exit;
EOFfi
$BIN/exp netkell/netkell file=$BACKUP_PATH/data/$DATE/live.rman.$DATE_2.dmp log=$BACKUP_PATH/log/$196.rman.$DATE_2.log那个执行了,不认识\这个符号
backup incremental level ${LEVEL} filesperset 3
format '$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'
(database include current controlfile) ; 这样呢?
if [ $LEVEL = 0 ]; then
$BIN/rman log $BACKUP_PATH/log/level.$TARGET_SID.$LEVEL.$DATE_2.log <<EOF
connect target sys/sys;
connect catalog netkell/netkell;
resync catalog;
run{
allocate channel c1 type disk ;
crosscheck backupset of archivelog all ;
backup filesperset 3
format='$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t'
(archivelog from time='sysdate-7' until time='sysdate' delete input) ;
delete noprompt expired backupset of archivelog all ;
release channel c1 ;
} run{
allocate channel c2 type disk ;
crosscheck backupset of database ;
backup incremental level=0 filesperset 3
format='$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'
(database include current controlfile) ;
delete noprompt expired backupset of database ;
delete noprompt obsolete ;
release channel c2 ;
}
exit;
EOF else
$BIN/rman log $BACKUP_PATH/log/level.$TARGET_SID.$LEVEL.$DATE_2.log <<EOF
connect target sys/sys;
connect catalog netkell/netkell;
resync catalog;
run{
allocate channel c1 type disk ;
crosscheck backupset of archivelog all ;
backup filesperset 3
format='$BACKUP_PATH/data/$DATE/arch.%d.live.$LEVEL.%t'
(archivelog from time='sysdate-1' until time='sysdate') ;
delete noprompt expired backupset of archivelog all ;
release channel c1 ;
} run{
allocate channel c2 type disk ;
crosscheck backupset of database ;
backup incremental level=${LEVEL} filesperset 3
format='$BACKUP_PATH/data/$DATE/data.%d.live.$LEVEL.%t'
(database include current controlfile) ;
delete noprompt expired backupset of database ;
delete noprompt obsolete ;
release channel c2 ;
} exit;
EOF fi
$BIN/exp netkell/netkell file=$BACKUP_PATH/data/$DATE/live.rman.$DATE_2.dmp log=$BACKUP_PATH/log/$196.rman.$DATE_2.log 简单整理了一下,试下看看