Introduction to Oracle instance recovery and flashback, oracleflashback

Source: Internet
Author: User

Introduction to Oracle instance recovery and flashback, oracleflashback

Instance recovery phase:
1. data files are not synchronized

2. Roll Forward (redo)
3. submitted and unsubmitted data in the file

4. Open the database

5. Roll Back (Restore undo)

6. submit data in the file
Optimize instance recovery: (accelerate dirty Data Writing)
Use MTTR
Fast_start_mttr_target (do not set/increase system burden)
Db_writer_pricesses (DBWn process)

Flashback;
The location is specified by the DB_RECOVERY_FILE_DEST parameter and the size is specified by the DB_RECOVERY_FILE_DEST_SIZE parameter. This parameter can be used to store backup, archived logs, flash logs, image control files, and image redo logs and automatically manage them according to the retention policy
Flash query: flashback query
Flash back transaction query:
Flash back VERSION Query:
Flash Back table deletion:
Flash back database:
Flash back archive: 11 GB New Features

Flash recovery zone: the default location of all recovery-related files, which simplifies the management of files required for restoration and recovery.
Permanent file: Control File multiplexing copy
Online redo log file multiplexing copies
Temporary Files: Archived logs, rman backups, and copies
Automatic Backup of Control Files
Flash Back log files,
Except for the flash log, other files can be redirected.

Archive log list;
-- Check whether the archive is enabled
Select log_mode from v $ database;
-- Whether the database is archived


 

The is_recovery_dest_file of the data dictionary shows whether the data is stored in the Flash recovery zone.


V $ controlfile, v $ logfile, v $ archived_log
V $ recovery_file_dest
-----------------------------------------------------

Select GROUP #, BYTES/1024/1024 size_m, MEMBERS, STATUS from v $ log;
-- View a log Group
Alter system switch logfile;
-- Switch logs
Select GROUP #, STATUS, TYPE, MEMBER, IS_RECOVERY_DEST_FILE from v $ logfile;
-- View information in v $ logfile

Instance recovery: instance recovery
Crash recovery: crash recovery

 

 

 

 


Which background process can automatically restore an Oracle instance when it is started?

SMON

SMON is responsible for system monitoring and cleaning and recovery of some systems, including:
1. Clear temporary space and temporary segments
SMON is responsible for clearing the temporary segments in the temporary tablespace when the database is started, or temporary segments left behind by some abnormal operations, such as when an index is created, the Segment allocated to the Index during creation is marked as TEMPORARY. If the Create Index (or rebuild Index, etc.) Session is interrupted due to exceptions, SMON is responsible for clearing these TEMPORARY segments.
2. Join idle Space
In DMT (dictionary management tablespace), SMON is responsible for concatenating Extent that are idle in the tablespace and are adjacent to each other into a large idle expansion zone, this requires that the pctincrease of the tablespace be set to a non-zero value.
3. Execute Instance recovery)
During instance recovery, SMON involves three steps: Application Redo rollback, database access, and uncommitted data rollback.

The SMON background process performs all system monitoring functions on the Oracle database. the SMON process performs a "warm start" each time that Oracle is re-started, ensuring that any in-flight transaction at the time of the last shutdown are recovered. for example, if Oracle crashed hard with a power failure, the SMON process is attached at startup time, and detects any uncompleted work, using the rollback segments to recover the transactions. in addition, SMON performs periodic cleanup of temporary segments that are no longer needed, and also perform tablespace operations, coalescing contiguous free extents into larger extents.

Oracle Advanced database application, lab report: Use flashback to restore tables, modes, and database-level accidental deletion of data flash back

First, you need to know the dependency:
Flashback database depends on: flashback log
Flashback drop depends on: Recycle Bin
Flashback table/query depends on: undo
To enable flashback, you must be in the mount status:
Alter system set db_flashback_retention_target = 2880 scope = both;
Alter database flashback on;
In addition, you need to use the transaction number to obtain the undo statement.
View the transaction number: select versions_xid, empno, ename, sal from tt01
Versions between timestamp minvalue and maxvalue
Order by empno;
View the undo_ SQL statement based on the obtained transaction number:
Select undo_ SQL from flashback_transaction_query
Where xid = 'versions _ xid' // the xid here is the versions_xid found above.
If only the tables accidentally deleted are flashed back:
Flashback table TT01 to before drop;
Flashback refers to the recently deleted table. You can also customize the accidentally deleted table as needed.
Steps:
View the content of the DB recycle bin: show recyclebin;
You can view the deleted table, and view the table structure according to the recyclebin name.
For example, desc "BIN $ 3naDFKEKFIDISB332DI"

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.