Home » RDBMS Server » Server Administration » How to recreate control file
How to recreate control file [message #235087] Fri, 04 May 2007 01:03 Go to next message
gajini
Messages: 262
Registered: January 2006
Senior Member
Hi,

I tried to clone the database,for that I copied all the datafiles,
redo log files,control files from database DB1 to database DB2.
When I try to recreate the controlfile of DB2 using,

CREATE CONTROLFILE SET DATABASE "DB2" RESETLOGS NOARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXDATAFILES 254
MAXINSTANCES 8
MAXLOGHISTORY 16336
LOGFILE
GROUP 1('/oradata/admin/redo01a.log',
'/oradata/admin/redo01b.log') SIZE 10M,
GROUP 2('/oradata/admin/redo02a.log',
'/oradata/admin/redo02b.log') SIZE 10M
DATAFILE
'/oradata/data/system01.dbf',
'/oradata/data/undotbs01.dbf',
'/oradata/data/data01.dbf',
'/oradata/data/data02.dbf'
CHARACTER SET US7ASCII
;


it gave the following error,

CREATE CONTROLFILE SET DATABASE "DB2" RESETLOGS NOARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-00200: controlfile could not be created
ORA-00202: controlfile: '/oradata/admin/control1.ctl'
ORA-27038: skgfrcre: file exists


I tried to recreate the controlfile using REUSE option,

CREATE CONTROLFILE REUSE DATABASE "DB2" RESETLOGS NOARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXDATAFILES 254
MAXINSTANCES 8
MAXLOGHISTORY 16336
LOGFILE
GROUP 1('/oradata/admin/redo01a.log',
'/oradata/admin/redo01b.log') SIZE 10M,
GROUP 2('/oradata/admin/redo02a.log',
'/oradata/admin/redo02b.log') SIZE 10M
DATAFILE
'/oradata/data/system01.dbf',
'/oradata/data/undotbs01.dbf',
'/oradata/data/data01.dbf',
'/oradata/data/data02.dbf'
CHARACTER SET US7ASCII
;


but it results in the following error,

CREATE CONTROLFILE REUSE DATABASE "DB2" RESETLOGS NOARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01161: database name DB1 in file header does not match given name of DB2
ORA-01110: data file 1: '/oradata/data/system01.dbf'


How to resolve this error to recreate the controlfile successfully?

Thanks...

[Updated on: Fri, 04 May 2007 01:18]

Report message to a moderator

Re: How to recreate control file [message #235088 is a reply to message #235087] Fri, 04 May 2007 01:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68686
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use nid utility.
> nid help=y

DBNEWID: Release 10.2.0.2.0 - Production on Fri May 4 08:10:05 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Keyword     Description                    (Default)
----------------------------------------------------
TARGET      Username/Password              (NONE)
DBNAME      New database name              (NONE)
LOGFILE     Output Log                     (NONE)
REVERT      Revert failed change           NO
SETNAME     Set a new database name only   NO
APPEND      Append to output log           NO
HELP        Displays these messages        NO

And also DBNEWID Utility

Regards
Michel
Re: How to recreate control file [message #235091 is a reply to message #235087] Fri, 04 May 2007 01:16 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Self explanative.
>>ORA-27038: skgfrcre: file exists
You are trying to create new control. Oracle finds one already in the said location(identified by control_files in your initsid.ora). So it is failing.
Remove the files and try again.

Second case:
You are trying to reuse the existing controlfiles.
the database name that is recorded in control file is not the same you are using (new dbname).

And Michel was faster Smile

[Updated on: Fri, 04 May 2007 01:17]

Report message to a moderator

Previous Topic: Import Specific Tables with Batch
Next Topic: Slow performance
Goto Forum:
  


Current Time: Fri Sep 20 04:51:03 CDT 2024