Wednesday, September 18, 2013

DB_NAME vs DB_UNIQUE_NAME????

Got puzzled over db_name vs db_unique_name while creating a standby database on same physical host.

A great explanation from Hemant K Chitale in Oracle Formus on this:

Instances are distinguished by SID. Thus, two instances, particularly if running from the same ORACLE_HOME, have to have different SIDs if on the same server. However, Oracle has an additional check on DB_NAME as well. Two instances cannot have the same DB_NAME unless DB_UNIQUE_NAME is specified.

DB_NAME is always the same when you create a Physical Standby. You can't change the DB_NAME -- if you change the value in the init/spfile parameter file, a startup will error out because it checks the DB_NAME with that in the DataFile Headers. Since the DataFiles of a Physical Standby are a physical clone of the primary, the DB_NAME has to be the same. (the same applies for DBID -- the DBID of the Primary and the Standby are the same and that is why you have to be careful about using a common RMAN Repository for both databases -- there are MetaLink notes about how to do Standby Backups).

DB_UNIQUE_NAME doesn't get stored in the DataFile headers.


DB_NAME must be the same.

DB_UNIQUE_NAME must be configured if both the Primary and Secondary are running on the same host (in the same DB_DOMAIN). In this case, the DB_UNIQUE_NAME must be set on the Secondary to a value other than the DB_NAME.
If both the instances are on separate servers, DB_UNIQUE_NAME need not be configured (although it can be set).

(Pre-10g, the parameter LOCK_NAME_SPACE was used, DB_UNIQUE_NAME was introduced in 10g)

And to create a standby on same machine useful link from Anuj Singh
http://anuj-singh.blogspot.in/2009/10/creating-physical-standby-database-on_16.html
 

No comments:

Post a Comment