Subscribe to Posts by Email

Subscriber Count

    698

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

18c Database : ASM Database Mirror for PDB Cloning

Starting 18c, we can create a clone of PDB using ASM level mirror copy the diskgroup with a point in time recovery of the PDB database.

This will be really helpful when you want to clone the PDB in the same instance and a point-in-time database clone is a full copy of a specific database, not the underlying storage system. Only data files are copied with in the ASM instance. Other files are created, or referenced as required to create the clone.

To use this feature, your compatible.asm and compatible.rdbms must be set 18.0 or higher and the disk groups must be flex/extended disk groups only and also the filegroups are part of only diskgroup.

It works in phases

  • Prepare Mirror Copy - This process involves creating the cloned files and linking them with the parent files. However, the data is not copied at this time; the copying is done during remirroring. Remirroring occurs during the prepare phase of rebalance, which is initiated as part of this step
  • Split the Mirror - Create the PDB using mirror copy
  • Rebalance - Copying of ASM extents to Mirror

The progress of the operation and status can be checked in V$ASM_DBCLONE_INFO under DBCLONE_STATUS (PREPARED, SPLIT COMPLETED etc.)

Mirror Copy

ALTER SESSION SET CONTAINER = pdb1;
Session altered.

SHOW CON_NAME
CON_NAME
------------------------------
PDB1

ALTER PLUGGABLE DATABASE PREPARE MIRROR COPY pdb1_mirror;
Pluggable database altered.

Check in v$asm_dbclone_info view

SELECT * FROM V$ASM_DBCLONE_INFO;
GROUP_NUMBER DBCLONE_NAME  MIRRORCOPY_NAME  DBCLONE_STATUS   PARENT_DBNAME PARENT_FILEGROUP_NAME     CON_ID
------------ ------------- ---------------- ---------------- ------------- ---------------------- ---------
           1 DB_UNKNOWN    PDB1_MIRROR      PREPARED         ORCL_PDB1     ORCL_PDB1

 

Split the Mirror copy and create clone

SHOW CON_NAME
CON_NAME
------------------------------
CDB$ROOT

CREATE PLUGGABLE DATABASE newpdb1 FROM pdb1 USING MIRROR COPY pdb1_mirror;
Pluggable database created.

ALTER SESSION SET CONTAINER = newpdb1;
session altered.

SHOW CON_NAME
CON_NAME
------------------------------
NEWPDB1

Check the V$asm_dbclone_info to check the status of the SPLIT
SELECT * FROM V$ASM_DBCLONE_INFO;
GROUP_NUMBER DBCLONE_NAME  MIRRORCOPY_NAME  DBCLONE_STATUS   PARENT_DBNAME PARENT_FILEGROUP_NAME     CON_ID
------------ ------------- ---------------- ---------------- ------------- ---------------------- ---------
           1 ORCL_NEWPDB1  PDB1_MIRROR      SPLIT COMPLETED  ORCL_PDB1     ORCL_PDB1                      0

Drop the Mirror Copy

ALTER SESSION SET CONTAINER = pdb1;
Session altered.

ALTER PLUGGABLE DATABASE DROP MIRROR COPY pdb1_mirror;
Pluggable database altered.

Rebalance the Data group

ALTER DISKGROUP data REBALANCE WAIT;

Now the diskgroup data holds the datafiles for PDB1 and NEWPDB1 also. This is will really help not to touch anything on PDB level or copying datafiles for pdb clone level if you have datafiles under ASM.

-Thanks

Suresh

 

Comments are closed.