简体   繁体   中英

How to connect to Oracle 21c in Oracle Cloud from DataGrip

I have created an Autonomous Transaction Processing database in Oracle Cloud. There are no ready-for-use JDBC links around, but there are "wallets". There is an instance wallet and regional wallet. Oracle says one of them, preferably instance wallet, should be used to connect to this DB instance.

A wallet is a ZIP file with a dozen of files inside. I've downloaded an instance wallet and unzipped it. Now I'm trying to connect DataGrip to this instance.

There is a TNS connection type in DataGrip and there is a famous tnsnames.ora in the wallet, so I guess I should use them. TNS connection type accepts a TNSADMIN parameter, which, I guess, is a directory of that wallet. tnsnames.ora from the wallet lists a few service names, AFAIU they differ by their priority, eg one for low-priority queries, another for medium-priority and one for the highest priorities question. I'm OK with medium priority, so I did this:

没运气

As you see, I'm getting an error:

[08006][17002] IO Error: The Network Adapter could not establish the connection
SSO KeyStore not available.

I've googled around, but this topic seems to be complicated. Oracle has a lot of connection parameters with certificates involved in the connection process, and I'm really new and I just want to connect to this instance. Why it should be so complicated? Can I use this wallet directly in DataGrip?

It seems that I've did everything correctly and the only problem is actually the driver version.

As of today, 2021-02-02, the latest available Oracle driver version in DataGrip is 19.8.0.0:

最新可用的 Oracle 驱动程序版本

To fix the issue I've just created another Oracle driver in DataGrip and manually provided the latest JARs:

  1. Go to the Oracle Database 21c (21.1) JDBC Driver & UCP Downloads
  2. Download the ZIPped JDBC driver and companion JARs corresponding to your Java version: 8 or 11. Or just download the version for Java 8 ( ojdbc8-full.tar.gz ). It should work with any modern Java.
  3. Create new subdirectory in the DataGrip's drivers directory for you driver. Something like ~/.config/JetBrains/DataGrip2020.3/jdbc-drivers/Oracle/21.1 for Linix.
  4. Unzip the driver in that directory.
  5. Configure new driver in DataGrip. Just clone the existing Oracle driver and replace the "Driver Files" with the ones from the ZIP. 甲骨文 21 驱动程序
  6. Use this new driver to connect to the instance: 成功!

DataGrip 2021.1 provides Oracle JDBC Driver 21.1.0.0 with all required jar files.

Also, read DataGrip article about connection to Oracle using wallets.

Oracle JDBC 驱动程序 21.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM