Home » RDBMS Server » Backup & Recovery » Restore database on new host with no recovery catalog (oracle 10.2.0.2, unix)
Restore database on new host with no recovery catalog [message #358529] Tue, 11 November 2008 16:34 Go to next message
vmdba
Messages: 6
Registered: November 2008
Location: CA
Junior Member
I want to refresh/create a new DB instance on a different host (b) from the prouction instance on host (a).

On our production instance (host a) we backup the full database to disk everyday using RMAN but without recovery catalog. Here's the backup script that we use to take backup of the prod instance. The files created in the /u01/oradata/backup/<prodSID> using the below RMAN backup routine, are backed up to tape by sysadmin everyday. These backup files are deleted everyday (after they are backed upto tape by sys admin) before the RMAN script runs again to take fresh backup of database.

run {
allocate channel d1 type disk;
backup format '/u01/oradata/backup/<prodSID>/bu_db_%d_t%t_s%s_p%p' database;
sql 'alter system archive log current';
backup format '/u01/oradata/backup/<prodSID>/bu_al_%d_t%t_s%s_p%p' archivelog all;
delete noprompt archivelog all backed up 2 times to DEVICE TYPE DISK completed before 'sysdate-3' ;
backup format '/u01/oradata/backup/<prodSID>/bu_cl_%d_%t_s%s_p%p' current controlfile;
release channel d1;
}

Now my question is once this production backup files are made available to me by sys admin on the new host machine (b), how can I perform a restore to create a new DB instance on the new host (b) with no recovery catalog?

How would I make the recovery and restore procedure recognize that it has to use the backup files made available by the sys admin on new host (say made available on mount /u01/oradata/dev on host machine b), to restore/create this new database.

PS> we do not yet have netbackup agent configured on our systems to talk to backup media, thats why we use the RMAN routine mentioned above to take backup to disk, and then sys admin just takes file system backup of that mount, and stores it on a tape.
Re: Restore database on new host with no recovery catalog [message #358555 is a reply to message #358529] Tue, 11 November 2008 20:23 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Yes you can. Check Restore and Recovery of the Database on a New Host for all the details.
Re: Restore database on new host with no recovery catalog [message #358564 is a reply to message #358555] Tue, 11 November 2008 20:51 Go to previous messageGo to next message
vmdba
Messages: 6
Registered: November 2008
Location: CA
Junior Member
I did go through the documentation before I posted this thread. It was not very clear to me as to what I need to do.

For eg. The document says restore spfile from AUTOBACKUP. But I do not have autobackup set on my target database.

RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='...';
RESTORE SPFILE TO PFILE 'target location on traget instance' FROM AUTOBACKUP;
SHUTDOWN ABORT;
}


So in my scenario would I be doing something like this to restore the SPfile ( and I guess I can skip this step, and just do the controlfile, as I can copy the spfile from the source DB to the target DB and edit it manually to the same purpose).


RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='...';
RESTORE SPFILE from '/u01/oradata/dev/<control file backup file>' TO PFILE '<target location on the target host>';
SHUTDOWN ABORT;
}


And similarliy for restoring controlfile, would I be doing something like:

RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS='...';
RESTORE CONTROLFILE FROM '/u01/oradata/dev/<control file backup file>';
ALTER DATABASE MOUNT;
}


I haven't done too many RMAN restores, so I have all these questions. I will appreciate an answer to the query.

PS> '/u01/oradata/dev/' being the mount where the backup files from source host have been made available on the target host.
Re: Restore database on new host with no recovery catalog [message #358573 is a reply to message #358564] Tue, 11 November 2008 21:24 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Since you aren't integrated with Netbackup, you don't have to allocate a tape 'sbt' channel.

If you have a spfile that you can use, then if mods need to be made to it, you'll need to create a pfile and make the necessary changes first.

Your syntax for restoring the controlfile without using autobackup is correct.

Since the backups are restored to a different directory structure than what they were backed up to, you will need to CATALOG the backuppieces once you have restored your SPFILE and controlfile.

Once the pieces are cataloged, you can do your restore/recover database.
Re: Restore database on new host with no recovery catalog [message #358604 is a reply to message #358573] Tue, 11 November 2008 23:14 Go to previous messageGo to next message
vmdba
Messages: 6
Registered: November 2008
Location: CA
Junior Member
I am more confused now, not sure how to use CATALOG. Can I not do the same steps as mentioned in the documentation for oracle backup and recovery, and perform the restore & recover DB as below:

RUN
{
# allocate a channel to the tape device
ALLOCATE CHANNEL c1 type disk;

# rename the datafiles and online redo logs
SET NEWNAME FOR DATAFILE 1 TO '?/oradata/test/system01.dbf';
SET NEWNAME FOR DATAFILE 2 TO '?/oradata/test/undotbs01.dbf';
SET NEWNAME FOR DATAFILE 3 TO '?/oradata/test/cwmlite01.dbf';
SET NEWNAME FOR DATAFILE 4 TO '?/oradata/test/drsys01.dbf';
SET NEWNAME FOR DATAFILE 5 TO '?/oradata/test/example01.dbf';
SET NEWNAME FOR DATAFILE 6 TO '?/oradata/test/indx01.dbf';
SET NEWNAME FOR DATAFILE 7 TO '?/oradata/test/tools01.dbf';
SET NEWNAME FOR DATAFILE 8 TO '?/oradata/test/users01.dbf';
SQL "ALTER DATABASE RENAME FILE ''/dev3/oracle/dbs/redo01.log''
TO ''?/oradata/test/redo01.log'' ";
SQL "ALTER DATABASE RENAME FILE ''/dev3/oracle/dbs/redo02.log''
TO ''?/oradata/test/redo02.log'' ";

# Do a SET UNTIL to prevent recovery of the online logs
SET UNTIL SCN 123456;
# restore the database and switch the datafile names
RESTORE DATABASE;
SWITCH DATAFILE ALL;

# recover the database
RECOVER DATABASE;
}
EXIT


Making sure that I provide the right file paths to match my filesystem layout.
Re: Restore database on new host with no recovery catalog [message #358722 is a reply to message #358604] Wed, 12 November 2008 05:26 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Since the backups that you restored (/u01/oradata/dev/) do not have the same directory path name (/u01/oradata/backup/<prodSID>/) that you backed them up to, your restored control file will not know where they exist. Therefore, a CATALOG is required to tell RMAN where to find the restored backups.

If you can create the mount on the new server with the same directory path name as the original backup directory, then no CATALOG is required.
Re: Restore database on new host with no recovery catalog [message #358832 is a reply to message #358722] Wed, 12 November 2008 10:44 Go to previous messageGo to next message
vmdba
Messages: 6
Registered: November 2008
Location: CA
Junior Member
Thanks...that makes sense now.

I also wanted to ask can I alternatively use the RMAN duplicate DB functionality to clone/refresh the target DB from source DB with the same scenario as mentioned by me in the email thread without a recovery catalog?

Would the first approach of restoring controlfile, DB etc be easier or the duplicate DB processes will be easier.
Re: Restore database on new host with no recovery catalog [message #358842 is a reply to message #358832] Wed, 12 November 2008 11:28 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You absolutely can. Duplicate would be the way to go and can pretty much be scripted.

Check Using DUPLICATE DATABASE to Resynchronize a Duplicate Database: Example for details on the process.
Re: Restore database on new host with no recovery catalog [message #359125 is a reply to message #358529] Thu, 13 November 2008 16:31 Go to previous messageGo to next message
vmdba
Messages: 6
Registered: November 2008
Location: CA
Junior Member
I have one more question, if I go the route of doing duplicate for the DB, as below, then should this be done from the 'target host' or should these commands be run on the 'source host'. Of course i wouldn't be connecting to the recovery catalog, as I do not have one.

Example 13-5 Reduplicating the Database

# start RMAN and then connect to the target and auxiliary databases
CONNECT TARGET /;
#CONNECT CATALOG rman/cat@catdb;
CONNECT AUXILIARY SYS/oracle@dupdb;

# Create the duplicate database. Run the same command periodically
# to re-create the database, thereby keeping the duplicate
# in sync with the target.
DUPLICATE TARGET DATABASE TO dupdb
SKIP TABLESPACE tools
LOGFILE
GROUP 1 ('/duplogs/redo01a.log',
'/duplogs/redo01b.log') SIZE 200K REUSE,
GROUP 2 ('/duplogs/redo02a.log',
'/duplogs/redo02b.log') SIZE 200K REUSE;
Re: Restore database on new host with no recovery catalog [message #359129 is a reply to message #359125] Thu, 13 November 2008 18:39 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Assuming the backups are accessible from both nodes, the process can be initiated from either node. The target host is the source/primary node and the auxiliary is the new/duplicate node.
Previous Topic: Recover Standby Database
Next Topic: ***How to take RMAN backup in IBM TS3100 tape library***
Goto Forum:
  


Current Time: Thu May 02 04:19:39 CDT 2024