A control file is a small binary file and an indispensable part of the Oracle database. It is used to record the database status and physical structure. Each database must have at least one control file, but it is strongly recommended that more than one control file be created. The backup of each control file should be stored on different disks.
The information in the control file includes the following:
? The DATABASE name is taken from the name specified by the initialization parameter DB_NAME or the name used in the create database statement.
? The database identifier is recorded when a database is created.
? When creating a database, the timestamp of the created database is recorded.
? When you add, rename, or delete data files or redo logs in a database, the names and locations of related data files and online redo log files are updated.
? When a tablespace is added or deleted, the tablespace information is updated.
? Redo log history is recorded during log switching.
? The location and status of archived logs are recorded during archiving.
? The backup location and status are recorded by the Recovery Manager utility.
? The current log serial number is recorded during log switching.
? Record the checkpoint information when a Check Point is created.
The control file contains the following entries:
? Database Name and identifier
? Database creation Timestamp
? Table space name
? Name and location of the data file and redo log file
? Serial number of the current redo log
? Checkpoint Information
? Start and end of the restore segment
? Redo log archiving information
? Backup Information
The following describes how to add a multi-path control file to a database:
Method 1:
1. Modify the parameter file
2. Stop the database.
3: Copy Control Files
4. Start the database.
5: Verify and view v $ controlfile
SQL> alter system set control_files = '/u01/app/oracle/oradata/PROD/control01.ctl', '/u01/app/oracle/oradata/PROD/control02.ctl ', '/u01/app/oracle/oradata/PROD/control03.ctl' scope = spfile;
(You must pay attention to the dot and no parentheses. The same letter in a line in vi cannot be split. It is best to wrap it actively)
SQL> shutdown immediate;
$ Cp control01.ctl control03.ctl
SQL> startup;
SQL> select * from v $ controlfile;
SQL> shutdown immediate
SQL> startup
Method 2:
1. create pfile from spfile;
2. shutdown immediate
3. Modify the parameter file initPROD. ora cd $ ORACLE_HOME/dbs vi initPROD. ora.
*. Control_files = '/u01/app/oracle/oradata/PROD/DISK1/control01.ctl', '/u01/app/oracle/oradata/PROD/DISK2/control02.ctl', '/u
01/app/oracle/oradata/PROD/DISK3/control03.ctl'
4. Copy control files to the new disk address multiple times: [oracle @ vmoel5u4 DISK2] $ cp./control02.ctl/u01/app/oracle/oradata/PROD/DISK3/control03.ctl
5. Recreate the spfile and start the database: sqlplus/as sysdba create spfile from pfile startup
6. Check whether the parameter is successfully added: SQL> show parameter control