This discussion is archived
1 2 Previous Next 15 Replies Latest reply: Mar 25, 2013 10:59 AM by TSharma-Oracle RSS

Using RMAN "copy datafile" to restore db on a different host

stopuz Newbie
Currently Being Moderated
Hi,

DB 8.1.7 (Standard Edition) on Windows Server 2000 SP4.
Database is in Archivelog mode. RMAN uses a catalog database.

The client does not want to spend money to upgrade the application (which only supports 8i - old app), therefore we have to relocate the database onto a new hardware (the machine is also old):

Here is how I backup the database every night (I also make an OS copy of archivelogs on an hourly basis):
@(
echo run {
echo allocate channel d1 type disk;
echo backup
echo tag db_full
echo format '\\backupserver\backups\prodserver\rman\df_u%%u_s%%s_p%%p_t%%t'
echo database;
echo copy current controlfile to '\\backupserver\backups\prodserver\rman\DB_CONTROL01.ctl';
echo sql 'alter system archive log current';
echo backup
echo format '\\backupserver\backups\prodserver\rman\al_u%%u_s%%s_p%%p_t%%t'
echo archivelog all
echo delete input;
echo release channel d1;
echo resync catalog;
echo }
) | d:\orahome\bin\rman.exe target sys/***@db_ded rcvcat rman/rman@rpdb > D:\oracle_backup_db\rman_db_backup.log
Now on a new 2003 server with database installed and rman catalog created, I am trying to restore my backups from the productions.

After reading some online documents forums, I noticed that if I do not have image copies of datafiles, controlfile, and archivelogs I CANNOT catalog them on this new database.

So, I want to create image copies when the database is in normal open state. What will I need to do get the new server to the same state as the production server? I know I will have to do media recovery, therefore copy and catalog the archivelogs created after the image copy was created.

What are the steps to do this?

If I create an image copy of a datafile on the production database and move that file to another location (to the new server with OS commands), will that affect a possible restore I might have to perform on the production database? I have space concerns on the production db so I do not want to keep them there and want to delete them after I test restoring them to the new server.

Is this the best method to move this database to a host with the same name same folder structure?

Thanks in advance,
Sinan
  • 1. Re: Using RMAN "copy datafile" to restore db on a different host
    mseberg Guru
    Currently Being Moderated
    Hello;

    I'm not a windows guy but you could move the database cold using scp.

    Putty has PSCP here :

    http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html


    You can create the scp batch file using SQL

    set heading off
    set feedback off
    set pagesize 100
    set linesize 400
    
    
    
    select 'scp '||a.name ||' server_name:' || a.name as newname from v$datafile a;
    
    
    
    
    select 'scp '||a.name ||' server_name:' || a.name as newname from v$controlfile a;
    
    
    select 'scp '||a.member ||' server_name:' || a.member as newname from v$logfile a;
    So shutdown the database and move the files. Restart do your RMAN backup and your done.

    The only issue I can is 2003 server probably does not have an SCP service like Unix.

    Here's a couple links to address that :

    http://mobassh.mobatek.net/

    http://www.netadmintools.com/art516.html

    Best Regards

    mseberg
  • 2. Re: Using RMAN "copy datafile" to restore db on a different host
    stopuz Newbie
    Currently Being Moderated
    Mseberg,

    Thanks for the response. I am trying to minimize the downtime since the database is used by many users in different time zones. Also, I'd like to test certain things on the new server before actually doing this.

    In 8i, is there a way of moving/copying the entire database without interrupting the production system? Since the DB edition is standard, I cannot use STANDBY database commands, etc.

    Thanks,
    Sinan
  • 3. Re: Using RMAN "copy datafile" to restore db on a different host
    TSharma-Oracle Guru
    Currently Being Moderated
    You do not have to make image copies. You can use your existing full backup and archive logs to restore database on your new server.

    You can use this below link. This will help.
    http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmadvre.htm#i1007814
  • 4. Re: Using RMAN "copy datafile" to restore db on a different host
    stopuz Newbie
    Currently Being Moderated
    Tsharma,

    The link does use DATAFILECOPYs, which are created by "*copy datafile to*" command.

    Please see Item#9 under title "Testing the Restore of a Database on a New Host"
    CATALOG DATAFILECOPY
      '/oracle/oradata/trgt/system01.dbf', '/oracle/oradata/trgt/undotbs01.dbf', 
      '/oracle/oradata/trgt/cwmlite01.dbf', '/oracle/oradata/trgt/drsys01.dbf',
      '/oracle/oradata/trgt/example01.dbf', '/oracle/oradata/trgt/indx01.dbf', 
      '/oracle/oradata/trgt/tools01.dbf', '/oracle/oradata/trgt/users01.dbf';
    Regards,
    Sinan
  • 5. Re: Using RMAN "copy datafile" to restore db on a different host
    TSharma-Oracle Guru
    Currently Being Moderated
    Yes that is one way but you can use the DISASTER RECOVERY steps and can restore a database on a new machine. See this "Recovering the Database After a Disaster" heading in that document I mentioned. There it shows how to use RMAN backup and restore it to new machine.
  • 6. Re: Using RMAN "copy datafile" to restore db on a different host
    mseberg Guru
    Currently Being Moderated
    Hello again;

    I'm not sure about TSharma's idea. If it works that's great but you did say

    "8.1.7 (Standard Edition)" and he points you to an Oracle 11 document.

    The closest I can find to his idea are :

    http://docs.oracle.com/cd/B10501_01/server.920/a96572/performingreco.htm#27081

    http://docs.oracle.com/html/A85455_01/rmanadde.htm


    I took the Oracle backup and recovery class for Oracle 8 late in that products life.
    We did not spend a lot of time on RMAN.

    Good Luck with your move

    mseberg
  • 7. Re: Using RMAN "copy datafile" to restore db on a different host
    TSharma-Oracle Guru
    Currently Being Moderated
    Oops, I missed that. Thanks msberg for pointing this out. Lot of commands in that document won't work. Sorry about that. This is the new link for 8i almost step by step recovery for full database.

    http://www.oracle-base.com/articles/8i/recovery-manager-8i.php#WholeDatabase

    The above doc is exactly for *8.1.7* as OP mentioned. Sorry for the confusion above.
  • 8. Re: Using RMAN "copy datafile" to restore db on a different host
    stopuz Newbie
    Currently Being Moderated
    Hi Tsharma,

    The link you sent to me is actually for one my favorite article. So, I have already reviewed it. But, there it assumes that the recovery catalog database is intact. In my case, I installed a new OS, a new database service with the same name, configured a recovery catalog. Now I just want to be able to catalog the production backups in the new server's recovery catalog, so that I can restore and recover it to the latest production state (using archivelogs from production).

    Thanks,
    Sinan
  • 9. Re: Using RMAN "copy datafile" to restore db on a different host
    mseberg Guru
    Currently Being Moderated
    What is the size of this database ?

    The reason I ask is if you just move everything cold you avoid catalog issues, data sync issues etc. Yes you have an outage. But the database comes back up right where you left it. If your tnsnames is correct ( I would move them too ) then you can take a full backup a minute after startup. Plus you have the perfect rollback, an exact copy.

    Will an RMAN method you still need a test plan to prove the data matches. This and accounting for any data gap will cause an outage anyway. The other thing is with Oracle 8 if you have an RMAN issue at crunch time who can help you?

    OK, I will stop now with the hard sell.

    Best Regards

    mseberg
  • 10. Re: Using RMAN "copy datafile" to restore db on a different host
    stopuz Newbie
    Currently Being Moderated
    Mseberg,

    The reason I want to use the RMAN method is that I need to test some applications on the new server before I do the actual cut over.

    Will you please answer this question for me?

    I just do not know the affect of running a "copy datafile" against the production database and whether it will affect my backup/recovery plan (I have always used backup sets) on the production server.

    Thanks,
    Sinan
  • 11. Re: Using RMAN "copy datafile" to restore db on a different host
    TSharma-Oracle Guru
    Currently Being Moderated
    If you have reviwed so many articles then you should start reading some basic RMAN documentation to restore databases. You need to these steps:

    1) create a service with the same name
    2) copy the backups to the new server on the same location.
    3) copy the init.ora file ans using that init.ora file, start the database to the nomount state.
    4) Go to RMAN , restore the controlfile from the backup you have.
    5) After restoring controlfile, take your backup into the mount stage
    6) Because you are not using CATALOG, you might need to use catalog backup pieces and archive logs using 'catalog' command(Search google for this "how to catalog backup pieces).

    And than you can use that link I mentioned whcih is your favorite as a help and recover it.
  • 12. Re: Using RMAN "copy datafile" to restore db on a different host
    stopuz Newbie
    Currently Being Moderated
    TSharma,

    I am using a RMAN catalog database.

    Thanks,
    Sinan
  • 13. Re: Using RMAN "copy datafile" to restore db on a different host
    TSharma-Oracle Guru
    Currently Being Moderated
    You do not need to use catalog database in order to restore the database. You can always register the database in a new catalog after your restore.

    I can bet there will be way to move the catalog content to a new database but why do you want to do that if you can do without it.
  • 14. Re: Using RMAN "copy datafile" to restore db on a different host
    stopuz Newbie
    Currently Being Moderated
    Sorry for the misunderstanding. You are right, if I can restore the database onto the new server without a catalog database, I am happy. But, the backup records are stored in the recovery catalog database, NOT in the controlfile. So, I do not know how to let the new server know which backups to use and how?

    Thanks,
    Sinan
1 2 Previous Next

Legend

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