What is the Flashback Database? Improves a database’s availability Useful alternative to traditional restoration methods Contains Flashback logs Archived.

Slides:



Advertisements
Similar presentations
9 Creating and Managing Tables. Objectives After completing this lesson, you should be able to do the following: Describe the main database objects Create.
Advertisements

SQL2-ch2 管理綱要物件.
Data Definition Language (DDL)
Oracle Academy Egypt Virtual training week 8 Sections from 7 to 9.
Creating Tables. 2 home back first prev next last What Will I Learn? List and provide an example of each of the number, character, and date data types.
17 Copyright © 2005, Oracle. All rights reserved. Performing Flashback.
Introduction to Structured Query Language (SQL)
Chapter 3: Using SQL Queries to Insert, Update, Delete, and View Data
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Introduction to Structured Query Language (SQL)
5 Copyright © 2006, Oracle. All rights reserved. Database Recovery.
Chapter 5 Data Manipulation and Transaction Control Oracle 10g: SQL
RMAN Restore and Recovery
Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.
Chapter 12 Performing Incomplete Recovery. Background Viewed as one of the more difficult chapters to write Thought it was important to put in material.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
CHAPTER 16 User-Managed Backup and Recovery. Introduction to User Managed Backup and Recovery Backup and recover is one of the most critical skills a.
7 Copyright © 2006, Oracle. All rights reserved. Dealing with Database Corruption.
NoCOUG 2005 Winter Conference NoCOUG 2005 Winter Conference Oracle 10g Backup and Recovery New Features Daniel T. Liu Senior Technical Consultant First.
Chapter 6 Additional Database Objects
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
1 Oracle Flashback Technologies COUG Presentation – Feb 2010 Feb 25, 2010 Ray Smith
9 Copyright © 2004, Oracle. All rights reserved. Flashback Database.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
17 Copyright © Oracle Corporation, All rights reserved. Recovery Catalog Creation and Maintenance.
Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: Tammy Bednar Sr. Product.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
6 Copyright © 2006, Oracle. All rights reserved. Flashback.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
7 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
11 Copyright © 2004, Oracle. All rights reserved. Dealing with Database Corruption.
Database Lab Lecture 1. Database Languages Data definition language ( DDL ) Data definition language –defines data types and the relationships among them.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
10 Copyright © 2004, Oracle. All rights reserved. Recovering from User Errors.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
2 Copyright © 2006, Oracle. All rights reserved. Managing Schema Objects.
Over view  Why Oracle Forensic  California Breach security Act  Oracle Logical Structure  Oracle System Change Number  Oracle Data Block Structure.
1 Announcements Reading for next week: Chapter 4 Your first homework will be assigned as soon as your database accounts have been set up.  Expect an .
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
Chapter 12 Additional Database Objects. Chapter Objectives  Define the purpose of a sequence and state how it can be used by an organization  Explain.
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
Chapter 12Introduction to Oracle9i: SQL1 Chapter 12 Additional Database Objects.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
19 Managing Privileges Objectives Identifying system and object privileges Granting and revoking privileges Controlling operating system or password.
11 Copyright © 2007, Oracle. All rights reserved. Using Flashback Technology.
Chapter 3 Table Creation and Management Oracle 10g: SQL.
 CONACT UC:  Magnific training   
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
Oracle 11g: SQL Chapter 5 Data Manipulation and Transaction Control.
23 Copyright © 2004, Oracle. All rights reserved. Preferring the Past: Flashback.
2 Copyright © 2009, Oracle. All rights reserved. Managing Schema Objects.
10 Copyright © 2007, Oracle. All rights reserved. Managing Undo Data.
Oracle Database High Availability
Performing Flashback.
Recovering from User Errors
Oracle Database High Availability
SQL .. An overview lecture3.
Using Flashback Technology II
Using Flashback Technology I
Presentation transcript:

What is the Flashback Database? Improves a database’s availability Useful alternative to traditional restoration methods Contains Flashback logs Archived log files Backups Retrieves old data block versions Integrated with RMAN and SQL*Plus.

Oracle Flashback Technology Options Oracle Flashback Query Oracle Flashback Transaction Query Oracle Flashback Table Oracle Flashback Drop Oracle Flashback Version Query

FLASHBACK TABLE Summary Point-in-time Recovery On-line Table Attributes Maintained Constraints Considered Return to Original State

FLASHBACK in Practice Prerequisites FLASHBACK ANY TABLE system privilege or FLASHBACK object privilege on table SELECT, INSERT, DELETE and ALTER privilege on table UNDO goes back to desired point in time Execute SQL*Plus command FLASHBACK TABLE SCOTT.ORDERS TO TIMESTAMP TO_DATE('28-JUL-08 01:00:00','dd-MON-yy hh24:mi:ss');

Manage the Recycle Bin Recycle Bin: Data dictionary table Stores information about dropped tables, nested tables, constraints, indexes and related objects Information stays in recycle bin until purged

Viewing Contents of Recycle Bin At the view level: DBA_RECYCLEBIN view USER_RECYCLEBIN view Using SQL*Plus : SQL> SHOW RECYCLEBIN

Object Naming in the Recycle Bin Naming convention: BIN$unique_id$version where: unique_id is a 26-character unique identifier version is a system-assigned version number

The FLASHBACK TABLE... TO BEFORE DROP Statement Used to recover objects from the recycle bin Must have the same privileges you needed to drop the table in order to execute the command May use the system-assigned name, the name you have assigned to the table using the RENAME TO clause, or the original name of the table Dependent objects keep the names the system has assigned to them

Purging Objects in the Recycle Bin Permanently delete data from recycle bin Syntax: PURGE RECYCLEBIN; PURGE DBA_RECYCLEBIN;

Automatically Purged Objects Objects belonging to a dropped user Dependent objects belonging to dropped types Member tables belonging to a dropped cluster Objects belonging to a dropped tablespace

Disabling the Recycle Bin Disabling does not purge the recycle bin You may not recover dropped tables from a disabled recycle bin Syntax: ALTER SESSION SET recyclebin = OFF; ALTER SYSTEM SET recyclebin = OFF;

Enabling the Recycle Bin The recycle bin is enabled by default. Use ALTER SESSION SET or ALTER SYSTEM SET to enable it, if needed: ALTER SESSION SET recyclebin = ON; ALTER SYSTEM SET recyclebin = ON;

Recover from User Errors Using Flashback Versions Query Use VERSIONS BETWEEN clause of the SELECT statement for Flashback Versions Queries: SELECT … VERSIONS {BETWEEN {SCN | TIMESTAMP} start AND end}

Perform Transaction Level Recovery Using Flashback Transaction Query Query against FLASHBACK_TRANSACTION_QUERY view Requires SELECT ANY TRANSACTION system privilege Gives you information that lets you undo changes made by the transaction Lets you reconstruct SQL statements used to make changes to the database This feature is useful for recovering from application or user errors.

Flashback Transaction Query Example SET PAGESIZE 130 SET LINESIZE 110 TTITLE 'Current FLASHBACK_TRANSACTION_QUERY Contents For Selected Users' COL xid FORMAT A16 HEADING 'XID#' COL commit_scn FORMAT HEADING 'Commit|SCN' COL operation FORMAT A10 HEADING 'Operation' COL logon_user FORMAT A06 HEADING 'User|Logon ID' COL table_owner FORMAT A06 HEADING 'Table|Owner' COL table_name FORMAT A12 HEADING 'Table Name' COL undo_sql FORMAT A80 HEADING 'UNDO SQL'

Flashback Transaction Query Example SELECT xid, operation, logon_user, table_owner, table_name, commit_scn, undo_sql FROM flashback_transaction_query WHERE xid IN (SELECT versions_xid FROM hr.users VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE WHERE user_id >= 540 AND versions_xid IS NOT NULL);

Flashback Transaction Query Results Current FLASHBACK_TRANSACTION_QUERY Contents For Selected Users User Table Commit XID# Operation Logon Owner Table Name SCN UNDO SQL —————— C00E UPDATE SYS HR USERS update "HR"."USERS" set "SALARY" = '49680' where ROWID = 'AAAGMsAAEAAAABWAAA'; 04000C00E UPDATE SYS HR USERS update "HR"."USERS" set "SALARY" = '54900' where ROWID = 'AAAGMsAAEAAAABYAAE'; 04000C00E UPDATE SYS HR USERS update "HR"."USERS" set "SALARY" = '32700' where ROWID = 'AAAGMsAAEAAAABYAAD';