Site Logo

IzzySoft


{itemlist}
 

Oracle Wallet

Oracle Wallet can be used for password-less logon to specified databases. Its location needs to be set up in $TNS_ADMIN/sqlnet.ora. Example snippet:

wallet_location=
    (SOURCE=
        (METHOD=FILE)
        (METHOD_DATA=
            (DIRECTORY=/var/opt/oracle/config/tns)
        )
    )

sqlnet.wallet_override=TRUE

The wallet will be password protected. On creating its first entry you will be asked to set a password – which you then will have to specify whenever you want to list or modify the wallet's contents. You will not be asked for the password when using the wallet's entries to connect a database (that's the idea behind a wallet after all) – but for that you will have to know the alias used.

Edit the wallet

For manipulation of the wallet, Oracle ships the mkstore utility. Note that the <DB-Alias> must be resolvable, e.g. via your tnsnames.ora:

# add an entry
# mkstore -wrl <wallet_location> -createCredential <DB-Alias> <User> [<Password>]
mkstore -wrl /var/opt/oracle/config/tns -createCredential MyDB scott tiger

# modify an entry
# mkstore -wrl <wallet_location> -modifyCredential <DB-Alias> <User> <Password>
mkstore -wrl /var/opt/oracle/config/tns -modifyCredential MyDB scott sealion

# delete an entry
# mkstore -wrl <wallet_location> -deleteCredential <DB-Alias>
mkstore -wrl /var/opt/oracle/config/tns -deleteCredential <DB-Alias>

# list existing entries
# mkstore -wrl <wallet_location> -listCredential
mkstore -wrl /var/opt/oracle/config/tns -listCredential

Using a wallet entry to connect

Given the above examples, you could now easily connect to MyDB as user scott without knowing Scott's password:

sqlplus /@MyDB
2020-11-18