Home » RDBMS Server » Backup & Recovery » backup control file to trace (Oracle 10.2.0)
backup control file to trace [message #555755] Mon, 28 May 2012 06:22 Go to next message
azhar1234
Messages: 2
Registered: May 2012
Junior Member
Hi Experts,

Please help me in takeing the backup of a control file, as i am taking online backup, archive mode.

At first i have executed the statement

sql> alter database backup control file to trace;

then i have removed the control files and enterd some data in a table and committed it.

As my oracle is not shutting down, so i shut aborted it.

Now after saving the last file from the udump as obkp.sql i am unable to edit this file and use.

Please help me how to edit and use this file, so that i can startup my database normally.
Re: backup control file to trace [message #555759 is a reply to message #555755] Mon, 28 May 2012 06:33 Go to previous messageGo to next message
John Watson
Messages: 4381
Registered: January 2010
Location: Global Village
Senior Member
Welcome to the forum. Please read our OraFAQ Forum Guide and How to use [code] tags and make your code easier to read

No-one here can help with advice on how to edit a file, you must study your operating system manual for that. If you are using Windows, notepad.exe is probably the best tool. If Unix, the vi editor.
Re: backup control file to trace [message #555837 is a reply to message #555759] Tue, 29 May 2012 05:15 Go to previous messageGo to next message
azhar1234
Messages: 2
Registered: May 2012
Junior Member
Hi John,

Thanks for your reply, sorry for the confusion, as i am running my oracle on Linux, i am editing the file in vi editor.

To get my database up and running i need to do some modification in the obkp.sql file and run this file to recreate the control file which i have deleted earlier.

Please can you give me the steps and the modifications to be done in this file, hope you get it what i mean.
Re: backup control file to trace [message #555840 is a reply to message #555837] Tue, 29 May 2012 05:48 Go to previous messageGo to next message
Michel Cadot
Messages: 58557
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You have to first remove all the lines still the first comment line which starts with "--".
Then please read the file and tell us what you don't understand in it.

Regards
Michel
Re: backup control file to trace [message #556181 is a reply to message #555755] Thu, 31 May 2012 13:45 Go to previous message
vijenderkdba
Messages: 28
Registered: May 2012
Location: mumbai
Junior Member
hi

just follow these steps
step1:-------------------------------------------------------
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE
2 AS '/home/oracle/Desktop/create_ctl.sql';
step2:-------------------------------------------------------
go to /home/oracle/desktop and open creat_ctl.sql file

say for example file is generated like this

step3:--------------------------------------------------------
u01/app/oracle/admin/rev1/udump/rev1_ora_10939.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning and OLAP options
ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1
System name: Linux
Node name: rac1.localdomain
Release: 2.6.9-42.0.0.0.1.ELhugemem
Version: #1 SMP Sun Oct 15 14:06:18 PDT 2006
Machine: i686
Instance name: rev1
Redo thread mounted by this instance: 1
Oracle process number: 23
Unix process pid: 10939, image: oracle@rac1.localdomain (TNS V1-V3)

*** SERVICE NAME:(SYS$USERS) 2010-09-21 16:52:23.473
*** SESSION ID:(142.32) 2010-09-21 16:52:23.473
*** 2010-09-21 16:52:23.472
-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf
--
-- DB_UNIQUE_NAME="rev1"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=2
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=?/dbs/arch
-- FAL_CLIENT=''
-- FAL_SERVER=''
--
-- LOG_ARCHIVE_DEST_10='LOCATION=USE_DB_RECOVERY_FILE_DEST'
-- LOG_ARCHIVE_DEST_10='OPTIONAL REOPEN=300 NODELAY'
-- LOG_ARCHIVE_DEST_10='ARCH NOAFFIRM NOEXPEDITE NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_10='REGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_10='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_10='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_10=ENABLE
--
-- Below are two sets of SQL statements, each of which creates a new
-- control file and uses it to open the database. The first set opens
-- the database with the NORESETLOGS option and should be used only if
-- the current versions of all online logs are available. The second
-- set opens the database with the RESETLOGS option and should be used
-- if online logs are unavailable.
-- The appropriate set of statements can be copied from the trace into
-- a script file, edited as necessary, and executed when there is a
-- need to re-create the control file.
--
-- Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
-- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "REV1" NORESETLOGS FORCE LOGGING ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u01/app/oracle/oradata/rev1/redo01.log' SIZE 5M,
GROUP 2 '/u01/app/oracle/oradata/rev1/redo02.log' SIZE 5M,
GROUP 3 '/u01/app/oracle/oradata/rev1/redo03.log' SIZE 5M
-- STANDBY LOGFILE
DATAFILE
'/u01/app/oracle/oradata/rev1/system01.dbf',
'/u01/app/oracle/oradata/rev1/undotbs01.dbf',
'/u01/app/oracle/oradata/rev1/sysaux01.dbf',
'/u01/app/oracle/oradata/rev1/users01.dbf'
CHARACTER SET WE8ISO8859P1
;
-- Configure RMAN configuration record 1
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP','ON');
-- 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 '/u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_09_21/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_09_21/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_09_21/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_09_21/o1_mf_1_1_%u_.arc';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- All logs need archiving and a log switch is needed.
ALTER SYSTEM ARCHIVE LOG ALL;
-- Database can now be opened normally.
ALTER DATABASE OPEN;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/rev1/temp01.dbf'
SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
-- End of tempfile additions.


step4:---------------------------------------------------------------------------------
in the above file just select this portion

STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "REV1" NORESETLOGS FORCE LOGGING ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u01/app/oracle/oradata/rev1/redo01.log' SIZE 5M,
GROUP 2 '/u01/app/oracle/oradata/rev1/redo02.log' SIZE 5M,
GROUP 3 '/u01/app/oracle/oradata/rev1/redo03.log' SIZE 5M
-- STANDBY LOGFILE
DATAFILE
'/u01/app/oracle/oradata/rev1/system01.dbf',
'/u01/app/oracle/oradata/rev1/undotbs01.dbf',
'/u01/app/oracle/oradata/rev1/sysaux01.dbf',
'/u01/app/oracle/oradata/rev1/users01.dbf'
CHARACTER SET WE8ISO8859P1
;
step5:-------------------------------------------
save this file as run.sql and run in the sql prompt
Thanks.
Vij

[Updated on: Thu, 31 May 2012 13:50]

Report message to a moderator

Previous Topic: Rman catalog
Next Topic: default location for RMAN backup
Goto Forum:
  


Current Time: Fri Jul 25 02:37:59 CDT 2014

Total time taken to generate the page: 0.16795 seconds