Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 Oracle PL/SQL: Control File Jump to:  
Category: >> Oracle PL/SQL >> Control File Bookmark and Share

<< lastnext >>

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;


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 202 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?