RMAN-01009: syntax error: found "dot" 解決辦法

tags:    時間:2013-12-22 21:39:46
RMAN-01009: syntax error: found "dot" 解決方法

 

 

今天調試一個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

 

Argument    Value          Description

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

target      quoted-string  connect-string fortarget database

catalog     quoted-string  connect-string forrecovery catalog

nocatalog   none           if specified, thenno recovery catalog

cmdfile     quoted-string  name of inputcommand file

log         quoted-string  name of outputmessage log file

trace       quoted-string  name of outputdebugging message log file

append      none           if specified, logis opened in append mode

debug       optional-args  activate debugging

msgno       none           show RMAN-nnnnprefix for all messages

send        quoted-string  send a command tothe media manager

pipe        string         building block forpipe names

timeout     integer        number of secondsto wait for pipe input

checksyntax none           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.csdn.net/tianlesoftware

Weibo:    http://weibo.com/tianlesoftware

Twitter:  http://twitter.com/tianlesoftware

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

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


推薦閱讀文章

Bookmark the permalink ,來源:互聯網