Re: RMAN conundrum

From: Tony van Lingen <tony_vanlingen_at_technologyonecorp.com>
Date: Wed, 27 May 2009 10:13:48 +1000
Message-ID: <4A1C85BC.9030906_at_technologyonecorp.com>



Jared,

I dont mean a syntax problem with the script as you gave it - I do appreciate that it is the same in both cases. However, it contains variables, Hence *at runtime* the scripts do differ.

What I am thinking of is the resulting syntax after the two environment variables are evaluated. Presumably you either construct them earlier in the script or pipe them in somehow. If one of the variables has a value that disrupts the syntax at runtime, you could get the error that you are seeing. A statement like

_at_echo [%FORMAT_PREFIX%] >> %RMAN_LOG_FILE% _at_echo [%FORMAT_SUFFIX%] >> %RMAN_LOG_FILE%

after the point where they are set would print the runtime value into your log file. Alternatively you could echo every line of the actual RMAN command into the logfile and see the runtime command. (that way you can run the script without setting off the backup if that is a concern).

I suspect that there may be some stray character in there. One value could contain quotes for instance, in which case your script could contain e.g.:

echo BACKUP FORMAT ''myprefix'_arch_mysuffix' ARCHIVELOG ALL NOT BACKED UP 2 TIMES; Note that this leads to 2 quoted strings and an unquoted word in the runtime command. In Windhoze you can even have a single quote in an echo...

Just a thought...

Cheers,
Tony

Jared Still wrote:
> Not a syntax problem.
>
> A script that works on one database does not work on the other.
>
> Jared Still
> Certifiable Oracle DBA and Part Time Perl Evangelist
>
>
>
> On Tue, May 26, 2009 at 4:12 PM, Tony van Lingen
> <tony_vanlingen_at_technologyonecorp.com
> <mailto:tony_vanlingen_at_technologyonecorp.com>> wrote:
>
> Jared,
>
> My first thought would be a problem with the environment variables
> '%FORMAT_PREFIX% and %FORMAT_SUFFIX% the second time round -
> perhaps a stray curly bracket, a space or a reserved word or so.
> Did you try to echo them into the logfile?
>
> Cheers,
> Tony
>
> Jared Still wrote:
>> First, a little background.
>>
>> Two SAP systems running on a single Windows Server.
>>
>> Windows 2003 Server
>> Oracle 10.2.0.4
>> Databases are using separate ORACLE_HOMEs.
>>
>> Backups consistently fail following the last command of the RMAN
>> script for one of the databases, but not the other.
>>
>> Each database has its own copy of the backup scripts.
>> The only difference is the script that sets the ORACLE_HOME,
>> PATH and ORACLE_SID.
>>
>> Other than that, the backup scripts are identical, as was
>> confirmed by using md5sum in cygwin to compare them.
>>
>> Here's the relevant part of the RMAN script:
>>
>> _at_(
>> echo RUN {
>> echo SQL 'ALTER SESSION SET OPTIMIZER_MODE=RULE';
>> echo SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
>> echo BACKUP FORMAT '%FORMAT_PREFIX%_arch_%FORMAT_SUFFIX%'
>> ARCHIVELOG ALL NOT BACKED UP 2 TIMES;
>> echo DELETE NOPROMPT ARCHIVELOG ALL BACKED UP 2 TIMES TO DEVICE
>> TYPE sbt;
>> echo BACKUP FORMAT '%FORMAT_PREFIX%_ctl_%FORMAT_SUFFIX%' CURRENT
>> CONTROLFILE;
>> echo }
>> ) | %RMAN% target %TARGET_CONNECT_STR% catalog %RCAT_CONNECT_STR%
>> msglog '%RMAN_LOG_FILE%' append
>>
>> all of the environment variables are being set correctly.
>>
>> On database A, everything works fine.
>>
>> On database B, this error occurs after executing the last line of
>> the
>> script where the current controlfile is to be backed up:
>>
>> RMAN>
>> RMAN-00571:
>> ===========================================================
>> RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
>> ===============
>> RMAN-00571:
>> ===========================================================
>> RMAN-00558: error encountered while parsing input commands
>> RMAN-01009: syntax error: found "}": expecting one of: "allocate,
>> alter, backup, beginline, blockrecover, catalog, change, connect,
>> copy, convert, create, crosscheck, configure, duplicate, debug,
>> delete, drop, exit, endinline, flashback, host, {, library, list,
>> mount, open, print, quit, recover, register, release, replace,
>> report, renormalize, reset, restore, resync, rman, run, rpctest,
>> set, setlimit, sql, switch, spool, startup, shutdown, send, show,
>> test, transport, upgrade, unregister, validate"
>> RMAN-01007: at line 1 column 1 file: standard input
>>
>> If I remove the last line of the script, so that the script looks
>> like this:
>>
>> _at_(
>> echo RUN {
>> echo SQL 'ALTER SESSION SET OPTIMIZER_MODE=RULE';
>> echo SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
>> echo BACKUP FORMAT '%FORMAT_PREFIX%_arch_%FORMAT_SUFFIX%'
>> ARCHIVELOG ALL NOT BACKED UP 2 TIMES;
>> echo DELETE NOPROMPT ARCHIVELOG ALL BACKED UP 2 TIMES TO DEVICE
>> TYPE sbt;
>> echo }
>> ) | %RMAN% target %TARGET_CONNECT_STR% catalog %RCAT_CONNECT_STR%
>> msglog '%RMAN_LOG_FILE%' append
>>
>> ... then the script fails with the same error as previously.
>>
>> Adding SHOW ALL as the last command causes the SHOW ALL output to
>> be in the logfile, followed by the same error message complaining
>> about '}'
>>
>> querying DBA_REGISTRY_HISTORY shows the same patches applied to
>> both databases.
>>
>> opatch lsinventory -details shows that database B has 2 products
>> installed that are not on database A
>>
>> diff A_details.txt B_details.tx
>>
>> < Installed Products (172):
>> ---
>> > Installed Products (174):
>> 82a83
>> > Oracle Configuration
>> Manager 10.2.7.1.0
>> 149a151
>> > Oracle Real Application
>> Testing 10.2.0.4.0
>>
>> comparing the output of SHOW ALL for both shows the only difference
>> to be the value for SNAPSHOT CONTROLFILE NAME
>>
>> The logfile includes the PATH information, and it is correct in
>> both instances.
>>
>> It's my hope that someone here can think of something I've missed.
>>
>> The backups are working, but it's move than a little annoying to
>> see the
>> errors in the logs every day, and then have to go check to see if
>> it's the
>> same old "problem", or a real problem.
>>
>> Thanks,
>>
>> Jared Still
>> Certifiable Oracle DBA and Part Time Perl Evangelist
>>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Tue May 26 2009 - 19:13:48 CDT

Original text of this message