Oracle Consulting Oracle Training Oracle Support Development
Home
Catalog
Oracle Books
SQL Server Books
IT Books
Job Interview Books
eBooks
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
image
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
 Phone
 800-766-1884
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books
image
image

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle

STATSPACK Viewer

Privacy Policy

 

 
 

RMAN Duplicate Changes db_name

Expert Oracle Tips by Laurent Schneider

January 14, 2011

RMAN Duplicate Changes db_name

NOTE: This only applies to version 11.2.0.1. According to Note 11063122, it is fixed in 11.2.0.2.

I was cloning a database last Friday, and I had a very serious issue with errors as weird as:

 ORA-00322: log name of thread num is not current copy.

After a clone from PROD to TEST, PROD crashed. I am not a virtualization fanatic, so both databases are located on the same server.  I was not concerned because  successful clones from PROD to TEST have been done by most of my dba readers.

 So, what changed in 11gR1 to cause this problem?

Incredibly, in 11gR1, RMAN issues the following statement before restore:

sql clone "alter system set  db_name = ''PROD'' ...
restore clone primary controlfile...

This is likely related to the capability of cloning a database without connecting to the target database. At the end of the clone, RMAN is setting the db_name back to TEST and recreating the TEST controlfile:

 sql statement: alter system set  db_name = ''TEST'' ...
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TEST" ...
...
LOGFILE GROUP 1 ('/.../TEST/redo1.dbf')...

So what is wrong with this? How is it possible for a clone from PROD to TEST screw up the production database???

Simple, the RMAN job did not complete:

  1.  set new name, restore PROD controlfile to TEST
  2. restore issue, for instance:
    ORA-19870: error while restoring backup piece archive1234
  3. RMAN-03002: failure of Duplicate Db command

At this point, the complete restore was finished.  We restored the missing archivelog, recovered and opened resetlog.

What happened then???

At this point, remember you still have the PROD controlfile and db_name, so by doing an ALTER resetlogs, the production redologs will get overwritten without notice!

This is a fairly important change that could really hurt if you are cloning two databases on the same server.

In case you are trying to save a failed database clone, make sure to check db_name and also v$logfile before doing an ALTER database resetlogs!!!

 
 
 
Get the Complete
Oracle Tuning Details 

The landmark book "Oracle Tuning: The Definitive Reference Second Edition" has been updated with over 1,150 pages of expert performance tuning tips. It's packed with scripts and tools to hypercharge Oracle 11g performance and you can buy it for 40% off directly from the publisher.
 

Download your Oracle scripts now:

www.oracle-script.com

The definitive Oracle Script collection for every Oracle professional DBA

 

 
   

 Copyright © 1996 -2017 by Burleson. All rights reserved.


Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks
 

 

Linux Oracle commands syntax poster

ION Oracle tuning software

Oracle data dictionary reference poster



Oracle Forum

BC Oracle consulting support training

BC remote Oracle DBA