SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Anar Godjaev

FLASHBACK (Practical test)

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size

1300928 bytes

Variable Size

157820480 bytes

Database Buffers

25165824 bytes

Redo Buffers

262144 bytes

Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter system set DB_FLASHBACK_RETENTION_TARGET=4320;
System altered.
SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=536870912;
System altered.
SQL> alter system set DB_RECOVERY_FILE_DEST='/home/oracle/flash';
System altered.
SQL> alter database flashback on;
Database altered.
Anar Godjaev
SQL> alter database open;
Database altered.
SQL> select flashback_on from v$database;
FLASHBACK_ON
-----------YES
FLASHBACK (DROP TABLE)
CMD > sqlplus hr/hr
SQL> create table test_table(
id number(2),
name varchar2(30)
);
Table created.
SQL> insert into test_table values (1, 'Ben Rockwood');
1 row created.
SQL> insert into test_table values (2, 'Tamarah Rockwood');
1 row created.
SQL> insert into test_table values (3, 'Nova Rockwood');
1 row created.
SQL> insert into test_table values (4, 'Hunter Rockwood');
insert into test_table values (5, 'ddddter Rockwood');
1 row created.
SQL> select * from test_table;
Anar Godjaev
ID NAME
---------- -----------------------------1 Ben Rockwood
2 Tamarah Rockwood
3 Nova Rockwood
4 Hunter Rockwood
SQL> drop table test_table;
Table dropped.
SQL> select * from test_table;
select * from test_table
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from recyclebin;
SQL> show recyclebin;
SQL> flashback table test_table to before drop;
Flashback complete.
SQL> select * from test_table;
ID NAME
---------- -----------------------------1 Ben Rockwood
2 Tamarah Rockwood
3 Nova Rockwood
4 Hunter Rockwood
SQL> drop table test_table purge;
Table dropped.
SQL> select * from test_table;
Anar Godjaev

select * from test_table
*
ERROR at line 1:
ORA-00942: table or view does not exist

SQL> select * from recyclebin;
SQL> show recyclebin;
SQL> alter system set "_recyclebin"=FALSE;
FLASHBACK (SCN)
CMD > sqlplus hr/hr
SQL> CREATE TABLE flashback_table_test (
id NUMBER(10)
);
SQL> ALTER TABLE flashback_table_test ENABLE ROW MOVEMENT;
SQL> SELECT current_scn FROM v$database;
CURRENT_SCN
----------933716
SQL> INSERT INTO flashback_table_test (id) VALUES (1);
SQL> INSERT INTO flashback_table_test (id) VALUES (2);
SQL> COMMIT;
SQL> SELECT current_scn FROM v$database;
CURRENT_SCN
----------934423
Anar Godjaev

SQL> SELECT * FROM flashback_table_test;
ID
----------1
2
SQL> INSERT INTO flashback_table_test (id) VALUES (3);
SQL> INSERT INTO flashback_table_test (id) VALUES (4);
SQL> COMMIT;
SQL> SELECT current_scn FROM v$database;
CURRENT_SCN
----------934474

SQL> SELECT * FROM flashback_table_test;
ID
----------1
2
3
4
SQL> FLASHBACK TABLE flashback_table_test TO SCN 934423;
SQL> SELECT COUNT(*) FROM flashback_table_test;
COUNT(*)
---------2
SQL> FLASHBACK TABLE flashback_table_test TO SCN 934474;
Anar Godjaev
SQL> SELECT COUNT(*) FROM flashback_table_test;
COUNT(*)
---------4
SQL> FLASHBACK TABLE flashback_table_test TO SCN 933716;
SQL> SELECT COUNT(*) FROM flashback_table_test;
COUNT(*)
---------4

FLASHBACK (TIME)
CMD > sqlplus hr/hr
SQL> CREATE TABLE t3
ENABLE ROW MOVEMENT AS
SELECT owner, table_name, tablespace_name
FROM all_tables
WHERE 1=2;

