This discussion is archived
3 Replies Latest reply: Nov 5, 2012 10:57 AM by mseberg RSS

Creating a new controlfile with datafiles in RMAN backup

007 Newbie
Currently Being Moderated
Hi,

i am using oracle 10g (10.2.0.1) in RHEL5 server. i am trying to restore a RMAN backup from one server to another new server with new db name. i have taken out the spfile from RMAN autobackup and created pfile from it and edited the pfile with new dbname and directory structure and started the db in nomount with the new pfile. Now i have restored the controfile from the RMAN autobackup tried to put the database in mount state. But it failed due to the below error

RMAN-03002: failure of alter db command at 11/05/2012 21:44:56
ORA-01103: database name 'ORADB' in control file is not 'DEVDB'

Hence i shutdown the database and started the db in nomount with new pfile and tried to create the controlfile with the new db name,but it failed as it is looking for the datafiles.

ORA-01503: CREATE CONTROLFILE failed
ORA-01565: error in identifying file
'/u01/app/oracle/oradata/DEVDB/datafile/o1_mf_system_80jq0kfw_.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

All my datafiles reside in my RMAN backup. How to get the datafiles from RMAN backup in the above scenario??

Regards,
007
  • 1. Re: Creating a new controlfile with datafiles in RMAN backup
    Balazs Papp Expert
    Currently Being Moderated
    restore as ORADB, then rename the database with DBNEWID
    http://docs.oracle.com/cd/B19306_01/server.102/b14215/dbnewid.htm

    or use duplicate instead of restore
  • 2. Re: Creating a new controlfile with datafiles in RMAN backup
    mseberg Guru
    Currently Being Moderated
    Hello;

    The location and filename and DBIS will be different, but you need something like this :
    $ORACLE_HOME/bin/rman  << EOF
     
    CONNECT TARGET / 
    STARTUP NOMOUNT;
    SET DBID 3754763357;  #DBID of PROD database
     
    RUN
     {
       ALLOCATE CHANNEL c1 DEVICE TYPE disk format '/u01/oradata/backups';
       RESTORE CONTROLFILE FROM '/u01/oradata/backups/sb_t790762003_s85_p1'; 
       ALTER DATABASE MOUNT;
       SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/CLONE/system01.dbf'; 
    
       
    
        SET NEWNAME FOR TEMPFILE 1 TO '/u01/app/oracle/oradata/CLONE/temp01.dbf';
       RESTORE DATABASE;
       SWITCH DATAFILE ALL;
       RECOVER DATABASE;
       release channel c1;
     }
    ALTER DATABASE OPEN RESETLOGS; 
    So you need "SET NEWNAME" for all your files

    Full Example

    http://www.visi.com/~mseberg/rman/restore_database_without_catalog.html


    Best Regards

    mseberg
  • 3. Re: Creating a new controlfile with datafiles in RMAN backup
    Shivananda Rao Guru
    Currently Being Moderated
    Hello,
    RMAN-03002: failure of alter db command at 11/05/2012 21:44:56
    ORA-01103: database name 'ORADB' in control file is not 'DEVDB'
    You have the backup of database ORADB, hence you'll have to restore it as ORADB and then change the dbname using NID. Refer this http://shivanandarao.wordpress.com/2012/04/19/duplicating-primary-database-to-a-new-host-without-connecting-to-the-primary-database-in-oracle-10g11g/

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points