Skip to content

create restore point

CONN / AS SYSDBA
SHUTDOWN IMMEDIATE
STARTUP MOUNT
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
Create guarantee restore point in 12c
ALTER DATABASE FLASHBACK ON;
--ALTER DATABASE FLASHBACK OFF;
-- Retention for 7 days.
ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=10080 SCOPE=BOTH;

CDB level

CONN / AS SYSDBA

-- Normal restore point.
CREATE RESTORE POINT cdb1_before_changes;
DROP RESTORE POINT cdb1_before_changes;

-- Guaranteed restore point.
CREATE RESTORE POINT cdb1_before_changes GUARANTEE FLASHBACK DATABASE;
DROP RESTORE POINT cdb1_before_changes;

PDB level

CONN / AS SYSDBA

ALTER SESSION SET CONTAINER=pdb1;

-- Normal restore point.
CREATE RESTORE POINT pdb1_before_changes;
DROP RESTORE POINT pdb1_before_changes;

-- Guaranteed restore point.
CREATE RESTORE POINT pdb1_before_changes GUARANTEE FLASHBACK DATABASE;
DROP RESTORE POINT pdb1_before_changes;

PDB level from cdb

CONN / AS SYSDBA

-- Normal restore point.
CREATE RESTORE POINT pdb1_before_changes FOR PLUGGABLE DATABASE pdb1;
DROP RESTORE POINT pdb1_before_changes FOR PLUGGABLE DATABASE pdb1;

-- Guaranteed restore point.
CREATE RESTORE POINT pdb1_before_changes FOR PLUGGABLE DATABASE pdb1 GUARANTEE FLASHBACK DATABASE;
DROP RESTORE POINT pdb1_before_changes FOR PLUGGABLE DATABASE pdb1;

 

CREATE RESTORE POINT pdb_532019 FOR PLUGGABLE DATABASE abc GUARANTEE FLASHBACK DATABASE;

 

--
-- List Flashback Database Restore Points
--
 
SET PAUSE ON
SET PAUSE 'Press Return to Continue'
SET PAGESIZE 60
SET LINESIZE 300
SET VERIFY OFF
 
COLUMN scn FOR 999,999,999,999,999
COLUMN Incar FOR 99
COLUMN name FOR A25
COLUMN storage_size FOR 999,999,999,999
COLUMN guarantee_flashback_database FOR A3
 
SELECT 
      database_incarnation# as Incar,
      scn,
      name,
      time,
      storage_size,
      guarantee_flashback_database
FROM 
      v$restore_point
ORDER BY 4
/

 

Flashback PDB

CONN / AS SYSDBA

ALTER PLUGGABLE DATABASE pdb1 CLOSE immediate;
FLASHBACK PLUGGABLE DATABASE pdb1 TO RESTORE POINT pdb1_before_changes;
ALTER PLUGGABLE DATABASE pdb1 OPEN RESETLOGS;

Start services for PDB

srvctl start service -d cdb

 

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: