3 Replies Latest reply: Dec 3, 2012 8:10 AM by 977617 RSS

    RMAN Duplicate database fails with RMAN-06136 ORA-06502

    bderous
      HP-UX ia64
      Oracle 11.2.0.3

      Want to duplicate database to other server with RMAN duplicate command. This fails with this main error : RMAN-06136: ORACLE error from auxiliary database: ORA-06502: PL/SQL: numeric or value error

      This is my command :

      rman TARGET / CATALOG xxx/yyy@zzz AUXILIARY SYS/xxx@target_db cmdfile restore_aux.rman log restore_aux.log

      RMAN> run {
      set UNTIL TIME '27.10.12:17.08.30';
      allocate auxiliary channel c1 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/etc/opt/oracle/tdpo.S205528X_SACO01_3376980735_DUP_DB)';
      DUPLICATE TARGET DATABASE TO SACO01 NOFILENAMECHECK;
      }

      This is the logfile :

      executing command: SET until clause

      allocated channel: c1
      channel c1: SID=394 device type=SBT_TAPE
      channel c1: Data Protection for Oracle: version 5.5.1.0

      Starting Duplicate Db at 31.10.12:13.31.46

      contents of Memory Script:
      {
      set until scn 10577952347858;
      sql clone "alter system set db_name =
      ''SACO01'' comment=
      ''Modified by RMAN duplicate'' scope=spfile";
      shutdown clone immediate;
      startup clone force nomount
      restore clone primary controlfile;
      alter clone database mount;
      }
      executing Memory Script

      executing command: SET until clause

      sql statement: alter system set db_name = ''SACO01'' comment= ''Modified by RMAN duplicate'' scope=spfile

      Oracle instance shut down

      Oracle instance started

      Total System Global Area 12827369472 bytes

      Fixed Size 2194576 bytes
      Variable Size 8287945584 bytes
      Database Buffers 4529848320 bytes
      Redo Buffers 7380992 bytes
      allocated channel: c1
      channel c1: SID=345 device type=SBT_TAPE
      channel c1: Data Protection for Oracle: version 5.5.1.0

      Starting restore at 31.10.12:13.32.18

      channel c1: starting datafile backup set restore
      channel c1: restoring control file
      channel c1: reading from backup piece ctrl_1unoql8s_1_1
      channel c1: piece handle=ctrl_1unoql8s_1_1 tag=BACKUP_CONTROL_FILE
      channel c1: restored backup piece 1
      channel c1: restore complete, elapsed time: 00:00:15
      output file name=/u01/ORACLE/SACO01/ctl/cntrlSACO01.dbf
      output file name=/u03/ORACLE/SACO01/ctl/cntrlSACO01.dbf
      Finished restore at 31.10.12:13.32.44

      database mounted
      Using previous duplicated file /u01/ORACLE/SACO01/sys/systema.dbf for datafile 1 with checkpoint SCN of 10577952177232
      Using previous duplicated file /u01/ORACLE/SACO01/sys/sysauxa.dbf for datafile 2 with checkpoint SCN of 10577804912714
      Using previous duplicated file /u01/ORACLE/SACO01/rbs/undo01a.dbf for datafile 3 with checkpoint SCN of 10577804912714
      ....
      Using previous duplicated file /u50/ORACLE/SACO01/tbl/ts_tir002e.dbf for datafile 69 with checkpoint SCN of 10577952177232
      Using previous duplicated file /u50/ORACLE/SACO01/tbl/ts_tir002d.dbf for datafile 70 with checkpoint SCN of 10577952177214

      DBGSQL: AUXILIARY> begin :ofname := sys.dbms_backup_restore.convertFileName( fname => :ifname, ftype => :iftype, osftype => TRUE); end;
      DBGSQL: sqlcode = 6502
      DBGSQL: B :ofname = NULL
      DBGSQL: B :ifname =
      DBGSQL: B :iftype = 2
      Oracle instance started

      Total System Global Area 12827369472 bytes

      Fixed Size 2194576 bytes
      Variable Size 8287945584 bytes
      Database Buffers 4529848320 bytes
      Redo Buffers 7380992 bytes

      contents of Memory Script:
      {
      sql clone "alter system set db_name =
      ''SACO01'' comment=
      ''Reset to original value by RMAN'' scope=spfile";
      shutdown clone immediate;
      }
      executing Memory Script

      sql statement: alter system set db_name = ''SACO01'' comment= ''Reset to original value by RMAN'' scope=spfile

      Oracle instance shut down
      RMAN-00571: ===========================================================
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
      RMAN-00571: ===========================================================
      RMAN-03002: failure of Duplicate Db command at 10/31/2012 13:33:13
      RMAN-05501: aborting duplication of target database
      RMAN-06136: ORACLE error from auxiliary database: ORA-06502: PL/SQL: numeric or value error

      Recovery Manager complete.

      Software level is same on both servers : same version, same patches
      Anybody a good suggestion.
      Thanx.
        • 1. Re: RMAN Duplicate database fails with RMAN-06136 ORA-06502
          mseberg
          Hello;

          I would look for an issue ( probably custom code ) in the database I'm duplicating from. I probably look at Types first and then procedures etc. Watch for triggers created in the SYS or SYSTEM schema. What I'm thinking is there's an object or objects that have that numeric error error. Once you find them, save them off and then drop them and try the duplicate again.

          If it works manually recreate them/it in the new database.

          Sounds easy, is probably not.

          Best Regards

          mseberg
          • 2. Re: RMAN Duplicate database fails with RMAN-06136 ORA-06502
            Satishbabu Gunukula
            Can you follow the steps mentined below

            http://www.oracleracexpert.com/2011/09/duplicate-database-using-rman.html
            http://www.oracleracexpert.com/2012/10/convert-single-instance-to-rac-part1.html

            If you still see any issues, let me know

            Regards,
            http://www.oracleracexpert.com
            Time for Change: Migrate your Non-RAC Database to RAC
            http://www.oracleracexpert.com/2012/10/time-for-change-migrate-your-non-rac.html
            Migrate Database to ASM using RMAN
            http://www.oracleracexpert.com/2009/10/migrate-database-to-asm-using-rman.html
            • 3. Re: RMAN Duplicate database fails with RMAN-06136 ORA-06502
              977617
              Hello

              I have exactly the same error during duplicate database.

              allocated channel: t2
              channel t2: SID=239 device type=SBT_TAPE
              channel t2: Data Protection for Oracle: version 6.3.0.0

              Starting restore at 03-DEC-2012 10:07:11

              channel t1: starting datafile backup set restore
              channel t1: restoring control file
              channel t1: reading from backup piece ctl_c-4163028223-20121202-01
              channel t1: piece handle=ctl_c-4163028223-20121202-01 tag=TAG20121202T025029
              channel t1: restored backup piece 1
              channel t1: restore complete, elapsed time: 00:00:35
              output file name=/u01t2/oradata/TGHMIT2/control01.ctl
              output file name=/u01t2/oradata/TGHMIT2/control02.ctl
              output file name=/u01t2/oradata/TGHMIT2/control03.ctl
              Finished restore at 03-DEC-2012 10:07:48

              database mounted

              DBGSQL:     AUXILIARY> begin :ofname := sys.dbms_backup_restore.convertFileName( fname   =>   :ifname, ftype   =>   :iftype, osftype =>   TRUE); end;
              DBGSQL:        sqlcode = 6502
              DBGSQL:         B :ofname = NULL
              DBGSQL:         B :ifname =
              DBGSQL:         B :iftype = 2
              released channel: t1
              released channel: t2
              RMAN-00571: ===========================================================
              RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
              RMAN-00571: ===========================================================
              RMAN-03002: failure of Duplicate Db command at 12/03/2012 10:07:53
              RMAN-05501: aborting duplication of target database
              RMAN-06136: ORACLE error from auxiliary database: ORA-06502: PL/SQL: numeric or value error

              RMAN>

              Recovery Manager complete.


              Did you find a solution for the problem ?

              In my case the problem must be related with a new created datafile.
              If I skip the corresponding tablespace then the duplication works or if I duplicate the database before we created the new datafile duplicate database also works.

              Thanks
              Uwe