1 Oracle Flashback Technologies COUG Presentation – Feb 2010 Feb 25, 2010 Ray Smith

Slides:



Advertisements
Similar presentations
SQL Gone Bad What to do when faulty SQL code corrupts your database Mary Louise Powers Tom Smull Lehigh University.
Advertisements

Chris Ruel * Image used without permission.
1 Oracle Migration Strategies COUG Presentation – Feb 2013 Feb 21, 2013 Ray Smith
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Oracle 11g R1 Top Features for Developers & DBA’s August 2008.
17 Copyright © 2005, Oracle. All rights reserved. Performing Flashback.
Chapter 14 Handling Online Redo Log Failures. Background RMAN doesn’t back up online redo logs You don’t use RMAN to recover from online redo log failures.
ORACLE FLASHBACK. Flashback Flashback a nivel de base de datos Flashback a nivel de tabla Flashback a nivel de tabla borrada Flashback query Flashback.
Backup and recovery Basics of Backup and restoration Types of recovery Defining strategy Starting up and shutting down 80/20 rule SLA’s.
10 Copyright © 2009, Oracle. All rights reserved. Managing Undo Data.
5 Copyright © 2006, Oracle. All rights reserved. Database Recovery.
Database Backup and Recovery
RMAN Restore and Recovery
Backup and Recovery Part 1.
Chapter 12 Performing Incomplete Recovery. Background Viewed as one of the more difficult chapters to write Thought it was important to put in material.
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.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Introduction to Oracle Backup and Recovery
Using RMAN to Perform Recovery
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.
Oracle Database High Availability Brandon Kuschel Jian Liu Source: Oracle Database 11g Release 2 High Availability An Oracle White Paper November 2010.
Clonedb: The quick and easy cloning solution you never knew you had. Tim Hall Oracle ACE Director Oracle ACE of the Year 2006.
13 Copyright © Oracle Corporation, All rights reserved. RMAN Complete Recovery.
NoCOUG 2005 Winter Conference NoCOUG 2005 Winter Conference Oracle 10g Backup and Recovery New Features Daniel T. Liu Senior Technical Consultant First.
UNIT TESTING FOR SQL Prepared for SUGSA CodeLabs Alain King Paul Johnson.
1 Oracle Database 11g – Flashback Data Archive. 2 Data History and Retention Data retention and change control requirements are growing Regulatory oversight.
1 Transaction Internals Julian Dyke Independent Consultant Web Version juliandyke.com © 2007 Julian Dyke.
4 Copyright © 2006, Oracle. All rights reserved. Recovering from Noncritical Losses.
9 Copyright © 2004, Oracle. All rights reserved. Flashback Database.
Flashback Flashback Query Fb0.sql 9iR1 – primitive
Backup and Recovery Overview Supinfo Oracle Lab. 6.
Understanding SQL Server 2008 Change Data Capture Bret Stateham Training Manager Vortex Learning Solutions blogs.netconnex.com.
16 Copyright © 2004, Oracle. All rights reserved. Undo Management.
Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: Tammy Bednar Sr. Product.
6 Copyright © 2006, Oracle. All rights reserved. Flashback.
15 Copyright © Oracle Corporation, All rights reserved. RMAN Incomplete Recovery.
7 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
10 Copyright © 2004, Oracle. All rights reserved. Recovering from User Errors.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Over view  Why Oracle Forensic  California Breach security Act  Oracle Logical Structure  Oracle System Change Number  Oracle Data Block Structure.
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
© 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.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
3 Copyright © 2007, Oracle. All rights reserved. Using the RMAN Recovery Catalog.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
11 Copyright © 2007, Oracle. All rights reserved. Using Flashback Technology.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
20 Copyright © 2006, Oracle. All rights reserved. Best Practices and Operational Considerations.
What is the Flashback Database? Improves a database’s availability Useful alternative to traditional restoration methods Contains Flashback logs Archived.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
What is Flashback? Technology that allows you to revert the database to a point in time in the past Several versions of flashback available Different types.
23 Copyright © 2004, Oracle. All rights reserved. Preferring the Past: Flashback.
Oracle 10g Administration Database Control and Storage Structures Copyright ©2006 Custom Training Institute.
A Hitchhikers View Of The Oracle Underground Raghav Vinjamuri.
9 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
10 Copyright © 2007, Oracle. All rights reserved. Managing Undo Data.
Oracle Database High Availability
How To Pass Oracle 1z0-060 Exam In First Attempt?
Performing Flashback.
Recovering from User Errors
Oracle Database High Availability
Clonedb: The quick and easy cloning solution you never knew you had.
Transaction Internals
Advanced PL/SQL Programing
Using Flashback Technology I
RAC Backup and Recovery Lab
Oracle 12R2 Database Flashback Technologies
Presentation transcript:

1 Oracle Flashback Technologies COUG Presentation – Feb 2010 Feb 25, 2010 Ray Smith

2 What are my objectives today? Introduce you to some flashback technologies Raise your awareness of what’s available I won’t go over everything, 1 hour, not 5 days.. Maybe light a spark so you’ll go play too. Fly through the slides as quickly as possible. Go break my system and fix it… lots of times Agenda:

3 Flashback technologies Flashback Query Flashback Table Flashback Drop Flashback Versions Query Flashback Transaction Query Flashback Database Flashback Data Archive

4 Flashback technologies Flashback Query SQL> exec dbms_flashback package.. 9i R1. Scary code: DECLARE CURSOR emp_cur IS SELECT * FROM EMPLOYEE; v_rec emp_cur%rowtype; BEGIN DBMS_FLASHBACK.ENABLE_AT_TIME ('25-FEB-10 08:10:58'); open emp_cur; DBMS_FLASHBACK.DISABLE; LOOP fetch emp_cur into v_rec; EXIT WHEN emp_cur%NOTFOUND; INSERT INTO EMPLOYEE_TEMP VALUES (v_rec.emp_id, v_rec.name, v_rec.age ); END LOOP; close emp_cur; COMMIT; END; SQL> SELECT.. FROM.. AS OF…. WHERE

5 Flashback technologies Flashback Table SQL> flashback table … to timestamp … SQL> flashback table … to SCN … Flashback Drop Use of Recyclebin flashback table … to before drop;

6 Flashback technologies Flashback Versions Query Ability to capture changes to data over a given time. VERSIONS_STARTTIME (start timestamp of version); VERSIONS_STARTSCN (start SCN of version); VERSIONS_ENDTIME (end timestamp of version); VERSIONS_ENDSCN (end SCN of version); VERSIONS_XID (transaction ID of version); and VERSIONS_OPERATION (DML operation of version).

7 Flashback technologies Flashback Transaction Query Who run that? What was it? What is the UNDO code? Use of FLASHBACK_TRANSACTION_QUERY SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; SQL> select * from FLASHBACK_TRANSACTION_QUERY where xid= HEXTORAW(' A D');

8 Flashback technologies Flashback Database – through RESETLOGS (10.2) Create a flash recovery area Restart database ( mount exclusive ) SQL> ALTER DATASE FLASHBACK ON; SQL> ALTER SYSTEM SET db_flashback_retention_target = ; SQL> ALTER DATABASE OPEN; Restore Points create restore point PREQA_TESTING; create restore point PREQA_TESTING guarantee flashback database; drop restore point PREQA_TESTING;

9 Flashback technologies Flashback Data Archive SQL> create FLASHBACK ARCHIVE default tablespace quota 200M retention 1 MONTH; SQL> alter table flashback archive ;

10 Why are DBA’s avoiding using Flashback options? Complicated to setup – I think.. Too confusing.. I don’t have time to figure it out It slows down my system.. I think It’s new, so probably not so reliable

11 Why DBA’s should get to know it… It’s actually quite good. It can seriously save your bacon. Fast recoveries

12 How do you configure Flashback? It Depends.. Flashback Query – no setup required – Just undo Flashback Table – no setup required – Just undo Flashback Drop – Recyclebin – on by default. Flashback Versions - no setup required – Just undo Flashback Database – Requires a flash recovery area / feature to be switched on. Flashback Transaction – may require supplimental data Flashback Data Archives – needs flashback tablespace

13 How to Flashback Database? FLASHBACK DATABASE TO [BEFORE] SCN FLASHBACK DATABASE TO [BEFORE] TIMESTAMP FLASHBACK DATABASE TO [BEFORE] RESTORE POINT

14 Live Demo

15 Summary Start playing with flashback. Potential issues ERROR at line 1: ORA-08185: Flashback not supported for user SYS