• No results found

HOT CLONING SERVER TO SERVER.pdf

N/A
N/A
Protected

Academic year: 2021

Share "HOT CLONING SERVER TO SERVER.pdf"

Copied!
19
0
0

Loading.... (view fulltext now)

Full text

(1)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

CLONING ORACLE DATABASE (DIFFERENT DIRECTORY STRUCTURE )

Database cloning is creating a Identical copy of existing database. It can be done on separate hosts or on the same host. This article is wished-for as a brief guide to clone Oracle database from one server to another server. I will show how to clone database using HOT backup. HOT cloning is very easier to clone by using OS commands. HOT cloning requires database recovery. To get insight about HOT BACKUP HIT HERE.

Source database name : sham on OEL5.SERVER1.COM Clone database name : rose on OEL5.SERVER2.COM SOURCE IP : 192.168.241.131  SERVER1

TARGET IP : 192.168.241.132  SERVER2

CHECKING IPADDRESS FOR SERVER1 & SERVER2

SERVER 1

(2)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

CHECK NETWORK AVAILABILITY BETWEEN TWO SERVERS SERVER 1

SERVER 2

CREATE DIRECTORIES FOR ADMIN LOG FILES $ mkdir –p /u01/app/oracle/admin/rose/ $ mkdir –p /u01/app/oracle/admin/rose/adump $ mkdir –p /u01/app/oracle/admin/rose/bdump $ mkdir –p /u01/app/oracle/admin/rose/cdump $ mkdir –p /u01/app/oracle/admin/rose/udump

CREATE DIRECTORIES FOR CRD FILES AND ARCHIVELOGS

$ mkdir –p /u01/app/oracle/oradata/rose

(3)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

CREATING NECESSARY DIRECTORIES FOR CLONE DATABASE

(4)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

COPYING PFILE FROM SEVER1 TO SERVER2

(5)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

CHECKING ARCHIVELOGS DETAILS

(6)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

COPYING *.dbf FILES TO CLONE SERVER

(7)
(8)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

CHECKING FRA FOR SOURCE DATABASE

COPYING ALL ARCHIVES FROM SOURCE TO DESTINATION

(9)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

CHECKING TARGET SERVER

CREATING CONTROLFILE SCRIPT

The word 'REUSE' needs to be changed to 'SET'. The database name needs setting to the new database name (if it is being changed). You can decide whether the database will be put into archivelog mode or not.

Remove any lines that start with -- Remove any lines that start with a #

Remove any blank lines in the 'CREATE CONTROLFILE' section. Remove the line 'RECOVER DATABASE USING BACKUP CONTROLFILE' Remove the line 'ALTER DATABASE OPEN RESETLOGS;’

$ ls -l /home/oracle/trace.sql

(10)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

NEWLY CREATED PFILE FOR CLONE DATABASE

I am using pfile, I have placed initrose.ora file under $ORACLE_HOME/dbs directory. According to clone database, i made some changes related to clone database in init.ora file. ( Location of control file path, audit_file_dest, background_dump_dest core_dump_dest, user_dump_dest, db_name , etc ).

$ cd /u01/app/oracle/product/10.2.0/db_1/dbs/ [oracle@oel5 dbs] $ ls -l initrose.ora

-rwxrwxr-x 1 oracle oinstall 1038 Oct 27 18:08 initrose.ora

$ cd /u01/app/oracle/oradata/hotbkp $ cp * /u01/app/oracle/oradata/rose/

(11)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

PHYSICAL DATAFILES IN CLONE SERVER

STARTING CLONE DATABASE & RECREATING CONTROL FILE

(12)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

APPLYING REQUIRED ARCHIVED LOGS

APPLYING SEQUNCE - 4

(13)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

APPLYING SEQUNCE 7 & SEQUENCE 8

(14)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

HOT CLONING ( SAME DIRECTORY STRUCTURE ) Source database name : sham

Clone database name : rose

To maintain Admin related files

Source database path=/u01/app/oracle/admin/sham/ Clone database path=/u01/app/oracle/admin/sham/

To maintain Physical files

Source database path=/u01/app/oracle/oradata/sham/ Clone database path=/u01/app/oracle/oradata/sham/ SOURCE IP : 192.168.241.131  SERVER1

TARGET IP : 192.168.241.132  SERVER2

Source database name : sham on OEL5.SERVER1.COM Clone database name : sham on OEL5.SERVER2.COM

