Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-01103: database name 'PROD1' in control file is not 'PROD2'

864988Jul 18 2013 — edited Jul 19 2013

Dear Experts,

I am trying to use a full compressed backup of PROD1database to create a new database called PROD2 on the SAME host.

Both databases are using 11.2.0.2 version on Oracle Redhat 5.

1- I created pfile from source PROD1 database, and modified the following;

{code}

*.control_files='+prod2_DG/prod2/controlfile/control01.ctl'

*.db_create_file_dest='+prod2_DG'

*.db_name='prod2'

{code}

2- Started up no mount the prod2 database using the new pfile.

3- restore the controlfile from PROD1 backup;

restore controlfile from '/tmp/prod2/prod1_cntl_4ioet09f_1_1.bkp'

4- alter database mount give me the following error;

{code}

RMAN-00571: ===========================================================

RMAN-03002: failure of startup command at 07/18/2013 05:52:51

ORA-01103: database name 'PROD1' in control file is not 'PROD2'

{code}

I want to test the backup made on prod1 and same time have a new database prod2 on same host.

I also tried with SET DBID = <DBID_OF_PROD1> and it doesn't work!

How I can fix that?

Thanks and best regards

Comments

tsangsir

In pfile, set

*.db_name=prod1

*.db_unique_name=prod2

And you must be VERY careful when doing this kind of experience because you may easily mix up the files in your 2 databases.

Mahir M. Quluzade

Hi,

You  can restore database other directory with  same name .

After restoreation you can change with nid TARGET=sys/password@(New database Network Sevice Name) DBNAME=prod2_DG

Or you  can use RMAN DUPLICATE command for duplication new database.

Note : If you  want crerate standby  database, then you not need change database name. Need different db_unique_name for standby database

Regards

Mahir

864988

Hello,

I am not creating a standby database, I just want to test my backups on same host and at the same time create a new database with different name (prod2)

How can I achieve that?

SANCHITGUPTA

you are cloning your database with different name so you need to set the parameters in pfile. start your database with pfile in nomount state... and then run the below command.

rman > duplicate target database  to “prod2”  nofilenamecheck


pfile :

*.db_name=prod1

*.db_unique_name=prod2

Mahir M. Quluzade

Then you can use DUPLICATE Command written as SANCHITGUPTA.

or you can use NID tool for change database name

You  can use : http://gavinsoorma.com/2009/07/rman-duplicate-database-on-same-host/

tsangsir

As described above and below,

In pfile, set

*.db_name=prod1

*.db_unique_name=prod2

This should allow you to mount the restored controlfile.

Use 'set newname' to make RMAN restore datafiles to different location. Please check rman documentation.

Emphasis again, be careful not to overwrite files in prod1. Make sure to rename files in prod2 (datafiles, online redo logs, tempfiles)

EdStevens

Just to get very explicit about the danger of what you are doing.

The control file contains the fully qualified names of all of the data files to be opened.

So the control file for db1 will list file names like '/u01/oradata/db1/system01.dbf'

Now, you simply copy that control file to a different location and try to use it for db2.  Even if you use the hack to get around the database_name issue, that control file will still list '/u01/oradata/db1/system.dbf', which clearly does not belong to db2.  But when you open database db2, guess what?

Selvakumar.Nagulan

The scenario you are trying to undergo is cloning or duplicating a database. Please use the below link to achieve this.

Oracle tips and techs: Database cloning using RMAN DUPLICATE

Thank you!!

Hemant K Chitale

SET DBID or DB_NAME in the parameter file don't change the database name  that is in the control file.  At the point of restore, the control file still has the "prod1" database name.

With RMAN backups, you should consider using DUPLICATE DATABASE

http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmdupdb.htm#i1008564

Running a DUPLICATE Database on the same host as the source database is a risky operation.  Done incorrectly, you run the risk of overwriting the datafiles of the source database.  Since your source is a Production database, you run the risk of taking the production database down.  I suggest that you practice the steps on a non-production environment first.

Hemant K Chitale

mBk77

You need to recreate the controlfile..

Backup controlfile to trace and edit it and recreate the control file with the new database name .

or create a new control file

follow the link below

Creating Control Files

1 - 10
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 16 2013
Added on Jul 18 2013
10 comments
34,920 views