Practice: Maintaining the Control File

 

This practice covers determining the name and the location of the controlfile and multiplexing it.

 

Instructions

 

Where is the existing control file located and what is the name?

 

 

SQL> SELECT *

  2  FROM   v$controlfile;

STATUS  NAME

------- --------------------------------------

        /u01/home/dba01/ORADATA/u01/ctrl01.ctl

 

 

Multiplex the existing control file, using the directory u02, and name the new control file ctrl02.ctl.

 

 

Hints

 

Before shutting down the database alter the SPFILE (SCOPE=SPILE) to add

the new control file to the initialization file.

 

Shut down the database, and copy the existing control file to a new file with the name ctrl02.ctl in the directory u02.

 

Start up the database.

 

Query the dynamic performance views V$CONTROLFILE or V$PARAMETER, or use the SHOW PARAMETER command to confirm that both control files are being used.

 

SQL> CONNECT / AS SYSDBA

Connected.

SQL> ALTER SYSTEM SET control_files =                   '$HOME/ORADATA/u01/ctrl01.ctl',

    '$HOME/ORADATA/u02/ctrl02.ctl' SCOPE=SPFILE;

System altered.

SQL> SHUTDOWN IMMEDIATE;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> !cp $HOME/ORADATA/u01/ctrl01.ctl                   $HOME/ORADATA/u02/ctrl02.ctl

SQL> STARTUP

ORACLE instance started.

Database mounted.

Database opened.

SQL> SELECT name FROM v$controlfile;

NAME

--------------------------------------

/u01/home/dba01/ORADATA/u01/ctrl01.ctl

/u01/home/dba01/ORADATA/u02/ctrl02.ctl

 

 

Quick Quiz

 

Why should a DBA multiplex the controlfile?

 

To avoid a single point of failure.

 

Why does the database need to be shutdown to copy the controlfile for the purpose of multiplexing?

 

            Because the controlfile is constantly being updated while the database is running.  The copy would not agree with the original file when the database is restarted.

1