FAQ
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

Search Discussions

  • Tony van Lingen at May 26, 2009 at 11:12 pm
    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
  • Jared Still at May 26, 2009 at 11:51 pm

    On Tue, May 26, 2009 at 1:18 PM, Jared Still wrote:

    On database B, this error occurs after executing the last line of the
    script where the current controlfile is to be backed up:

    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,
    Thanks for all your suggestions.

    I found the problem (sort of), and it is not oracle related.

    However, there is still something funny going on with oracle.

    There is a password server used to retrieve database passwords.

    The user setup on the server to retrieve the passwords was authorized
    for database A, but not for database B.

    The command is pwc.pl -instance DB_NAME -username USERNAME

    At the command line, it worked for the RMAN repository and database A,
    but not for database B.

    Checking the permissions in the password database showed where the problem
    was.

    A quick change in the local authorization file to use a different users that
    is authorized
    for both databases, and it all works.

    Here's what is strange: the backups worked for database B, up until the
    closing
    curly brace of the RUN block.

    This is from the log file of a backup of database B that ended with the
    RMAN-1009 error:

    connected to target database: B (DBID=999999)
    connected to recovery catalog database

    So I then set the permissions back to previous.
    eg. the password needed for database B can no longer be retrieved.

    Another backup was run on Database B, and the log file shows that
    it is indeed connected. This is verified via v$session as well.

    The logging was set to show the connection information.
    This is what is in the logfile for the user used to backup database B:

    backup_user/_at_b.mydomain.com

    Notice that the password is missing.

    At the command line:

    c:\ rman target backup_user/_at_b.mydomain.com nocatalog
    Recovery Manager: Release 10.2.0.4.0 - Production on Tue May 26 16:41:35
    2009

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    target database Password:

    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================

    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-04005: error from target database:
    ORA-01005: null password given; logon denied

    And yet, the script is able to logon without the password.

    It is called by the NetBackup service, which is running as Local System

    Though I can now 'fix' the problem, questions remain:

    Why does the script end in error, even though the script connected
    to the database without the password?
    How is the script able to connect without the target db user password?

    I've burned a whole on this now, so I probably won't be pursuing it
    anymore, even though I would like to know what is actually going on.

    Too many other things to attend to.

    But, if you think you know what is causing this behavior, please chime in!

    Jared Still
    Certifiable Oracle DBA and Part Time Perl Evangelist
  • Jared Still at May 27, 2009 at 12:21 am

    On Tue, May 26, 2009 at 4:51 PM, Jared Still wrote:

    * How is the script able to connect without the target db user password?
    I just accidentally partially answered this question:

    D:\dba\bin>rman target backup_user/_at_b.radisys.com nocatalog

    Recovery Manager: Release 10.2.0.4.0 - Production on Tue May 26 16:54:32
    2009

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    target database Password:
    connected to target database: B (DBID=9999999)
    using target database control file instead of recovery catalog

    RMAN>

    I did not enter the password: I hit at the password prompt,
    and was logged in.

    This appears to be acting just as if I had used this command:

    rman target /_at_b.radisys.com nocatalog

    which logs me in as SYSDBA

    I can't seem to find any documentation describing this behavior.

    Both 'slaxdebug' and 'debug trace ' were used as well.

    Both forms of debug start their output following the logon, so they
    weren't much help.

    Jared Still
    Certifiable Oracle DBA and Part Time Perl Evangelist
  • Tony van Lingen at May 27, 2009 at 12:38 am
    Jared,

    If you type '{' at the password prompt, instead of ctrl-c it also logs
    you in. The closing bracket is then the first bracket to arrive...

    Cheers,
    Tony

    Jared Still wrote:
    On Tue, May 26, 2009 at 4:51 PM, Jared Still > wrote:

    * How is the script able to connect without the target db user
    password?


    I just accidentally partially answered this question:

    D:\dba\bin>rman target backup_user/_at_b.radisys.com
    <http://b.radisys.com> nocatalog

    Recovery Manager: Release 10.2.0.4.0 - Production on Tue May 26
    16:54:32 2009

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    target database Password:
    connected to target database: B (DBID=9999999)
    using target database control file instead of recovery catalog

    RMAN>
    I did not enter the password: I hit at the password
    prompt, and was logged in.

    This appears to be acting just as if I had used this command:

    rman target /_at_b.radisys.com <http://b.radisys.com> nocatalog

    which logs me in as SYSDBA

    I can't seem to find any documentation describing this behavior.

    Both 'slaxdebug' and 'debug trace ' were used as well.

    Both forms of debug start their output following the logon, so they
    weren't much help.


    Jared Still
    Certifiable Oracle DBA and Part Time Perl Evangelist


    --
    http://www.freelists.org/webpage/oracle-l
  • Jared Still at May 27, 2009 at 12:43 am

    On Tue, May 26, 2009 at 5:38 PM, Tony van Lingen < tony_vanlingen_at_technologyonecorp.com> wrote:

    Jared,

    If you type '{' at the password prompt, instead of ctrl-c it also logs you
    in. The closing bracket is then the first bracket to arrive...
    Thanks Tony.

    Jared Still
    Certifiable Oracle DBA and Part Time Perl Evangelist
  • Tony van Lingen at May 27, 2009 at 12:13 am
    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
    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
  • Jared Still at May 27, 2009 at 12:16 am
    Jared Still
    Certifiable Oracle DBA and Part Time Perl Evangelist

    On Tue, May 26, 2009 at 5:13 PM, Tony van Lingen <
    tony_vanlingen_at_technologyonecorp.com> wrote:
    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%

    ...
    No, that wasn't it.

    I did check all of these.

    Jared

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouporacle-l @
categoriesoracle
postedMay 26, '09 at 8:18p
activeMay 27, '09 at 12:43a
posts8
users2
websiteoracle.com

2 users in discussion

Jared Still: 5 posts Tony van Lingen: 3 posts

People

Translate

site design / logo © 2023 Grokbase