Oracle backup recovery Overview

Source: Internet
Author: User

Backup recovery is an important technology in Oracle. Of course, it is recommended that you do not need this technology, just as you do not need to go to the hospital.

When you open the database, oracle compares the control file with the data file header checkpoint:
 
1. Check whether the checkpoint cnt in the data file header is consistent with the checkpoint cnt in the control file. If so, perform the second check.
 
2. Check that the SCN at the beginning of the data file header is compared with the ending SCN in the control file. If they are consistent, no recovery is required. If they are inconsistent, such as sudden power failure, the control file is not
 
The second step cannot be passed because it is too late to record the ending SCN of the data file.
 
Of course, all backups are for faster recovery. Therefore, you must take into account many aspects when developing a backup policy.
 
The following Backup Types:
 
Category:
 
Logical backup and physical backup
 
Database status:
 
Hot Standby and Cold Standby
 
Backup status:
 
Consistent backup and non-consistent backup
 
Backup scale:
 
Full backup (archive and non-archive), tablespace backup, data file backup, control file backup, archive log file backup
 

 

Recovery category:
 
Instance recovery, media recovery
 
Recovery Method:
 
Full recovery and Incomplete recovery
 

 

Common Backup Recovery Technologies:
 
1. the user manages backup and recovery
 
2. RMAN backup and recovery
 
3. Flashback
 
4. Logical import and export, exp/imp expdp/empdp
 
5. data guard, of course, DG is used for Disaster Tolerance. In the end, it is still backup.
 

 

Let's take a look at the simplest technology.
 
Flash back query:
 
This feature is actually attributed to UNDO. Flash-back queries are actually the data that has been operated by the UNDO query. Therefore, if the operated data is not included in the UNDO query, it is certainly impossible to flash back the query.
 
For example, for an update operation, after the operation, the data to be operated before the update will be constructed in the UNDO, so you can use the flashback query immediately. Of course, if your update operation is incorrect, you can flash back
 
However, if UNDO already overwrites the operation data, it cannot be flashed back. As we all know, the UNDO data is retained based on certain parameters and will be overwritten after this time.
 
Supported types of flashback query:
 
1. SCN-based flash query (as of scn)
 
2. Time-based flash back query (as of timestamp)
 
SCN-based flash back query instance:
 
SQL> create table flash_table_scn as select * from dba_objects where rownum <= 1000;
 

 

Table created.
 

 

SQL> select count (*) from flash_table_scn;
 

 

COUNT (*)
 
--------------------------------------------------
 
1000
 

 

SQL> SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;
 

 

GET_SYSTEM_CHANGE_NUMBER
 
--------------------------------------------------
 
122693324625
 

 

SQL> delete from flash_table_scn;
 

 

1000 rows deleted.
 

 

SQL> commit;
 

 

Commit complete.
 

 

SQL> select count (*) from flash_table_scn as of scn 122693324625;
 

 

COUNT (*)
 
--------------------------------------------------
 
1000
 
As of timestamp is still converted to as of scn
 

SQL> select timestamp_to_scn (sysdate) from dual;
 

 

TIMESTAMP_TO_SCN (SYSDATE)
 
--------------------------------------------------
 
122693325694
 

 


SQL> select to_char (scn_to_timestamp (122693325694), 'yyyy-mm-dd hh24: mi: ss') from dual;
 

 

TO_CHAR (SCN_TO_TIMESTAMP (12269
 
---------------------------------------------------------------------------
 
2013-04-15 17:21:56
 

 

The possible conversion is because the table SMON_SCN_TIME records the corresponding data of the time and SCN. Therefore, if this table does not have a corresponding data, it cannot be converted.
 
Flash back technology is easy to use. Here you can also flash back to the database. The table technology will continue. See

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.