Oracle internal recovery principle (hot backup)

Source: Internet
Author: User
Oracle Hot Backup refers to copying data files when they are in use. DBWR is also in progress during the replication process, so some ldquo and inconsistent rdquo may be obtained from the backup;

Oracle Hot Backup refers to copying data files when they are in use. DBWR is also in progress during the replication process, so some ldquo and inconsistent rdquo may be obtained from the backup;

Oracle Hot Backup refers to copying data files when they are in use. DBWR is also in progress during the replication process. Therefore, the backup may result in "inconsistent" backup:

Series of articles: Oracle internal recovery principles? Where = nkey & keyword = 19824

A. Some data blocks may be earlier than other data blocks.

B. the SCN of some data blocks may be earlier than the SCN of the data file header.

C. Some blocks may contain partial updates of a redo record, while others may be on this data file or other data files.

D. Some data blocks may be damaged because the headers and tails of the blocks are copied at different times.

The backup set obtained through the above replication method is useless after restoration and media restoration. During media recovery, hot-standby SCN is performed from the beginning of the data file (see step 2 in 4.1) until the recovery process ends (complete or incomplete recovery ). In this way, the data files are consistent in transactions.

Hot Backup involves three steps:

A. Execute the command: alter tablespace... begin backup.

B. Call the replication tool of the operating system to copy all data files in the tablespace.

C. Execute the command: alter tablespace... END BACKUP

4.1 BEGIN BACKUP

The begin backup command actually performs the following operations on all data files in the table space (not in order ):

1. A hot backup fuzzy flag is set in the header of each data file, indicating that the data file is in the hot backup state. The data file header with this mark indicates that this backup is a hot backup. The purpose of the flag is to freeze the checkpoint of the data file header (staying at the SCN at the moment when the begin backup command is issued ). This value is used to re-apply the redo log from the early enough SCN when the backup is restored. Because we cannot guarantee that the data file header is copied first, during hot backup, the checkpoint of the data file header must be frozen to support hot backup. This standard also freezes the checkpoints of data files (as well as the checkpoints recorded in the control file) to avoid being updated by the thread checkpoint. After version 7.2, a new backup checkpoint is added to the data file header to receive updates that were originally frozen checkpoint.

2. A data file checkpoint operation is performed to capture the checkpoint information when the hot backup starts, including the SCN when the hot backup starts. When a data file is checked, all instances must refresh the dirty data related to the data file. If the instance needs to be restored at this time, the check point will wait until the recovery is complete and then continue. When the backup is started, the data file is checked to ensure that during the hot backup period, the blocks modified only after the Hot Backup command is issued may be written to the data file.

3. [related to the platform, optional]: pre-image records of data blocks starting after hot backup. During the record process, all instances record the complete block for each block to be modified, rather than modifying the vector to the redo log. This is to prevent the recovery from encountering fragmented blocks (inconsistent blocks), most of which occurs when the size of data blocks is larger than that of the operating system blocks, updating data blocks results in the previous and later parts being copied at different times. After hot backup, the recovery process can use the complete pre-image recorded in the redo log to build data blocks.

4. Set the Check Point in the data file header to be consistent with the check point at the time when hot BACKUP is started, and freeze it until the "end backup" command is issued.

5. The online fuzzy bit mark of the data file is cleared. During Hot BACKUP, this status bit is cleared until the "end backup" command is issued.

4.2 copy a file

Replication is performed by operating system tools. The Administrator must ensure that the replication operation occurs between "bengin backup" and "end backup" or when the file is not used.

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.