• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Techgoeasy

Techgoeasy

Learn Oracle, PHP, HTML,CSS,Perl,UNIX shell scripts

  • Home
  • Oracle
    • Oracle database
    • Oracle Ebusiness Suite
    • Oracle weblogic
    • Oracle Performance Tuning
    • Oracle Hyperion
    • Oracle Cloud Tutorials
  • SQL
  • interview questions
  • Linux
  • PHP and HTML
  • Downloads
  • General
Home » Oracle » Oracle Database » Oracle database 12c:How to create Pluggable database in 12c database

Oracle database 12c:How to create Pluggable database in 12c database

October 2, 2015 by techgoeasy Leave a Comment

Today we are going to talked about How to create Pluggable database in Oracle 12c database

We have already learned to create the container database which has one seed PDB

 

How to create Pluggable database in 12c database

Pluggable database in 12 database  can be created in following ways

1) Create a pluggable database using the seed container.
The seed data files are copied to the new location and used by the new database. The catalog scripts, etc do not need to be executed afresh.

a) Login to root container with user  have create pluggable database privilege

If OMF is set using DB_CREATE_FILE_DEST then

CREATE PLUGGABLE DATABASE test1_tech
ADMIN USER tech_admin IDENTIFIED BY oracle
;

It does following things
1) Copied the seed datafiles to new database
2) Create system,sysaux tablespace
3) Create the temp tablespace
4) Creates a full catalog including metadata pointing to Oracle-supplied objects
5) Create common user SYS and SYSTEM
6) Create the local user tech_admin

If OMF is not set then

CREATE PLUGGABLE DATABASE test1_tech
ADMIN USER tech_admin IDENTIFIED BY oracle
FILE_NAME_CONVERT= (‘/u01/oracle/CDB1/datafile/seed’,
‘/u01/oracle/CDB1/datafile/techdata’);
;

There is one more parameter which can be set in init.ora avoid the location clause given above
PDB_FILE_NAME_CONVERT

b) The new PDB created is in mounted state only, we need to make it read write before using it

SQL> alter pluggable database test1_tech open read write;

Pluggable database altered.
SQL> select pdb_name,status from cdb_pdbs;

PDB_NAME STATUS
——————– ——————–
PDB$SEED NORMAL
test1_tech NORMAL

2) Create a pluggable database by duplicating an existing one.
The files from the existing database are copied to the location of the new database. The new database automatically gets assigned new pdb id to distinguish it from its parent.
Suppose we want to create PDB(test2_tech) from existing db test1_tech,

a) Close the test1_tech database and open read only

alter pluggable database test1_tech close;

Pluggable database altered.

SQL> alter pluggable database test1_tech open read only;

Pluggable database altered.

b) If OMF is set i.e DB_CREATE_FILE_DEST or CREATE_FILE_DEST,

CREATE PLUGGABLE DATABASE
test2_tech FROM test1_tech;

if OMF not set

CREATE PLUGGABLE DATABASE
test2_tech FROM test1_tech
FILE_NAME_CONVERT= (‘/u01/oracle/CDB1/datafile/techdata’,
‘/u01/oracle/CDB1/datafile/tech2data’);
;

c) ReOpen the source PDB

alter pluggable database test1_tech open;

d) Open the clone db in read write mode

SQL> alter pluggable database test2_tech open read write;

Pluggable database altered.
SQL> select pdb_name,status from cdb_pdbs;

PDB_NAME STATUS
——————– ——————–
PDB$SEED NORMAL
test1_tech NORMAL
test2_tech NORMAL

 Related Articles
Top Oracle 12c New Features for developers
Oracle Database 12c:How to Create the container database
Understand Oracle Database 12c – Multitenant Architecture
Step by Step Oracle 12c Database Installation on Linux
Very useful 10 new things in 12c database
Top 10 oracle 12c new features

Filed Under: Oracle, Oracle Database Tagged With: How to create Pluggable database in 12c database

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar



Subscribe to our mailing list

Enter your email address to subscribe to this blog and receive notifications of new posts by email

Recent Posts

  • sed delete line containing string
  • How to insert line after match using sed
  • How to see the OS timezone used when the database was started
  • How to add datafile to tablespace in Oracle
  • Oracle Database Recovery various cases and solution

Copyright © 2023 : TechGoEasy

  • Hire me
  • Privacy Policy
  • Contact Us
  • New? Start Here
  • About Us