SQL> desc t
SQL> SELECT table_name, row_movement
FROM user_tables;
SQL> SELECT current_scn, SYSTIMESTAMP
FROM gv$database;

CURRENT_SCN
----------SYSTIMESTAMP
--------------------------------------------------------------------------935085
Anar Godjaev
10-MAR-12 10.30.40.360096 AM +02:00

SQL> INSERT INTO t3
SELECT owner, table_name, tablespace_name
FROM all_tables
WHERE owner = 'SYS';
SQL> COMMIT;
SQL> SELECT current_scn, SYSTIMESTAMP
FROM gv$database;
CURRENT_SCN
----------SYSTIMESTAMP
--------------------------------------------------------------------------935177
10-MAR-12 10.32.18.675106 AM +02:00

SQL> INSERT INTO t3
SELECT owner, table_name, tablespace_name
FROM all_tables
WHERE owner = 'HR';
SQL> COMMIT;
SQL> SELECT current_scn, SYSTIMESTAMP
FROM gv$database;
CURRENT_SCN
----------SYSTIMESTAMP
--------------------------------------------------------------------------935196
10-MAR-12 10.32.57.849132 AM +02:00
SQL> INSERT INTO t3
SELECT owner, table_name, tablespace_name
FROM all_tables
WHERE owner = 'CTXSYS';
SQL> COMMIT;
Anar Godjaev
SQL> SELECT current_scn, SYSTIMESTAMP
FROM gv$database;
CURRENT_SCN
----------SYSTIMESTAMP
--------------------------------------------------------------------------935239
10-MAR-12 10.33.36.687213 AM +02:00
SQL> SELECT owner, COUNT(*)
FROM t3
GROUP BY owner;
OWNER
COUNT(*)
------------------------------ ---------HR
10
CTXSYS
5
SYS
27

SQL> FLASHBACK TABLE t3 TO TIMESTAMP
TO_TIMESTAMP('10/03/2012 10:40:00','dd/mm/yyyy hh24:mi:ss');
SQL> SELECT owner, COUNT(*)
FROM t3
GROUP BY owner;
SQL> FLASHBACK TABLE t3 TO TIMESTAMP
TO_TIMESTAMP('07/02/2011 19:31:22','dd/mm/yyyy hh24:mi:ss');
SQL> SELECT owner, COUNT(*)
FROM t3
GROUP BY owner;
SQL> FLASHBACK TABLE t3 TO TIMESTAMP
TO_TIMESTAMP('07/02/2011 19:33:55','dd/mm/yyyy hh24:mi:ss');
SQL> SELECT owner, COUNT(*)
FROM t3
GROUP BY owner;
FLASHBACK (POINT)
CMD > sqlplus hr/hr
SQL> CREATE TABLE t2
ENABLE ROW MOVEMENT AS
SELECT owner, table_name, tablespace_name
Anar Godjaev
FROM all_tables
WHERE 1=2;
SQL> desc t2
SQL> SELECT table_name, row_movement
FROM user_tables;
SQL> CREATE RESTORE POINT zero;

