Control file managementEvery oracle database has a control file. A control file contains information about the associatedd...
To see the location of control files:Select name from v$controlfile;To add a control file:Sql>create pfile from spfile;1. ...
$mkdir data log control udump cdump bdump adump arch$cd$vi createcontrol.ctlClick on I to enter INSERT mode and then write...
:1,$s/prod/clone/gc:wq$env |grep ORA$export ORACLE_SID=clone$env |grep ORA$cd$sqlplus / as sysdbaSql>startup nomount;Sql>@...
Upcoming SlideShare
Loading in …5
×

Controlfilemanagement

291 views

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
291
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Controlfilemanagement

  1. 1. Control file managementEvery oracle database has a control file. A control file contains information about the associateddatabase that is required for access by an instance, both at startup and during normal operation.Control file information can be modified only by oracle; no database administrator or user can edit acontrol file.Among other things, a control file contains information such as:--• The database name.• The timestamp of database creation.• The names and locations of associated data files and redo log files.• Table space information.• Data file offline ranges.• The log history.• Archived log information.• Backup set and backup piece information.• Backup data file and redo log information.• Data file copy information.• The current log sequence number.• Checkpoint information.The database name and timestamp originate at database creation. The database name is taken fromeither the name specified by the db_name initialization parameter or the name used in the createdatabase statement.Each time that a data file or a redo log file is added to, renamed in, or dropped from the database, thecontrol file is updated to reflect this physical structure change.These changes are recorded so that:Oracle can identify the data files and redo log files to open during database startup. Oracle can identifyfiles that are required or available in case database recovery is necessary.View: desc v$controlfile;
  2. 2. To see the location of control files:Select name from v$controlfile;To add a control file:Sql>create pfile from spfile;1. Shutdown the database gracefully.2. Edit the init<sid>.ora file3 Modify the control file parameter and add the location of the new file.4. Copy the control file physically using ‘cp’ command.$cd dev/control/$cp control.ctl control2.ctlSql>create spfile from pfile;Sql>startupCloning:To backup control file:Sql>Alter database backup controlfile to trace;Sql>show parameter user_dump_destSql>shutdown immediateSql>exit$cd prod/udump$ls –ltr$vi “latest updated file.trc” #here file name is not latest updated file.Copy the create controlfile script up to character set.:q$mkdir clone$cd clone
  3. 3. $mkdir data log control udump cdump bdump adump arch$cd$vi createcontrol.ctlClick on I to enter INSERT mode and then write click on your mouse.Change the directory path from prod to clone.Create controlfile set database “newsid” resetlogs archivelogLogfileGroup 1’/data/oracle/clone/redolog01.log’ size 50M;Group 2’/path’ size 50M;Datafile‘/data/oracle/clone/system.dbf’‘/path/sysaux.dbf’‘/path/undotbs.dbf’‘/path/users.dbf’:1,$s/prod/clone/gc:wq$cdCopy the datafiles from prod/data to /home/oracle/clone/data$cd prod/data$cp -v *.dbf /home/oracle/clone/data/Go to parameters file location $ORACLE_HOME/dbs$cd $ORACLE_HOME/dbsCopy the init parameter file to clone.$cp initprod.ora initclone.ora$vi initclone.ora
  4. 4. :1,$s/prod/clone/gc:wq$env |grep ORA$export ORACLE_SID=clone$env |grep ORA$cd$sqlplus / as sysdbaSql>startup nomount;Sql>@createcontrol.ctlSql>alter database open resetlogs;Sql>recover database using backup controlfile; (online)

×