Databases Reference
In-Depth Information
Viewing Control File Names and Locations
If your database is in a nomount state, a mounted state, or an open state, you can view the names and locations of the
control files, as follows:
SQL> show parameter control_files
You can also view control file location and name information by querying the V$CONTROLFILE view. This query
works while your database is mounted or open:
SQL> select name from v$controlfile;
If, for some reason, you can't start your database at all, and you need to know the names and locations of the
control files, you can inspect the contents of the initialization (parameter) file to see where they're located. If you're
using an spfile , even though it's a binary file, you can still open it with a text editor. The safest approach is to make a
copy of the spfile and then inspect its contents with an OS editor:
$ cp $ORACLE_HOME/dbs/spfileo12c.ora $ORACLE_HOME/dbs/spfileo12c.copy
$ vi $ORACLE_HOME/dbs/spfileo12c.copy
You can also use the strings command to search for values in a binary file:
$ strings spfileo12c.ora | grep -i control_files
If you're using a text-based initialization file, you can view the file directly, with an OS editor, or use
the grep command:
$ grep -i control_files $ORACLE_HOME/dbs/inito12c.ora
Adding a Control File
Adding a control file means copying an existing control file and making your database aware of the copy by modifying
your CONTROL_FILES parameter. This task must be done while your database is shut down. This procedure only works
when you have a good existing control file that can be copied. Adding a control file isn't the same thing as creating or
restoring a control file.
see Chapter 4 for an example of re-creating a control file for the purpose of renaming and moving data files.
see Chapter 19 for an example of re-creating a control file for the purpose of renaming a database.
Tip
If your database uses only one control file, and that control file becomes damaged, you need to either restore a
control file from a backup (if available) and perform a recovery or re-create the control file. If you're using two or more
control files, and one becomes damaged, you can use the remaining good control file(s) to quickly get your database
into an operating state.
If a database is using only one control file, the basic procedure for adding a control file is as follows:
1.
Alter the initialization file CONTROL_FILES parameter to include the new location and name
of the control file.
2.
Shut down your database.
 
 
Search WWH ::




Custom Search