SQL> INSERT INTO t2
SELECT owner, table_name, tablespace_name
FROM all_tables
WHERE owner = 'SYS';
SQL> COMMIT;
SQL> CREATE RESTORE POINT one;
SQL> INSERT INTO t2
SELECT owner, table_name, tablespace_name
FROM all_tables
WHERE owner = 'WMSYS';
SQL> COMMIT;
SQL> CREATE RESTORE POINT two;
SQL> INSERT INTO t2
SELECT owner, table_name, tablespace_name
FROM all_tables
WHERE owner = 'CTXSYS';
SQL> COMMIT;
SQL> SELECT owner, COUNT(*)
FROM t2
GROUP BY owner;
Anar Godjaev
SQL> SELECT scn, time, name
FROM gv$restore_point;
SQL> FLASHBACK TABLE t2 TO RESTORE POINT two;
SQL> SELECT owner, COUNT(*)
FROM t2
GROUP BY owner;
SQL> FLASHBACK TABLE t2 TO RESTORE POINT one;
SQL> SELECT owner, COUNT(*)
FROM t2
GROUP BY owner;
SQL> FLASHBACK TABLE t2 TO RESTORE POINT zero;
SQL> SELECT owner, COUNT(*)
FROM t2
GROUP BY owner;
FLASHBACK (DATABASE)
CMD > sqlplus hr/hr
SQL> create table test_table2(
id number(2),
name varchar2(30)
);
Table created.
SQL> insert into test_table values (1, 'Ben Rockwood');
1 row created.
SQL> insert into test_table values (2, 'Tamarah Rockwood');
1 row created.
Anar Godjaev
SQL> insert into test_table values (3, 'Nova Rockwood');
1 row created.
SQL> insert into test_table values (4, 'Hunter Rockwood');
1 row created.
SQL> select * from test_table;
ID NAME
---------- -----------------------------1 Ben Rockwood
2 Tamarah Rockwood
3 Nova Rockwood
4 Hunter Rockwood
SQL> CONN sys/password AS SYSDBA;
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT EXCLUSIVE;
SQL> FLASHBACK DATABASE TO TIMESTAMP SYSDATE-(1/24/12); // 5 minutes earlier to
SQL> ALTER DATABASE OPEN RESETLOGS;
SQL> CONN hr/hr
SQL> select * from test_table;
FLASHBACK DATABASE TO TIMESTAMP my_date;
FLASHBACK DATABASE TO BEFORE TIMESTAMP my_date;
FLASHBACK DATABASE TO SCN my_scn;
FLASHBACK DATABASE TO BEFORE SCN my_scn;

Weitere Àhnliche Inhalte

Was ist angesagt?

Oracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseOracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseuzzal basak
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneDeepti Singh
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneDeepti Singh
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from Anar Godjaev
 
Install and upgrade Oracle grid infrastructure 12.1.0.2
Install and upgrade Oracle grid infrastructure 12.1.0.2Install and upgrade Oracle grid infrastructure 12.1.0.2
Install and upgrade Oracle grid infrastructure 12.1.0.2Biju Thomas
 
How to create a pluggable database by cloning an existing local pdb
How to create a pluggable database by cloning an existing local pdbHow to create a pluggable database by cloning an existing local pdb
How to create a pluggable database by cloning an existing local pdbMarco Vigelini
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
 
Store and Process Big Data with Hadoop and Cassandra
Store and Process Big Data with Hadoop and CassandraStore and Process Big Data with Hadoop and Cassandra
Store and Process Big Data with Hadoop and CassandraDeependra Ariyadewa
 
Oracle Database 11g Product Family
Oracle Database 11g Product FamilyOracle Database 11g Product Family
Oracle Database 11g Product FamilyN/A
 
oracle cloud with 2 nodes processing
oracle cloud with 2 nodes processingoracle cloud with 2 nodes processing
oracle cloud with 2 nodes processingmahdi ahmadi
 
Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsRoo Wall
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different hostOsama Mustafa
 
Pontos para criar_instancia_data guard_11g
Pontos para criar_instancia_data guard_11gPontos para criar_instancia_data guard_11g
Pontos para criar_instancia_data guard_11gLeandro Santos
 
PostgreSQL and PL/Java
PostgreSQL and PL/JavaPostgreSQL and PL/Java
PostgreSQL and PL/JavaPeter Eisentraut
 
UKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction LocksUKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction LocksKyle Hailey
 
Cloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step ProcedureCloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step ProcedureOrazer Technologies
 
Migrate from database file system to asm
Migrate from database file system to asmMigrate from database file system to asm
Migrate from database file system to asmSurender Martha
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4uzzal basak
 

Was ist angesagt? (20)

Oracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseOracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby database
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from
 
Install and upgrade Oracle grid infrastructure 12.1.0.2
Install and upgrade Oracle grid infrastructure 12.1.0.2Install and upgrade Oracle grid infrastructure 12.1.0.2
Install and upgrade Oracle grid infrastructure 12.1.0.2
 
