Thinking Out Loud

August 2, 2013

12c Cloning PDB – Oracle Multitenant (PDB)

Filed under: 12c,CDB,GoldenGate — mdinh @ 5:19 am

It’s so easy that even a caveman can do it.

Where do you think I am going with this?

What PDB was just cloned and what users were there?

oracle@san:cdb01:/u01/app/ggs01
> sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Aug 1 21:56:35 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> create pluggable database pdb02 from pdb01;

create pluggable database pdb02 from pdb01
*
ERROR at line 1:
ORA-65081: database or pluggable database is not open in read only mode

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB01                          READ WRITE NO

SQL> alter pluggable database pdb01 close;

Pluggable database altered.

SQL> alter pluggable database pdb01 open read only;

Pluggable database altered.

SQL> create pluggable database pdb02 from pdb01;

Pluggable database created.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB01                          READ ONLY  NO
         4 PDB02                          MOUNTED

SQL> alter pluggable database pdb02 open;

Pluggable database altered.

SQL> show pdbs

CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB01                          READ ONLY  NO
         4 PDB02                          READ WRITE NO

SQL> alter session set container=pdb02;

Session altered.

SQL> select username from dba_users where username like ‘GG%’;

USERNAME
--------------------------------------------------------------------------------
GGR
GGE
GGS

SQL>

1 Comment »

  1. Thank you for your post.

    I had to “set db_create_file_dest” to clone PDB (within the same container/CDB):

    SQL> create pluggable database pdb01 from pdborcl;
    create pluggable database pdb01 from pdborcl
    *
    ERROR at line 1:
    ORA-65016: FILE_NAME_CONVERT must be specified

    SQL> alter system set db_create_file_dest=’C:\app\oracle\oradata\orcl12c\pdb01′;

    System altered.

    SQL> create pluggable database pdb01 from pdborcl;

    Pluggable database created.

    SQL>

    Comment by amer — November 19, 2015 @ 2:34 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.