|
-
did you change ORACLE_SID?
let me paste the whole procedure
-------------------------------------------------------------------------------
--
-- Script: clonedatabase.txt
-- Purpose: Outlines procedures for cloning a database
--
-- Copyright: (c) 2000 Howard Rogers
-- Author: Howard Rogers
-- Date: 2nd September 2000
-------------------------------------------------------------------------------
-- This is a simple list of steps that will allow you to clone
-- a database on the same machine as the original database.
-- It then goes on to show how you can re-name the clone, and
-- thereby permit the original database, plus its clone, to be
-- up and running at the same time on the one machine.
-- Clearly, if you were cloning off onto another machine altogether,
-- you wouldn't particularly need to rename the database.
-- CLONING A DATABASE
--1. In the original database, run the 'Alter Database Backup Controlfile to trace' command
--2. Perform a clean shutdown of the original database
--3. Copy all files (ie, Control Files, Data Files and Redo Logs) to clone location
--4. Blow away the Control files in the clone location
-- Since you are going to delete the Control Files, you could skip copying them in the first place
-- However, especially on Unix, it might be easier to simply 'cp -R' and sort out the files afterwards!
--5. Edit the Control File trace script:
-- Add a PFILE statement to the startup line
-- Edit all the file locations so they point to clone locations
--6. Copy the init.ora from the original database, then edit it for the Clone.
-- Make sure you edit:
-- Control_Files= (point to new location)
-- Log_archive_dest (and variants) (make sure you aren't going to generate
-- files which might over-write real logs etc)
-- User_Dump_Dest and Background_Dump_dest (the clone's alert log etc shouldn't
-- be allowed to over-write the real ones)
--7. Start Server Manager
--8. Run the Trace File script
-- At this point, you make sure everything is working perfectly. Once you know it is, it is
-- time to consider re-naming the Instance and the Database (yes, that's two separate operations!)
--CHANGING THE INSTANCE NAME
--1. Export a new ORACLE_SID
-- In other words, it isn't hard to change the Instance name. Just have a new ORACLE_SID set
-- before trying to do a 'startup'.
--CHANGING THE DATABASE NAME
--1. Issue the 'Alter Database Backup Controlfile to Trace' command once again from the Clone
--2. Perform a clean Shutdown of the clone.
--3. Blow away all clone Control Files
--4. Edit Control File trace script:
-- Change the "Create Controlfile Reuse 'X' noresetlogs....." line to read
-- "Create Controlfile SET 'Y' Resetlogs.....
-- In other words, X is the old name, and Y is the new one. And you're going to have to do a
-- Resetlogs after this procedure.
--5. Change the line "Alter database open" to 'Alter Database Open Resetlogs"
--6. Edit the clone init.ora and change the db_name parameter to match the new database name
--7. Start Server Manager
--8. Run the Control File trace script
--9. Perform a clean shutdown and backup.
-- You must always do a complete, closed database backup after every resetlogs. Otherwise, you
-- have no baseline to fall back on, or to which you can apply Redo Logs to achieve recovery.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|