How to create a pluggable database by cloning an existing local pdb
How to create a pluggable database by cloning an existing local pdbHow to create a pluggable database by cloning an existing local pdb
How to create a pluggable database by cloning an existing local pdb
 
Beginbackup
BeginbackupBeginbackup
Beginbackup
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
 
Store and Process Big Data with Hadoop and Cassandra
Store and Process Big Data with Hadoop and CassandraStore and Process Big Data with Hadoop and Cassandra
Store and Process Big Data with Hadoop and Cassandra
 
Oracle Database 11g Product Family
Oracle Database 11g Product FamilyOracle Database 11g Product Family
Oracle Database 11g Product Family
 
oracle cloud with 2 nodes processing
oracle cloud with 2 nodes processingoracle cloud with 2 nodes processing
oracle cloud with 2 nodes processing
 
Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windows
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different host
 
Pontos para criar_instancia_data guard_11g
Pontos para criar_instancia_data guard_11gPontos para criar_instancia_data guard_11g
Pontos para criar_instancia_data guard_11g
 
PostgreSQL and PL/Java
PostgreSQL and PL/JavaPostgreSQL and PL/Java
PostgreSQL and PL/Java
 
UKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction LocksUKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction Locks
 
Cloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step ProcedureCloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step Procedure
 
Pdxpugday2010 pg90
Pdxpugday2010 pg90Pdxpugday2010 pg90
Pdxpugday2010 pg90
 
Migrate from database file system to asm
Migrate from database file system to asmMigrate from database file system to asm
Migrate from database file system to asm
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4
 

Andere mochten auch

Database Security
Database SecurityDatabase Security
Database SecurityAnar Godjaev
 
11 g RAC -ASM
11 g RAC -ASM11 g RAC -ASM
11 g RAC -ASMAnar Godjaev
 
WebLogic JMX for DevOps
WebLogic JMX for DevOpsWebLogic JMX for DevOps
WebLogic JMX for DevOpsFrank Munz
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery ProcedureAnar Godjaev
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and RecoveryAnar Godjaev
 
How to add storage to esxi 5.5
How to add storage to esxi 5.5How to add storage to esxi 5.5
How to add storage to esxi 5.5Osama Mustafa
 
How to apply new patch on siebel 8.2.2.4
How to apply new patch on siebel 8.2.2.4How to apply new patch on siebel 8.2.2.4
How to apply new patch on siebel 8.2.2.4Osama Mustafa
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productionsOsama Mustafa
 
Enable oracle database vault
Enable oracle database vaultEnable oracle database vault
Enable oracle database vaultOsama Mustafa
 
Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6Osama Mustafa
 
Oracle autovue
Oracle autovueOracle autovue
Oracle autovueOsama Mustafa
 
Apache Tomcat Shutdown Startup Script Shell
Apache Tomcat Shutdown Startup Script ShellApache Tomcat Shutdown Startup Script Shell
Apache Tomcat Shutdown Startup Script ShellAnar Godjaev
 
Erp installation r12.2
Erp installation r12.2Erp installation r12.2
Erp installation r12.2Osama Mustafa
 
HTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive ListHTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive ListMainstreethost
 
J2ee user managment using dwh builder
J2ee user managment using dwh builderJ2ee user managment using dwh builder
J2ee user managment using dwh builderOsama Mustafa
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed FilesAnar Godjaev
 
Ebs clone r12.2.4
Ebs clone r12.2.4Ebs clone r12.2.4
Ebs clone r12.2.4Osama Mustafa
 
Oracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOsama Mustafa
 

Andere mochten auch (20)

Database Security
Database SecurityDatabase Security
Database Security
 
11 g RAC -ASM
11 g RAC -ASM11 g RAC -ASM
11 g RAC -ASM
 
Vyg monitor
Vyg monitorVyg monitor
Vyg monitor
 
LogMiner
LogMinerLogMiner
LogMiner
 
