SlideShare a Scribd company logo
1 of 22
How Oracle Database Flashback Features can Save Your Job?
08/07/2020
Tércio Costa
Tércio Costa
• Oracle DBA
• https://twitter.com/tercioscosta
• https://www.linkedin.com/in/terciocosta/
• https://oraclepress.wordpress.com/
• Oracle Database 12c Administrator Certified
Associate
• Oracle Database PL/SQL Developer Certified
Professional
• Oracle Database SQL Certified Expert
• Oracle Autonomous Database Cloud 2019
Certified Specialist
• Oracle Cloud Infrastructure 2019 Architect
Associate
• Oracle Cloud Infrastructure Foundations 2020
Certified Associate
• Oracle ACE
3 Membership Tiers
• Oracle ACE Director
• Oracle ACE
• Oracle ACE Associate
bit.ly/OracleACEProgram
500+ Technical Experts
Helping Peers Globally
Connect:
Nominate yourself or someone you know: acenomination.oracle.com
@oracleace
Facebook.com/oracleaces
oracle-ace_ww@oracle.com
O CONTEÚDO DA LIVE EXPRESSA A OPINIÃO DOS SPEAKERS E NÃO NECESSARIAMENTE A OPINIÃO DO
GUOB E/OU DOS EMPREGADORES DOS SPEAKERS.
DISCLAIMER
Why Flashback?
Flashback Technology
• Perform queries that return past data
• Perform queries that return metadata that shows a detailed history of changes
to the database
• Recover tables or rows to a previous point in time
• Automatically track and archive transactional data changes
• Roll back a transaction and its dependent transactions while the database
remains online
How
Flashback
Works?
Flashback
Features
• Oracle Flashback Query
• Oracle Flashback Version Query
• Oracle Flashback Transaction Query
• Oracle Flashback Transaction
• DBMS_FLASHBACK Package
• Oracle Flashback Data Archive
• Oracle Flashback Table
• Oracle Flashback Drop
• Oracle Flashback Database
Flashback Query
SELECT AS OF
Requirements:
• FLASHBACK Privilege
Example:
SELECT *
FROM employees
AS OF TIMESTAMP
TO_TIMESTAMP('2004-04-04
09:30:00', 'YYYY-MM-DD
HH:MI:SS')
WHERE last_name = 'Chung';
Flashback Version Query
VERSIONS BETWEEN { SCN | TIMESTAMP }
start AND end
Example:
SELECT versions_startscn,
versions_starttime,
versions_endscn, versions_endtime,
versions_xid, versions_operation,
last_name, salary
FROM employees
VERSIONS BETWEEN TIMESTAMP
TO_TIMESTAMP('2008-12-18 14:00:00',
'YYYY-MM-DD HH24:MI:SS')
AND TO_TIMESTAMP('2008-12-18
17:00:00', 'YYYY-MM-DD HH24:MI:SS')
WHERE first_name = 'John';
Pseudocolumns:
• VERSIONS_STARTSCN
• VERSIONS_STARTTIME
• VERSIONS_ENDSCN
• VERSIONS_ENDTIME
• VERSIONS_XID
• VERSIONS_OPERATION
Requirements:
• FLASHBACK Privilege
Oracle Flashback Transaction Query
View:
FLASHBACK_TRANSACTION_QUERY
Requeriments:
• SUPPLEMENTAL LOG DATA;
• SUPPLEMENTAL LOG DATA (PRIMARY
KEY)
• SUPPLEMENTAL LOG DATA (FOREIGN
KEY)
• SELECT ANY TRANSACTION Privilege
OR FLASHBACK AND READ OR SELECT
Example:
SELECT xid, operation, start_scn,
commit_scn, logon_user, undo_sql
FROM flashback_transaction_query
WHERE xid =
HEXTORAW('000200030000002D')
;
DBMS_FLASHBACK
DBMS_FLASHBACK Package
Requirements:
• EXECUTE
ON DBMS_FLASHBACK Privilege
Example(Procedures):
ENABLE_AT_TIME
ENABLE_AT_SYSTEM_CHANGE_NUMBER
Flashback Transaction
DBMS_FLASHBACK Package
Requeriments:
• EXECUTE
ON DBMS_FLASHBACK Privilege
• ALTER DATABASE ADD
SUPPLEMENTAL LOG DATA
(PRIMARY KEY) COLUMNS;
• ALTER DATABASE ADD
SUPPLEMENTAL LOG DATA
(FOREIGN KEY) COLUMNS;
Example(procedure):
• TRANSACTION_BACKOUT
Views:
• DBA_FLASHBACK_TXN_STATE
• DBA_FLASHBACK_TXN_REPORT
Flashback Data Archive
Once the undo information is lost, the
view of the past is lost also
Privileges:
• FLASHBACK ARCHIVE ADMINISTER
• CREATE FLASHBACK ARCHIVE
• ALTER FLASHBACK ARCHIVE
• DROP FLASHBACK ARCHIVE
• FLASHBACK ARCHIVE object
Package
• DBMS_FLASHBACK_ARCHIVE
Requirements:
• Name of the first tablespace of the Flas
hback Data Archive
• Name of the Flashback Data Archive
• Quota (optional)
• Retention time
• Optimize
Views:
• DBA_FLASHBACK_ARCHIVE
• DBA_FLASHBACK_ARCHIVE_TS
• DBA_FLASHBACK_ARCHIVE_TABLES
Flashback Table
Flashback the entire table.
Privileges:
• FLASHBACK ANY TABLE OR
FLASHBACK OBJECT
• READ or SELECT, INSERT, DELETE,
and ALTER privileges on the table
Requirements:
• ROW MOVEMENT (rowids)
Example:
• FLASHBACK TABLE hr.employees TO
TIMESTAMP TO_TIMESTAMP('2013-
10-17 09:30:00', 'YYYY-MM-DD
HH:MI:SS');
Can flashback to time, scn and restore
point.
Flashback Drop
Database parameter: recyclebin.
Not a basic parameter!
Do not use UNDO!
The table is only renamed on drop!
Privileges:
• DROP
• READ or SELECT and FLASHBACK
Requirements:
• ALTER SYSTEM SET RECYCLEBIN='on'
SCOPE=SPFILE;
Views:
• RECYCLEBIN
• USER_RECYCLEBIN
• DBA_RECYCLEBIN
• (SHOW RECYCLEBIN)
Flashback Database
Flashback the entire database!
Use Flashback logs
Offline operation
Privileges:
• SYSDBA, SYSBACKUP OR SYSDG
View:
• V$FLASHBACK_DATABASE_LOG
Requirements.
• FRA Configured (OMF)
• ARCHIVELOG
• ALTER DATABASE FLASHBACK ON;
Parameter:
• DB_FLASHBACK_RETENTION_TARGET
Best Pratices
• UNDO RETENTION
• UNDO TABLESPACE SIZE
• ADD SUPPLEMENTAL LOG DATA AT LEAST
• DOT NOT USE TRIGGERS FOR LOG. USE FLASHBACK DATA ARCHIVE!
• CREATE YOUR OWN INDICES ON FLASBACK DATA ARCHIVE BASE TABLES
• ENABLE RECYCLEBIN
• ENABLE FLASHBACK DATABASE
FLASHBACK <> DBPITR
• Media recovery
• Time
• Logical <> phisical
• Redo, Undo and Flashback logs <> backupsets and image copies
References
• https://docs.oracle.com/en/database/oracle/oracle-
database/19/sqlrf/FLASHBACK-DATABASE.htm
• https://docs.oracle.com/en/database/oracle/oracle-database/19/bradv/rman-
performing-flashback-dbpitr.html
• https://docs.oracle.com/en/database/oracle/oracle-
database/19/adfns/flashback.html
Guob flashback

More Related Content

What's hot

Oracle database 12c intro
Oracle database 12c introOracle database 12c intro
Oracle database 12c intropasalapudi
 
Oracle olap-installation
Oracle olap-installationOracle olap-installation
Oracle olap-installationAmit Sharma
 
Whatsnew in-my sql-primary
Whatsnew in-my sql-primaryWhatsnew in-my sql-primary
Whatsnew in-my sql-primaryKaizenlogcom
 
Liquibase for java developers
Liquibase for java developersLiquibase for java developers
Liquibase for java developersIllia Seleznov
 
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3Marco Gralike
 
Oracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTSOracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTSChristian Gohmann
 
An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)Marco Gralike
 
Sql portfolio admin_practicals
Sql portfolio admin_practicalsSql portfolio admin_practicals
Sql portfolio admin_practicalsShelli Ciaschini
 
Oracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra PasalapudiOracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra Pasalapudipasalapudi123
 
Web Quick Start: Exploring the Web Tier
Web Quick Start: Exploring the Web TierWeb Quick Start: Exploring the Web Tier
Web Quick Start: Exploring the Web TierAlfresco Software
 
Oracle 10g introduction
Oracle 10g introductionOracle 10g introduction
Oracle 10g introductionsagaroceanic11
 
Build Application With MongoDB
Build Application With MongoDBBuild Application With MongoDB
Build Application With MongoDBEdureka!
 
New Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageNew Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageSteven Feuerstein
 
Web Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaWeb Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaArafat Rahman
 
Oracle Database 12c "New features"
Oracle Database 12c "New features" Oracle Database 12c "New features"
Oracle Database 12c "New features" Anar Godjaev
 
Oracle 12c Multitenant architecture
Oracle 12c Multitenant architectureOracle 12c Multitenant architecture
Oracle 12c Multitenant architecturenaderattia
 

What's hot (20)

Oracle database 12c intro
Oracle database 12c introOracle database 12c intro
Oracle database 12c intro
 
Oracle olap-installation
Oracle olap-installationOracle olap-installation
Oracle olap-installation
 
Whatsnew in-my sql-primary
Whatsnew in-my sql-primaryWhatsnew in-my sql-primary
Whatsnew in-my sql-primary
 
Liquibase for java developers
Liquibase for java developersLiquibase for java developers
Liquibase for java developers
 
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
 
Oracle 12c
Oracle 12cOracle 12c
Oracle 12c
 
Oracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTSOracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTS
 
An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)
 
Sql portfolio admin_practicals
Sql portfolio admin_practicalsSql portfolio admin_practicals
Sql portfolio admin_practicals
 
Oracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra PasalapudiOracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra Pasalapudi
 
Web Quick Start: Exploring the Web Tier
Web Quick Start: Exploring the Web TierWeb Quick Start: Exploring the Web Tier
Web Quick Start: Exploring the Web Tier
 
Oracle 12c Architecture
Oracle 12c ArchitectureOracle 12c Architecture
Oracle 12c Architecture
 
Oracle 10g introduction
Oracle 10g introductionOracle 10g introduction
Oracle 10g introduction
 
Build Application With MongoDB
Build Application With MongoDBBuild Application With MongoDB
Build Application With MongoDB
 
Obia with odi
Obia with odiObia with odi
Obia with odi
 
New Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageNew Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL Language
 
Web Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaWeb Application Development using MVC Framework Kohana
Web Application Development using MVC Framework Kohana
 
Oracle 12c - Multitenant Feature
Oracle 12c - Multitenant FeatureOracle 12c - Multitenant Feature
Oracle 12c - Multitenant Feature
 
Oracle Database 12c "New features"
Oracle Database 12c "New features" Oracle Database 12c "New features"
Oracle Database 12c "New features"
 
Oracle 12c Multitenant architecture
Oracle 12c Multitenant architectureOracle 12c Multitenant architecture
Oracle 12c Multitenant architecture
 

Similar to Guob flashback

2008 Collaborate IOUG Presentation
2008 Collaborate IOUG Presentation2008 Collaborate IOUG Presentation
2008 Collaborate IOUG PresentationBiju Thomas
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsZohar Elkayam
 
5675212318661411677_TRN4034_How_to_Migrate_to_Oracle_Autonomous_Database_Clou...
5675212318661411677_TRN4034_How_to_Migrate_to_Oracle_Autonomous_Database_Clou...5675212318661411677_TRN4034_How_to_Migrate_to_Oracle_Autonomous_Database_Clou...
5675212318661411677_TRN4034_How_to_Migrate_to_Oracle_Autonomous_Database_Clou...NomanKhalid56
 
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint SecurityAUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint SecurityMichael Noel
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxSatishbabu Gunukula
 
Take your database source code and data under control
Take your database source code and data under controlTake your database source code and data under control
Take your database source code and data under controlMarcin Przepiórowski
 
Privilege Analysis with the Oracle Database
Privilege Analysis with the Oracle DatabasePrivilege Analysis with the Oracle Database
Privilege Analysis with the Oracle DatabaseMarkus Flechtner
 
2009 Collaborate IOUG Presentation
2009 Collaborate IOUG Presentation2009 Collaborate IOUG Presentation
2009 Collaborate IOUG PresentationBiju Thomas
 
Improving oracle12c security
Improving oracle12c securityImproving oracle12c security
Improving oracle12c securityLaurent Leturgez
 
Improve oracle 12c security
Improve oracle 12c securityImprove oracle 12c security
Improve oracle 12c securityLaurent Leturgez
 
REST in Piece - Administration of an Oracle Cluster/Database using REST
REST in Piece - Administration of an Oracle Cluster/Database using RESTREST in Piece - Administration of an Oracle Cluster/Database using REST
REST in Piece - Administration of an Oracle Cluster/Database using RESTChristian Gohmann
 
SOUG Day Oracle 21c New Security Features
SOUG Day Oracle 21c New Security FeaturesSOUG Day Oracle 21c New Security Features
SOUG Day Oracle 21c New Security FeaturesStefan Oehrli
 

Similar to Guob flashback (20)

Flashback in OCI
Flashback in OCIFlashback in OCI
Flashback in OCI
 
2008 Collaborate IOUG Presentation
2008 Collaborate IOUG Presentation2008 Collaborate IOUG Presentation
2008 Collaborate IOUG Presentation
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
5675212318661411677_TRN4034_How_to_Migrate_to_Oracle_Autonomous_Database_Clou...
5675212318661411677_TRN4034_How_to_Migrate_to_Oracle_Autonomous_Database_Clou...5675212318661411677_TRN4034_How_to_Migrate_to_Oracle_Autonomous_Database_Clou...
5675212318661411677_TRN4034_How_to_Migrate_to_Oracle_Autonomous_Database_Clou...
 
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint SecurityAUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 
SQL Server 2014 Backup to Azure - SQL Saturday CR 2015
SQL Server 2014 Backup to Azure - SQL Saturday CR 2015SQL Server 2014 Backup to Azure - SQL Saturday CR 2015
SQL Server 2014 Backup to Azure - SQL Saturday CR 2015
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptx
 
Take your database source code and data under control
Take your database source code and data under controlTake your database source code and data under control
Take your database source code and data under control
 
2019 - COMPUFAJ - DBA Career and Cloud
2019 - COMPUFAJ - DBA Career and Cloud2019 - COMPUFAJ - DBA Career and Cloud
2019 - COMPUFAJ - DBA Career and Cloud
 
Partially Contained Databases
Partially Contained DatabasesPartially Contained Databases
Partially Contained Databases
 
Privilege Analysis with the Oracle Database
Privilege Analysis with the Oracle DatabasePrivilege Analysis with the Oracle Database
Privilege Analysis with the Oracle Database
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 
2009 Collaborate IOUG Presentation
2009 Collaborate IOUG Presentation2009 Collaborate IOUG Presentation
2009 Collaborate IOUG Presentation
 
Improving oracle12c security
Improving oracle12c securityImproving oracle12c security
Improving oracle12c security
 
Improve oracle 12c security
Improve oracle 12c securityImprove oracle 12c security
Improve oracle 12c security
 
REST in Piece - Administration of an Oracle Cluster/Database using REST
REST in Piece - Administration of an Oracle Cluster/Database using RESTREST in Piece - Administration of an Oracle Cluster/Database using REST
REST in Piece - Administration of an Oracle Cluster/Database using REST
 
A to z for sql azure databases
A to z for sql azure databasesA to z for sql azure databases
A to z for sql azure databases
 
Oracle DBA
Oracle DBAOracle DBA
Oracle DBA
 
SOUG Day Oracle 21c New Security Features
SOUG Day Oracle 21c New Security FeaturesSOUG Day Oracle 21c New Security Features
SOUG Day Oracle 21c New Security Features
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Guob flashback

  • 1. How Oracle Database Flashback Features can Save Your Job? 08/07/2020 Tércio Costa
  • 2. Tércio Costa • Oracle DBA • https://twitter.com/tercioscosta • https://www.linkedin.com/in/terciocosta/ • https://oraclepress.wordpress.com/ • Oracle Database 12c Administrator Certified Associate • Oracle Database PL/SQL Developer Certified Professional • Oracle Database SQL Certified Expert • Oracle Autonomous Database Cloud 2019 Certified Specialist • Oracle Cloud Infrastructure 2019 Architect Associate • Oracle Cloud Infrastructure Foundations 2020 Certified Associate • Oracle ACE
  • 3. 3 Membership Tiers • Oracle ACE Director • Oracle ACE • Oracle ACE Associate bit.ly/OracleACEProgram 500+ Technical Experts Helping Peers Globally Connect: Nominate yourself or someone you know: acenomination.oracle.com @oracleace Facebook.com/oracleaces oracle-ace_ww@oracle.com
  • 4. O CONTEÚDO DA LIVE EXPRESSA A OPINIÃO DOS SPEAKERS E NÃO NECESSARIAMENTE A OPINIÃO DO GUOB E/OU DOS EMPREGADORES DOS SPEAKERS. DISCLAIMER
  • 6. Flashback Technology • Perform queries that return past data • Perform queries that return metadata that shows a detailed history of changes to the database • Recover tables or rows to a previous point in time • Automatically track and archive transactional data changes • Roll back a transaction and its dependent transactions while the database remains online
  • 8. Flashback Features • Oracle Flashback Query • Oracle Flashback Version Query • Oracle Flashback Transaction Query • Oracle Flashback Transaction • DBMS_FLASHBACK Package • Oracle Flashback Data Archive • Oracle Flashback Table • Oracle Flashback Drop • Oracle Flashback Database
  • 9. Flashback Query SELECT AS OF Requirements: • FLASHBACK Privilege Example: SELECT * FROM employees AS OF TIMESTAMP TO_TIMESTAMP('2004-04-04 09:30:00', 'YYYY-MM-DD HH:MI:SS') WHERE last_name = 'Chung';
  • 10. Flashback Version Query VERSIONS BETWEEN { SCN | TIMESTAMP } start AND end Example: SELECT versions_startscn, versions_starttime, versions_endscn, versions_endtime, versions_xid, versions_operation, last_name, salary FROM employees VERSIONS BETWEEN TIMESTAMP TO_TIMESTAMP('2008-12-18 14:00:00', 'YYYY-MM-DD HH24:MI:SS') AND TO_TIMESTAMP('2008-12-18 17:00:00', 'YYYY-MM-DD HH24:MI:SS') WHERE first_name = 'John'; Pseudocolumns: • VERSIONS_STARTSCN • VERSIONS_STARTTIME • VERSIONS_ENDSCN • VERSIONS_ENDTIME • VERSIONS_XID • VERSIONS_OPERATION Requirements: • FLASHBACK Privilege
  • 11. Oracle Flashback Transaction Query View: FLASHBACK_TRANSACTION_QUERY Requeriments: • SUPPLEMENTAL LOG DATA; • SUPPLEMENTAL LOG DATA (PRIMARY KEY) • SUPPLEMENTAL LOG DATA (FOREIGN KEY) • SELECT ANY TRANSACTION Privilege OR FLASHBACK AND READ OR SELECT Example: SELECT xid, operation, start_scn, commit_scn, logon_user, undo_sql FROM flashback_transaction_query WHERE xid = HEXTORAW('000200030000002D') ;
  • 12. DBMS_FLASHBACK DBMS_FLASHBACK Package Requirements: • EXECUTE ON DBMS_FLASHBACK Privilege Example(Procedures): ENABLE_AT_TIME ENABLE_AT_SYSTEM_CHANGE_NUMBER
  • 13.
  • 14. Flashback Transaction DBMS_FLASHBACK Package Requeriments: • EXECUTE ON DBMS_FLASHBACK Privilege • ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS; • ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (FOREIGN KEY) COLUMNS; Example(procedure): • TRANSACTION_BACKOUT Views: • DBA_FLASHBACK_TXN_STATE • DBA_FLASHBACK_TXN_REPORT
  • 15. Flashback Data Archive Once the undo information is lost, the view of the past is lost also Privileges: • FLASHBACK ARCHIVE ADMINISTER • CREATE FLASHBACK ARCHIVE • ALTER FLASHBACK ARCHIVE • DROP FLASHBACK ARCHIVE • FLASHBACK ARCHIVE object Package • DBMS_FLASHBACK_ARCHIVE Requirements: • Name of the first tablespace of the Flas hback Data Archive • Name of the Flashback Data Archive • Quota (optional) • Retention time • Optimize Views: • DBA_FLASHBACK_ARCHIVE • DBA_FLASHBACK_ARCHIVE_TS • DBA_FLASHBACK_ARCHIVE_TABLES
  • 16. Flashback Table Flashback the entire table. Privileges: • FLASHBACK ANY TABLE OR FLASHBACK OBJECT • READ or SELECT, INSERT, DELETE, and ALTER privileges on the table Requirements: • ROW MOVEMENT (rowids) Example: • FLASHBACK TABLE hr.employees TO TIMESTAMP TO_TIMESTAMP('2013- 10-17 09:30:00', 'YYYY-MM-DD HH:MI:SS'); Can flashback to time, scn and restore point.
  • 17. Flashback Drop Database parameter: recyclebin. Not a basic parameter! Do not use UNDO! The table is only renamed on drop! Privileges: • DROP • READ or SELECT and FLASHBACK Requirements: • ALTER SYSTEM SET RECYCLEBIN='on' SCOPE=SPFILE; Views: • RECYCLEBIN • USER_RECYCLEBIN • DBA_RECYCLEBIN • (SHOW RECYCLEBIN)
  • 18. Flashback Database Flashback the entire database! Use Flashback logs Offline operation Privileges: • SYSDBA, SYSBACKUP OR SYSDG View: • V$FLASHBACK_DATABASE_LOG Requirements. • FRA Configured (OMF) • ARCHIVELOG • ALTER DATABASE FLASHBACK ON; Parameter: • DB_FLASHBACK_RETENTION_TARGET
  • 19. Best Pratices • UNDO RETENTION • UNDO TABLESPACE SIZE • ADD SUPPLEMENTAL LOG DATA AT LEAST • DOT NOT USE TRIGGERS FOR LOG. USE FLASHBACK DATA ARCHIVE! • CREATE YOUR OWN INDICES ON FLASBACK DATA ARCHIVE BASE TABLES • ENABLE RECYCLEBIN • ENABLE FLASHBACK DATABASE
  • 20. FLASHBACK <> DBPITR • Media recovery • Time • Logical <> phisical • Redo, Undo and Flashback logs <> backupsets and image copies