Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Moving a Database

Moving a Database

From: MacGregor, Ian A. <ian_at_slac.stanford.edu>
Date: Fri, 28 May 2004 12:38:44 -0700
Message-ID: <26E3EC48949D134C94A1574B2C89466113A8D5@exchange2.slac.stanford.edu>


I have used a script similar to the following to clone a database

#!/bin/sh
ORACLE_HOME=/opt/oracle/dbserver/9.2.0
export ORACLE_HOME
ORACLE_SID=DEV
export ORACLE_SID
NLS_DATE_FORMAT=DD-MON-YYYY:HH24:MI:SS
export NLS_DATE_FORMAT
$ORACLE_HOME/bin/rman <<EOF
connect target sys<password>/@prod
connect auxiliary /
connect catalog <username/password>@recoverymanagerdb run
{
allocate auxiliary channel c2 device type sbt format 'df_%t_%s_%p' PARMS="SBT_LIBRARY=/opt//oracle/dbserver/9.2.0/lib/libobk.so, ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt.proddb-machine)"; set newname for datafile 1 to '/u2/oradata/DEV/system01.dbf'; set newname for datafile 2 to '/u2/oradata/DEV/slacprod_rollback01.dbf'; #[atually lots of these, one for each datafile. I use the init.ora parameter as well. (Belt and suspenders)] duplicate target database to dev
LOGFILE

group 1 ('/u1/oradata/DEV/redo0101.log',

'/opt/oracle2/admin/DEV/redologs/redo0102.log') size 200M,
group 2 ('/u1/oradata/DEV/redo0201.log',
'/opt/oracle2/admin/DEV/redologs/redo0202.log') size 200M,
group 3 ('/u1/oradata/DEV/redo0301.log',
'/opt/oracle2/admin/DEV/redologs/redo0302.log') size 200M,
group 4 ('/u1/oradata/DEV/redo0401.log', '/opt/oracle2/admin/DEV/redologs/redo0402.log') size 200M; } -------------------------------------------------------------------------------------------------------------------
It works nicely. But what if I want to move a database from one machine to another, because the present database host is old and under-powered? If I use duplicate I get a different dbid. How then do I access the old backups afterwards? One additional wrinkle is that after the restore, the new machine will get the old machine's name and ip address.

If I used the old fashion way of doing things. I would restore a hot backup, to the new machine, create a control file, begin the database recovery and start applying the redo logs. When it was time to make the move, I'd just perform a log switch on the old box, shutdown the database on the old box, transfer the log through backup and restore to the new box, apply the log and open the database. The outage is about less than 15 minutes, plus the time it takes for the sys-admins to rename the box. However, the duplicate command takes much longer as it performs the entire restore.

Is there anyway to use duplicate and have the process stop before it performs the open resetlogs? Is one supposed to make a standby database and then convert it to a full-fledged one.

Perhaps one could use restore to bring over the database files and archive log, and then create the control file and recover the old fashion way. But, can one restore to the auxiliary instance. I think restores always go to the target.

I need to run the program from the auxiliary database machine due to our TSM setup . Perhaps I'm supposed to start on the old machine and mount the new machines file systems associated with database storage, restore the data files and archive logs to the remote file systems, and then recover the old fashion way.???

I must be overlooking something. It seems easier to move a database the old way rather than through rman. One more tidbit, although the script above is for a 9.2.0 database. The one I need to move is a 8.1.7 database.

Ian MacGregor
Stanford Linear Accelerator Center
ian_at_slac.stanford.edu



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Fri May 28 2004 - 14:39:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US