Quantcast
Channel: Oracle DBA - RajaBaskar Blog
Viewing all articles
Browse latest Browse all 25

Database cloning using physical dataguard database data

$
0
0
 Normally everyone have done several database cloning, this one is somewhat different  and new approach I have followed based on the necessity. I would like to share with you all.

Database architecture:

§  Both source and its DR running on different data center.
§  create the new database on server 2 using source1 database data.


Pre-requisite:

·         Primary database(Source1) total size is ~ 1.8 TB and used space 1.0 TB
·         In  target server I have only ~ 900 GB spaces available.

    I had no enough storage space on target server (server2) for database cloning and i can't wait for storage.

To reduce the Database size:

I had planning to resize the data files which is having free space on source1 database(server 1)

1.     Resized the data file and freed up the space on source database (source1) and reclaimed the 500 GB spaces
2.     The same space was claimed  on target server DR database (source1-DR database: server2)
3.     Current source1 database  total size is 1.3 TB and target server having 1.4 TB free space.

If I  used RMAN backup, I don’t have space to keep the backup on target server (server 2) or If I copy the data files  around ~2 TB across the server with different data  center using RMAN active database cloning will be difficult (from server 1  to server 2).

So I have decided to clone the database using DR database data which is running on source2 server. Our requirement also to create the new database on same
server(server 2). Using OS copy command to copied the datafiles and created the database within short time and no need any file system for this database cloning.

High level plan:

1.     SOURCE1 PRIMARY database force logging enabled – Checked and looks good
2.     Validate the datafiles on SOURCE1-DR  database using RMAN Validate command (Make sure there is no block corruption on SOURCE1 DR database)
3.     Disable the archive purge cronjob on both SOURCE1 and SOURCE1-DR databases
4.     Stop the MRP process on SOURCE1-DR databases  for database consistency. (SCN Should not be changed)

                        alter database recover managed standby database cancel;

                        $ ps -ef|grep mrp

                        oracle 13763     1   0   Mar 10 ?         104:06 ora_mrp0_SOURCE1

5.     Install Separate ORACLE_HOME for new database
6.     Create parameter and  respective directory for new database.
7.     Using OS copy command to copy the datafiles from SOURCE1 –DR database to new database datafiles location.
8.     Once I copied the datafiles, I can start up the database in NOMOUNT stage.
9.     Create the control files for new databases using SOURCE1-DR database control file trace.
10.  Recovering the new database using the  archive logs whatever generated on SOURCE1 PRIMARY after I stopped the MRP process on SOURCE1-DR database.
11.  Ensure the SCN timestamp is same on all the datafiles of the new database
12.  Open the new database in READ WRITE mode
13.  Start the MRP processes on SOURCE1-DR database

                        alter database recover managed standby database disconnect from session;

14.  Shutdown the NEW database
15.  Using NID, I can change the DBID for new database.
16.  Start the database

I Hope this article helped you. Suggestions are welcome.
Thanks !!!

Viewing all articles
Browse latest Browse all 25

Trending Articles