5 Replies Latest reply: Sep 23, 2013 11:30 AM by jgarry RSS

    RMAN cold DB backup & restore on other server: best procedure ?

    1007321

      Hello,

      A few days ago I made a cold backup of an 11gR2 RAC DB with the following commands:

       

      srvctl stop database -d DBPOC

       

      rman target / << EOF

       

      startup mount;

      run

      {

        allocate channel c1  type disk format '/tmp/dump/coldBkp/%T_%d_DBID%I_s%s_p%p.bkp';

        backup database TAG 'BKPCOLDDBPOCC' keep until time 'sysdate+1000';

        backup current controlfile TAG 'BKPCOLDDBPOC_CTL' keep until time 'sysdate+1000';

        backup spfile TAG 'BKPCOLDDBPOC_SPF' keep until time 'sysdate+1000';

        release channel c1;

      }

      SHUTDOWN IMMEDIATE;

      quit;

      EOF

       

      srvctl start database -d DBPOC

      srvctl start service -d DBPOC

       

      Then noticing I need a controlfile copy I also did:

      backup as copy current controlfile format '/opt/dump/oracle/coldBkp/currentctlfile.ctl';

       

      It made a set of files in filesystem /tmp/dump/coldBkp that I copied to another server, looking like:

      20130912_DBPOC_DBID23987234897_s371_p1.bkp... plus my currentctlfile.ctl.

       

      I copied everything to another machine in /tmp/rest, where the same fs structure and ASM

      diskgroups already existed; then launched the following commands to restore this DB on

      this new server:

       

      1/ set a few env variables

      2/ cp initDBPOC.ora /opt/oracle/app/ora11g/product/11.2.0/db_1/dbs

      3/ sqlplus: startup pfile=/opt/oracle/app/ora11g/product/11.2.0/db_1/dbs/initDBPOC.ora nomount

      4/ rman: restore controlfile from '/location/of/coldbackup/files/currentctlfile.ctl';

      5/ rman: sql "alter database mount";

      6/ rman: catalog start with '/location/of/coldbackup/files';

      [typed YES here]

      7/ rman: restore database;

      8/ sqlplus: recover database using backup controlfile UNTIL CANCEL;

      [immediately cancelled for the first archive log required]

      9/ sqlplus: alter database open resetlogs;

       

      The procedure worked.

      But I'm not satisfied with this, I thought I could've done everything with RMAN; yet I found out

      that for ex. a RECOVER USING BACKUP CONTROLFILE is not possible with RMAN etc etc.

      and I had to swith back to sqlplus, surprisingly.

       

      Am I missing RMAN commands that I should've used ? Is there another -simpler ?- way to

      perform this simple restore/recover through RMAN utility only ?? Or is my backup wrong in

      the first place and I should've used other backup commands ?

       

      Thanks a lot in advance for any advice you'll provide me...

      Regards,

      Sébastien