Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN,...

29

Transcript of Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN,...

Page 1: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.
Page 2: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Oracle Database 10g Time Navigation: Human-Error Correction

Magnus Lubeck

DBA/Systems Analyst

CERN, IT-DB Group

Session id: 40109

Tammy BednarSr. Product Manager

Oracle Corporation

Page 3: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Time Navigation Time Navigation and Humanand HumanErrorErrorCorrectionCorrection

noitcerroCnoitcerroC

Correction CorrectionCorrectionCorrection C

orrection

Correction

Correction

Correction

Page 4: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Human Error

Estimated to be the biggest single cause of downtime Need to quickly determine what happened and fix it

– Localized damage Needs surgical detection and repair Example – removed wrong person named ‘Smith’

– Widespread damage Requires drastic action to avoid long downtime Example – batch job deletes this month’s orders

Analysis and correction using traditional recovery is slow and complex

– Restore database to point in time and extract data

Oracle Database 10g is a breakthrough release for human error correction

Human Errors

Other Downtime

Page 5: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Flashback Time Navigation Flashback Query

– Query all data at point in time

Flashback Versions Query– See all versions of a row between

two times– See transactions that changed the

row

Flashback Transaction Query– See all changes made by a

transactionTx 1

Tx 2

Tx 3

Select * from Emp AS OF ‘2:00 P.M.’ where …

Select * from Emp VERSIONS BETWEEN ‘2:00 PM’ and ‘3:00 PM’ where …

Select * from DBA_TRANSACTION_QUERY where xid = ‘000200030000002D’;

Page 6: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Flashback Error Correction Recovery at all levels Database Level

– Flashback Database restores the whole database to time

Uses Flashback Logs Table Level

– Flashback Table restores rows in a set of tables to time

Uses UNDO in database– Flashback Drop restores a

dropped table or a index Recycle bin for DROPs

Row Level– Flashback Query restores rows

to time

Order

Database

Customer

Page 7: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Flashback Database

A new strategy for point in time recovery Eliminate the need to restore a whole

database backup Integrated seamlessly with RMAN

– Think of it as a continuous backup– Restores just changed blocks

– Replay log to restore DB to time It’s fast - recover in minutes, not hours It’s easy - single command restore

Flashback Database to ‘2:05 PM’

“Rewind” button for the DatabaseData Files Flashback

Log

New BlockVersion

Disk Write

Old BlockVersion

Page 8: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Flashback Drop

Quickly recover dropped objects Provides self-service recovery

Eliminate the need for TSPITR Virtual Recycle Bin

– Objects remain in the recycle bin until you permanently drop them with the PURGE command or recover them with the Flashback Table command.

– Objects will remain in the recycle bin until there is no room in the tablespace for new rows or updates to existing rows or until the tablespace needs to be extended

– Objects are purged in the order they were dropped.

Drop table emp;

Emp

Mistake was made

Emp

Recycle bin

Flashback Table emp

before drop;

Page 9: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Flashback Table

Recover a table or tables to a specific point in time without restoring a backup

Provides a way for users to easily and quickly recover from accidental modifications without DBA involvement

In-place and online recovery of a table to a point in time in the past Eliminate traditional restores and clone instances to recover a table or tables

to a specific point in time Data in the tables and all associated objects (indexes, constraints,

triggers, etc.) are restored

Page 10: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Flashback Versions Query

Provides a way to audit the rows of a table and retrieve information about the transactions that changed the rows.

Retrieve all committed versions of the rows that exist or ever existed between the time the query was issued and a point in time in the past

Use the transaction ID to perform transaction mining using LogMiner or Flashback Transaction Query to obtain additional information about the transaction.

Page 11: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Flashback Transaction Query

Provides a way for you to view changes made to the database at the transaction level

When used in conjunction with Flashback Versions Query, it allows you to easily recover from user or application errors.

Benefits– Increase online diagnosability of problems in your

database – Perform analysis and audits of transactions– Fast recovery at the transaction level

Page 12: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Database Mission

Determine what transaction removed Order ID 2453 Recover the corruption fast!

Page 13: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Order ID 2453& line item data

Page 14: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

The Order IDdata is removedfrom the database

Page 15: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Using the ‘VERSIONS BETWEEN’ syntax, you can find the operationsand transactions executed for Order 2453

Page 16: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

After manually executing the SQL statements, Order 2453 & its lineitems have beeninserted back into thedatabase!

Page 17: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Flashback Transaction QueryProvides the SQL statements to ‘undo’the offending operation

Page 18: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

CERN Magnus Lubeck, DBA/Systems analyst

CERN is the world biggest particle physics research center. In operation for 50 years!

In our physics research we collect enormous amounts of data, of which some is stored in ORDBMS

Oracle 10G beta testing and evaluation is an important activity for CERN to support the physics community by understanding and request new features.

10 people in our Oracle beta test team, focusing on different areas

6 miles

Page 19: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Testbed setup

SAN

General purpose for– RAC testing– Oracle 10G testing

The setup– Five dual CPU servers (four connected to SAN)– Gbit interconnect– Plenty of disk– A set up workstations to run applications

Not a setup for Benchmarks, but for proof of concept

Page 20: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Testing Flashback Features

The Flashback features is a subset of the beta testing performed at CERN

The Human Error Correction testing, in order of appearance – the one hour approach

– Install Sofware + DB instance– Setting up the recovery area– Flashback table– Flashback transaction query– Flashback database

Page 21: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

CERN – Testing FB features

RMAN

Repository

Flashback

Table

Database

Instances

SCNFlashback

Database

Flashback

Transaction Query

Configure

Flash

Recovery

Area

Software

Installation

Timeline

Preparations Testing

Page 22: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Summary of CERN Flashback testing

Flashback Table/Drop– Easy to get back dropped

tables– Nice to be able to query

dropped tables Flashback Transaction

Query– Diagnosability– Accountability

Flashback database– Fast recovery

Flash Recovery Area– Organizes & manages

backups

Future use of FB features

Page 23: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Revolution in Recovery

Flashback Revolutionizes Recovery– Operates on just the changed data– Time to correct error equals time to make error

Minutes instead of hours

Flashback is Easy– Single command instead of complex procedure

Correction Time = Error Time + f(DB_SIZE)

Page 24: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Flashback for All UsersEND USER• Flashback Query• Flashback Versions Query

DEVELOPER• Flashback Versions Query• Flashback Transaction Query• Flashback Table

DATABASE ADMIN• Flashback Database• Flashback Drop

SYSTEM ADMIN• Data Guard

Page 25: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Next StepsHigh Availability Sessions from Oracle

11:00 AM

How Oracle Database 10G Revolutionizes Availability and

Enables the Grid

3:30 PM

Oracle Recovery Manager (RMAN) 10G: Reloaded

5:00 PM

Proven Techniques for Maximizing Availability

8:30 AM

Oracle Database 10G - RMAN and ATA Storage in Action

 

11:00 AM

Oracle Data Guard: Maximum Data Protection at Minimum Cost

 

1:00 PM

Oracle Database 10G Time Navigation: Human-Error Correction

 

4:30 PM

Data Guard SQL Apply: Back to the Future

Wednesday in Moscone Room 304Tuesday in Moscone Room 304

For More Info On Oracle HA Go To http://otn.oracle.com/deploy/availability/

Page 26: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Next StepsHigh Availability Sessions from Oracle

8:30 AM -- Moscone Room 304

Oracle Database 10G Data Warehouse Backup and Recovery:

Automatic, Simple, Reliable

8:30 AM -- Moscone Room 104

Building RAC Clusters over InfiniBand

Thursday

For More Info On Oracle HA Go To http://otn.oracle.com/deploy/availability/

Real Application Clusters

Data Guard

Database Backup & Recovery

Flashback Recovery

LogMiner, Online Redefinition, and Cross Platform Transportable

Tablespaces

Database HA Demos All Four DaysIn The Oracle Demo Campground

Page 27: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

Reminder – please complete the OracleWorld online session survey

Thank you.

Page 28: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.

AQ&Q U E S T I O N SQ U E S T I O N S

A N S W E R SA N S W E R S

Page 29: Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: 40109 Tammy Bednar Sr. Product.