WebLogic JMX for DevOps
WebLogic JMX for DevOpsWebLogic JMX for DevOps
WebLogic JMX for DevOps
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and Recovery
 
How to add storage to esxi 5.5
How to add storage to esxi 5.5How to add storage to esxi 5.5
How to add storage to esxi 5.5
 
How to apply new patch on siebel 8.2.2.4
How to apply new patch on siebel 8.2.2.4How to apply new patch on siebel 8.2.2.4
How to apply new patch on siebel 8.2.2.4
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productions
 
Enable oracle database vault
Enable oracle database vaultEnable oracle database vault
Enable oracle database vault
 
Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6
 
Oracle autovue
Oracle autovueOracle autovue
Oracle autovue
 
Apache Tomcat Shutdown Startup Script Shell
Apache Tomcat Shutdown Startup Script ShellApache Tomcat Shutdown Startup Script Shell
Apache Tomcat Shutdown Startup Script Shell
 
Erp installation r12.2
Erp installation r12.2Erp installation r12.2
Erp installation r12.2
 
HTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive ListHTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive List
 
J2ee user managment using dwh builder
J2ee user managment using dwh builderJ2ee user managment using dwh builder
J2ee user managment using dwh builder
 
Oracle Managed Files
Oracle Managed FilesOracle Managed Files
Oracle Managed Files
 
Ebs clone r12.2.4
Ebs clone r12.2.4Ebs clone r12.2.4
Ebs clone r12.2.4
 
Oracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c Installation
 

Ähnlich wie Flashback (Practical Test)

OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
Enable archivelod mode in oracle rac12cR1 with asm location
Enable archivelod mode  in oracle rac12cR1 with asm locationEnable archivelod mode  in oracle rac12cR1 with asm location
Enable archivelod mode in oracle rac12cR1 with asm locationDebasish Nayak
 
br_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docbr_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docLucky Ally
 
Data Migration in Database
Data Migration in DatabaseData Migration in Database
Data Migration in DatabaseJingun Jung
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission processK Kumar Guduru
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12cuzzal basak
 
Oracle10g New Features I
Oracle10g New Features IOracle10g New Features I
Oracle10g New Features IDenish Patel
 
Pluggable database tutorial
Pluggable database tutorialPluggable database tutorial
Pluggable database tutorialOsama Mustafa
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql SyntaxReka
 
Oracle database 12.2 new features
Oracle database 12.2 new featuresOracle database 12.2 new features
Oracle database 12.2 new featuresAlfredo Krieg
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersConnor McDonald
 

Ähnlich wie Flashback (Practical Test) (20)

OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
 
Enable archivelod mode in oracle rac12cR1 with asm location
Enable archivelod mode  in oracle rac12cR1 with asm locationEnable archivelod mode  in oracle rac12cR1 with asm location
Enable archivelod mode in oracle rac12cR1 with asm location
 
br_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docbr_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.doc
 
Data Migration in Database
Data Migration in DatabaseData Migration in Database
Data Migration in Database
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission process
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
Nls
NlsNls
Nls
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12c
 
Dbmsmanual
DbmsmanualDbmsmanual
Dbmsmanual
 
Oracle10g New Features I
Oracle10g New Features IOracle10g New Features I
Oracle10g New Features I
 
Pluggable database tutorial
Pluggable database tutorialPluggable database tutorial
Pluggable database tutorial
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql Syntax
 
Oracle database 12.2 new features
Oracle database 12.2 new featuresOracle database 12.2 new features
Oracle database 12.2 new features
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4
 
Oracle ORA Errors
Oracle ORA ErrorsOracle ORA Errors
Oracle ORA Errors
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer Disasters
 

Mehr von Anar Godjaev

Oracle GoldenGate
Oracle GoldenGateOracle GoldenGate
Oracle GoldenGateAnar Godjaev
 
How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...Anar Godjaev
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaultAnar Godjaev
 
