Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 63 Insurance
- 536.4K On-Premises Infrastructure
- 138.3K Analytics Software
- 38.6K Application Development Software
- 5.8K Cloud Platform
- 109.5K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71.1K Infrastructure Software
- 105.3K Integration
- 41.6K Security Software
Connecting to a PDB using ALTER SESSION SET CONTAINER

DB version: 12c till 19c
OS : Oracle Linux, RHEL 7.x
I am new to working in multitenant architecture.
As a DBA, when I want to do some admin tasks in a PDB, I connect to the root container as SYS first and then I issue the following command to 'connect' to the PDB.
alter session set container=pdb3;
I have done basic stuff like user management, adding datafile, etc after connecting to the PDB using the above mentioned ALTER SESSION SET CONTAINER
method. It seems to be working fine. But, then again, I am new to working in a multi-tenant architecture.
Hence, I would like to know if there are any risks in following the above method, in any special circumstances.
Answers
-
Hi,
I don't see any problem with this approach of using "alter session" to execute commands in the PDB.
It's just always good to check if it's in the correct PDB, you can for example use a "show con_name" to make sure you are in the right place.
-
as luis has already mention, check pdb before doing admin task, rest of your approach is fine