Back to: Oracle DBA Tutorials
Creating Pluggable Database using DBCA in Oracle
In this article, I am going to discuss Creating Pluggable Database using DBCA in Oracle with Examples. Please read our previous article where we discussed the Connection to Pluggable Database in Oracle with Examples.
Creating Pluggable Database using DBCA in Oracle
Previously we have learned how to create a pluggable database from the SEED and we have learned how to connect to the newly created pluggable database. Now, we will learn about how to create a pluggable database using the DBCA (Database Configuration Assistant). This is a very useful tool to manage databases but we recommend you use the create a statement to create a database because this will help you to learn the algorithm of creating databases better. We will perform the Creation of pluggable databases in steps.
Step 1: Open DBCA
Open the Linux machine and open the terminal and enter the command “dbca”.
If you enter the command “dbca” then there will be a popup as above opening the DBCA.
Step 2: Manage Pluggable Database
Once the DBCA is opened you will be able to see the below options. Just select the option “Manage Pluggable Database” and click Next.
Step 3: Create a New Pluggable Database
You will see the below options. If you need to create a pluggable database select “create a pluggable database” or if you need to drop a database select “delete pluggable database”. We are selecting “Create a Pluggable Database” and clicking Next.
Step 4: Select Container Database
Once you select the option to create a pluggable database and click next you will get the below page asking to select the container database. Therefore, we have only one container database we will be selecting the container database. We are selecting the JAYADB database. Leave the username and password column. Click Next.
Step 5: Create Pluggable Database from PDB$SEED.
Once you click the next DBCA bring to the below page asking to select the pluggable database. You can select any database but we are using PDB$SEED since it is a template database to create multiple pluggable databases. Click Next.
Step 6: Pluggable Database Details.
Once you select the template database and click next the DBCA asks you to provide the pluggable database name and administrator username and password for the administrator. We are giving the pluggable database name as JAYAPDB2 and username as pdb2admin and password for the user pdb2admin.
Once you click next you will see a popup that the password does not match the oracle requirements. Ignore the popup and click next.
Click Yes and continue.
Step 7: Create Pluggable Database Summary.
The Storage is a file system and the Database location is the default that is taken by DBCA and it asks to create the Default user tablespace. Select the option. This is the default option. If you observe the process until now it is the same as the create statement that we used in the previous pluggable database creation but in a visual manner. Click Next.
Statement:
Create pluggable database jayapdb1 Admin user pdb1admin identified by goodluck Roles=(dba) DEFAULT TABLESPACE users Datafile '/u01/app/oracle/oradata/JAYADB/jayapdb1/users01.dbf' size 250M autoextend on FILE_NAME_CONVERT=('/u01/app/oracle/oradata/JAYADB/pdbseed/', '/u01/app/oracle/oradata/JAYADB/jayapdb1/')
Step 8: Create Database.
You can see create database summary which displays the pluggable database name as JAYAPDB2 and the pluggable database source as default and datafile location.
Click finish and the process of creating pluggable database starts.
Wait for a few minutes until the process becomes 100%.
The database is successfully created.
Step 9: Check the data files and list of pluggable databases.
Open the below location and check the data files created in the JAYAPDB2 database.
We can see there are data files present in the folder JAYAPDB2. So, the pluggable database is created. Open the terminal and connect to the database as “Sqlplus / as sysdba” and check the list of pluggable databases using the below query.
Query: select name, open_mode from v$pdbs;
Step 10: Check the Listener Status.
Run the command “lsnrctl status” to check the listener of the newly created pluggable database as the service is registered to the listener.
So, the new pluggable database service is registered to the listener.
Note: Please try to follow the previous exercise in that we tried to connect to the newly pluggable database using SQL developer, easy connect method, and then connect using the tnsnames.ora file and making an entry in the tnsnames.ora file. For more info, you can verify this page. Connection to Pluggable Database in Oracle – Dot Net Tutorials
In the next article, I am going to discuss Drop Pluggable Database in Oracle with Examples. Here, in this article, I try to explain Creating a Pluggable database using DBCA in Oracle with Examples and I hope you enjoy this Creating a Pluggable database using DBCA in Oracle article.