Database Vault / Verinin GĂŒvenliği
Database Vault /  Verinin GĂŒvenliğiDatabase Vault /  Verinin GĂŒvenliği
Database Vault / Verinin GĂŒvenliğiAnar Godjaev
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden GateAnar Godjaev
 
Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumAnar Godjaev
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon ExportAnar Godjaev
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Anar Godjaev
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Anar Godjaev
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeAnar Godjaev
 
Conditional Control
Conditional ControlConditional Control
Conditional ControlAnar Godjaev
 
PL/SQL Blocks
PL/SQL BlocksPL/SQL Blocks
PL/SQL BlocksAnar Godjaev
 
Wait Interface
Wait InterfaceWait Interface
Wait InterfaceAnar Godjaev
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasiAnar Godjaev
 
Parallel Server
Parallel ServerParallel Server
Parallel ServerAnar Godjaev
 
Table Partitions
Table PartitionsTable Partitions
Table PartitionsAnar Godjaev
 
Memory Management
Memory ManagementMemory Management
Memory ManagementAnar Godjaev
 

Mehr von Anar Godjaev (20)

Oracle GoldenGate
Oracle GoldenGateOracle GoldenGate
Oracle GoldenGate
 
How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vault
 
Database Vault / Verinin GĂŒvenliği
Database Vault /  Verinin GĂŒvenliğiDatabase Vault /  Verinin GĂŒvenliği
Database Vault / Verinin GĂŒvenliği
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden Gate
 
Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server Kurulum
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon Export
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇
 
Contraints
ContraintsContraints
Contraints
 
Oracle SQL
Oracle SQLOracle SQL
Oracle SQL
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını Inceleme
 
Conditional Control
Conditional ControlConditional Control
Conditional Control
 
PL/SQL Blocks
PL/SQL BlocksPL/SQL Blocks
PL/SQL Blocks
 
Wait Interface
Wait InterfaceWait Interface
Wait Interface
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasi
 
Tuning SGA
Tuning SGATuning SGA
Tuning SGA
 
Parallel Server
Parallel ServerParallel Server
Parallel Server
 
Table Partitions
Table PartitionsTable Partitions
Table Partitions
 
Memory Management
Memory ManagementMemory Management
Memory Management
 

KĂŒrzlich hochgeladen

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

