Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 Oracle PL/SQL: FLASHBACK: SYS commands and queries Jump to:  
Category: >> Oracle PL/SQL >> FLASHBACK: SYS commands and queries Bookmark and Share

<< 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;


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 70 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?