SQL*PLUS

Connect to Autonomous Database using SQLPlus

Connect to Autonomous db using sqlplus

In this post I will describe how to connect to Autonomous Database using SQL*PLUS

Steps: Connecting to Autonomous Database using SQL*PLUS

To connect to Autonomous database we need to download the client credentials wallet

  1. From Autonomous database details page: Click on DB Connection

2. Select Download Wallet

3. Enter the credentials to protect wallet and Click on Download, once downloaded close the window.

Connect using SQL*PLUS

  1. Unzip the credentials on the machine where Oracle client is installed
[oracle@ol7-db wallet]$ pwd
/u01/wallet
[oracle@ol7-db wallet]$ ls -ltrh
total 24K
-rw-r--r--. 1 oracle oinstall 21K Mar 31 23:13 Wallet_orbgadb.zip
[oracle@ol7-db wallet]$ unzip Wallet_orbgadb.zip
Archive:  Wallet_orbgadb.zip
  inflating: README
  inflating: cwallet.sso
  inflating: tnsnames.ora
  inflating: truststore.jks
  inflating: ojdbc.properties
  inflating: sqlnet.ora
  inflating: ewallet.p12
  inflating: keystore.jks
[oracle@ol7-db wallet]$

2. Edit the sqlnet.ora and specify the correct wallet location
In my case Wallet unzipped location is : /u01/wallet

WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="?/network/admin")))
SSL_SERVER_DN_MATCH=yes

To

WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="/u01/wallet")))
SSL_SERVER_DN_MATCH=yes

3. Set the TNS environment variable and verify the connection

export TNS_ADMIN=/u01/wallet
tnsping orbgadb_low
sqlplus admin@orbgadb_low

Output:

[oracle@ol7-db wallet]$ export TNS_ADMIN=/u01/wallet
[oracle@ol7-db wallet]$
[oracle@ol7-db wallet]$ tnsping orbgadb_low

TNS Ping Utility for Linux: Version 18.0.0.0.0 - Production on 31-MAR-2021 23:45:35

Copyright (c) 1997, 2018, Oracle.  All rights reserved.

Used parameter files:
/u01/wallet/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.me-dubai-1.oraclecloud.com))(connect_data=(service_name=atrc9lotdxsjqrj_orbgadb_low.adb.oraclecloud.com))(security=(ssl_server_cert_dn=CN=adb.me-dubai-1.oraclecloud.com,OU=Oracle ADB DUBAI,O=Oracle Corporation,L=Redwood City,ST=California,C=US)))
OK (150 msec)
[oracle@ol7-db wallet]$
[oracle@ol7-db wallet]$
[oracle@ol7-db wallet]$ sqlplus admin@orbgadb_low

SQL*Plus: Release 18.0.0.0.0 - Production on Wed Mar 31 23:45:44 2021
Version 18.3.0.0.0

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

Enter password:
Last Successful login time: Wed Mar 31 2021 23:24:18 +04:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.5.0.0.0

SQL> 

Hope this helps…