Re: newbie tablespace coyp question

From: osy45 <member18536_at_dbforums.com>
Date: Mon, 14 Apr 2003 15:48:33 +0000
Message-ID: <2765157.1050335313_at_dbforums.com>


that's what I figured out so fare can be done to clone a db

exp/imp is the easiest but for large volumes of data it is no the best way to do it:

 database cloning

  A little bit depends on how big your database is and how long you   have
access to it.
  Say the database is small and you have plenty of time of   exclusive use
then you could look at export and import   but of course you have to create the clone before importing.   An old favourite is to copy the datafiles from the Prod to the other server (you maybe able to use a backup tape)   then rebuild the controlfile.

  Heres the steps (it says svrmgrl but of course this is now gone in latter versions of Oracle)

  Description Need to create a duplicate database on the same machine   ?
Database too big to use Export/Import ?
  This is the easiest way to do it.

  Assume the original database is called PROD1 and you want to create a CLONE1 duplicate database.

  Procedure

  • Find some disk space and create appropriate directories / file systems for you cloned database (conforming to the OFA guidelines)
  • Connect to the PROD1 instance and dump the controlfile using the SQL command

  ALTER DATABASE BACKUP CONTROLFILE TO TRACE;   This will put a text copy of the controlfile in the USER_DUMP_DEST

  • Shutdown Normal PROD1 database
  • Perform an operating system copy of PROD1 to the new location where CLONE1 will reside.
  • Startup the PROD1 instance
  • Edit the controlfile you created and change all the path names of the database to the new location.
  • Set your environment to the CLONE1 instance and run Server Manager (svrmgrl)

  CONNECT INTERNAL
  STARTUP NOMOUNT   CREATE CONTROLFILE REUSE SET DATABASE "CLONE1" RESETLOGS NOARCHIVELOG   MAXLOGFILES 32
  MAXLOGMEMBERS 2
  MAXDATAFILES 64
  MAXINSTANCES 8
  MAXLOGHISTORY 800
  LOGFILE

  GROUP 1 '/oracle/data/CLONE1/redos/log1CLONE1.dbf' SIZE 512K,
  GROUP 2 '/oracle/data/CLONE1/redos/log2CLONE1.dbf' SIZE 512K,
  GROUP 3 '/oracle/data/CLONE1/redos/log3CLONE1.dbf' SIZE 512K
  DATAFILE
  '/oracle/data/CLONE1/system_ts/systCLONE1.dbf' SIZE 25M,
  '/oracle/data/CLONE1/data_ts/data_CLONE1.dbf' SIZE 230M,
  '/oracle/data/CLONE1/index_ts/index_CLONE1.dbf' SIZE 230M,
  '/oracle/data/CLONE1/rbs_ts/rbs_CLONE1.dbf' SIZE 10M,
  '/oracle/data/CLONE1/temp_ts/temp_CLONE1.dbf' SIZE 10M,
  '/oracle/data/CLONE1/tools_ts/ts_tools_CLONE1_02.dbf' SIZE 15M,
  '/oracle/data/CLONE1/users_ts/ts_users_CLONE1.dbf' SIZE 1M  ;

  ALTER DATABASE OPEN RESETLOGS;

  • That's it, an exact duplicate of PROD1 and a painless procedure

  You could also use transportable tablespaces as long as the server hosting the clone is the same platform as the original etc etc

--
Posted via http://dbforums.com
Received on Mon Apr 14 2003 - 17:48:33 CEST

Original text of this message