Following are steps to configure Oracle wallet so that the authorized user need not be specified the password and username while connecting to the database. It will be helpful if we have a shell scripts to be executed and which the credential in clear case. Once this is configured, credential information can be removed from the file and database can be accessed using the alias specified in the wallet configuration.
Decide the location of the Oracle wallet say("/u01/app/oracle/wallet")
Add the following lines to the sqlnet.ora which is present at $ORACLE_HOME/network/admin/sqlnet.ora
- WALLET_LOCATION =
- (SOURCE =
- (METHOD = FILE)
- (METHOD_DATA =
- (DIRECTORY = /u01/app/oracle/wallet)
- )
- )
- SQLNET.WALLET_OVERRIDE = TRUE
- SSL_CLIENT_AUTHENTICATION = FALSE
- SSL_VERSION = 0
- $ mkdir /u01/app/oracle/wallet
- $ mkstore -wrl "/u01/app/oracle/wallet" -create
- Enter password:
- Enter password again:
- $
Add the password credential to the wallet using the following command.
- $ mkstore -wrl "/u01/app/oracle/wallet" -createCredential db10g_test scott tiger
- Enter password:
- Create credential oracle.security.client.connect_string1
- $
The db_alias, in this case "db10g", is the identifier used in the "/@db_alias" syntax, and must have a matching entry in the "tnsnames.ora" file.
Make a new entry for the "db10g" database in the client "tnsnames.ora" file.
- DB10G_TEST =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = <IP_ADDRESS>)(PORT = 1521))
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = <SID>)
- )
- )
- $ sqlplus /@db10g_test
- SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 19 10:17:47 2007
- Copyright (c) 1982, 2005, Oracle. All rights reserved.
- Connected to:
- Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
- With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
- SQL> show user
- USER is "SCOTT"
- SQL