Cannot connect to a pluggable database via IDE

All we need is an easy explanation of the problem, so here it is.

I have an Oracle XE database on computer1.

When I try to connect to it via sqlplus from computer2, it works fine, for both cdb and pdb connections;
e.g.:

rlwrap sqlplus [email protected]//192.168.0.115:9121/xepdb1                                                                                  

SQL*Plus: Release 21.0.0.0.0 - Production on Tue Jun 21 09:40:00 2022
Version 21.6.0.0.0

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

Enter password: 
Last Successful login time: Tue Jun 21 2022 09:39:11 +03:00

Connected to:
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0

SQL> 

When I try to connect to it via DataGrip IDE:

  • I can connect to container database with username "sys as sysdba"
  • I cannot connect to pluggable database xepdb1. Settings are following:
    Cannot connect to a pluggable database via IDE

Error is following:

Cannot connect to a pluggable database via IDE

How can I fix it?

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

In order to connect to a pluggable database, you need to specify the SERVICE_NAME for it (forslash notation '/XEPDB1'), so you will have to specify database type "Oracle Database" and not "Oracle SID" (colon notation ':XEPDB1') in the DataGrip IDE.

Best of luck!

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply