Atikh's DBA blog
  • Home
  • Oracle
  • MySQL
  • MongoDB
  • PostgreSQL
  • Snowflake
  • About Me
  • Contact Us

Oracle : Restore points

 Atikh Shaikh     oracle, restore point     No comments   

Restore point plays important role in restore and recovery scenario as it allows to store state of the database to certain point, Lets discuss oracle restore points in details with example
  • Restore point is said to be "point" in database which is associated with timestamp or an SCN of the database
  • Restore point is used to flash back a table or the whole database to certain point specified as per restore point
  • Various RMAN operations such as backup and archival backup also uses these restore point
  • Restore point can be name up to 128 characters
  • There can be 2048 restore points in database provided database has enough FRA
  • Privileges required to create restore points
Normal restore point
Guaranteed restore point
SELECT ANY DICTIONARY
SYSDBA
FLASHBACK ANY TABLE
SYSBACKUP
SYSDBA
SYSDG
SYSBACKUP

SYSDG

Privileges required to view or use of restore point
      SELECT ANY DICTIONARY
      FLASHBACK ANY TABLE
      SYSDBA
      SYSBACKUP or
      SYSDG or
      SELECT_CATALOG_ROLE
Requirements:
  • Database must have fast recovery area (FRA) set for guaranteed restore point
  • Database is in Archive log mode (guaranteed restore point)

Types of Restore points

There are two types of restore points
  1. Guaranteed restore point
  2. Normal restore point
Guaranteed restore point
  • A guaranteed restore point enables you to flash the database back to the restore point regardless of DB_FLASHBACK_RETENTION_TARGET initialization parameter setting
  • Guaranteed restore point must be dropped explicitly by user using DROP RESTORE POINT command
  • Guaranteed restore point never ages out
Normal Restore Point
  • A normal restore point enables you to flash the database back to a restore point within time determined by DB_FLASHBACK_RETENTION_TARGET initialization parameter setting
  • Normal restore point can be dropped explicitly
  • The control files stores name of restore point and the SCN
Creating restore point
In below example, we are going to create guaranteed restore point
Check for flashback on in the database using below query

SQL>  select name,FLASHBACK_ON,open_mode from v$database;

NAME      FLASHBACK_ON     OPEN_MODE
--------- ------------     --------------------------
TECHNO_DB  NO              READ WRITE

Turn the flashback on using below statement

SQL> alter database flashback on;

Database altered.

SQL> select FLASHBACK_ON from v$database;

FLASHBACK_ON
------------------
YES

Check for Fast Recovery Area size and location

SQL> show parameter db_recovery

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------
db_recovery_file_dest                string      +FLASH
db_recovery_file_dest_size           big integer 100G
SQL>

Check for any restore point using v$restore_point view

set lines 200
col TIME for a40
col NAME for a40
select inst_id,NAME,TIME,GUARANTEE_FLASHBACK_DATABASE,storage_size/1024/1024/1024 from v$restore_point;

no rows selected

Create actual restore point using CREATE RESTORE POINT command

SQL> create restore point RESTORE_POINT_20FEB2019 guarantee flashback database;

Restore point created.

Verify if restore point is created

set lines 200
col TIME for a40
col NAME for a40
select NAME,TIME,GUARANTEE_FLASHBACK_DATABASE,storage_size/1024/1024/1024 from v$restore_point;

    NAME                 TIME           GUA STORAGE_SIZE/1024/1024/1024
-------------         ------------ -------------------------- --- ----------------
RESTORE_POINT_20FEB2019 20-FEB-19 06.20.40.000000000 AM    YES        2

DROP Restore Point
Drop restore point can be performed using DROP RESTORE POINT command and we need turn off flashback_on option

SQL> DROP RESTORE POINT RESTORE_POINT_20FEB2019;

Restore point dropped.

SQL> alter database flashback on;

Database altered.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Instagram
  •  Pin
  •  linkedin
  •  reddit
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Author

Atikh Shaikh
View my complete profile

Categories

  • MongoDB (18)
  • Oracle 12c (30)
  • Oracle12cR2 New Feature (3)
  • PostgreSQL (20)
  • RMAN (10)
  • Snowflake (8)
  • mysql (23)
  • oracle (74)

Blog Archive

  • ►  2018 (38)
    • ►  November (25)
    • ►  December (13)
  • ▼  2019 (33)
    • ►  January (15)
    • ▼  February (6)
      • PostgreSQL : pg_hba. conf configuration file
      • MongoDB : Creating a Large Document
      • MongoDB : Indexing and explain Plan
      • MongoDB : Basic Administration
      • Oracle : Restore points
      • Configure and Use of Flash Recovery Area
    • ►  March (2)
    • ►  April (5)
    • ►  May (5)
  • ►  2020 (5)
    • ►  April (1)
    • ►  May (2)
    • ►  July (2)
  • ►  2021 (8)
    • ►  June (3)
    • ►  July (3)
    • ►  August (1)
    • ►  December (1)
  • ►  2022 (33)
    • ►  May (3)
    • ►  June (10)
    • ►  July (3)
    • ►  August (4)
    • ►  September (8)
    • ►  October (3)
    • ►  November (2)
  • ►  2023 (14)
    • ►  February (1)
    • ►  April (5)
    • ►  May (2)
    • ►  June (1)
    • ►  September (1)
    • ►  October (1)
    • ►  December (3)
  • ►  2024 (5)
    • ►  January (2)
    • ►  March (3)
  • ►  2025 (6)
    • ►  March (1)
    • ►  April (3)
    • ►  May (2)

Popular Posts

  • ORA-29283: invalid file operation: unexpected "LFI" error (1509)[29437]
    I was trying to export the schema in my windows PC, it got stuck with below error    C:\Users\shaik\Videos\technodba exp>expdp userid...
  • PostgreSQL : How to get data directory location for PostgreSQL instance
    Sometimes, you start working on a PostgreSQL instance but forget about the data directory, here we will discuss different methods to know th...
  • Oracle 23ai : Use of NOVALIDATE Constraints in IMPDP
    While performing impdp operations in the Oracle database, Oracle performs validation checks for every constraint on the imported table, that...
  • ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
    In previous articles, we have learned about user creation and grants  in MySQL in detail, but there are a few privileges called global priv...
  • Oracle Dataguard Broker Configuration (DGMGRL)
    Data Guard Broker is a command-line interface that makes managing primary and standby databases easy. DBA can use a single command to switch...

Labels

oracle Oracle 12c mysql PostgreSQL MongoDB oracle 19c Oracle23c oracle19c Orale PDB-CDB oracle12c python AWS Oracle ASM Virtualbox pluggable database storage engine

Pages

  • Disclaimer
  • Privacy Policy

Follow TechnoDBA

Copyright © Atikh's DBA blog | Powered by Blogger