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

发布于 2022-08-06 06:35:21 字数 6713 浏览 7 评论 1

环境:
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.  

Products Applied:
NetBackup DataCenter 4.5

Last Updated: March 15 2004 01:01 PM GMT
Expires on: 365 days from publish date
Subscribe to receive critical updates about this document

Subjects:
NetBackup DataCenter
   Application: Backup, Compatibility
   Best Practice: Backup
   Database: Backup, Best Practice, Compatibility
   Options: Database Extensions
Solaris
   Application: Compatibility, Configuration

Languages:
English (US)

Operating Systems:
Solaris 8.0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

感性 2022-08-18 15:13:45

受教

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文