Playing with mkstore..

It is often necessary to make connections to the database from shell scripts held on the file system. This can be a major security issue if these scripts contain the database connection details. Oracle gives us the option of using a secure external password store where the Oracle login credentials are stored in a client-side Oracle wallet. This allows scripts to contain connections using the "/@db_alias" syntax.


Create a wallet and wallet entry for database connection.
Identify the wallet location
set the wallet location as TNS_ADMIN
export TNS_ADMIN=
create the sqlnet.ora file
Create the tnsnames.ora file with the wallet entries
run create_wallet.sh which will ask you about the schema and wallet password.


Create_wallet.sh..You can wrap up commands in a single shell file if you need to create lot of wallet entries on many locations.

echo -n "Creating Wallet entries.."


print $password \n | mkstore -wrl $TNS_ADMIN -createCredential walletname username password << END_OF_MKSTORE
END_OF_MKSTORE

echo -n "Done creating wallet entry for user"

No comments:

Post a Comment