Control Files BY Sundar - KM: Click To Edit Master Subtitle Style
Control Files BY Sundar - KM: Click To Edit Master Subtitle Style
What Is a Control File? Binary file. Mandatory 1 control file per DB. Records the Physical structure of the DB. Contents of Control file
The database name Names and locations of associated
Files
Parameter CONTROL_FILES in init file. If control_files not specified then, Database creates it own ctl file with
default name.
OMF depends. ASM depends. Multiplex Control Files on Different
3/29/12
par.
DB reads only the first file listed in the
unavailable during the db operation, the instance becomes inoperable and the instance must be aborted. 3/29/12
Back Up Control Files Every time you change the physical structure of your database.
Adding, dropping, or renaming datafiles. Adding or dropping a tablespace, or
groups.
3/29/12
Size of Control Files MAXDATAFILES MAXLOGFILES MAXLOGMEMBERS MAXLOGHISTORY and MAXINSTANCES. The values of these parameters specified in the CREATE DATABASE statement increases the size of the controlfile. 3/29/12
Creating Control Files Creating Initial Control Files The control_files parameter values specified in the init file will create the files. Fully qualified names must be specified. If it already exists, REUSE clause can be used but the size of the existing OS files must be same or else Reuse 3/29/12
Relocating
Shut down the database. Copy an existing control file to a new
the database initialization parameter file to add the new control file name, or to change the existing control filename.
Restart the database.
3/29/12
been permanently damaged and you do not have a control file backup.
You want to change the database name.
DBID utility. Compatibility set 10.2.0 or later, file automatically expands to accommodate the changes.
3/29/12 Compatibility set earlier than 10.2.0, Need
GROUP 2
GROUP 3
RESETLOGS DATAFILE
3/29/12
Steps for Creating New Control Files 1) Make a list of all datafiles and redo log files of the database.
SELECT MEMBER FROM V$LOGFILE; SELECT NAME FROM V$DATAFILE; SELECT VALUE FROM V$PARAMETER
2) Shut down the database normally if possible. (shutdown abort a last resort). 3) Back up all datafiles and redo log files of the database. 4) STARTUP NOMOUNT 5) CREATE CONTROLFILE statement. (Specify resetlogs clause, if you have lost
3/29/12
6) Store a backup of the new control file on offline. 7) Edit Control_files Parameter & DB_NAME only if you change the DB name. 8) Recover the Database. 9) Alter database open; Alter database open resetlogs;
3/29/12
TO '/oracle/backup/control.bkp';
SQL statement Backup. ALTER DATABASE BACKUP CONTROLFILE
TO TRACE;
3/29/12
DDV
V$Database : Displays the DB info from Controlfile. V$Controlfile : List the names of controlfile. V$Controlfile_record_section : Info about records. V$parameter : Control_files
3/29/12