Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

Clonig a PDB in Same CDB in 12c

$
0
0
The Hot cloning is ability to clone a active database, and create a copy of that database in multi tenant database environment.
      In Oracle 12c cloing allows the capability and flexibiltiy of rapid provisioning of database.
     The Hot Cloning of a existing PDB in same CDB using create
pluggable database statement.
     Existing PDB         - PSDBT
     New Clone PDB    - PCLONE

step 1. Connect to the CDB
    CON_NAME
    ------------
    CDB$ROOT
step 2. Check the available PDB
    SQL> show pdbs
    CON_ID CON_NAME  OPEN MODE     RESTRICTED
    ----------- ------------------ ---------------------- -------------------
               2 PDB$SEED    READ ONLY       NO
               3 PSDBT           READ WRITE     NO
               4 APPS             READ WRITE     NO
step 3. Check the datafile path 
        A PDB named as PSDBT is going to be cloned. So before going to cloing that PDB we must check there physical path of the datafile.
  
    SQL> select name from v$datafile where con_id=3;
  
    NAME
    --------------------------------------------------------------------------------
    /u02/app/oracle/oradata/acs/psdbt/system01.dbf
    /u02/app/oracle/oradata/acs/psdbt/sysaux01.dbf
    /u02/app/oracle/oradata/acs/psdbt/undotbs01.dbf
    /u02/app/oracle/oradata/acs/psdbt/user01.dbf
    /u02/app/oracle/oradata/acs/psdbt/user02.dbf
step 4. create a directory 
        Create a Physical directory in Operating System responisble
    for the clonig PDB.
    SQL> !
    [oracle@ramkumar ~]$ mkdir /u02/app/oracle/oradata/acs/pclone
    [oracle@ramkumar pclone]$ exit
    exit
step 5. Clone the PDB 
        The PSDBT Pluggable Database is cloned to PCLONE  Pluggable database using below statement.
  
    SQL> create pluggable database pclone from psdbt
      2 file_name_convert=('psdbt','pclone');
    Pluggable database created.
step 6. Check the PDB status
        The cloned Pluggable database is always in mounted stage.
    SQL> show pdbs
     CON_ID CON_NAME       OPEN MODE  RESTRICTED
    ------- --------------------------- ------------------- ----------
          2 PDB$SEED               READ ONLY    NO
          3 PSDBT                      READ WRITE  NO
          4 APPS                        READ WRITE  NO
          5 PCLONE                   MOUNTED
step 7. Open the PDB and Check the Status
    SQL> alter pluggable database pclone open;
    Pluggable database altered.

    SQL> show pdbs
     CON_ID CON_NAME        OPEN MODE  RESTRICTED
    -------- --------------------------- ------------------- ----------
          2 PDB$SEED                   READ ONLY    NO
          3 PSDBT                          READ WRITE  NO
          4 APPS                            READ WRITE  NO
          5 PCLONE                       READ WRITE  NO

Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>