14 Replies Latest reply on Jul 9, 2012 12:45 PM by BalazsBerki

    RMAN-01009: syntax error:

    malhi
      I need your help in resolving error, while executing following command.
      RMAN> backup database plus archivelog tag='Weekly_full_backup' keep until time 'sysdate+7';
      RMAN-00571: ===========================================================
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
      RMAN-00571: ===========================================================
      RMAN-00558: error encountered while parsing input commands
      RMAN-01009: syntax error: found "identifier": expecting one of: "double-quoted-string, equal, single-quoted-string"
      RMAN-01008: the bad identifier was: 
      RMAN-01007: at line 1 column 74 file: standard input
        • 1. Re: RMAN-01009: syntax error:
          Ehtiram Hasanov
          you have not specified backup command correctly, i.e. there is a syntax error.
          please use as below:

          backup tag='Weekly_full_backup' database plus archivelog keep until time 'sysdate+7';
          • 2. Re: RMAN-01009: syntax error:
            CKPT
            malhi wrote:
            I need your help in resolving error, while executing following command.
            RMAN> backup database plus archivelog tag='Weekly_full_backup' keep until time 'sysdate+7';
            RMAN-00571: ===========================================================
            RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
            RMAN-00571: ===========================================================
            RMAN-00558: error encountered while parsing input commands
            RMAN-01009: syntax error: found "identifier": expecting one of: "double-quoted-string, equal, single-quoted-string"
            RMAN-01008: the bad identifier was: 
            RMAN-01007: at line 1 column 74 file: standard input
            use as below

            C:\Users\bn2676>rman target /
            
            Recovery Manager: Release 11.2.0.1.0 - Production on Tue Feb 21 17:07:02 2012
            
            Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
            
            connected to target database: ORCL (DBID=1303021375)
            
            RMAN> backup database plus archivelog keep until time 'sysdate+7' tag='weekly_full_backup';
            
            
            Starting backup at 21-FEB-12
            current log archived
            using target database control file instead of recovery catalog
            allocated channel: ORA_DISK_1
            channel ORA_DISK_1: SID=68 device type=DISK
            • 3. Re: RMAN-01009: syntax error:
              malhi
              Same error
              RMAN> backup tag='Weekly_full_backup' database plus archivelog keep until time 'sysdate+7';
              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: "consistent, logs, nologs"
              RMAN-01007: at line 1 column 85 file: standard input
              • 4. Re: RMAN-01009: syntax error:
                malhi
                Now error is like this
                oracle@keenjhar:~$ rman target / catalog=rman/sbarman@sba
                
                Recovery Manager: Release 10.2.0.1.0 - Production on Wed Feb 22 08:29:08 2012
                
                Copyright (c) 1982, 2005, Oracle.  All rights reserved.
                
                connected to target database: SBA (DBID=2314609871)
                connected to recovery catalog database
                
                RMAN> backup database plus archivelog keep until time 'sysdate+7' tag='weekly_full_backup';
                
                RMAN-00571: ===========================================================
                RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                RMAN-00571: ===========================================================
                RMAN-00558: error encountered while parsing input commands
                RMAN-01009: syntax error: found "tag": expecting one of: "consistent, logs, nologs"
                RMAN-01007: at line 1 column 61 file: standard input
                
                RMAN-00571: ===========================================================
                RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                RMAN-00571: ===========================================================
                RMAN-00558: error encountered while parsing input commands
                RMAN-01009: syntax error: found "equal": 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 64 file: standard input
                • 5. Re: RMAN-01009: syntax error:
                  CKPT
                  It should work, try as tag 'weekly_full_backup';
                  RMAN> backup database plus archivelog keep until time 'sysdate+7' tag 'weekly_full_backup';
                  
                  
                  Starting backup at 22-FEB-12
                  current log archived
                  using channel ORA_DISK_1
                  backup will be obsolete on date 29-FEB-12
                  archived logs required to recover from this backup will be backed up
                  channel ORA_DISK_1: starting archived log backup set
                  channel ORA_DISK_1: specifying archived log(s) in backup set
                  input archived log thread=1 sequence=16 RECID=11 STAMP=775778430
                  input archived log thread=1 sequence=17 RECID=12 STAMP=775819218
                  input archived log thread=1 sequence=18 RECID=13 STAMP=775835555
                  input archived log thread=1 sequence=19 RECID=14 STAMP=775835555
                  • 6. Re: RMAN-01009: syntax error:
                    doginthesun
                    I could be wrong, but I believe the 'plus archivelog' option is not valid with KEEP UNTIL. If run something like command below, it should also backup the archivelogs as it creates a self-contained backup point. I recommend using the retention policies to control backup retention times. A few quirks, but they work well.

                    BACKUP DATABASE
                    FORMAT '/u01/myBackups/db_%U.bck'
                    TAG weekly_full_backup
                    KEEP UNTIL TIME 'SYSDATE + 7' LOGS;

                    The above will backup the database plus archivelogs.
                    1 person found this helpful
                    • 7. Re: RMAN-01009: syntax error:
                      CKPT
                      user636550 wrote:
                      I could be wrong, but I believe the 'plus archivelog' option is not valid with KEEP UNTIL. If run something like command below, it should also backup the archivelogs as it creates a self-contained backup point. I recommend using the retention policies to control backup retention times. A few quirks, but they work well.
                      Then how RMAN is executing above command. Read carefully again.
                      • 8. Re: RMAN-01009: syntax error:
                        malhi
                        Out come is like this
                        RMAN> BACKUP DATABASE TAG weekly_full_backup KEEP UNTIL TIME 'SYSDATE + 7' LOGS;
                        
                        Starting backup at 22-FEB-12
                        starting full resync of recovery catalog
                        full resync complete
                        using channel ORA_DISK_1
                        using channel ORA_DISK_2
                        backup will be obsolete on date 29-FEB-12
                        archived logs required to recover from this backup will expire when this backup expires
                        channel ORA_DISK_1: starting compressed full datafile backupset
                        channel ORA_DISK_1: specifying datafile(s) in backupset
                        input datafile fno=00004 name=/u01/app/oracle/oradata/sba/users01.dbf
                        input datafile fno=00006 name=/u01/app/oracle/oradata/sba/rman01.dbf
                        input datafile fno=00007 name=/u01/app/oracle/oradata/sba/eobi01.dbf
                        channel ORA_DISK_1: starting piece 1 at 22-FEB-12
                        channel ORA_DISK_2: starting compressed full datafile backupset
                        channel ORA_DISK_2: specifying datafile(s) in backupset
                        input datafile fno=00005 name=/u01/app/oracle/oradata/sba/stream_tbs.dbf
                        input datafile fno=00001 name=/u01/app/oracle/oradata/sba/system01.dbf
                        input datafile fno=00003 name=/u01/app/oracle/oradata/sba/sysaux01.dbf
                        input datafile fno=00002 name=/u01/app/oracle/oradata/sba/undotbs01.dbf
                        channel ORA_DISK_2: starting piece 1 at 22-FEB-12
                        RMAN-03009: failure of backup command on ORA_DISK_2 channel at 02/22/2012 09:48:58
                        ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes
                        continuing other job steps, job failed will not be re-run
                        RMAN-00571: ===========================================================
                        RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                        RMAN-00571: ===========================================================
                        RMAN-03009: failure of backup command on ORA_DISK_1 channel at 02/22/2012 09:48:58
                        ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes
                        • 9. Re: RMAN-01009: syntax error:
                          CKPT
                          check this MOS note *How to KEEP a backup created in the Flash Recovery Area (FRA)? [ID 401163.1]*
                          1 person found this helpful
                          • 10. Re: RMAN-01009: syntax error:
                            doginthesun
                            RMAN automatically backs up archived redo logs if you specify BACKUP DATABASE with the KEEP option. You don't need to explicitly tell it too, it will grab the archivelogs required to create a consist restore point. We use the format tag to specify a disk staging area for backups we need to keep and then backup that area to tape.
                            • 11. Re: RMAN-01009: syntax error:
                              malhi
                              I am using 10g, this feature may not available in this version of oracle. As you have execute command on 11gr2. Is it like this.
                              • 12. Re: RMAN-01009: syntax error:
                                doginthesun
                                The script I posted worked on 10.2.0.5 if that helps.
                                • 13. Re: RMAN-01009: syntax error:
                                  malhi
                                  I mange to take backup with following command, earlier the problem was that oracle do not allow backup with KEEP option in F.R Area. Which is default in my case.
                                  But it does not include archivelog backup, which i want.
                                  RMAN> BACKUP DATABASE FORMAT '/u01/app/oracle/level_0_backup/sba_full_bk_%U' TAG weekly_full_backup KEEP UNTIL TIME 'SYSDATE + 7' LOGS;
                                  
                                  Starting backup at 23-FEB-12
                                  allocated channel: ORA_DISK_1
                                  channel ORA_DISK_1: sid=3200 devtype=DISK
                                  allocated channel: ORA_DISK_2
                                  channel ORA_DISK_2: sid=3267 devtype=DISK
                                  backup will be obsolete on date 01-MAR-12
                                  archived logs required to recover from this backup will expire when this backup expires
                                  channel ORA_DISK_1: starting compressed full datafile backupset
                                  channel ORA_DISK_1: specifying datafile(s) in backupset
                                  input datafile fno=00004 name=/u01/app/oracle/oradata/sba/users01.dbf
                                  input datafile fno=00006 name=/u01/app/oracle/oradata/sba/rman01.dbf
                                  input datafile fno=00007 name=/u01/app/oracle/oradata/sba/eobi01.dbf
                                  channel ORA_DISK_1: starting piece 1 at 23-FEB-12
                                  channel ORA_DISK_2: starting compressed full datafile backupset
                                  channel ORA_DISK_2: specifying datafile(s) in backupset
                                  input datafile fno=00005 name=/u01/app/oracle/oradata/sba/stream_tbs.dbf
                                  input datafile fno=00001 name=/u01/app/oracle/oradata/sba/system01.dbf
                                  input datafile fno=00003 name=/u01/app/oracle/oradata/sba/sysaux01.dbf
                                  input datafile fno=00002 name=/u01/app/oracle/oradata/sba/undotbs01.dbf
                                  channel ORA_DISK_2: starting piece 1 at 23-FEB-12
                                  channel ORA_DISK_2: finished piece 1 at 23-FEB-12
                                  piece handle=/u01/app/oracle/level_0_backup/sba_full_bk_nhn41gjp_1_1 tag=WEEKLY_FULL_BACKUP comment=NONE
                                  channel ORA_DISK_2: backup set complete, elapsed time: 00:02:05
                                  channel ORA_DISK_1: finished piece 1 at 23-FEB-12
                                  piece handle=/u01/app/oracle/level_0_backup/sba_full_bk_ngn41gjp_1_1 tag=WEEKLY_FULL_BACKUP comment=NONE
                                  channel ORA_DISK_1: backup set complete, elapsed time: 00:06:10
                                  Finished backup at 23-FEB-12
                                  
                                  Starting Control File and SPFILE Autobackup at 23-FEB-12
                                  piece handle=/u01/app/oracle/flash_recovery_area/SBA/autobackup/2012_02_23/o1_mf_s_775996395_7ncmww2t_.bkp comment=NONE
                                  Finished Control File and SPFILE Autobackup at 23-FEB-12
                                  • 14. Re: RMAN-01009: syntax error:
                                    BalazsBerki
                                    The error is related to the following:

                                    In 11.2 you can use the following command: .... keep until time 'SYSDATE+100';

                                    but in 10.2 it is obligatory to include the logs or nologs statement like this: ... keep until time = 'SYSDATE+100' nologs;