Thinking Out Loud

August 2, 2013

12c Cloning PDB – Oracle Multitenant (PDB)

Filed under: 12c,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>

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

The Rubric Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 272 other followers

%d bloggers like this: