Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
0Activity
0 of .
Results for:
No results containing your search query
P. 1
Control Files

Control Files

Ratings: (0)|Views: 6|Likes:
Published by dbareddy
Contril Files
Contril Files

More info:

Categories:Types, Reviews
Published by: dbareddy on May 29, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/29/2013

pdf

text

original

 
Q. When to create control files ?A. Create controlfiles when1. You have lost all your control files.2. When you want to rename a database name (db_name)Q. How to create control files.You need a create controlfile script for recreating control files.SQL*Plus: Release 9.2.0.2.0 - Production on Fri Feb 28 17:04:00 2003Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.Enter user-name: sys as sysdbaEnter password:Connected to:Oracle9i Enterprise Edition Release 9.2.0.2.1 - ProductionWith the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining optionsJServer Release 9.2.0.2.0 - ProductionSQL> alter database backup controlfile to trace;Database altered.SQL>This will create a trace file in the udump directory.Im my case it wasE:\oracle\admin\ORCL\udump\orcl_ora_2052.trcEdit the file to point the path of the datafiles and redologfiles.CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOGMAXLOGFILES 5MAXLOGMEMBERS 3MAXDATAFILES 14MAXINSTANCES 1MAXLOGHISTORY 226LOGFILEGROUP 1 'E:\ORACLE\ORADATA\ORCL\REDO01.LOG' SIZE 100M,GROUP 2 'E:\ORACLE\ORADATA\ORCL\REDO02.LOG' SIZE 100M,GROUP 3 'E:\ORACLE\ORADATA\ORCL\REDO03.LOG' SIZE 100MDATAFILE'E:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF','E:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF','E:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF','E:\ORACLE\ORADATA\ORCL\INDX01.DBF','E:\ORACLE\ORADATA\ORCL\TOOLS01.DBF','E:\ORACLE\ORADATA\ORCL\USERS01.DBF','E:\ORACLE\ORADATA\ORCL\OEM_REPOSITORY.DBF','E:\ORACLE\ORADATA\ORCL\CWMLITE01.DBF','E:\ORACLE\ORADATA\ORCL\DRSYS01.DBF','E:\ORACLE\ORADATA\ORCL\ODM01.DBF','E:\ORACLE\ORADATA\ORCL\XDB01.DBF',
 
'E:\ORACLE\ORADATA\ORCL\USERS02.DBF','E:\ORACLE\ORADATA\ORCL\USERS03.DBF','E:\ORACLE\ORADATA\ORCL\USERS04.DBF'CHARACTER SET WE8MSWIN1252;ALTER DATABASE OPEN RESETLOGS;and rename it to ctl.sqlThen startup the database in nomount mode and run the ctl.sql file as sys as sysdba userSQL*Plus: Release 9.2.0.2.0 - Production on Fri Feb 28 17:25:14 2003Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.Enter user-name: sys as sysdbaEnter password:Connected to an idle instance.SQL> startup nomountORACLE instance started.Total System Global Area 80812648 bytesFixed Size 453224 bytesVariable Size 54525952 bytesDatabase Buffers 25165824 bytesRedo Buffers 667648 bytesSQL> @E:\oracle\admin\ORCL\udump\ctl.sqlControl file created.Database altered.SQL> select status from v$instance;STATUS------------------------------------OPENSQL> select name from v$controlfile;NAME--------------------------------------------------------E:\ORACLE\ORADATA\ORCL\CONTROL01.CTLE:\ORACLE\ORADATA\ORCL\CONTROL02.CTLE:\ORACLE\ORADATA\ORCL\CONTROL03.CTLTo rename the database change reuse to set in the create control file script asshown belowCREATE CONTROLFILE SET DATABASE "ORCL" RESETLOGS ARCHIVELOGMAXLOGFILES 5
 
MAXLOGMEMBERS 3MAXDATAFILES 14MAXINSTANCES 1MAXLOGHISTORY 226LOGFILEGROUP 1 'E:\ORACLE\ORADATA\ORCL\REDO01.LOG' SIZE 100M,GROUP 2 'E:\ORACLE\ORADATA\ORCL\REDO02.LOG' SIZE 100M,GROUP 3 'E:\ORACLE\ORADATA\ORCL\REDO03.LOG' SIZE 100MDATAFILE'E:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF','E:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF','E:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF','E:\ORACLE\ORADATA\ORCL\INDX01.DBF','E:\ORACLE\ORADATA\ORCL\TOOLS01.DBF','E:\ORACLE\ORADATA\ORCL\USERS01.DBF','E:\ORACLE\ORADATA\ORCL\OEM_REPOSITORY.DBF','E:\ORACLE\ORADATA\ORCL\CWMLITE01.DBF','E:\ORACLE\ORADATA\ORCL\DRSYS01.DBF','E:\ORACLE\ORADATA\ORCL\ODM01.DBF','E:\ORACLE\ORADATA\ORCL\XDB01.DBF','E:\ORACLE\ORADATA\ORCL\USERS02.DBF','E:\ORACLE\ORADATA\ORCL\USERS03.DBF','E:\ORACLE\ORADATA\ORCL\USERS04.DBF'CHARACTER SET WE8MSWIN1252;ALTER DATABASE OPEN RESETLOGS;HAPPINESS IS REAL WHEN SHAREDHomeAbout MeUseful QueriesUseful ScriptsDisclaimerIn sweet memories of my ever loving brother "kutty thambi " ARUN KUMARTUESDAY, SEPTEMBER 21, 2010Re-create lost controlfileHere in this demo i deleted all control files and re-created using trace file.In Oracle forum OTN related to re-create controlfile, confusion between shutdownimmediate and shutdown abort after controlfile lost. this demo helps you to re-create lost control fileview plainprint?SQL> select name from v$controlfile;NAME-------------------------------------------------------------------------------- /u01/app/oracle/oradata/rev1/control01.ctl/u01/app/oracle/oradata/rev1/control02.ctl/u01/app/oracle/oradata/rev1/control03.ctlSQL> select name from v$datafile;NAME-------------------------------------------------------------------------------- /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.dbfSQL> col member format a50SQL> select a.group#,a.member,b.status from v$logfile a, v$log b where a.group#=b.group#;

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->