4 Replies Latest reply: Jan 22, 2013 2:54 AM by Maahjoor RSS

    RMAN-01005: syntax error:

    Maahjoor
      Dear all,

      i have a backup script like below
      RUN {
      ALLOCATE CHANNEL ch00 TYPE DISK FORMAT 'E:\BACKUP\rmanbackup\db\%d_DB_%u_%s_%p';
      ####crosscheck backup;
      backup
      filesperset 4
      INCREMENTAL LEVEL 0 AS COMPRESSED BACKUPSET database include current controlfile;
      sql "alter system archive log current";
      release channel ch00;
      ALLOCATE CHANNEL CH01 TYPE DISK FORMAT 'E:\BACKUP\rmanbackup\ar\al_%U';
      backup
      filesperset 4
      AS COMPRESSED BACKUPSET archivelog all delete input;
      restore database validate;
      delete noprompt archivelog until time 'SYSDATE-1';
      ###delete backup completed before 'sysdate-1';
      delete obsolete device type disk;
      RELEASE CHANNEL CH01;
      }
      it give the following error
      RMAN-06091: no channel allocated for maintenance (of an appropriate type)
      i search the internet and find the following command
       allocate channel for maintenance type disk;
      delete obsolete device type disk;
      but it give the following error
      RMAN-00558: error encountered while parsing input commands
      RMAN-01005: syntax error: found "for": expecting one of: "channel_id, double-quoted-string, equal, identifier, single-quoted-string"
      i think my rman is not recognising the command.
      my oracle version is
      Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
      PL/SQL Release 10.1.0.2.0 - Production
      CORE    10.1.0.2.0      Production
      TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
      NLSRTL Version 10.1.0.2.0 - Production
      Kindly help.
        • 1. Re: RMAN-01005: syntax error:
          Mihael
          "ALLOCATE CHANNEL FOR MAINTENANCE" should not be used in RUN block
          • 2. Re: RMAN-01005: syntax error:
            Maahjoor
            yes, you are right,
            i did it and its gone ok,
            my question is solved and i am marking this thread to be soleved,
            a little problem i face,
            i run the delete commands like below
            allocate channel for maintenance type disk;
            crosscheck backup;
            ###delete backup completed before 'sysdate-1';
            delete noprompt obsolete;
            delete noprompt archivelog until time 'SYSDATE-10';
            and receive the following error in the log file
            RMAN> allocate channel for maintenance type disk;
            2> crosscheck backup;
            3> ###delete backup completed before 'sysdate-1';
            4> delete noprompt obsolete;
            5> delete noprompt archivelog until time 'SYSDATE-10';
            6> 
            using target database controlfile instead of recovery catalog
            allocated channel: ORA_MAINT_DISK_1
            channel ORA_MAINT_DISK_1: sid=733 devtype=DISK
            
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\DB\ORCL_DB_BJO01LR2_2419_1 recid=2169 stamp=805361506
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\DB\ORCL_DB_BKO01LS5_2420_1 recid=2170 stamp=805361541
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\AR\AL_BNO01LTI_1_1 recid=2173 stamp=805361587
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\DB\ORCL_DB_BPO01P2C_2425_1 recid=2175 stamp=805364812
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\DB\ORCL_DB_BQO01P3F_2426_1 recid=2176 stamp=805364847
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\AR\AL_BTO01P4R_1_1 recid=2179 stamp=805364892
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\DB\ORCL_DB_BVO01QHR_2431_1 recid=2181 stamp=805366331
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\DB\ORCL_DB_C0O01QIU_2432_1 recid=2182 stamp=805366367
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\DB\ORCL_DB_C1O01QK2_2433_1 recid=2183 stamp=805366403
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\CONTROLFILE\CONTROLFILE_C-1136678447-20130122-08 recid=2184 stamp=805366406
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\AR\AL_C3O01QKC_1_1 recid=2185 stamp=805366413
            crosschecked backup piece: found to be 'AVAILABLE'
            backup piece handle=E:\BACKUP\RMANBACKUP\CONTROLFILE\CONTROLFILE_C-1136678447-20130122-09 recid=2186 stamp=805366415
            Crosschecked 12 objects
            
            
            RMAN retention policy will be applied to the command
            RMAN retention policy is set to redundancy 3
            Deleting the following obsolete backups and copies:
            Type                 Key    Completion Time    Filename/Handle
            -------------------- ------ ------------------ --------------------
            Controlfile Copy     4      20-سبتمبر-10       C:\PROGRAM FILES\OMNIBACK\TMP\CTRL_ORCL.DBF
            
            RMAN-06207: WARNING: 1 objects could not be deleted for DISK channel(s) due
            RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
            RMAN-06210: List of Mismatched objects
            RMAN-06211: ==========================
            RMAN-06212:   Object Type   Filename/Handle
            RMAN-06213: --------------- ---------------------------------------------------
            RMAN-06214: Datafile Copy   C:\PROGRAM FILES\OMNIBACK\TMP\CTRL_ORCL.DBF
            
            
            specification does not match any archive log in the recovery catalog
            
            Recovery Manager complete.
            do you know why?
            • 3. Re: RMAN-01005: syntax error:
              Mihael
              use :

              RMAN> crosscheck copy;
              RMAN> delete expired copy;
              • 4. Re: RMAN-01005: syntax error:
                Maahjoor
                thank you so much for help.

                i will try your code, and if there is somehting wrong, i will inform you.

                once again, thank you so much dear.