RMAN-01009: syntax error: found "dot" 解决方法

本文介绍了一次RMAN备份脚本调试的经历,包括遇到的语法错误及其解决过程。通过检查RMAN命令行参数和使用绝对路径修正了脚本中的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天调试一个RMAN 的备份脚本,这个脚本以前也用过很多次,并没有什么问题,今天执行时,就是过不去。

操作系统:Redhat 5.8

数据库:11.2.0.3

错误如下:

RMAN-00571:===========================================================

RMAN-00569: =============== ERROR MESSAGESTACK FOLLOWS ===============

RMAN-00571:===========================================================

RMAN-00552: syntax error in command linearguments

RMAN-01009: syntax error:found "dot": expecting one of: "double-quoted-string,identifier, single-quoted-string, "

RMAN-01007: at line 2 column 1 file:command line arguments

这个错误,提示在第二行有问题。

根据MOS 文档[ID427224.1]的说明:

How to check for correct RMAN syntax [ID427224.1]

我们也可以使用rman checksyntax 命令检查RMAN 脚本的语法问题。

如下:

[oracle@rac1 scripts]$ rman checksyntaxrman.sh

ArgumentValue Description

-----------------------------------------------------------------------------

targetquoted-string connect-string fortarget database

catalogquoted-string connect-string forrecovery catalog

nocatalognone if specified, thenno recovery catalog

cmdfilequoted-string name of inputcommand file

logquoted-string name of outputmessage log file

tracequoted-string name of outputdebugging message log file

appendnone if specified, logis opened in append mode

debugoptional-args activate debugging

msgnonone show RMAN-nnnnprefix for all messages

sendquoted-string send a command tothe media manager

pipestring building block forpipe names

timeoutinteger number of secondsto wait for pipe input

checksyntaxnone check the commandfile for syntax errors

-----------------------------------------------------------------------------

Both single and double quotes (' or ")are accepted for a quoted-string.

Quotes are not required unless the stringcontains embedded white-space.

RMAN-00571:===========================================================

RMAN-00569: =============== ERROR MESSAGESTACK FOLLOWS ===============

RMAN-00571:===========================================================

RMAN-00552: syntax error in command linearguments

RMAN-01009: syntax error: found"rman": expecting one of: "append, auxiliary, catalog,checksyntax, cmdfile, log, msgno, nocatalog, pipe, script, send, target,timeout, using, @, ;"

RMAN-01007: at line 2 column 1 file:command line arguments

RMAN 脚本的开始一段内容如下:

#!/bin/ksh

export LANG=en_US

BACKUP_DATE=`date +%d`

RMAN_LOG_FILE=${0}.out

TODAY=`date`

USER=`id|cut -d "(" -f2|cut -d")" -f1`

echo"-----------------$TODAY-------------------">$RMAN_LOG_FILE

ORACLE_HOME=/u01/app/oracle/11.2.0/db_1

export ORACLE_HOME

RMAN=$ORACLE_HOME/bin/rman

export RMAN

错误提示的第二行也只是一个大概范围,我们这里报错,是因为$RMAN_LOG_FILE变量来自shell变量$0,使用了相对路径,而有些版本rman不支持相对路径,因此执行时报错。

解决方法是给$RMAN_LOG_FILE予绝对路径:

将:

RMAN_LOG_FILE=${0}.out

修改成:

RMAN_LOG_FILE=`pwd`/${0}.out

再次执行就ok了。

---------------------------------------------------------------------------------------

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

Skype: tianlesoftware

QQ: tianlesoftware@gmail.com

Email: tianlesoftware@gmail.com

Blog: http://blog.youkuaiyun.com/tianlesoftware

Weibo: http://weibo.com/tianlesoftware

Twitter: http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

Linkedin: http://cn.linkedin.com/in/tianlesoftware


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值