Debug a backup script for RMAN today. This script has been used many times before, and there is no problem. When it is executed today, it cannot be used.
OS: RedHat 5.8
Database: 11.2.0.3
The error is as follows:
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
This error indicates a problem in the second line.
According to the description in the mos document [id427224.1:
How to check for correct RMAN syntax [id427224.1]
We can also use the RMAN checksyntax command to check the syntax of the RMAN script.
As follows:
[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
Invalid file 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, syntax file, log, msgno, nocatalog, pipe, script, send, target, timeout, using ,@,;"
RMAN-01007: At Line 2 column 1 file: command line arguments
The start part of The RMAN script is as follows:
#! /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
The second row of the error message is only an approximate range. Here, an error is reported because the $ rman_log_file variable comes from the shell variable $0 and uses a relative path. However, some versions of RMAN do not support relative paths, therefore, an error is returned.
The solution is to give $ rman_log_file an absolute path:
Set:
Rman_log_file =$ {0}. Out
Modify:
Rman_log_file = 'pwd'/$ {0}. Out
If you execute the command again, it will be OK.
Bytes ---------------------------------------------------------------------------------------
All rights reserved. reprinted articles are allowed, but source addresses must be indicated by links. Otherwise, the documents will be held legally responsible!
Skype: tianlesoftware
QQ: tianlesoftware@gmail.com
Email: tianlesoftware@gmail.com
Blog: http://blog.csdn.net/tianlesoftware
WEAVER: http://weibo.com/tianlesoftware
Twitter: http://twitter.com/tianlesoftware
Facebook: http://www.facebook.com/tianlesoftware
LinkedIn: http://cn.linkedin.com/in/tianlesoftware