Connect to Oracle Autonomous Data Warehouse via SQL*Plus
Oracle Autonomous Data Warehouse is hereinafter referred to as ADW.
All ways to connect to ADW can be found here .
Create ADW
Created with OCI CLI:
$ oci db autonomous-data-warehouse create — compartment-id … — admin-password … — db-name demodb — cpu-core-count 1 — data-storage-size-in-tbs 1
Download the wallet to a specified directory, such as ~/.ssh/instantclient:
Then unzip:
$ cd .instantclient/
$ unzip wallet
After decompression, the files needed for subsequent sqlplus will be generated:
$ ls -1
cwallet.sso
ewallet.p12
keystore.jks
ojdbc.properties
sqlnet.ora
tnsnames.ora
truststore.jks
wallet
Install and configure SQL*Plus
Install oracle instant client:
$ sudo yum install -y oracle-instantclient18.3-basic oracle-instantclient18.3-sqlplus
Install and configure SQL*Plus
Install oracle instant client:
$ sudo yum install -y oracle-instantclient18.3-basic oracle-instantclient18.3-sqlplus
Set the environment variables:
$ export CLIENT_HOME=/usr/lib/oracle/18.3/client64
$ export LD_LIBRARY_PATH=$CLIENT_HOME/lib
$ export PATH=$PATH:$CLIENT_HOME/bin
Modify sqlnet.ora in the specified directory:
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY=”/home/opc/.instantclient”)))
SSL_SERVER_DN_MATCH=yes
Set TNS_ADMIN to point to the specified directory, because this directory also includes the tnsnames.ora setting:
$ export TNS_ADMIN=/home/opc/.instantclient
Then connect:
$ sqlplus admin@Testdb
SQL*Plus: Release 18.0.0.0.0 — Production on Mon JUN 9 05:41:04 2020
Version 18.3.0.0.0
Copyright © 1982, 2018, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 — Production
Version 18.4.0.0.0
SQL> select name, platform_name, cdb from v$database;
NAME PLATFORM_NAME CDB
— — — — — — — — — — — — — — — — -
Testdb Linux x86 64-bit YES
— — — — — — — — — — — — — — — —
Thanks
Pankaj K.(pankajconnect.com)