Oracle
  Home arrow Oracle arrow Implementing and Using Oracle`s Restore Point Functionality
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ORACLE

Implementing and Using Oracle`s Restore Point Functionality
By: Ray Terrill
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2008-07-22


    Table of Contents:
  • Implementing and Using Oracle`s Restore Point Functionality
  • Example 1: Normal Restore Point - Flashback Logging Disabled
  • Example 2: Guaranteed Restore Point - Flashback Logging Enabled
  • Reset and Reopen

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Implementing and Using Oracle`s Restore Point Functionality
    ( Page 1 of 4 )

    With the release of Oracle 10gR2, Oracle introduced the concept of Restore Points, presenting to DBAs a more user-friendly approach to implementing point-in-time recovery. In this article, you'll learn what Restore Points are, their many advantages, and how to use them.

    Implementing/Using Oracle's Restore Point Functionality

    Restore points allow DBAs to create a label for a particular moment in the timeline of the database, eliminating the need to delve into the details of SCNs or to attempt to calculate the exact time transactions are occurring. In addition, a specific type of restore point known as a Guaranteed Restore Point allows the DBA to ensure beyond any doubt that the database is able to flash back to a specific point in time (or even to any point in time between the guaranteed restore point and the current time with some additional configuration).

    As we will see, restore points provide an invaluable tool that can be used to assist the DBA in application testing, guarding against failed batch updates, and anywhere else you'd consider using a conventional point-in-time recovery.

    Configuration

    Restore Point Prerequisites:

    • COMPATIBLE initialization parameter must be > 10.2

    Flashback Database Prerequisites:

    • Database must be configured for and running in ARCHIVELOG mode

    • Database must have configured and be using a FLASH_RECOVERY_AREA

    Because restore points work hand-in-hand with the Flashback features introduced in Oracle 10g, many of the same prerequisites (above) apply to the configuration of restore points. I'll assume that the above parameters have been configured correctly, and move on to implementing and using both normal and guaranteed restore points.

    To Enable Flashback Logging or Not

    Because the restore point functionality works hand-in-hand with flashback database, it is advisable to enable flashback logging before beginning with the restore point functionality. Without this logging enabled, you will be unable to use flashback database to quickly return your database to the time specified by the restore point, except in the case of a guaranteed restore point (where you will lose the ability to restore the database to a point-in-time between the specified guaranteed restore point and the current time). You must also shut down and mount the database to create the first guaranteed restore point without flashback database enabled. To truly enjoy the functionality of restore points, as well as flashback database, it's vital to enable flashback logging (shown in Example 2).

    Normal vs. Guaranteed Restore Point

    There are two types of restore points that can be created, with differing levels of functionality. The Normal Restore Point simply allows the DBA to provide a name for the current state of the database, used instead of an SCN or timestamp for point-in-time recovery. A Guaranteed Restore Point also provides the ability to name the current state of the database, but allows for greater security in that the restore point will forever be available unless explicitly removed by the DBA, and also can provide the ability to flash back the database without first enabling flashback logging (albeit at a reduced level of functionality, discussed above in the "To Enable Flashback Logging or Not" section).

    Examples: Using Restore Points

    (Configuration for Examples)

    To create the test user and test table used in the following examples, use the following SQL/PL SQL to create the user and insert 200 rows of sample data (code below assumes you have a USERS tablespace):

    --Create user and grant necessary permissions

    create user testuser identified by testuser;

    grant create table to testuser;

    grant create session to testuser;

    grant create procedure to testuser;

    grant execute on dbms_lock to testuser;

    alter user testuser quota 5m on users;


    --Connect as the newly created testuser and create the test table and logging table

    conn testuser/testuser;

    create table testuser.test (id int, name varchar2(5)) tablespace users;

    create table testuser.logging (timestamp date, loginfo varchar2(15)) tablespace users;


    --Insert sample data into the test table

    declare

    i number(5);

    begin

    for i in 1..200 loop

    insert into testuser.test values (i, 'a'||i);

    end loop;

    commit;

    end;

    /




     
     
    >>> More Oracle Articles          >>> More By Ray Terrill
     

       

    ORACLE ARTICLES

    - Oracle's Turn to Play in the Sun
    - Implementing and Using Oracle`s Restore Poin...
    - Tuning PL/SQL Code
    - Debugging PL/SQL Code
    - Testing PL/SQL Code
    - Working With PL/SQL Code
    - Conditional Compilation for Oracle Database ...
    - Compile-Time Warnings for Oracle DB 10g
    - Compiling PL/SQL Code for an Oracle Database
    - Troubleshooting PL/SQL Code
    - Managing PL/SQL Code
    - Data Manipulation and More for HTML DB Appli...
    - Oracle Database Fundamentals
    - Adding Processes to HTML DB Applications
    - Adding Computations, Processes, and Validati...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT