© 2006 northgate information solutions plc and its associated companies. all rights reserved. slide...
DESCRIPTION
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. 3 Flashback Coverage Introduction Brief History User Induced Trauma Extended Flashback Features SummaryTRANSCRIPT
![Page 1: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/1.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1
![Page 2: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/2.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
2
Oracle Flashback Presented BySimon Swann
![Page 3: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/3.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
3
Flashback Coverage
• Introduction• Brief History• User Induced Trauma • Extended Flashback Features• Summary
![Page 4: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/4.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
4
Flashback Introduction
• Introduction: Several New Features► ASMM (automatic shared memory management)
(ability to share memory in a more efficient manor )
► ASM (automatic storage management)(store thousands of files in disk groups)
► OMF (oracle managed files)(control of naming & location left to Oracle)
► Enhancements to Flashback(allows speedy recovery from data loss)
![Page 5: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/5.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
5
Flashback Brief History
• Brief History:
► Backup & Recovery main hallmark is the ability to recover from failure
► Datafile loss, a set of Datafiles, Redologs, Controlfile loss
► Restore options from:Physical backup copies, Rman backups or Export/Import
![Page 6: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/6.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
6
FlashbackUser Induced Trauma
Deletions
• Truncations
Drops
Data
Tables Database
• Corruptions
• Human Errors
• Disasters
• Power Outage
• Hardware Failure
![Page 7: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/7.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 7
• Database Recovery Time► How long will it take?
• Is the Backup good?► Has it been tested?
• Time spent Trouble Shooting► Do we have the relevant
Backups onsite?► Have we recovered far
enough back?
![Page 8: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/8.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
8
FlashbackRecovery Solutions
• Logical Methods:► Export and Import► Datapump
• Physical Methods:► O/S Backup and Restore► RMAN Backup and Restore
• Flashback can be used to ‘speed up’ the recovery process in certain areas
![Page 9: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/9.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
9
Flashback Features
• What is it?► A feature that allows data, tables or the database to be
flashed back to a previous point in time
• Introduced in Oracle 9i► DBMS_FLASHBACK package
• Expanded in Oracle 10g► Incorporated in SQL
![Page 10: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/10.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
10
Flashback Background
• How does it work?► Technology was there in Rollback segments, which are used for
transaction read consistency, commit or rollback and recovery assistance.
Before data could be over written within the rollback segment • Flashback makes use of Automatic Undo Management.
► Undo_management=AUTO► Undo_tablespace=UNDOTBS► Undo_retention=3600
Before data could possibly remain there for longer periods of time before being over written within the undo segment
![Page 11: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/11.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. 11
FlashbackQuery
FlashbackQuery
![Page 12: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/12.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
12
Flashback QueryFeature
• Allows Querying of data in the past
• CURRENT_SCNfrom V$DATABASE;
![Page 13: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/13.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
13
Flashback QueryFeature
• Flashback Query additions:
► select * from <table_name> as of scn timestamp_to_scn (sysdate – 2/24);
► select * from <table_name> as of scn timestamp_to_scn (sysdate – 0.25/24);
![Page 14: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/14.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. 14
FlashbackQuery
FlashbackVersion
Flashback Version Feature
![Page 15: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/15.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
15
Flashback Version QueryFeature
• A short term auditing feature that allows changes to individual rows to be tracked over a time period.
• The information about the transactions are stored in the Undo Segments.
![Page 16: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/16.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
16
Flashback Version Querypseudocolumns
• Use the ‘versions between’ clause to track the changesbetween different SCN values.
• VERSIONS_STARTSCN - starting SCN when the row acquired this value
• VERSIONS_STARTTIME - specifies a time rather than an SCN
• VERSIONS_ENDSCN - last SCN when the row held the value
• VERSIONS_ENDTIME - specifies a time rather than an SCN
• VERSIONS_XID - ID of the transaction involved
• VERSIONS_OPERATION - performing insert, update, delete
![Page 17: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/17.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
17
Flashback Version Queryexample
• Performing a Flashback Version Query against
a table that has had a column heading change.
![Page 18: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/18.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
18
Flashback Version QueryFeature
![Page 19: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/19.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. 19
FlashbackQuery
FlashbackVersion
Flashback Transaction
Flashback Transaction Feature
![Page 20: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/20.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
20
Flashback Transaction QueryFeature
• Displays detailed transaction information
• Information about transactions affecting a table can be obtained using the view ‘FLASHBACK_TRANSACTION_QUERY’
• The view contains a column ‘XID’ which can be joined to the ‘VERSIONS_XID’ row returned by the ‘VERSIONS_BETWEEN’ clause.
![Page 21: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/21.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
21
Flashback Transaction Query
• The view contains a column ‘XID’ which can be joined to the ‘VERSIONS_XID’ row returned by the ‘VERSIONS_BETWEEN’ clause.
select * from flashback_transaction_querywhere xid in
(select hextoraw(versions_xid)from divisionversions between scn 3792856 and 3793944);
![Page 22: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/22.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. 22
FlashbackQuery
FlashbackVersion
Flashback Transaction
FlashbackTable
Flashback Table
Feature
![Page 23: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/23.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
23
Flashback TableFeature
• Allows a table to be rolled back to a particular point in time
• The relevant information will need to be in the ‘UNDO SEGMENTS’ and ‘ROW MOVEMENT’ must be enabled
• When you use the Flashback Table feature to restore a table to a specific point in time, all associated objects, such as, indexes, constraints, and triggers will be restored
![Page 24: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/24.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
24
Flashback TableFeature
Flashback Table allows you to recover a table or tables to a specific point In time without restoring a backup.
![Page 25: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/25.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. 25
FlashbackQuery
FlashbackVersion
Flashback Transaction
FlashbackTable
FlashbackDrop
Flashback Drop Feature
![Page 26: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/26.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
26
Flashback DropFeature
• Acts as a ‘RECYCLEBIN’ allowing droppedtables to be retrieved
• Flashback Drop is a variation of Flashback table as it handles rolling back a dropped table
• Dropped tables are ‘RENAMED’ in the ‘RECYCLEBIN’ and can be retrieved using the ‘FLASHBACK DROP’ command
![Page 27: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/27.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
27
Flashback DropFeature
• Tables must be in Locally managed tablespaces
• Tables must not be in the SYSTEM tablespace
![Page 28: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/28.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
28
Flashback DropFeature
• Purge Recyclebin:► Will remove ALL dropped objects from
individual USERS recyclebin ► Select * from user_recyclebin► Show recyclebin► Purge recyclebin
• Purge DBA Recyclebin:► Will remove ALL dropped objects from all users recyclebin► Select * from DBA_recyclebin► Show DBA_recyclebin► Purge DBA_recyclebin
![Page 29: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/29.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. 29
FlashbackDatabase
FlashbackQuery
FlashbackVersion
Flashback Transaction
FlashbackTable
FlashbackDrop
Flashback Database Feature
![Page 30: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/30.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
30
Flashback DatabaseFeature
Database
LGWR RVWR
Log file 1
Log file 2
Flashback Log
Flashback Log
![Page 31: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/31.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
31
Flashback DatabaseFeature
• Initialization Parameters to be defined:
► DB_RECOVERY_FILE_DEST_SIZE
► Alter system set DB_RECOVERY_FILE_DEST_SIZE=8g
scope=both;
► DB_RECOVERY_FILE_DEST
► Alter system setDB_RECOVERY_FILE_DEST=`C:\flash`scope=both;
![Page 32: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/32.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
32
Flashback DatabaseFeature
• SHUTDOWN IMMEDIATE
• STARTUP MOUNT
• ALTER DATABASE FLASHBACK ON
• ALTER DATABASE OPEN
• Select CURRENT_SCN, FLASHBACK_ONFrom V$DATABASE
To monitor Flashback Database use V$flashback_database_stat
![Page 33: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/33.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
33
Flashback DatabaseFeature
Then the Inevitablehappens
Table truncated
Databasebecomescorrupt
![Page 34: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/34.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
34
Flashback DatabaseFeature
• Performing a FLASHBACK DATABASE recovery:
► SHUTDOWN IMMEDIATE
► STARTUP MOUNT
► FLASHBACK DATABASE to SCN <scn>
► ALTER DATABASE OPEN RESETLOGS
![Page 35: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/35.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
35
Flashback DatabaseFeature
• FLASHBACK DATABASE recovery options:
► FLASHBACK DATABASE to TIMESTAMP <date>
► FLASHBACK DATABASE to BEFORE SCN <scn>
► FLASHBACK DATABASE to BEFORE TIMESTAMP <date>
Set the Flashback Database retention target:► DB_FLASHBACK_RETENTION_TARGET
The default value for flashback retention time is 1400 minutes.
![Page 36: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/36.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. 36
FlashbackDatabase
FlashbackQuery
FlashbackVersion
Flashback Transaction
FlashbackTable
FlashbackDrop
Summary
![Page 37: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/37.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
Summary
• Flashback Query – allows a user to view previous versions of a table.
• Flashback Version – allows changes of individual rows to be tracked.
• Flashback Transaction – allows tracking of specific transaction changes.
• Flashback Table – put the table back as it was, undoing corruption
• Flashback Drop – retrieve a dropped table from the recyclebin
• Flashback Database – perform an incomplete recovery without the aid of a backup
![Page 38: © 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1](https://reader036.vdocuments.net/reader036/viewer/2022062503/5a4d1aed7f8b9ab05997c55a/html5/thumbnails/38.jpg)
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved.
38
Thank you for your time
Simon Swann