Restore database on new host with no recovery catalog [message #358529] |
Tue, 11 November 2008 16:34 |
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 #358564 is a reply to message #358555] |
Tue, 11 November 2008 20:51 |
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 #358604 is a reply to message #358573] |
Tue, 11 November 2008 23:14 |
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 #358832 is a reply to message #358722] |
Wed, 12 November 2008 10:44 |
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 #359125 is a reply to message #358529] |
Thu, 13 November 2008 16:31 |
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;
|
|
|
|