Free Newsletters:
Database Journal  
DBAnews  

DBASupport

 The Knowledge Center for Oracle Professionals

Search DBAsupport:
 
HOME 11g Central 10g Central 9i Central 8i Central Oracle News Scripts FAQ OCP Zone Resources Technical Docs Tools & Utilities Forums
internet.com

» HOME
» FEATURES
    11g Central
    10g Central
    9i Central
    8i Central
    Oracle News
» COMMUNITY
    Scripts
    Forums
    FAQ
    OCP Zone
» RESOURCES
    Resources
    Technical Docs
    Tools & Utilities
    Tech Jobs


internet.commerce
Be a Commerce Partner
GPS
Online Education
Boat Donations
Promotional Products
Logo Design
Corporate Gifts
KVM Switch over IP
PDA Phones & Cases
Web Design
Career Education


internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


   DBAsupport.com > Oracle > Oracle 9i Central > Featured Stories


Guide to Oracle 11g and Database Migration
Oracle Database 11g includes more features for self-management and automation, which makes it easier for customers to cost-effectively manage their data. Download this Internet.com eBook for an overview of some of the new features in 11g and for an overview of the issues you need to consider as you prepare for a database migration. »
Innovate Faster with Oracle Database 11g
Read this in-depth analysis of 56 customers, which shows significant differences between the value software vendors Oracle and SAP deliver to midsize companies. »
Oracle Business Intelligence Standard Edition One
Find out how Newport Beach, CA-based Mobilitie is shaking up the telecom industry by leveraging technology to provide an entirely different financial model for deploying, upgrading, and owning wireless and wireline network assets. »
Business Intelligence and Enterprise Performance Management: Trends for Emerging Businesses
Quickly implementing an ERP software solution can be of tremendous benefit; however, companies often struggle to balance the benefits of reducing implementation time and cost with the risks of an accelerated deployment. Read this white paper to learn about easy-to-follow best practices for achieving a successful accelerated implementation. »
Making the Case for Oracle Database on Windows
Users benefit as vendors reduce enterprise complexity and deliver integration. »


CA ERwin® Data Modeler Proven database design and modeling. Efficiently analyze, design and deploy effective database solutions. Whitepaper: Manage SQL Server Deployments
Try it free: CA ERwin® Data Modeler

ASP 3.0/.NET Developer
Jupitermedia
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Recovering Accidentally Lost Data Using Oracle's Flashback Query
Sreeram Surapaneni, svsreeram@yahoo.com


Extract

Recent studies show that nearly 50% of system outages are due to human errors. The ability to recover from these user errors using a simple, easy to use interface is challenging. Most database products today do not offer any solutions, thus administrators have no option but to recover the database using a previous backup. This not only requires the database to be unavailable during the period of recovery but also leads loss of valid transactions if the database to be restored to a point in time in the past. Oracle 9i's new feature, Flashback Query allows the users to view the old image of data that was modified and committed by DML statement, without requiring any structural changes to the database.

Introduction

Oracle database uses a version based read consistency mechanism by saving an image of the data prior to making any modifications. These changes are stored in the undo tablespace. If the users decide not to commit the transaction, Oracle uses the data saved in the undo tablespace to recreate the original data. The Flashback Query uses the same mechanism to construct an image of the data, as it existed at a time in the past. Oracle professionals can specify how long they wish to retain the undo data using the UNDO_RETENTION parameter in the init.ora file and thereby can control how far back a Flashback Query can go.

The Flashback query feature in an application can be utilized by using either of the following two techniques. Using the AS OF clause in SQL queries to specify a past time is the simplest way to implement the Flashback query. This method allows you to perform DDL operations such as creating and truncating tables, and DML operations such as inserts and deletes, in the same session as queries using the AS OF clause. Alternatively, it can be implemented using the DBMS_FLASHBACK package but we must open a cursor before making a call to disable the Flashback mode. We can fetch results from past data from the cursor, then issue INSERT or UPDATE statements against the current state of the Database. This is illustrated in the next section with examples.

Before ordinary users can take advantage of this functionality, the Database Administrators must perform the following actions.

  • Configure for Automatic undo management: set initialization parameter undo_management=auto and undo_tablespace= < undo tablespace name> in the init.ora file.
  • Specify undo retention time by setting undo_reention = < time in seconds> in the init.ora.

    For eg:

    		undo_management=auto 
    		undo_retention=1200 
    		undo_tablespace=UNDOTBS
    
    
  • Grant execute privilege on dbms_flashback package to the users that need to perform Flashback Query.
  • Grant 'FLASHBACK' privilege on the table's that users need to perform flashback query. Alternatively, 'FLASHBACK ANY TABLE' system privilege to allow the user to use this feature on any table except data dictionary tables.

Please note that the flashback query is turned off when the session ends, and if there is no explicit call to the disable procedure.

Notes:

  • Flashback Query is supported by the export utility to export data which is consistent as of a specified point in time.
  • PL/SQL cursors opened in Flashback mode area available for DML after Flashback mode is disabled.

Next


Back to DBAsupport.com







JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES