Oracle 18c-PDB Snapshot Carousel
Description:-
- In this article we are going to see the oracle 18 new feature “PDB Snapshot Carousel”
- PDB Snapshot Carousel is a new feature of Oracle Database 18c
- We will configure the PDB snapshot carousel for a specified PDB,
- Create snapshots manually or automatically, and set the maximum number of snapshots.
- A PDB snapshot carousel is a useful way of maintaining a library of recent PDB copies for point-in-time recovery and cloning.
- This version allows us to maintain up to a maximum of 8 snapshots per PDB, once this number is reached,these will be overwritten as new instant copies are required. Snapshots can be configured automatically (executed from time to time) as a manual.
- A PDB snapshot carousel is a useful way of maintaining a library of recent PDB copies for point-in-time recovery and cloning.
- For example, while the production PDB named pdb1_prod is open and in use, you create a refreshable clone named pdb1_test_master.You then configure pdb1_test_master to create automatic snapshots every day. When you need new PDBs for testing, create a full clone of any snapshot, and then create sparse clones using CREATE PLUGGABLE DATABASE … SNAPSHOT COPY.
Oracle 18c-Creating a Point-in-Time Clone of a PDB Snapshot Here
- Setting the Maximum Number of Snapshots in a PDB Snapshot Carousel
Prerequisites
The PDB must be open in read/write mode.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
———- ————- ———- ———-
2 PDB$SEED READ ONLY NO
4 PDB1 READ WRITE NO
SET LINESIZE 150
COL CON_ID FORMAT 99999
COL PROPERTY_NAME FORMAT a17
COL PDB_NAME FORMAT a9
COL VALUE FORMAT a3
COL DESCRIPTION FORMAT a43
SELECT r.CON_ID, p.PDB_NAME, PROPERTY_NAME,
PROPERTY_VALUE AS value, DESCRIPTION
FROM CDB_PROPERTIES r, CDB_PDBS p
WHERE r.CON_ID = p.CON_ID
AND PROPERTY_NAME LIKE ‘MAX_PDB%’
ORDER BY PROPERTY_NAME;
- SQL statement sets the maximum number of PDB snapshots for the current PDB to 7
SQL> ALTER PLUGGABLE DATABASE SET MAX_PDB_SNAPSHOTS=7;
Pluggable database altered.
- Dropping All Snapshots in a PDB Snapshot Carousel
ALTER PLUGGABLE DATABASE SET MAX_PDB_SNAPSHOTS=0;
- Configuring an Automatic Snapshot Every Day for an Existing PDB
Step:1
SQL> SELECT SNAPSHOT_MODE “S_MODE”, SNAPSHOT_INTERVAL/60 “SNAP_INT_HRS” FROM DBA_PDBS;
S_MODE SNAP_INT_HRS
—— ————
MANUAL
Step:2
SQL> ALTER PLUGGABLE DATABASE SNAPSHOT MODE EVERY 24 HOURS;
Pluggable database altered.
Step:3
SQL> SELECT SNAPSHOT_MODE “S_MODE”, SNAPSHOT_INTERVAL/60 “SNAP_INT_HRS” FROM DBA_PDBS;
S_MODE SNAP_INT_HRS
—— ————
AUTO 24
- Creating PDB Snapshots Manually
Creating a Snapshot with a System-Specified Name
ALTER PLUGGABLE DATABASE SNAPSHOT;
SET LINESIZE 150
COL CON_NAME FORMAT a10
COL SNAPSHOT_NAME FORMAT a25
COL SNAP_SCN FORMAT 9999999
COL FULL_SNAPSHOT_PATH FORMAT a45
SELECT CON_ID, CON_NAME, SNAPSHOT_NAME,SNAPSHOT_SCN AS snap_scn, FULL_SNAPSHOT_PATH
FROM DBA_PDB_SNAPSHOTS ORDER BY SNAP_SCN;
Creating a Snapshot with a User-Specified Name
ALTER PLUGGABLE DATABASE SNAPSHOT test_pdb2_wedload;
- Dropping a PDB Snapshot
ALTER PLUGGABLE DATABASE DROP SNAPSHOT test_pdb2_wedload;
Reference:-
Catch Me On:- Hariprasath Rajaram
LinkedIn: https://www.linkedin.com/in/hari-prasath-aa65bb19/
Facebook: https://www.facebook.com/HariPrasathdba
FB Group: https://www.facebook.com/groups/894402327369506/
FB Page: https://www.facebook.com/dbahariprasath/?
Twitter: https://twitter.com/hariprasathdba