HOT backup cloning, in same directory structure is almost similar to different directory structure. What we have seen above.

Few changes are required. They are NOT required to recreate controlfile for clone database. We can copy all controlfiles from source server to clone server ( along with datafiles and all required archives).

STEPS TO PERFORM HOT CLONING (SAME DIRECTORY STRUCTURE)

Create same directory structure in clone server.

Create pfile from spfile in source server and copy to clone server. Put source database in ‘begin backup mode’.

Copy *.dbf files to clone sever from source server. Release source database from begin backup mode.

Make log switches to get current archives in FRA for recovery purpose. Copy *.ctl files to clone sever from source server.

(15)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

CREATING DIRECTORIES FOR C/R/D FILES

PUTTING SOURCE DATABASE IN BEGIN BACKUP MODE

(16)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

COPYING *.dbf FILES TO CLONE SERVER

(17)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

RELEASING SOURCE DATABASE FROM BEGIN BACKUP MODE

COPYING ALL CONTROL FILES TO CLONE SERVER

(18)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

STARTUP CLONE DATABASE

SYS>recover database using backup controlfile until cancel;

ORA-00279: change 390017 generated at 11/05/2014 16:16:45 needed for thread 1 ORA-00289: suggestion:

/u01/app/oracle/flash_recovery_area/SHAM/archivelog/2014_11_05/o1_mf_1_1_b5n0l6f2_.arc ORA-00280: change 390017 for thread 1 is in sequence #1

Specify log: {<RET>=suggested | filename | AUTO | CANCEL} auto

ORA-00279: change 395354 generated at 11/05/2014 16:26:04 needed for thread 1 ORA-00289: suggestion :

/u01/app/oracle/flash_recovery_area/SHAM/archivelog/2014_11_05/o1_mf_1_2_b5n0lnrr_.arc ORA-00280: change 395354 for thread 1 is in sequence #2

ORA-00278: log file

'/u01/app/oracle/flash_recovery_area/SHAM/archivelog/2014_11_05/o1_mf_1_1_b5n0l6f2_.arc' no longer needed for this recovery

.. ...

[Trimmed]

ORA-00279: change 396250 generated at 11/05/2014 16:26:19 needed for thread 1 ORA-00289: suggestion:

/u01/app/oracle/flash_recovery_area/SHAM/archivelog/2014_11_05/o1_mf_1_3_b5n0ntjc_.arc ORA-00279: change 407663 generated at 11/05/2014 16:45:37 needed for thread 1

ORA-00289: suggestion:

/u01/app/oracle/flash_recovery_area/SHAM/archivelog/2014_11_05/o1_mf_1_11_%u_.arc ORA-00280: change 407663 for thread 1 is in sequence #11

ORA-00278: log file

'/u01/app/oracle/flash_recovery_area/SHAM/archivelog/2014_11_05/o1_mf_1_10_b5n1psc0_.arc' no longer needed for this recovery

(19)

Exploring the Oracle DBA Technology by

Gunasekaran , Thiyagu

ORA-00308: cannot open archived log

'/u01/app/oracle/flash_recovery_area/SHAM/archivelog/2014_11_05/o1_mf_1_11_%u_.arc' ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory Additional information: 3

SQL> alter database open resetlogs; Database altered.

References

Related documents

The analysis has shown that access to credit, level of education, access to location, access to market, interest rate perception, investment information, tax rate and

A closed database (cold) backup is an operating system backup of all data files, control files, redo log files, parameter files, and the password file that constitute an

The SGA is a read/write memory area that stores information shared by all database processes and by all users of the database (sometimes it is called the Shared Global Area ).. o

In Oracle SPARC SuperCluster environments, database backups are performed by Oracle RMAN handing backup data to the Oracle Secure Backup software on the media server, which then

set of all relevant POIs POI clustering set of clusters cluster path gener- ation cluster paths POI selection set of selected POIs Hamiltonian path generation itinerary.. Figure

If you have no or a very low security policy and do not mind that a service provider asks you to open up certain ports in your firewall, then you may consider the far-end NAT

Configure a Linux system for the Oracle boot script Clone a virtual server. Silently install Oracle database Software as a Service for Oracle

The storage-based replication (hot backup mode) of an Oracle single-instance database on a Celerra NS-480 storage array was to demonstrate that the Oracle 11g database