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

Home -> Community -> Usenet -> c.d.o.server -> Re: Cloning an Oracle instance

Re: Cloning an Oracle instance

From: <pamdba_at_my-deja.com>
Date: Fri, 10 Sep 1999 15:58:54 GMT
Message-ID: <7rb9rm$gtk$1@nnrp1.deja.com>


In article <01befa56$c5b8b2e0$d8b44f0c_at_liznet.bcgroup.com>,   "Lizzie" <GreenRaven_at_worldnet.spamless.att.net> wrote:
> Hi - I need to clone an Oracle instance to another, and never having
done
> this before wanted to bounce my ideas off you guys first to see if
you had
> any recommendations about what to do or not do!
>
> I need to migrate all the objects from this instance, including
packages,
> package bodies, views, etc.
> I'm planning on using Export (does Export do packages?) , but not
with a
> "full" option because I want to put the objects in the tablespaces
> belonging to the new instance, which will be in different
directories.
> I was planning on creating an empty new instance first, with all
needed
> files, then importing the stuff in. I need to retain the data in
some but
> not all of the tables, so was planning on taking it all and then
truncating
> what I didn't need later.
> We're doing this to create a few more test databases for a product
we're
> installing. Unfortunately the install process was so squirrely that I
can't
> just install fresh, as there is no real good "canned" install process
to
> follow. The vendor put on patch after patch after patch after the base
> install scripts were run. Ugh....
>
> Any ideas, warnings, etc that you have would be greatly
appreciated.....
> Hi

Here is a way to clone your database that is much faster and cleaner than exp/imp you can place your datafiles on any disk or remove tablespace or datafiles you know are not used or Rename the database. You can do it from tape it hot backup with the database in archive mode.

Steps

  1. Choose the physical layout of the database datafiles & that you have the need space.
  2. Update the init.ora and config.ora files that is if you use both. change the logs if location it is different the database name and many memory parameters if the box is smaller.
  3. Grerate control file script. You can do this from the database you are cloning with the command: ALTER DATABASE BACKUP CONTROLFILE TO TRACE; the script generated by the command can be found in the location specified by background _dump_dest parameter. rename the file exp. (control.sql)
  4. Edit the control file script Delete everything accept the create controlfile statement from the control.sql remove all occurrences of Reuse in the control.sql The Reuse option grants Oracle an authorization to overwrite any existing files of the same size. Replace NORESTLOGS with RESETLOGS. Replace the database name if needed and add reuse set.

  Replace the paths names of all the datafiles & logfiles with the new path names if needed.

CREATE CONTROLFILE reuse set DATABASE "FINP" resetlogs ARCHIVELOG

    MAXLOGFILES 64
    MAXLOGMEMBERS 5
    MAXDATAFILES 1022
    MAXINSTANCES 10
    MAXLOGHISTORY 1000
LOGFILE 5. Restore the datafiles from tape or from the database shutdown or in

   hot backup mode with the database in archiving mode.

6. If you are cloning from production in hot backup mode. After you have moved the lasted datafiles and taking the database out of hot backup up do the following.

  1. alter system checkpoint;
  2. alter system switch logfile;
  3. Move over all but the current archive log. If you do not the database will ask for log after log.

******Rememeber to setup the environment of the database**********

7. Create Control file

   commands:

A. svrmgrl
B. startup nomount;
C. @control.sql
D. alter database open resetlogs;

**********You will get an error like
ORA-01195 online backup of file needs more recovery to be consistent ORA-01110 data file 1; '/u01/oradata/finp/system.dbf'

E. recover database using backup controlfile until cancel;

alter all the archived logs have been applied.

F. alter database open resetlogs.

I hope this is helpful.

Pamela.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Fri Sep 10 1999 - 10:58:54 CDT

Original text of this message

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