When it comes to Multi-tenant architecture,  one question that comes to our mind is how to connect to container database and pluggable database.

Today we will see all possible way to connect to the container database.

Obviously, we connect database using service name for the non-local connection. When we create CDB, a service is created with the same name as the database concatenated with the domain name.

And each pdb is had service associated with it having the same name we have given while creating pluggable database concatenated with the domain name.

We can check the service name for each pdb using cdb_services.

For example :

We can see here services. PDB122 database has pdb122 service associated. CDB$ROOT has cdb122 service associated as my cdb database name is cdb122.

Now various ways to connect to CDB.

1. We can connect with OS authentication.

2. Connect with service

3. When we are connected to other pdb we can switch to cdb using alter session set container command.

Note: User needs SET CONTAINER privilege.

To check how to connect with PDBs.

Connecting PDB in Oracle 12c

Stay tuned for More articles on Oracle Multitenant

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Telegram Channel: https://t.me/helporacle

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.