Backed up control file to trace ... n
After restoring a test base from production we had to use the control file from the production database.
We issued alter database backup control file to trace and then changed some parameters.
Then this was saved (I think) as a .ctl file.
We then (I think) ran this script in sqlplus.
Im not entirely sure about this process. LIke most things the concept is much clearer than the practice.
I just need to clarify how we get from the trace file to actually using that as the control file in the target database.
Many thanks!
DJ
What you generate withe the ALTER DATABASE BACKUP CONTROLFILE TO TRACE command is a script to create the control file, this file is generated at the path defined by the user_dump_dest, and the filename has the oracle process id related to the one who processed the command.
If you take a look at the contents of the file what you will find is a CREATE CONTROLFILE command. The process to get from here to the actual binary file, is just to run this command and let the database create the binary controlfile. This file is not a pure sql file, this file contains information, comments and actually two scripts, one for the ARCHIVELOG and the other for the NOARCHIVELOG case, so you have to do some prior editing tasks before you are able to actually run it.
~ Madrid
Similar Messages
-
Backing up control file to trace
Hi blokes,
I been trying to include a copy of my controlfile scripts in my hot backup. i.e
"ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS ' /PATH/CONTROL.TXT" It worked for every database except the oracle8i databases.
I would appreciate if someone could let me know if it is not supported in oracle8i
Regards..
Shebby.backup controlfile to trace; this will create a trace file in your udump folder.
Your other option is you can use the following sql to restore the controlfile from your backup set. I've used this on 8i.
DECLARE
v_dev varchar2(50); -- device type allocated for restore
v_done boolean; -- has the controlfile been fully extracted yet
type t_fileTable is table of varchar2(255)
index by binary_integer;
v_fileTable t_fileTable; -- Stores the backuppiece names
v_maxPieces number:=1; -- Number of backuppieces in backupset
BEGIN
-- Initialise the filetable & number of backup pieces in the backupset
-- This section of code MUST be edited to reflect the customer's available
-- backupset before the procedure is compiled and run. In this example, the
-- backupset consists of 4 pieces:
v_fileTable(1):='/yourbackuploc/prod_l8imjqop_1_1704';
-- Allocate a device. In this example, I have specified 'sbt_tape' as I am
-- reading backuppieces from the media manager. If the backuppiece is on disk,
-- specify type=>null
v_dev:=sys.dbms_backup_restore.deviceAllocate(type=>'', ident=>'d1');
-- Begin the restore conversation
sys.dbms_backup_restore.restoreSetDatafile;
-- Specify where the controlfile is to be recreated
sys.dbms_backup_restore.restoreControlfileTo(cfname=>'/location/yourcontrolfile.ctl');
-- Restore the controlfile
FOR i IN 1..v_maxPieces LOOP
sys.dbms_backup_restore.restoreBackupPiece(done=>v_done,handle=>v_fileTable(i), params=>null);
IF v_done THEN
GOTO all_done;
END IF;
END LOOP;
<<all_done>>
-- Deallocate the device
sys.dbms_backup_restore.deviceDeallocate;
END;
/ -
Backup control file to trace failing with ORAORA-01116
Hi,
backup failing on 10.2 version as includes a backup controlfile command. This falls over with
unable to open file /u10/oradata/TISD/temp101.dbf
Now, there is a tempfile there, temp01.dbf.
Why is the temp101.dbf being looked for?
How can I proceed from this ?
As it doenst exist, I am tempted to create it; but why is it temp101? (and not something like temp02)
Thanks,
DA
Edited by: Dan A on Jul 16, 2009 4:31 AMThis turned out to be a case of a user playing around with the temp tablespace and not dropping original correctly. In teh end I dropped the tablasepace with everyting in it.
Thanks to all.
DA -
Creation of control file in Oracle 10g
Hi,
I had taken the backup of control file(backup control file to trace) and edited it to change the new location of the datafile.But when i try to create the Control file(Startup nomount,@cntrl.sql) it fails with the following error
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01276: Cannot add file
/oracle/DBS/redolog/DBS/controlfile/o1_mf_2s4ho2n8_.ctl. File has an Oracle
Managed Files file name.
how can i recreate it?
Regards,
CherryHI,
what are you actually trying to do...
relocation of datafile or control file.
if you want to relocation of data file then go through below link
http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b10739/dfiles.htm#i1006457
ORA-01276
http://www.idevelopment.info/data/Oracle/DBA_tips/Tablespaces/TBS_8.shtml
hope this helps
Taj -
Maybe it's because I've never looked before, but I have never before noticed a database which has been started with a pfile containing
"db_files = 80"
and yet displays
"MAXDATAFILES 30"
when I dump the control file to trace.
Views? and thanks up frontMaybe it's because I've never looked before, but I have never before noticed a database which has been started with a pfile containing
"db_files = 80"
and yet displays
"MAXDATAFILES 30"
when I dump the control file to trace.
Views? and thanks up front -
Lost all Control files (Want to Recover)
Hi
I have a database in archive log mode and we take a rman hot backup everyday. We are not using the recovery catalog. I lost all the control files
few days ago. I have a control file to trace and that was generated 20 days ago. This is our test database. I want to recover it. I don't know if we have
done any physical changes or not after the creation of this text file to create a control file. Database is still up and running.
Any help will be appreciated?
Thanks in AdvanceIf the control is restored from the rman backup lets say it is 3 days old, then how to update the same control file with the current database statistics.
--Luckys. -
Hello-
I was looking over some configurations that was setup by another DBA.
There are 3 control files created but they all are on the same disk/directory.
Control file auto backup is on to tape.
If there was a hardware failure and all three control were corrupted/lost then a backup would be used but
full recovery and RESETLOGS would be needed which would lead to redo data loss.
If I configured 1 control file on a seperate disk. I would be able to copy this one and create 3 files again and the database
would be started again without needing recovery if all else was fine.
If the control keeps track of redo logs SCN, Archive logs history and RMAN backups when these change then wouldn't another control file backup/ trace need to be done ?
Control File Trace only alllows to rebuild the database not to copy. How often is the need to taken ? Every change in the database ?
Backup to the Flash Recovery is another backup not an updated copy to copy from but to restore/recovery with.
Do have have these theories correct and my best setup would to send at least one to another disk.
Thanks-If there was a hardware failure and all three control were corrupted/lost then a backup would be used but
full recovery and RESETLOGS would be needed which would lead to redo data loss. No. If you lose all three controlfiles, you either
a. RESTORE a backup of the controlfile
OR
b. CREATE CONTROLFILE (from a script)
In either case, you do NOT need to do an INCOMPLETE Recovery. You will be doing a COMPLETE Recovery (if you have the Online Redo Logs). However, an OPEN RESETLOGS is still required. The %r in the log_archive_format since 10g allows ArchiveLogs to be retained through ResetLogs.
If the control keeps track of redo logs SCN, Archive logs history and RMAN backups when these change then wouldn't another control file backup/ trace need to be done ? If you RESTORE the controlfile you lose no information. However, you still have to OPEN RESETLOGS.
If you do a CREATE CONTROLFILE, yes, you lose information about ArchiveLogs history and RMAN Backups.
You can issue a CATALOG command to re-catalog available Backups.
Control File Trace only alllows to rebuild the database not to copy.A Control File Trace is to recreate the Controlfile. Not rebuild the database.
Backup to the Flash Recovery is another backup not an updated copy to copy from but to restore/recovery with. I don't understand what your statement or question might be here.
Hemant K Chitale
http://hemantoracledba.blogspot.com
Edited by: Hemant K Chitale on Mar 2, 2011 2:44 PM
Edited by: Hemant K Chitale on Mar 2, 2011 2:45 PM -
Hi
My database is running on solaris 10. database verrison is 10.2.0.3.0
when connecting ot db after databases get started. it throws error
ORA-00205: error in identifying control file, check alert log for more info
and when I checked in alert log file
Thu Dec 25 18:39:04 2008
Errors in file /testdb/..n/../admin/../udump/mft_ora_7988.trc:
ORA-19502: write error on file "/oradb/../../arch/arch1_2162_623164752_MFT.log", blockno 30721 (blocksize=512)
ORA-27063: number of bytes read/written is incorrect
after browsing google I infer that we lost control file.
I dont have it backup
how do i recover it
Thanks in advance.Do you have backup control file or auto backup control file by rman or not.
If you have backup, try recover controlfile from rman backup( you should know DBID).
Anyway If you don't have rman backup. so recreate controlfile (if you have backup control file to trace, you can use it):
1. Take a full backup of the database, including all datafiles and redo
log files.
2. Connect / as sysdba or as sys user and do a STARTUP NOMOUNT.
3. Issue the CREATE CONTROLFILE statement.
More information on Oracle.
http://www.oracle.com/pls/db102/homepage
Example:
CREATE CONTROLFILE REUSE DATABASE "TESTDB" NORESETLOGS NOARCHIVELOG
MAXLOGFILES 50
MAXLOGMEMBERS 3
MAXDATAFILES 300
MAXINSTANCES 8
MAXLOGHISTORY 500
LOGFILE
GROUP 1 '/oradata/testdb/log1.dbf' SIZE 100M,
GROUP 2 '/oradata/testdb/log2.dbf' SIZE 100M,
GROUP 3 '/oradata/testdb/log3.dbf' SIZE 100M
DATAFILE
'/oradata/testdb/system01.dbf' SIZE 400M,
'/oradata/testdb/sysaux01.dbf' SIZE 500M,
'/oradata/testdb/undotbs01.dbf' SIZE 100M ;
4. Perform media recovery on the database.
RECOVER DATABASE
5. Open the database.
ALTER DATABASE OPEN;
Good Luck. -
How to restore a control file without having its backup
Hi,
Can any one please suggest me how to restore a control file without having its backup.
ThanksTo add to what SB said, in years past the instructions for re-creating the control file manually were contained in the DBA Administration manual. It used to be and may still be common to be taking and saving a "backup control file to trace" for this purpose.
If you lost only the primary copy of the control file and it is an OS file then while the database is shutdown you can copy the secondary over the primary and then use if to start the database. If the control file is stored in ASM then there should be a way to perform the copy via ASM.
If you use rman for backups then a copy of the control file should be part of the backup process and you can retrieve it from the backup set then perform recovery using the backup control file though I do note the OP said something to the effect no backup exists. Still, I have knows of instances where the DBA did not realize that the backup set contained the control file and the spfile so I think this is worth mentioning just in case.
HTH -- Mark D Powell -- -
Need a help: how to recover using backup control file?
Please a help:
First computer
1. I create a database
2. put it in archive mode,
3. shutdown and made a cold backup
4. Created backup control file (alter database backup control file to trace)
5. I started up and created some archived log files.
Second Computer
1. I copied all files created in the step 3 above except the control file
2. I create all the same map directory on the 2nd computer as in the 1st computer
3. I recreate the control file from the script got in the step 4 above
4. I Copy archived log files generated at the step 5 in the local directory in the second computer
5. I set the logsource and set the autorecovery to on
6. I recover the database: RECOVER DATABASE USING BACKUP CONTROL FILE UNTIL CANCEL
Error got:
the archived log file applied do not go beyond the first one?,How could I do to applied all archived log files copied from the first computer to the second computer to have the same data?
Thank you very mucharchived log sequeces in the first computerSQL> select sequence#,first_change#,next_change# from v$log_history;
SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#
1 553723 555484
2 555484 557345
Actions I did in the second Computer(after copied the former two archived log files from the 1st computer)
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG' SIZE 50M,
9 GROUP 2 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG' SIZE 50M,
10 GROUP 3 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03.LOG' SIZE 50M
11 -- STANDBY LOGFILE
12 DATAFILE
13 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF',
14 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF',
15 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF',
16 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF'
17 CHARACTER SET WE8ISO8859P1
18 ;
Control file created.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 0
Next log sequence to archive 0
Current log sequence 0
SQL> alter database archivelog;
Database altered.
SQL> set logsource C:\local_destination1_orcl
SQL> set autorecovery on;
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 555611 generated at 01/18/2007 14:14:14 needed for thread 1
ORA-00289: suggestion :
C:\LOCAL_DESTINATION1_ORCL\ARCH.1_1_612194518_43F17CF5.ARC
ORA-00280: change 555611 for thread 1 is in sequence #1
ORA-00328: archived log ends at change 555483, need later change 555611
ORA-00334: archived log:
'C:\LOCAL_DESTINATION1_ORCL\ARCH.1_1_612194518_43F17CF5.ARC'
Idon't know where the change 555611 is coming from? -
A question about restoring from cold backup(control file backup not clear)
Hi,
I had another question about restoring the cold backup. My database is in noarchivelog mode and after taking a consistent cold backup, all I need to do is to restore the backup right? -Why I got this question is because: when I backup my control file to trace, I see statements like this:-----
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/uo1/app1/arch1_1_647102958.dbf';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- Database can now be opened normally.
ALTER DATABASE OPEN;
My database is in noarchivelog mode now so don't know why these statements (of register the logfile) is there in the backup of control file? so when I restore the cold backup of this database, it will still work correct? (there is no logfile I have only CRD files in cold backup -no archive log files.)
thanks
NiravThanks for your inputs! It is most useful to me.
Regards
Nirav -
Hi there,
compare to "binary control file" and "trace control file",
Which one is better for recovery, why??
Your replies will greatly appreciated.when we use "binary control file" to open, we need to use resetlogs option.
We don't need the "resetlogs" option if using sql in "trace control file".
I think "binary control file" is good for rman backup, and "trace control file" good for reuse archived log files. Am i right? -
I attempted to upgrade 10.2.0.1 to 11.2 but things went wrong. So, I am trying to start the source database but I get the following error: ORA-00201 control file version 11.2.0.0.0 incompatible with ORACLE version 10.2.0.1.0. Is there any way I can make this control file compatible with my source DB? I am no DB admin but I think I may have a backupset but I have no idea what's in it and how to restore controlfile from it.
Is it possible to recreate controlfile without restoring database? I was reading [managing control files|http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14231/control.htm#i1006293] from 10.2 database administrator's guide and it looks like to me it is possible. As I mentioned, I am no dba admin so please bear with me.
Yes, it is possible to recreate the control file. If you still have 11.2 software installed on target system and you have the init.ora file created as part of your failed upgrade attempt, the easiest way to do it is this:
1. load the 11.2 environment (set ORACLE_HOME, ORACLE_SID, etc.) and mount the database in 11.2 (that is, version that is compatible with control file version)
STARTUP MOUNT PFILE='/path/to/init.ora.for.11.2'2. backup the control file to trace:
ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/path/to/ctlfile_recreate.sql' NORESETLOGS;3. shutdown 11.2 instance
SHUTDOWN IMMEDIATE4. open the generated file and review it. If you see any statements you think are not needed, comment them out (like those related to standby log files.)
5. change your environment to 10.2 and run the script in SQL*Plus - it contains all commands necessary to start the instance, recreate the control file and other files, recover the database and open it.
Make sure you backup the whole database before doing this (you actually should've done that before upgrade attempt - if you did, you could simply restore from backup and be done with it already...) -
Restoring Control file from snapshot
Hi,
As in RMAN the following configuration will create snapshot of control file.
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'product/10.2.0/dbs/snapcf_PROD.f'; # default
My question is how to restore control file from this snapshot to another location.
Regards
KrishnaCopy RMAN backup files including archive log backup files to the target server
Copy the SNAPSHOT CONTROL FILE or backed up control file from source server to target server.
Source Server:
RMAN> connect target /;
connected to target database: HRDMO (DBID=209403493034)
RMAN> show SNAPSHOT CONTROLFILE NAME;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/10g/dbs/snapcf_HRDMO.f'; # default
Target Server:
Export ORACLE_SID=HRDMO
RMAN
RMAN>startup nomount;
RMAN> set DBID=209403493034;
executing command: SET DBID
RMAN> restore controlfile from '/opt/oracle/standby/dbs/snapcf_crmprod.f'; # The location where you have it in target srvr.
RMAN>alter database mount;
RMAN> run
2> {
3> sql 'alter session set NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"';
4> set until time '2008-01-31 01:00:00';
5> restore database;
6> recover database;
7> }
RMAN>alter database open resetlogs;
You have the copy of instance in the target server.
Edited by: rajeysh on Jun 23, 2010 3:34 PM -
Hi
Can anybody explain when to use "RESETLOGS" and "NORESETLOGS" option while making backup of Control File to TRACE and whats the purpose of using it?
ALTER DATABASE BACKUP CONTROL FILE TO TRACE RESETLOGS/NORESETLOGS;
TIA
Aqueel.read the following discussion from asktom site. Very informative and helpful.
http://asktom.oracle.com/pls/ask/f?p=4950:8:2270402190261165858::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:311016722068
Jaffar
Maybe you are looking for
-
Hi Friends, Is there any info structure which gives the list of open sales orders without entering material or customer. Similar functionality like VA05. However my client's purpose do not solve with VA05 because there we need to enter atleast a mate
-
HoW to ChaNGE the text in the mobile application to be in MulTi-CoLoR text
_* Do anyone can tell me how to change the text in the mobile application to be in multi-color text, to make it more interesting and increase readability? Is it using the Graphic's paint() method? or any better suggestion? Please give the short exam
-
What on earth is going on? What am I doing wrong?
-
Making a jargon buster in flash cs5 using XML
Hi guys !! I am working o a jargon buster for a college project. I have written up an XML document like this: <Items> <Query>Rip</Query> <answer>to copy files from a disc onto a computer</answer> </Items> Basically the user inputs their
-
Outlook 2013 "Unknown Error" Message Box
I am running Outlook 2013 Professional and we have Exchange 2010. Periodically when I am deleting messages I receive a box that says "Unknown Error" it doesn't say anything else and if I click OK it goes away... its more of an annoyance but we are g