Managing Control Files

The Control File can be considered to be the most important file in a database, it is the identity of the database.

Every database instance has at least 1 control file, the recommended practice is to have at least 2 control files located on separate physical disks. 3 control files are created by default.

The contents of a database’s Control File include:

• The names and locations (paths) of Data Files

• The names and locations of Redo Logs

• Current Log sequence numbers

• Backup Set information

& most importantly

• System Change Number (SCN) information

 

Users cannot view or alter a Control File as it is in binary format.

 

Making copies of Control Files

Control Files can be copied in two ways.

1. While the database is open

If a Control File’s location hasn’t been specified while creating the database, all 3 control files will be in the same path (/u01/app/oracle/oradata/SID_NAME/)

Checking the validity of the changes that have been made:

Changes can also be checked with:

2. Using the Pfile (Parameter file) to make copies

The following code creates a pfile.

“initSID_NAME.ora” in “/u01/app/oracle/product/10.2.0/db_1/dbs/”. In this example we have named the pfile initSMP.ora.

Using Vi or WinSCP’s text editor we can create the following configuration according our requirements:

Create an spfile from the pfile after finishing working on the pfile.

The database can be opened and checked using the following syntax.

If the dbms is unable to open a control file then it cannot open the database. Suggested solutions to this type of issue:

• Delete the problematic control file, replace it with another functioning one and rename it.

• If the other control files are in working order, delete the control file from the spfile (by using the same method as creating a pfile).

 

Accessing Controlfile information

V$CONTROLFILE : Contains the names and statuses of controlfiles.

V$PARAMETER : Statuses and locations/paths.

V$CONTROLFILE_RECORD_SECTION : Datafiles and the objects that they contain (such as record_size, records_total)

 

The performance view information listed below can be accessed through a control file:

• V$BACKUP

• V$DATAFILE

• V$TEMPFILE

• V$TABLESPACE

• V$ARCHIVE

• V$LOG

• V$LOGFILE

• V$LOGHIST

• V$ARCHIVED_LOG

• V$DATABASE

Kategori seçin...