DB Cloning

Published on October 2021 | Categories: Documents | Downloads: 1 | Comments: 0 | Views: 31
of 3
Download PDF   Embed   Report

Comments

Content

 

What is Cloning? Database Cloning is a procedure that can be used to create an identical copy of the existing Oracle database. DBA’s sometimes need to clone databases to test backup and recovery strategies or export a table that was dropped from the production database and import it back into the production database. Cloning can be done on separate hosts or on the same host and is different from standby database. Reason for Cloning In every oracle development and production environment there will become the need to to transport the entire database from one physical machine to another. This copy may be used for development, production testing, beta testing, etc, but rest assured that this need will arise and management will ask you to perform this task quickly. Listed below are the most typical uses: Relocating an Oracle database to another machine. Moving Oracle database to new Storage media. Renaming Oracle database. Database Cloning can be done using the following methods, Cold Cloning Hot Cloning RMAN Cloning Here is a brief explanation how to perform cloning in all these three methods METHOD 1: COLD CLONING Cold Cloning is one the reliable methods that is done using the Cold Backup. The drawback of this method is that the database has to be b e shutdown while taking the cold backup. Considerations: Source Database Name: RIS Clone Database Name: RISCLON Source Database physical files path=/u01/RIS/oradata Cloned Database physical files path=/u02/RISCLON/oradata Steps to be followed: Startup the source database (if not open) $ export ORACLE_SID=RIS $ sqlplus / as sysdba SQL> startup Find out the SQL> select SQL> select SQL> select

path and names of datafiles, control files, and redo log files. name from v$datafile; member from v$logfile; name from v$controlfile;

Take the control file backup. SQL> alter database backup controlfile to trace; Parameter file backup. If ‘RIS’ database is using spfile,  spfile,   SQL> create pfile=‟/u02/RISCLON/initRISCLON.ora‟ pfile=‟/u02/RISCLON/initRISCLON.ora‟ from spfile;  spfile;  If database is using pfile, use OS command to copy the pfile to a backup location. l ocation.

 

Shutdown the ‘RIS’ database  database  SQL> shutdown Copy all data files, control files, and redo log l og files of ‘RIS’ database to a target database location. $ mkdir /u02/RISCLON/oradata $ cp /u01/RIS/oradata/* /u02/RISCLON/oradata/  /u02/RISCLON/oradata/   Create appropriate directory structure in clone database for dumps and specify them iin n the parameter file. $ mkdir -p /u02/RISCLON/{bdump,udump} Edit the clone database parameter file and make necessary changes to the clone database $ cd /u02/RISCLON/ $ vi initRISCLON.ora db_name=RISCLON control_files=/u02/RISCLON/oradata/cntrl01.ctl background_dump_dest=/u02/RISCLON/bdump user_dump_dest=/u02/RISCLON/udump ... ... :wq! Startup the clone database in NOMOUNT stage. $ export ORACLE_SID=RISCLON SQL> startup nomount pfile=‟/u02/RISCLON/initRISCLON pfile=‟/u02/RISCLON/initRISCLON.ora‟ .ora‟   Create the control file trace for the clone database using the trace control file and specify the appropriate paths for redolog and datafiles. CREATE CONTROLFILE SET DATABASE “RISCLON” “R ISCLON” RESETLOGS ARCHIVELOG  ARCHIVELOG  MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 „/u02/RISCLON/oradata/redo01.log‟ „/u02/RISCLON/oradata/redo01.log‟ SIZE 5M,  5M,   GROUP 2 „/u02/RISCLON/oradata/redo02.log‟ „/u02/RISCLON/oradata/redo02.log‟ SIZE 5M,  5M,   DATAFILE „/u02/RISCLON/oradata/system01.dbf‟,   „/u02/RISCLON/oradata/system01.dbf‟, „/u02/RISCLON/oradata/undotbs01.dbf‟,   „/u02/RISCLON/oradata/undotbs01.dbf‟, „/u02/RISCLON/oradata/sysaux01.dbf‟,   „/u02/RISCLON/oradata/sysaux01.dbf‟, „/u02/RISCLON/oradata/users01.dbf‟,   „/u02/RISCLON/oradata/users01.dbf‟, „/u02/RISCLON/oradata/example01.dbf‟   „/u02/RISCLON/oradata/example01.dbf‟ CHARACTER SET AL32UTF8 Create the control file by running from the trace path SQL> @u01/RIS/source/udump/cntrl.sql Once the control file’s successfully created, open the database with resetlogs option. option.  

 

  SQL> alter database open resetlogs;

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close