Disaster recovery methods for Oracle databases (1)

Source: Internet
Author: User

Introduction: Oracle DatabaseIt is a kind of relational database management system that is favored by users. to make good use of Oracle databases, we need to have a clear understanding of Oracle database backup and recovery for a long time, first, it is necessary to have a full understanding of several running statuses of the database. The running status of the Oracle database is divided into three types.

The three running statuses are as follows:

There are three types of Database Backup:Cold backup; hot backup; logical backup;

Database Backup is not the focus of this Article. Here we will only give a brief introduction,Oracle Database BackupMainly include:

Database recovery can be divided into two categories:Full recovery; Incomplete recovery;

Full recovery refers to restoring the database to the time point of failure without losing any data. Incomplete recovery refers to restoring the database to a time point before a fault occurs. All changes after this time point will be lost. If there are no special requirements, we recommend that you use full recovery whenever possible.

The restoration process of the Oracle database is divided into two steps. First, all the retries stored in the redo log file are applied to the data file, and then all uncommitted transactions in the Redo are rolled back, in this way, all the data will be restored to the time of the disaster. Database recovery can only be used to redo data files before a fault occurs, restoring them to the time of failure, rather than rolling back the data files to a previous time point. For example, we have a database backup of 2001/1/1. When 2001/5/1, we find that data in the database is in disorder and want to restore the database to the status of 2001/4/30, we can only restore the database backup of 2001/1/1 and then use the redo record on it to roll back to the status of 2001/4/30, instead of rolling back the database of 2001/5/1 to 2001/4/30.

To design a database recovery plan for the system, we first classify possible errors,Oracle Database ErrorThere are five main categories:

If the first three failures do not require human intervention, the Oracle system will automatically recover. For user operation failures (such as accidental deletion of data), the main remedial measures we take include importing the latest logical backup or incomplete recovery at a certain point in time. In the new version after Oracle 8, table space-based time point recovery (TSPITR) is introduced. You can separately restore tablespaces that contain incorrect operations to the specified time, instead of completely restoring the entire database. You can use logminer to generate reverse SQL statements when error operations are detected in a timely manner and the data volume is small.

The failure of storage devices is complicated and is also the focus of this article. The failure of storage devices will inevitably make the files placed on them unavailable, first, we divide the files involved in the Oracle database into the following types:

Oracle system files refer to Oracle running files and various applications.

To avoid the first type of file failure, the system administrator is primarily responsible for operating system-level backup. in case of an accident, the system administrator can only rely on operating system backup to recover the file.

The control file records the entire database structure, the status of each data file, the system SCN, checkpoint counters, and other important information, when creating a database, users are asked to specify three locations to store control files. They mirror each other. when either of them fails, you only need to comment out the fault data file from the INI file to restart the data. When all the controls are invalid, You can execute create controlfile in Nomount mode to regenerate the control file. However, you must provide redo log, data file, file name and address, MAXLOGFILES, MAXDATAFILES, MAXINSTANCES and other information. If you have run alter database backup controlfile to trace or alter database backup controlfile to 'xxx' before the failure to back up the control file, during recovery, you can use the generated script to re-build or overwrite the backup file. If you use the old control file, you must use the recover xxx using backup controlfile option for recovery, and use the resetlogs option to open the database.


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.