There are two environment variables for Unix to connect an Oracle database.One of them is ORACLE_SID and the other one is TWO_TASK. ORACLE_SID is used for connecting a database which is installed to the same host. TWO_TASK is used for connecting an oracle database which is installed another host.

I must thank to my fellow DBA Pinto Das who provide this scenario and we both come out with below solution.

Database Details

I was trying to look at the container and pluggable databases when I hit my first hurdle trying to connect to the database using sqlplus.

I tried to connect again by using the credentials and it worked but point to PDB not to CDB

Being able to connect with the user id and password gave my the vital clue. As can be seen by the prompt ORCL we are connecting directly to the pluggable database and not the container. I wanted to connect to the container so I can view all pluggable databases.

Looking through the environment settings I noticed the TWO_TASK variable set in .bash_profile. TWO_TASK overrides the ORACLE_SID setting and uses sqlnet to connect.

So now all I had to do was unset it and connect.

And there you go. Now I’m connected to the container.


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:

Skant Gupta’s LinkedIn:

Joel Perez’s LinkedIn:

Anuradha’s LinkedIn:

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

Leave a Reply

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