Friday, September 13, 2013

Create Pluggable Database

In this demo I show how to use DBCA or command line to create new pluggable database into an existing container database.

Environment

CDB- TESTDBS
PDB- DEV3DB and DEV4DB

Create Pluggable Database Command Line

1. Connect to container root and check current pluggable databases.
$sqlplus / as sysdba
SQL> show con_id
SQL>select con_id,name,open_mode,open_time from v$pdbs;










2. Create new Pluggable database
SQL>CREATE PLUGGABLE DATABASE dev4db
ADMIN USER pdbadm IDENTIFIED BY temp1234
ROLES = (connect)
DEFAULT TABLESPACE users
DATAFILE '+DG01' SIZE 250M AUTOEXTEND ON
STORAGE (MAXSIZE 5G)
PATH_PREFIX = '+DG01';







3.Check newly created pluggable database.
SQL>show con_id
SQL>select con_id,name,open_mode,open_time from v$pdbs;











4.Open new pluggable database
SQL>alter pluggable database dev4db open read write;





5. Check pluggable database open mode.
SQL>show con_id
SQL>select con_id,name,open_mode,open_time from v$pdbs;











6. Using RMAN do a report schema to see datafile location. You of course can also do this by selecting from the dictionary tables v$datafile and v$tempfile.
$rman target /
RMAN>report schema





























Here is a select statement that can be used to see the datafiles if you don't want to use RMAN report schema.

SQL>set linesize 500
SQL>set pagesize 100
SQL>col name format a20
SQL>col db_file_name format a80
SQL>select b.con_id,b.name,a.name as db_file_name from v$datafile a, v$pdbs b
where a.con_id= b.con_id;

Create Pluggable Database DBCA

I will show how you can also create pluggable database using DBCA.

1. Execute DBCA
$ORACLE_HOME/bin/dbca

2. Select Manage Pluggable Databases click Next.


























3. Select Create a Pluggable Database click Next.


























4. Select your container database and click Next.


























5. Select Create a New Pluggable Database click Next.


























6. Set pluggable database name, specify storage type, database location, default tablespace and administrator account information. This is the similar information  I set during the pluggable database command line step. In my case I will ignore the warning message about the password. Click Next


























7. Review the summary and click Finish.


























8. The pluggable database create will begin. You can use the activity and alert log button to monitor the details during the creation process.


























9. Once the pluggable database has been created click the OK button to close out the DBCA session.



























10. Check the newly created pluggable database. You can see that when creating a pluggable database from DBCA the pluggable database is automatically in open read write mode.
$sqlplus / as sysdba
SQL>show con_id
SQL>select con_id,name,open_mode,open_time from v$pdbs;











11. Using RMAN do a report schema to see datafile location. You of course can also do this by selecting from the dictionary tables v$datafile and v$tempfile.
$rman target /
RMAN>report schema



























Here is a select statement that can be used to see the datafiles if you don't want to use RMAN report schema.

SQL>set linesize 500
SQL>set pagesize 100
SQL>col name format a20
SQL>col db_file_name format a80
SQL>select b.con_id,b.name,a.name as db_file_name from v$datafile a, v$pdbs b
where a.con_id= b.con_id;

Create Pluggable Database Using Enterprise Manager Cloud Control 12c

If you would like to see how to create more then one pluggable database in one provision operation see my blog post here.

Follow me on Twitter

16 comments:

  1. How I can get a tutorial or handbook for learning Oracle 12c

    ReplyDelete
  2. Pro Oracle Database 12c Administration from Apress is good. There are a few other 12c books that you can find out on Amazon.

    ReplyDelete
  3. I got a job by saying this answer in my last interview. thanks for awesome help.I got more idea about oracle from Besant Technologies. If anyone wants to get oracle Training in Chennai visit Besant Technologies.
    http://www.oracletraininginchennai.in
    http://www.oracletrainingchennai.in
    http://www.besanttechnologies.com/training-courses/oracle-training
    http://www.besanttech.com/best-oracle-training-institute-in-chennai.html
    http://www.besanttechnologies.in/oracle-training-in-chennai.html

    ReplyDelete
  4. Very nice post , thanks for sharing this post with us and gave us a good information regarding create pluggable database

    ReplyDelete
  5. The concept of your blog is very fresh i definitely sure the visitors who visit your will like your content and pointers.
    oracle rac dba training in chennai

    ReplyDelete
  6. It is a stunning post. Exceptionally valuable to me. I preferred it .Take a look to my site Professional Android Training in Chennai

    ReplyDelete
  7. It’s really Nice and Meaningful. It’s really cool Blog. You have really helped lots of people who visit Blog and provide them Useful Information. Thanks for Sharing. Oracle Corporate training Gurgaon

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Pmp training india, Digital Marketing Course
    Eduslab knowledge solutions provide some services as Project Management, Quality Management, Agile Management, IT Service Management etc...Our Mission is to become the foremost Essential, Respected, and skilled Development Company worldwide adhering to our values and attribute. Visit: http://eduslab.com/ for more infrmation call us 9971205918

    ReplyDelete
  10. Nice post. Very well explained.Please find more pluggable database here

    ReplyDelete

About Me

My photo

Senior DBA with over 16 years experience, specializing in "Database Performance Tuning" and High Availability (RAC, Data Guard & Oracle Golden Gate).