Followed https://docs.oracle.com/cd/E78494_01/aip/pdf/1411/html/ig/aip-ig-apx_wallet.htm guide and created ewallet.p12 (also generates cwallet.sso), sqlnet.ora, and tnsnames.ora:
PS C:\Users\myname\Oracle> echo $env:ORACLE_HOME
C:\app\oracle\product\19.0.0\client_1
PS C:\Users\myname\Oracle> echo $env:TNS_ADMIN
C:\Users\myname\Oracle\my_admin
Then tested my credentials, and tnsnames.ora successfully:
sqlplus user/password@tns_alias
However, removing user and password from above (expecting to get them from ewallet.p12 file) errors out:
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jul xxxxxxxxx
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
and then entering username and password when prompted, gives me tns adapter error:
Enter user-name: user
Enter password:
ERROR:
ORA-12560: TNS:protocol adapter error
Following is sqlnet.ora content:
SSL_CLIENT_AUTHENTICATION=FALSE
SSL_SERVER_DN_MATCH=TRUE
WALLET_LOCATION =
(SOURCE =
(METHOD=FILE) (METHOD_DATA = (DIRECTORY = C:\Users\myname\Oracle\my_wallet)))
TRACE_LEVEL_CLIENT=16
TRACE_FILE_CLIENT = client.trc
TRACE_DIRECTORY_CLIENT=%USERPROFILE%\ORACLE
and the content of wallet folder:
PS P:\> ls C:\Users\myname\Oracle\my_wallet\
Directory: C:\Users\myname\Oracle\my_wallet
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 30/07/2020 7:59 PM 2509 cwallet.sso
-a---- 30/07/2020 7:39 PM 0 cwallet.sso.lck
-a---- 30/07/2020 7:59 PM 2464 ewallet.p12
-a---- 30/07/2020 7:39 PM 0 ewallet.p12.lck
This seems to be very simple but not sure what I've missed?
When you use a WALLET for authentication using a password store it is a good advice to include two additional files (
sqlnet.ora and tnsnames.ora
) different to the ones you use normally for connections with passwords.Copy the
tnsnames.ora
andsqlnet.ora
to the same wallet directory and follow this steps:3.Edit the
sqlnet.ora
to look like this3.Your new
tnsnames.ora
must contain the entries for the wallet ( either service_name or sid )4.SET the TNS_ADMIN to the location of the new sqlnet and tnsnames files
5.The directory with all files should look like ( In my case I use Linux )
Then connect