Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Changing the SID of a database
Rick, here is how I do it. Contact me if there are any questions.
Make a copy of 'prod' on LAWDB to 'test' on LAWDB from Cold Backup
Introduction
The 'prod' Oracle instance sometimes need to be replicated, on demand, for testing and/or training purposes. The replication is done using a 'Cold' backup copy of the 'prod' instance using either the backup directory (/dbkup) or the ADSM backup. The procedure is very much the same for creating either 'test' or 'train'. This section will assume creating a 'test ' database.
Procedure
? Take a cold backup of 'prod'
? Shutdown 'test' instance
The 'test' instance should be shutdown using 'immediate' option.
>ORACLE_SID=test
>export ORACLE_SID
>svrmgrl
SVRMGR> connect / as sysdba;
connected;
SVRMGR> select name from v$database;
NAME
SVRMGR> oradebug ipc
SVRMGR> shutdown immediate;
SVRMGR> exit;
? Copy the datafiles files from the cold backup
Delete ALL TEST database related files, i.e. *.dbf, *.ctl, *.log
Use the cold backup to copy the .dbf files to the "test" instance mountpoints
? Re-create control files & redo logs for the "test" instance. (See example belos)
Use the 'make control file' script
>ORACLE_SID=test
>export ORACLE_SID
>cd $HOME/test/admin
>svrmgrl
SVRMGR> connect / as sysdba
SVRMGR> @mkctrl
SVRMGR> select name from v$database;
Example of creating control files & redo logs:
STARTUP NOMOUNT
CREATE CONTROLFILE SET DATABASE "lawtst5" RESETLOGS NOARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXDATAFILES 200
MAXINSTANCES 8
MAXLOGHISTORY 800
LOGFILE
GROUP 1 '/db/u05/oradata/lawtst5/redo01.log' SIZE 64M, GROUP 2 '/db/u06/oradata/lawtst5/redo02.log' SIZE 64M, GROUP 3 '/db/u07/oradata/lawtst5/redo03.log' SIZE 64MDATAFILE
. . . . '/db/u04/oradata/lawtst5/index22.dbf','/db/u04/oradata/lawtst5/index23.dbf', '/db/u04/oradata/lawtst5/index24.dbf'
> I'm going to take the datafiles from a cold backup and use them for a new
> database. However, to do this, I need to change the SID of the new db.
I've read
> that it's possible, but not how to do it. Is this an easy thing to do, or
would
> it be better to extract the tables and create the new db that way?
>
> Thanks for any help.
> Rick
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author:
> INET: rick_at_dormir.org
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Bill Gentry INET: gentry_at_allina.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Mon Mar 04 2002 - 10:23:35 CST