Rman and DBGSQL message

I have not seen DBGSQL very often. But today again, a duplicate in RMAN was failing with, amoung other errors, sqlcode 911


RMAN> duplicate target database to DB02
until time "to_date('2013-01-29_00:00:00','YYYY-MM-DD_HH24:MI:SS')"
nofilenamecheck ;

DBGSQL: TARGET> select 2013-01-29_00:00:00 from sys.dual
DBGSQL: sqlcode = 911
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 02/01/2013 17:58:23
RMAN-05501: aborting duplication of target database
ORA-01861: literal does not match format string

I have not found anything useful except bug Bug 9351175 which is fixed in 11.2 (and I have 11.2.0.2/aix), but I could workaround the problem with


unset NLS_DATE_FORMAT

Because I do like to have readable timestamp (with seconds) in my RMAN logs, I set NLS_DATE_FORMAT in my spfile

alter system set nls_date_format='YYYY-MM-DD_HH24:MI:SS';

3 thoughts on “Rman and DBGSQL message

  1. Tony Sleight

    I too like to have a full time stamp in the RMAN logs. The way I do it is to set NLS_DATE_FORMAT in the Windows command shell

    eg

    C:>SET NLS_DATE_FORMAT=YYYY-MON-DD HH24:MI:SS
    C:>RMAN target= catalog=

    The RMAN commands can then use “TO_DATE(‘2013-FEB-14 08:00:00′,’YYYY-MON-DD HH24:MI:SS’)” in the set until time parameter. The same approach can be taken for LINUX shells (although I’m not a LINUX user).

    Using the above approach negates the need of the ALTER SYSTEM SET NLS_DATE_FORMAT command.

  2. Kevin

    ORA-911 is an “invalid character”. The DBGSQL shows that the SQL is missing single quotes:

    DBGSQL: TARGET> select 2013-01-29_00:00:00 from sys.dual
    DBGSQL: sqlcode = 911

    The problem is with your “until time” line. You’re using double quotes instead of single quotes. See the docs here:

    Oracle® Database Backup and Recovery Reference 11g Release 2 (11.2)
    http://docs.oracle.com/cd/E11882_01/backup.112/e10643/rcmsynta020.htm#CHDCHBGC

    So, while I haven’t tested it, I think it should be:

    RMAN> duplicate target database to DB02
    until time ‘to_date(‘2013-01-29_00:00:00′,’YYYY-MM-DD_HH24:MI:SS’)’
    nofilenamecheck ;

Comments are closed.