In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The oracle database control file is a very important file. It is a binary file automatically generated when the database is created, which records the status information of the database and mainly includes the following contents.
The name of the 0 database. A control file can only belong to one database.
The time when the database was created
The name, location, online and offline status information of the @ data file
The name, location and archiving information of the redo log file
All tablespace information
The current log serial number
Recent checkpoint information
The control file is read in the Mount phase of database startup. When the database is started, the default rule is used to find and open the parameter file, and the location information of the control file is contained in the parameter file. After opening the control file, the database will be opened through the location of various database files recorded in the control file, thus starting the database to the available state. When the database is started successfully, during the operation of the database, the database server can constantly modify the contents of the control file, so when the database is opened, the control file must be readable and writable. However, no other user can modify the control file, and only the instance of the database can modify the information in the control file.
To view the control file information, you can view the control file information and control the file name from the V$controlfile view
In addition to viewing control file information from the V$controlfile view, you can also view it from the V$parameter view
How to view the content information stored in a control file
You can use V$controlfile_record_section
View type,record_size,records_total,records_used in V$controlfile_record_section
From the screenshot, you can see that the control file stores information about the creation of the database, redo log information, data files and archived log records and other information. This valuable information is used for data maintenance and management, and many data dictionary views are information obtained from control files.
Store multiple control files
Because the control file is very important, it requires that there can be not only one control file, usually more than 3 control files in the database, and stored on different disks. This method of using control files is also known as the multiplexing of control files. One way to achieve multiple is to copy the control file to multiple locations and modify the CONTROL_FILES parameter in the initialization parameter file to include all the control file names. It is important to note that when there are multiple control files, oracle updates all control files at the same time, but only reads the first control file listed in CONTROL_FILES.
An example is given to illustrate the method of multiplexing control files.
The database state is open. Modify the CONTROL_FILES parameter in SPFILE
Shut down the database
Use operating system commands to copy files to a new location
Restart the instance
Backup control file
Backup control file
In order to ensure the security of the database, the control file is backed up when the location information of the data file or log file changes, such as when the data file is added to the tablespace. There are two backup methods: backup as binary file and backup as script file
Give an example of how to back up as a binary file:
Check how many control files exist in the current system before backing up control files
Backup control file
Modify system parameter file
An ORA-00214 error was reported after starting the database after shutting down the database, due to inconsistent versions of the control files
The version of control01.ctl control file is 817, and the version of control02.ctl is 806.
Use control01.ctl to overwrite control03.ctl to keep the version of the control file consistent.
Shut down the database
Just restart the database.
Restore control file
Assuming that the control file specified by CONTROLD_FILES is corrupted, but the control file can still be accessed in the data dictionary, you can use the following steps to recover:
Close the database instance
Delete control file
Start the database
The status of the database at this time is
Overwrite the damaged control file with the intact control file with the operating system
Close the current database
Restart the database instance
If you have any questions about this article, please add Wechat below to discuss it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.