Just Clone Database – CREATE CONTROLFILE SET DATABASE


Just some idea, But It’s great for cloned database. You can read on Super fast Database Copying/Cloning Oracle Tips by Burleson Consulting.
This is idea for using CREATE CONTROLFILE SET DATABASE “NEW_DATABASE_NAME” RESETLOGS
Why I use it? because I use Oracle 9i (Don’t ask, why don’t I upgrade?) and No Archive Mode.

First step this , create controlfile to trace.

SQL> alter database backup controlfile to trace as ‘/tmp/ctrl.trc’;

Check in ‘/tmp/ctrl.trc’ file.

CREATE CONTROLFILE REUSE DATABASE “ORCL” NORESETLOGS NOARCHIVELOG
MAXLOGFILES 255
MAXLOGMEMBERS 2
MAXDATAFILES 256
MAXINSTANCES 1
MAXLOGHISTORY 1134
LOGFILE
GROUP 1 ‘/oradata/ORCL/redo11.log’ SIZE 20M,
GROUP 2 ‘/oradata/ORCL/redo21.log’ SIZE 20M
DATAFILE
‘/oradata/ORCL/system.dbf’,
‘/oradata/ORCL/undo.dbf’,
‘/oradata/ORCL/data01.dbf’,
‘/oradata/ORCL/index01.dbf’
CHARACTER SET US7ASCII
;

Change:

CREATE CONTROLFILE REUSE DATABASE “ORCL” NORESETLOGS

TO

CREATE CONTROLFILE SET DATABASE “NEW_ORCL” RESETLOGS

I don’t want to write How to success for cloned database from this idea. I mean… about
– Copy cold backup files to (new server).
– Change database files + folder names blah blah…
– Create, Modify and Check initNEW_ORCL.ora, orapwNEW_ORCL files.
– Check control_files parameter and then move/remove control files before clone database.
– set ORACLE_SID=NEW_ORCL

I just inform by using CREATE CONTROLFILE SET DATABASE “NEW_DATABASE_NAME” RESETLOGS
OK.. then new script:

STARTUP NOMOUNT

CREATE CONTROLFILE SET DATABASE “NEW_ORCL” RESETLOGS NOARCHIVELOG
MAXLOGFILES 255
MAXLOGMEMBERS 2
MAXDATAFILES 256
MAXINSTANCES 1
MAXLOGHISTORY 1134
LOGFILE
GROUP 1 ‘/oradata/NEW_ORCL/redo11.log’ SIZE 20M,
GROUP 2 ‘/oradata/NEW_ORCL/redo21.log’ SIZE 20M
DATAFILE
‘/oradata/NEW_ORCL/system.dbf’,
‘/oradata/NEW_ORCL/undo.dbf’,
‘/oradata/NEW_ORCL/data01.dbf’,
‘/oradata/NEW_ORCL/index01.dbf’
CHARACTER SET US7ASCII
;

ALTER DATABASE OPEN RESETLOGS;

Don’t forgot to create Temporary Tablespace, After open Database.

 

Source Knowledge : http://surachartopun.com/2011/06/just-clone-database-create-controlfile.html
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s