Home » RDBMS Server » Backup & Recovery » RMAN duplicate database restore
RMAN duplicate database restore [message #385913] Wed, 11 February 2009 20:00 Go to next message
caprikar
Messages: 226
Registered: March 2007
Senior Member
Hi,
I have two oracle 10g databases running with ASM, one PRODUCTION and the other one STAGE in HP-UX. I want to restore the production database into staging using RMAN.

In production I have the following datafiles and logfiles:
SQL> select file_name from dba_data_files;
 
FILE_NAME
--------------------------------------------------------------------------------
+DATA01_DG/prd/datafile/secadmin_data01.267.652251321
+DATA01_DG/prd/datafile/secadmin_data01.266.652251321
+DATA01_DG/prd/datafile/users.269.652251321
+DATA01_DG/prd/datafile/undotbs1.273.652251419
+DATA01_DG/prd/datafile/sysaux.268.652251321
+DATA01_DG/prd/datafile/system.271.652251403

SQL> select member from v$logfile;
+DATA01_DG/prd/onlinelog/group_8.258.652552575

and in staging database the datafiles and logfiles are:

SQL> select file_name from dba_data_files;
 
FILE_NAME
--------------------------------------------------------------------------------
+DATA01_DG/stg/datafile/system.263.673610317
+DATA01_DG/stg/datafile/undotbs1.292.673610317
+DATA01_DG/stg/datafile/sysaux.272.673610317
+DATA01_DG/stg/datafile/users.262.673610317
+DATA01_DG/stg/datafile/secadmin_data01.298.673610311
+DATA01_DG/stg/datafile/secadmin_data01.302.673610311

SQL> select member from v$logfile;
+DATA01_DG/stg/onlinelog/group_1.273.673612399

In order to restore the PRODUCTION database into STAGE, I follow the steps:

1. clean up all the database files
      ASMCMD> cd +DATA01_DG
      ASMCMD> rm *


2. copy the RMAN backup files from production to staging

3. Edit staging database init.ora file and add the following entry:
DB_FILE_NAME_CONVERT=(+DATA01_DG/prd/datafile/,+DATA01_DG/stg/datafile/)
LOG_FILE_NAME_CONVERT=(+DATA01_DG/prd/onlinelog/,+DATA01_DG/stg/onlinelog/)

3. SQL> startup nomount;

Now run the RMAN duplicate command to restore the database in staging:

4. rman target sys/password@PROD catalog rman_stg/rman@dbrman auxiliary sys/password

       RMAN>

       run {
         allocate auxiliary channel d1 type disk;
         allocate auxiliary channel d2 type disk;
         duplicate target database to STAGE
         until time "to_date('2009 JAN 10 10:25','yyyy mon dd hh24:mi')";
       }

5.SQL> startup;


Is that what I have to do, or do I need to take care of anything else? How do I make sure that I'm not touching the production database, because I don't want to take any chance to restore anything into production by mistake. Any help is appreciated.

Thanks.
Re: RMAN duplicate database restore [message #385979 is a reply to message #385913] Thu, 12 February 2009 02:12 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Are both in the same server?
Else
Just make sure the backupsets are visible in the other server call rman from the other server.
set ORACLE_SID explicitly before STARTUP NOMOUNT to the database to duplicated.
That is all you need.
And honestly,
this is just forum. Unless we have some telepathic capabilities we cannot guess every other action one can make to harm the database.
Best way to avoid any surprise is to
read docs
google/search this forum and see what others have done
test it in a secure test environment
document the procedure
do it for real.

[Updated on: Thu, 12 February 2009 02:14]

Report message to a moderator

Re: RMAN duplicate database restore [message #385982 is a reply to message #385913] Thu, 12 February 2009 02:26 Go to previous message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Also,
>>until time "to_date('2009 JAN 10 10:25','yyyy mon dd hh24:mi')";

Usually, the time format should be like this
>>Mon DD YYYY HH24:MI:SS

Have'nt seen anyone using 'YYYY mon dd' or even tried it myself.
Previous Topic: How to reset Used Flash Recovery Area Size (GB) ?
Next Topic: Rman Error
Goto Forum:
  


Current Time: Fri Nov 22 08:24:38 CST 2024