I have previously reproduced an article on backup and recovery of controlfile. The address is as follows:
Http://blog.csdn.net/wh62592855/archive/2009/11/20/4844506.aspx
Control File Content
Today, I suddenly wondered what information is contained in controlfile, how many data dictionary views are queried, and how many data dictionary views are searched online.
- Database Name. This name is taken from the database name specified in the initialization parameter description or the name used in the create database statement.
- Database identifier. This identifier is automatically generated by Oracle when a database is created.
- The timestamp at which the database is created. It is generated when the database is created.
- Name and exact location of online redo log files. Oracle modifies relevant information when adding redo log files, deleting redo log files, and modifying redo log files.
- The serial number of the current log. It is recorded in Oracle during log switching.
- Checkpoint information. This information is recorded in Oracle when a Check Point is generated.
- Log history. This information is recorded in Oracle during log switching.
- The exact location and status of the archived log file. This information is recorded in Oracle when the redo log file is archived.
- The name and exact location of the data file. Oracle modifies the relevant information when adding, deleting, and modifying data files.
- Tablespace information. When a tablespace is added or deleted, Oracle modifies the relevant information.
- The exact location and status of the backup. The information is recorded by the recovery manager.
How to limit the file size
A control file consists of two parts: reusable and reusable.
You can use the control_file_record_keep_time parameter to control the reusable part. The default value of this parameter is 7 days. The Reusable part of the content can be retained for 7 days. After one week, this part of content may be overwritten. The Reusable part is used by the recovery manager, which can be automatically expanded.
In addition, the Oracle database administrator can use the following keywords (parameters) in the create database or create controlfile statement to indirectly affect the size of reusable parts.
- Maxdatafiles
- Maxinstances
- Maxlogfiles
- Maxlghistory
- Maxlogmembers
Control_file_record_keep_time
Property |
Description |
Parameter type |
Integer |
Default Value |
7 (Days) |
Modifiable |
ALTER SYSTEM |
Range of Values |
0 To365 (Days) |
Basic |
No |
CONTROL_FILE_RECORD_KEEP_TIME
Specifies the minimum number of days before a reusable record in the control file can be reused. in the event a new record needs to be added to a reusable section and the oldest record has not aged enough, the record section expands. if this parameter is set to 0, then reusable sections never expand, and records are reused as needed.
Note:
This parameter applies only to records in the control file that are circularly reusable (such as archive log records and various backup records ). it does not apply to records such as datafile, tablespace, and redo thread records, which are never reused unless the corresponding object is dropped from the tablespace.
How to view control file configurationHow can we get all the records in the control file? It can be obtained through V $ controlfile_record_section.
V $ controlfile_record_section
V$CONTROLFILE_RECORD_SECTION
Displays information about the control file record sections.
Column |
Datatype |
Description |
TYPE |
VARCHAR2(28) |
Identifies the type of record section:
|
RECORD_SIZE |
NUMBER |
Record size in bytes |
RECORDS_TOTAL |
NUMBER |
Number of records allocated for the Section |
RECORDS_USED |
NUMBER |
Number of records used in the section |
FIRST_INDEX |
NUMBER |
Index (position) of the first record |
LAST_INDEX |
NUMBER |
Index of the last record |
LAST_RECID |
NUMBER |
Record ID of the last record |
How to add and move Control FilesTo add or move a control file when using pfile
- Use the data dictionary v $ controlfile to obtain the name of the existing control file
- Close the Oracle database normally
- Add the new control file name to the control_files parameter of the parameter file.
- Use the operating system command to copy the existing control file to the specified location
- Restart the Oracle database
- Use the data dictionary v $ controlfile to verify whether the new control file name is correct.
- If the preceding operations are redone incorrectly, if useless old control files are deleted correctly
To add or move a control file when using spfile
- Use the data dictionary v $ controlfile to obtain the name of the existing control file
- Modify the spfile and use the alter system set control_files command to change the location of the control file.
- Close database normally
- Use the operating system command to copy the existing control file to the specified location
- Restart the Oracle database
- Use the data dictionary v $ controlfile to verify whether the new control file name is correct.
- If the preceding operations are redone incorrectly, if useless old control files are deleted correctly