In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Self-organized: oracle11g database recovery technology in the face of crisis
Control file entries that are important for backup and recovery
Dbid
Dbid is saved in the control file, and also exists in the head of the data file and the log file. Its function is to judge whether the control file, data file and log file belong to the same database.
Database name
This information is consistent with dbid.
Control file serial number
The serial number is one of the elements to determine whether the control file is too old and will grow after the control file is updated. Controlling file growth includes checkpoint information updates, creation or deletion of tablespaces, and so on.
Control file sequence numbers are also found in the headers of data files and log files, but unlike those in control files, they are copied from the control file at that time when their headers are updated.
When the library is running, when the headers of the data files and log files are updated, the control file must copy part of its contents, so in general, the control file sequence number must be greater than the control file sequence number in the data file and log file header. Otherwise, the current control file is considered old.
Select controlfile_sequence# from v$database
Select hxfil as file#,fhcsq as controlfile_sequence# from x$kcvfh
Oracle will not only rely on the control file sequence number to determine whether the control file is old, but also rely on the control file checkpoint. If the sequence number check fails, then there is no need to check the control file checkpoint scn.
Control file checkpoint scn
The scn is also one of the elements to determine whether the control file is old. Full checkpoint updates scn to control file and data file header
The incremental checkpoint is only updated to the control file. Regardless of the checkpoint, the scn is represented in the control file by a record called the control file checkpoint scn.
In the database open state, the scn must be greater than or equal to the low scn (v$log.first_change#) in the current log file. At the same time, the value of the control file checkpoint SCN must be greater than the checkpoint SCN number of all data file headers, otherwise the control file is considered to be old and the instance recovery cannot be started.
Select controlfile_sequence#,controlfile_change# from v$database
Select group#,sequence#,first_change# from v$log where status='CURRENT'
Database checkpoint scn
The database checkpoint scn saved in the control file is actually the smallest checkpoint scn in all the data file headers. Based on its value compared with the high and low scn of each log file, oracle determines which log file needs to be used.
Online log low order (first_change#) and high order scn (next_change#)
The range of redo records in the log file is represented by the two scn. The low scn refers to the first redo record scn in the log file, and the high order scn refers to the first redo record scn in the next log file.
Rman database
By default, the control file is the rman database of the database. Related records include: rman configuration, flashback log path, redo log history, archive path and attributes, rman backup set information, rman image replication information, damaged block information in rman backup set and rman image replication, bad block information in data files, etc.
Restore point information
Restore point is an alias for scn, created by the create restore point command, mainly used for flashback technology, and saved in the control file
Reset log scn
Every time you use the resetlogs clause to open the scn of the database, the log file and data file header will also save the scn. Every time you open the database, oracle will check whether they are consistent. Resetlogs is generally the result of incomplete recovery.
There are mainly four kinds of SCN in Oracle
1. System checkpoint (system checkpoint) SCN
Whenever a checkpoint is completed, Oracle records the SCN corresponding to that checkpoint in the control file. You can view the checkpoint SCN of the current database with the following statement:
SYS@xbtst SQL > select checkpoint_change# from vested database China Checkpoint database-2084301
two。 Data file header SCN (startup SCN of data file)
The SCN is recorded in each data file header, and normally, the SCN should be the same as the checkpoint SCN recorded in the control file. You can view the SCN of the data file header with the following statement:
SYS@xbtst SQL > select file#,checkpoint_change# from vicious datafile headers; FILE# CHECKPOINT_CHANGE#--1 2084301 2 2084301 3 2084301 4 2084301 5 2084301
3. Checkpoint SCN and termination SCN of data files
These two SCN are not recorded in the data file, but in the control file, which can be viewed by the following statement:
SYS@xbtst SQL > select checkpoint_change#,last_change# from vault data; CHECKPOINT_CHANGE# LAST_CHANGE#--2084301 2084301 2084301
So how does Oracle determine whether a data file needs to be recovered and the type of recovery based on these different SCN? You can describe it with the following pseudo code:
If (data file checkpoint SCN
< 数据文件头SCN) then "控制文件来自备份,需要进行不完全恢复,恢复之后得用resetlog方式打开" else if (数据文件检查点SCN >Data file header SCN) then "data file comes from backup and requires full or incomplete recovery by log" else if (data file checkpoint SCN = data file header SCN) then "database can open normally You also need to determine whether instance recovery is required. "if (data file termination SCN = data file checkpoint SCN) then" instance recovery is not required when the database is opened "else if (data file termination SCN = NULL) then" the database requires instance recovery "
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.