About Me

Database and GIS Consultant.
Showing posts with label Wallet. Show all posts
Showing posts with label Wallet. Show all posts

Saturday, July 11, 2020

Configure Oracle Client with multiple Oracle wallets and locations and connect with different Autonomous Databases

Purpose: How to Configure Oracle Client with multiple Oracle wallets/locations for different Autonomous Databases and connect with SQL*Plus from your PC.

Environment: 
Database: Oracle Cloud, 19c, Autonomous Databases (ADB)
Client: Oracle 12c 64Bit Client from my Windows PC
Configuration Files: SQLNET.ORA and TNSNAMES.ORA

Step # 1: I have already have two ADBs (names: CWTP and CWDW) in Oracle Cloud and downloaded Oracle wallets (zip files and extracted) for each of those databases and placed at two different folders:-
C:\Oracle12cR2_64Bit_CL\wallet\cwdw
C:\Oracle12cR2_64Bit_CL\wallet\cwtp

Step # 2: From the extracted zip files (wallets), I copied and pasted contents of TNS entries from the sqlnet.ora and tnsnames.ora files that came along with the wallets into the SQLNET.ORA and TNSNAMES.ORA files ($ORACLE_HOME\Network\Admin) that's used by my Oracle client, which looked as follows:-

SQLNET.ORA

SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
# WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY=C:\\Oracle12cR2_64Bit_DB\\wallet\\cwdw)))
SSL_SERVER_DN_MATCH=yes









As you notice above, I commented out WALLET_LOCATION parameter, which is configured in the TNSNAMES.ORA file


Step # 3: TNSNAMES.ORA

cwtp_low = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1533)(host=adb.au-xxxxxxx-1.oraclecloud.com))(connect_data=(service_name=xxxxxcwtp_low.atp.oraclecloud.com))(security=(my_wallet_directory = "C:\\Oracle12cR2_64Bit_CL\\wallet\\cwtp")(ssl_server_cert_dn="CN=xxxxx.oraclecloud.com,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))

cwdw_low = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1533)(host=adb.au-xxxxxxx-1.oraclecloud.com))(connect_data=(service_name=xxxxxcwdw_low.adwc.oraclecloud.com))(security=(my_wallet_directory = "C:\\Oracle12cR2_64Bit_CL\\wallet\\cwdw")(ssl_server_cert_dn="CN=xxxxx.oraclecloud.com,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))










As you notice in the TNSNAMES.ORA file, I have added MY_WALLET_DIRECTORY (within the SECURITY parameter) to include the wallet location for each TNS Aliases. S

Step # 4: Test - Here are my tests connecting to the ADBs using SQL*Plus from my PC:-























Let me know how it works for you and also if there are any other options available to configure multiple wallets / locations for Oracle client.