cancel
Showing results for 
Search instead for 
Did you mean: 

Reload controlfile from file command???

Former Member
0 Kudos

Yesterday we restored our production system by brrestore to a training environment. An external consultant helped us on this action the restore is OK now and yesterday we changed the the names of the controlfiles and build a new control txt file.

I would like to start the database now and load the new control files from the build control txt file

I can 't seem to find the right command.

It should be alter database set controlfile.......

Can anyone tell me how I can point to the new source file for controlfiles.

Kind regards,

Leo

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello,

Thank you for the information I got the control files recovered from the txt file your help was very useful.

Kind regards,

Leo

former_member524429
Active Contributor
0 Kudos

HI,

As already suggested by Stefan, you can generate readable control file.

Following changes you will have to do in that generated/readable Control file before applying/generating onto your Training Server DB.

Open that readable control file with editor, and do the following...

->

Rename that file name as CONTROL.SQL

->

Remove all lines before "STARTUP MOUNT" line. Delete all commented "#" lines. Also

remove all lines after CHARACTER SET WE8DEC;" line.

->

Change all Source SID's to Target SID if its required.

->

Change the line

CREATE CONTROLFILE REUSE DATABASE u2018SSIDu2019 NORESETLOGS ARCHIVELOG;

as follow

CREATE CONTROLFILE REUSE SET DATABASE u2018TSIDu2019 RESETLOGS ARCHIVELOG;

->

If you want to change datafile or redolog file destinations, first move the files on target destination (on you training server) at OS level, then edit CONTROL.SQL file for new destinations.

Now after doing all above required corrections, you can create control files on ur training sever database, by executing following commands.

# su u2013 ora<SID>
# svrmgrl
SVRMGR> connect internal
SVRMGR> @/<path_to_file>/control.sql

Make sure the execution of above command complete with success.

After crating control files, your DB will be in inconsistent state. So it will demand Recovery using that backup control file. The recovery will be performed with "recover database using backup controlfile (until cancel);" statement. Please refer this useful guide "[System Copy-Using-Oracle DB Restore|http://www.basisconsultant.com/component/remository/Sytem-Copy-Guides/Homogeneous-System-Copy-using-OnlineandOffline-Backup/]" to get more detailed information.

Regards

Bhavik G. Shroff

Edited by: Bhavik G. Shroff on Feb 28, 2010 9:08 PM

stefan_koehler
Active Contributor
0 Kudos

Hello Leo,

> I would like to start the database now and load the new control files from the build control txt file

I think you mean the output of the SQL command "alter database backup controlfile to trace" as the "control txt file".

The original control file is a small binary file that records the physical structure of the database (and some other information). The command "alter database backup controlfile to trace" creates a readable file, that helps you to recreate that binary file. (in detail it only contains the two different SQL commands for creating a new binary file).

But you can not use that readable file as a control file.

By the way .. just keep in mind that you also loose information, if you recreate the binary control file with the help of that text file.

Regards

Stefan