NBU rman RMAN-01005 msglog 需要绝对路径

NBU下手工运行rman备份脚本失败,NBU返回status 6,及RMAN-01005报错的解决方法 


环境:
NBU:5.0
oracle: 9.2.0.1
OS: solaris 9

NBU调用的rman的备份脚本改自NBU模板hot_database_backup.sh

手工测试备份时,经常报错NBU返回status 6,和RMAN-01005错。

这是因为脚本中$RMAN_LOG_FILE变量借用shell变量$0使用了相对路径,而有些版本rman不支持相对路径,需要给出绝对路径。



解决方法:

在绝对路径下运行此脚本。
如:/oracle/hot_database_backup.sh

或者,修改RMAN_LOG_FILE变量
RMAN_LOG_FILE=`pwd`/${0}.out




以下是来veritas的官方说明:






Document ID: 249670
http://support.veritas.com/docs/249670 E-Mail this document to a colleague


VERITAS NetBackup (tm) Oracle backups fail with status 6 and RMAN-01005: "syntax error: found "dot": expecting one of: "double-quoted-string, equal, identifier, single-quoted-string""
Exact Error Message
RMAN-01005: syntax error: found "dot": expecting one of: "double-quoted-string, equal, identifier, single-quoted-string"


Details:
Oracle RMAN backup script fails with the following output. The dbclient log does not show any activity.

# ./hot_database_backup.sh
==== started on Sat Jul 6 15:04:11 BST 2002 ====

RMAN: /usr1/app/oracle/product/9.2.0/bin/rman
ORACLE_SID: oracle
ORACLE_USER: oracle
ORACLE_HOME: /usr1/app/oracle/product/9.2.0

NB_ORA_FULL:
NB_ORA_INCR:
NB_ORA_CINC:
NB_ORA_SERV:
NB_ORA_POLICY:

Default - Full backup requested
Sun Microsystems Inc. SunOS 5.8 Generic February 2000

Argument     Value          Description
-----------------------------------------------------------------------------
target       quoted-string  connect-string for target database
catalog      quoted-string  connect-string for recovery catalog
nocatalog    none           if specified, then no recovery catalog
cmdfile      quoted-string  name of input command file
log          quoted-string  name of output message log file
trace        quoted-string  name of output debugging message log file
append       none           if specified, log is opened in append mode
debug        optional-args  activate debugging
msgno        none           show RMAN-nnnn prefix for all messages
send         quoted-string  send a command to the media manager
pipe         string         building block for pipe names
timeout      integer        number of seconds to wait for pipe input
-----------------------------------------------------------------------------
Both single and double quotes (' or ") are accepted for a quoted-string.
Quotes are not required unless the string contains embedded white-space.

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00552: syntax error in command line arguments
RMAN-01005: syntax error: found "dot": expecting one of: "double-quoted-string, equal, identifier, single-quoted-string"
RMAN-01007: at line 2 column 1 file: command line arguments

Script ./hot_database_backup.sh
==== ended in error on Sat Jul 6 15:04:13 BST 2002 ====

This error is due to some versions of Recovery Manager (RMAN) not accepting a pathname relative to the current directory as an option for the msglog parameter.

The sample NetBackup Oracle backup scripts create an output log in the same directory as the backup script by using the pathname of the script and then pass this filename to RMAN.


RMAN_LOG_FILE=${0}.out



rman ... msglog $RMAN_LOG_FILE ...


Normally the backup script is invoked by the NetBackup master server, which uses a full pathname, e.g. /oracle/scripts/hot_database_backup.sh. This causes the following successful command line:


rman ... msglog /oracle/scripts/hot_database_backup.sh.out ...


However, if a user executes the shell script using a pathname relative to the local directory, e.g. ./hot_database_backup.sh, then RMAN does not correctly handle the relative pathname in the failing command line which results:


rman ... msglog ./hot_database_backup.sh.out ...



Solution:
Use a full pathname when executing the backup script.  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值