Quick Search:
 
 Oracle PL/SQL: FLASHBACK: SYS commands and queries Jump to:  
Category: >> Oracle PL/SQL >> FLASHBACK: SYS commands and queries  

<< lastnext >>

Snippet Name: FLASHBACK: SYS commands and queries

Description: A set of commands and queries related to flashback functionality.

The Flashback Data Archive can be used to automatically track and maintain historical changes to all Oracle data in a highly application transparent, secure and efficient manner. Flashback query allows a user to view the data quickly and easily the way it was at a particular time in the past, even when it is modified and committed, be it a single row or the whole table.

Also see:
» FLASHBACK: Oracle 10G enhancements
» FLASHBACK: AS OF clause
» FLASHBACK: Initialization Parameters
» FLASHBACK: Syntax Elements

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 13th, 2009

SELECT current_scn
FROM v$database;
 
SELECT oldest_flashback_scn,
oldest_flashback_time
FROM gv$flashback_database_log;
 
GRANT flashback ANY TABLE TO user1;
 
-------------------------------
 
SHUTDOWN IMMEDIATE;
 
startup mount EXCLUSIVE;
 
-- be sure to substitute your SCN
FLASHBACK DATABASE TO SCN 19516617;
OR
FLASHBACK DATABASE TO RESTORE POINT bef_damage;
 
/*
FLASHBACK DATABASE TO TIMESTAMP (SYSDATE-1/24);
 
FLASHBACK DATABASE TO TIMESTAMP timestamp'2002-11-05 14:00:00';
 
FLASHBACK DATABASE 
TO TIMESTAMP to_timestamp('2002-11-11 16:00:00', 'YYYY-MM-DD HH24:MI:SS');
*/
 
-- this will fail
ALTER database OPEN;
 
-- this will succeed
ALTER database OPEN resetlogs; 
 
 
========================
 
SELECT *
FROM gv$flashback_database_stat;
 
ALTER system switch logfile;
 
shutdown IMMEDIATE;
 
startup mount EXCLUSIVE;
 
ALTER database flashback off;
 
ALTER database noarchivelog;
 
ALTER database OPEN;
 
SELECT flashback_on, log_mode
FROM v$database;


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org