Snippet Name: Control File
Description: The control file contains data on system structures, log status, transaction numbers, and other important information about the database. The control file is absolutely crucial to database operation. It contains (but is not limited to) the following types of information:
- Database information (RESETLOGS SCN and their time stamp)
- Archive log history
- Tablespace and datafile records (filenames, datafile checkpoints, read/write status, offline or not)
- Redo threads (current online redo log)
- Database's creation date
- database name
- current archive log mode
- Log records (sequence numbers, SCN range in each log)
- RMAN catalog
- Database block corruption information
- Database ID, which is unique to each DB
The location of the control files is specified through the control_files init param.
To create a control file, you must have the SYSDBA system privilege, and the database must not be mounted by any instance.
Comment: (none)
Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 07th, 2009
|
#STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORACLE" NORESETLOGS NOARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXDATAFILES 32
MAXINSTANCES 16
MAXLOGHISTORY 1600
LOGFILE
GROUP 1 'E:\ORANT\DATABASE\LOG1ORCL.ORA' SIZE 2M,
GROUP 2 'E:\ORANT\DATABASE\LOG2ORCL.ORA' SIZE 2M
DATAFILE
'E:\ORADATA\SYSORCL.ORA',
'E:\ORADATA\USER2TSP.DBF',
'E:\ORADATA\USER1ISP.DBF',
'E:\ORADATA\USER1RSP.DBF',
'E:\ORADATA\VBIG1RSP.DBF',
'E:\ORADATA\USER1DSP.DBF',
'E:\ORADATA\TOOLS.DBF',
'E:\ORADATA\AEIDAT.DBF',
'E:\ORADATA\AEIIDX.DBF',
'E:\ORADATA\CTDAT.DBF',
'E:\ORADATA\CTIDX.DBF',
'E:\ORADATA\PADAT.DBF',
'E:\ORADATA\PAIDX.DBF',
'E:\ORADATA\SDDAT.DBF',
'E:\ORADATA\SDIDX.DBF',
'E:\ORADATA\SFDAT.DBF',
'E:\ORADATA\SFIDX.DBF',
'E:\ORADATA\SYDAT.DBF',
'E:\ORADATA\SYIDX.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; |