Control Files
Each CONTROL_FILES parameter entry is required to be:
- Comma separated.
- Contained in single quotes.
Add
A control file is added using the following steps:
- Change the control_files parameter adding the path to the new control file.
- Shut down the database.
- At the OS level copy one of the existing control files to the new control file location making
sure to change the name. - Start the database.
- Confirm that the database is OK.
Control file to add: R:\oradata\ctl\control.ctl
SQLPLUS> ALTER SYSTEM SET control_files= 'C:\oradata\ctl\control.ctl', 'O:\oradata\ctl\control.ctl', 'R:\oradata\ctl\control.ctl' SCOPE=SPFILE; SQLPLUS> shutdown immediate OS> copy C:\oradata\ctl\control.ctl R:\oradata\ctl\control.ctl SQLPLUS> startup SQLPLUS> SELECT name FROM v$controlfile;
Backup SPFILE To Trace
SQLPLUS> alter database backup controlfile to trace;
Trace file is created in the udump directory.
Display
SELECT name FROM v$controlfile; show parameter control_files;
Drop
A control file is dropped by performing the following steps:
- Remove it from the control_files parameter.
- Bounce the database.
- After confirming the database is OK delete the corresponding control file.
The control file to be dropped in this example: X:/oradata/ctl/control.ctl.
SQLPLUS> ALTER SYSTEM SET control_files= 'C:\oradata\ctl\control.ctl', 'R:\oradata\ctl\control.ctl' SCOPE=SPFILE; SQLPLUS> shutdown immediate SQLPLUS> startup SQLPLUS> SELECT name FROM v$controlfile; OS> del X:\oradata\DB1\ctl\control.ctl
Move
A control file is moved using the following steps:
- Change the control_files parameter changing the path to the corresponding control file.
- Shut down the database.
- At the OS level copy the file to the new location.
- Start the database.
- Confirm that the database is OK and the location of the control files.
The control file to be moved in this example: D:\oradata\ctl\control.ctl.
SQLPLUS> ALTER SYSTEM SET control_files= 'C:\oradata\ctl\control.ctl', 'X:\oradata\ctl\control.ctl' SCOPE=SPFILE; SQLPLUS> shutdown immediate OS> copy D:\oradata\ctl\control.ctl X:\oradata\control.ctl SQLPLUS> startup SQLPLUS> SELECT name FROM v$controlfile;