KĂŒrzlich hochgeladen (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Flashback (Practical Test)

  • 1. Anar Godjaev FLASHBACK (Practical test) SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount; ORACLE instance started. Total System Global Area 184549376 bytes Fixed Size 1300928 bytes Variable Size 157820480 bytes Database Buffers 25165824 bytes Redo Buffers 262144 bytes Database mounted. SQL> alter database archivelog; Database altered. SQL> alter system set DB_FLASHBACK_RETENTION_TARGET=4320; System altered. SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=536870912; System altered. SQL> alter system set DB_RECOVERY_FILE_DEST='/home/oracle/flash'; System altered. SQL> alter database flashback on; Database altered.
  • 2. Anar Godjaev SQL> alter database open; Database altered. SQL> select flashback_on from v$database; FLASHBACK_ON -----------YES FLASHBACK (DROP TABLE) CMD > sqlplus hr/hr SQL> create table test_table( id number(2), name varchar2(30) ); Table created. SQL> insert into test_table values (1, 'Ben Rockwood'); 1 row created. SQL> insert into test_table values (2, 'Tamarah Rockwood'); 1 row created. SQL> insert into test_table values (3, 'Nova Rockwood'); 1 row created. SQL> insert into test_table values (4, 'Hunter Rockwood'); insert into test_table values (5, 'ddddter Rockwood'); 1 row created. SQL> select * from test_table;
  • 3. Anar Godjaev ID NAME ---------- -----------------------------1 Ben Rockwood 2 Tamarah Rockwood 3 Nova Rockwood 4 Hunter Rockwood SQL> drop table test_table; Table dropped. SQL> select * from test_table; select * from test_table * ERROR at line 1: ORA-00942: table or view does not exist SQL> select * from recyclebin; SQL> show recyclebin; SQL> flashback table test_table to before drop; Flashback complete. SQL> select * from test_table; ID NAME ---------- -----------------------------1 Ben Rockwood 2 Tamarah Rockwood 3 Nova Rockwood 4 Hunter Rockwood SQL> drop table test_table purge; Table dropped. SQL> select * from test_table;
  • 4. Anar Godjaev select * from test_table * ERROR at line 1: ORA-00942: table or view does not exist SQL> select * from recyclebin; SQL> show recyclebin; SQL> alter system set "_recyclebin"=FALSE; FLASHBACK (SCN) CMD > sqlplus hr/hr SQL> CREATE TABLE flashback_table_test ( id NUMBER(10) ); SQL> ALTER TABLE flashback_table_test ENABLE ROW MOVEMENT; SQL> SELECT current_scn FROM v$database; CURRENT_SCN ----------933716 SQL> INSERT INTO flashback_table_test (id) VALUES (1); SQL> INSERT INTO flashback_table_test (id) VALUES (2); SQL> COMMIT; SQL> SELECT current_scn FROM v$database; CURRENT_SCN ----------934423
  • 5. Anar Godjaev SQL> SELECT * FROM flashback_table_test; ID ----------1 2 SQL> INSERT INTO flashback_table_test (id) VALUES (3); SQL> INSERT INTO flashback_table_test (id) VALUES (4); SQL> COMMIT; SQL> SELECT current_scn FROM v$database; CURRENT_SCN ----------934474 SQL> SELECT * FROM flashback_table_test; ID ----------1 2 3 4 SQL> FLASHBACK TABLE flashback_table_test TO SCN 934423; SQL> SELECT COUNT(*) FROM flashback_table_test; COUNT(*) ---------2 SQL> FLASHBACK TABLE flashback_table_test TO SCN 934474;
  • 6. Anar Godjaev SQL> SELECT COUNT(*) FROM flashback_table_test; COUNT(*) ---------4 SQL> FLASHBACK TABLE flashback_table_test TO SCN 933716; SQL> SELECT COUNT(*) FROM flashback_table_test; COUNT(*) ---------4 FLASHBACK (TIME) CMD > sqlplus hr/hr SQL> CREATE TABLE t3 ENABLE ROW MOVEMENT AS SELECT owner, table_name, tablespace_name FROM all_tables WHERE 1=2; SQL> desc t SQL> SELECT table_name, row_movement FROM user_tables; SQL> SELECT current_scn, SYSTIMESTAMP FROM gv$database; CURRENT_SCN ----------SYSTIMESTAMP --------------------------------------------------------------------------935085
  • 7. Anar Godjaev 10-MAR-12 10.30.40.360096 AM +02:00 SQL> INSERT INTO t3 SELECT owner, table_name, tablespace_name FROM all_tables WHERE owner = 'SYS'; SQL> COMMIT; SQL> SELECT current_scn, SYSTIMESTAMP FROM gv$database; CURRENT_SCN ----------SYSTIMESTAMP --------------------------------------------------------------------------935177 10-MAR-12 10.32.18.675106 AM +02:00 SQL> INSERT INTO t3 SELECT owner, table_name, tablespace_name FROM all_tables WHERE owner = 'HR'; SQL> COMMIT; SQL> SELECT current_scn, SYSTIMESTAMP FROM gv$database; CURRENT_SCN ----------SYSTIMESTAMP --------------------------------------------------------------------------935196 10-MAR-12 10.32.57.849132 AM +02:00 SQL> INSERT INTO t3 SELECT owner, table_name, tablespace_name FROM all_tables WHERE owner = 'CTXSYS'; SQL> COMMIT;
  • 8. Anar Godjaev SQL> SELECT current_scn, SYSTIMESTAMP FROM gv$database; CURRENT_SCN ----------SYSTIMESTAMP --------------------------------------------------------------------------935239 10-MAR-12 10.33.36.687213 AM +02:00 SQL> SELECT owner, COUNT(*) FROM t3 GROUP BY owner; OWNER COUNT(*) ------------------------------ ---------HR 10 CTXSYS 5 SYS 27 SQL> FLASHBACK TABLE t3 TO TIMESTAMP TO_TIMESTAMP('10/03/2012 10:40:00','dd/mm/yyyy hh24:mi:ss'); SQL> SELECT owner, COUNT(*) FROM t3 GROUP BY owner; SQL> FLASHBACK TABLE t3 TO TIMESTAMP TO_TIMESTAMP('07/02/2011 19:31:22','dd/mm/yyyy hh24:mi:ss'); SQL> SELECT owner, COUNT(*) FROM t3 GROUP BY owner; SQL> FLASHBACK TABLE t3 TO TIMESTAMP TO_TIMESTAMP('07/02/2011 19:33:55','dd/mm/yyyy hh24:mi:ss'); SQL> SELECT owner, COUNT(*) FROM t3 GROUP BY owner; FLASHBACK (POINT) CMD > sqlplus hr/hr SQL> CREATE TABLE t2 ENABLE ROW MOVEMENT AS SELECT owner, table_name, tablespace_name
  • 9. Anar Godjaev FROM all_tables WHERE 1=2; SQL> desc t2 SQL> SELECT table_name, row_movement FROM user_tables; SQL> CREATE RESTORE POINT zero; SQL> INSERT INTO t2 SELECT owner, table_name, tablespace_name FROM all_tables WHERE owner = 'SYS'; SQL> COMMIT; SQL> CREATE RESTORE POINT one; SQL> INSERT INTO t2 SELECT owner, table_name, tablespace_name FROM all_tables WHERE owner = 'WMSYS'; SQL> COMMIT; SQL> CREATE RESTORE POINT two; SQL> INSERT INTO t2 SELECT owner, table_name, tablespace_name FROM all_tables WHERE owner = 'CTXSYS'; SQL> COMMIT; SQL> SELECT owner, COUNT(*) FROM t2 GROUP BY owner;
  • 10. Anar Godjaev SQL> SELECT scn, time, name FROM gv$restore_point; SQL> FLASHBACK TABLE t2 TO RESTORE POINT two; SQL> SELECT owner, COUNT(*) FROM t2 GROUP BY owner; SQL> FLASHBACK TABLE t2 TO RESTORE POINT one; SQL> SELECT owner, COUNT(*) FROM t2 GROUP BY owner; SQL> FLASHBACK TABLE t2 TO RESTORE POINT zero; SQL> SELECT owner, COUNT(*) FROM t2 GROUP BY owner; FLASHBACK (DATABASE) CMD > sqlplus hr/hr SQL> create table test_table2( id number(2), name varchar2(30) ); Table created. SQL> insert into test_table values (1, 'Ben Rockwood'); 1 row created. SQL> insert into test_table values (2, 'Tamarah Rockwood'); 1 row created.
  • 11. Anar Godjaev SQL> insert into test_table values (3, 'Nova Rockwood'); 1 row created. SQL> insert into test_table values (4, 'Hunter Rockwood'); 1 row created. SQL> select * from test_table; ID NAME ---------- -----------------------------1 Ben Rockwood 2 Tamarah Rockwood 3 Nova Rockwood 4 Hunter Rockwood SQL> CONN sys/password AS SYSDBA; SQL> SHUTDOWN IMMEDIATE; SQL> STARTUP MOUNT EXCLUSIVE; SQL> FLASHBACK DATABASE TO TIMESTAMP SYSDATE-(1/24/12); // 5 minutes earlier to SQL> ALTER DATABASE OPEN RESETLOGS; SQL> CONN hr/hr SQL> select * from test_table; FLASHBACK DATABASE TO TIMESTAMP my_date; FLASHBACK DATABASE TO BEFORE TIMESTAMP my_date; FLASHBACK DATABASE TO SCN my_scn; FLASHBACK DATABASE TO BEFORE SCN my_scn;