Site icon DBsGuru

Create a PDB (Pluggable Database) using DBCA in Oracle 19c

Create a PDB (Pluggable Database) using DBCA in Oracle 19c


In this article, we are going to demonstrate Create a PDB (Pluggable Database) using DBCA in Oracle 19c in multitenant architecture on Linux environment. Follow the below steps for the same.

1.  PDB creation using DBCA


1.1. Set environment variables: Set environment variables for the container database where we want to create a new PDB.

[oracle@DBsGurun5 ~]$ . oraenv
ORACLE_SID = [oracle] ? labcdb08
The Oracle base has been set to /u01/app/oracle


1.2. Launch database creation assistant (DBCA) tool: Once you execute dbca, select option Manage Pluggable databases.

[oracle@DBsGurun5 ~]$ ./dbca


1.3. Creation Mode: In this screen, select Create a Pluggable database.


1.4. Select Database: Select a database in which you want to create a pluggable database (PDB) and also put username & password.


1.5. create Pluggable Database: If you want to create empty pluggable databases then select PDB$SEED in the option Create a new Pluggable database from another PDB.


1.6. PDB Identification: Put the new PDB name along with optionally Administrator username and password.


1.7. Pluggable Database Options: Select storage type and according to that location for physical files.


1.8. Summary: This is the last screen for input so review all details and if require any modification then go to the back, do modification as required, finally click on the button Finish.


1.9. Progress: Take a breath and wait for completion.


1.10. Finish: Congratulations!! your PDB is created and ready for rock and click on the button Close.


1.11. TNS Entry: Add TNS entry for newly created PDB’s serverce and validate ping utility for same.

[oracle@DBsGurun5 ~]$ cd $ORACLE_HOME/network/admin
[oracle@DBsGurun5 admin]$ vi tnsnames.ora

PDB_DBS1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DBsGurun5.dbdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pdb_dbs1)
    )
  )

[oracle@DBsGurun5 admin]$ tnsping PDB_DBS1

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 11-DEC-2021 16:00:48

Copyright (c) 1997, 2021, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/19.0.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = DBsGurun5.dbdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pdb_dbs1)))
OK (10 msec)

 

2.  Post Validation of PDB creation


2.1. Validate new PDB: Newly created PDB should be in READ WRITE mode.

[oracle@DBsGurun5 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Dec 11 15:53:49 2021
Version 19.13.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.13.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB_DBS1                       READ WRITE NO
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.13.0.0.0


2.2. Validate Service: PDB’s service should be running.

[oracle@DBsGurun5 ~]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 11-DEC-2021 15:55:04

Copyright (c) 1991, 2021, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBsGurun5.dbdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                11-DEC-2021 15:16:24
Uptime                    0 days 0 hr. 38 min. 40 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/DBsGurun5/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DBsGurun5.dbdomain)(PORT=1521)))
Services Summary...
Service "86b637b62fdf7a65e053f706e80a27ca" has 1 instance(s).
  Instance "labcdb08", status READY, has 1 handler(s) for this service...
Service "d2dd2f08bd66266be0536b00a8c0835b" has 1 instance(s).
  Instance "labcdb08", status READY, has 1 handler(s) for this service...
Service "labcdb08" has 1 instance(s).
  Instance "labcdb08", status READY, has 1 handler(s) for this service...
Service "labcdb08XDB" has 1 instance(s).
  Instance "labcdb08", status READY, has 1 handler(s) for this service...
Service "pdb_dbs1" has 1 instance(s).
  Instance "labcdb08", status READY, has 1 handler(s) for this service...
The command completed successfully


2.3. Connection to PDB: Established one connection to newly created PDB.

[oracle@DBsGurun5 ~]$ sqlplus dbs1_admin@pdb_dbs1

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Dec 11 16:00:55 2021
Version 19.13.0.0.0

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

Enter password:

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.13.0.0.0

SQL> show con_name

CON_NAME
------------------------------
PDB_DBS1


This document is only for learning purpose and always validate in the LAB environment first before applying in the LIVE environment.

Hope so you like this article!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the most recent update. 
Click here to understand more about our pursuit.

Related Articles


Exit mobile version