Oracle Control File

Source: Internet
Author: User

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.

  1. 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.
  2. Database identifier. This identifier is automatically generated by Oracle when a database is created.
  3. The timestamp at which the database is created. It is generated when the database is created.
  4. 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.
  5. The serial number of the current log. It is recorded in Oracle during log switching.
  6. Checkpoint information. This information is recorded in Oracle when a Check Point is generated.
  7. Log history. This information is recorded in Oracle during log switching.
  8. The exact location and status of the archived log file. This information is recorded in Oracle when the redo log file is archived.
  9. The name and exact location of the data file. Oracle modifies the relevant information when adding, deleting, and modifying data files.
  10. Tablespace information. When a tablespace is added or deleted, Oracle modifies the relevant information.
  11. 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 0To365(Days)
Basic No

CONTROL_FILE_RECORD_KEEP_TIMESpecifies 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_SECTIONDisplays information about the control file record sections.

Column Datatype Description
TYPE VARCHAR2(28) Identifies the type of record section:

  • DATABASE

  • CKPT PROGRESS

  • REDO THREAD

  • REDO LOG

  • DATAFILE

  • FILENAME

  • TABLESPACE

  • TEMPORARY FILENAME

  • RMAN CONFIGURATION

  • LOG HISTORY

  • OFFLINE RANGE

  • ARCHIVED LOG

  • BACKUP SET

  • BACKUP PIECE

  • BACKUP DATAFILE

  • BACKUP REDOLOG

  • DATAFILE COPY

  • BACKUP CORRUPTION

  • COPY CORRUPTION

  • DELETED OBJECT

  • PROXY COPY

  • BACKUP SPFILE

  • DATABASE INCARNATION

  • FLASHBACK LOG

  • RECOVERY DESTINATION

  • INSTANCE SPACE RESERVATION

  • REMOVABLE RECOVERY FILES

  • RMAN STATUS

  • THREAD INSTANCE NAME MAPPING

  • MTTR

  • DATAFILE HISTORY

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.