Oracle achieved using the wallet password-free login
Oracle provides a concept called wallet, is to exist inside the wallet password, then login time automatically extract the password from the wallet inside, without the need to enter a password every time the command line.
The benefit of this is a scripting language which can block access authentication information Oracle database.
step
- Creating a wallet
$ mkstore -wrl /path_to/mywallet -create
This step requires a password wallet inside, and modify the password in the wallet when it will be used, including the back of the add / delete / modify any database connection information, but do not need to read the password to access an Oracle connection.
The result is two files in / path_to mywallet below / directory: cwallet.sso ewallet.p12
- Add a database connection information to the wallet
$ mkstore -wrl /path_to/mywallet -createCredential myorcl scott tiger
Wherein parameters:
myorcl: a connection identification Oracle database, an item is defined in the tnsnames.ora.
scott / tiger: of course, is the user name and password.
This step requires a password set when creating a wallet in front.
- Modify the $ ORACLE_HOME / network / admin / sqlnet.ora
Add the following two lines:
WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=/path_to/mywallet)))
SQLNET.WALLET_OVERRIDE = TRUE
- Modify the $ ORACLE_HOME / network / admin / tnsnames.ora
Define a database connection attribute identifies myorcl of:
myorcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.xxx.xxx.xxx)(PORT = 1521))
(CONNECT_DATA=
(SERVER = DEDICATED)
(SERVICE_NAME=orcl)
)
)
- Test sqlplus
$ sqlplus /@peppino
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 6 02:28:56 2019
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>
You do not need a password.
Reproduced in: https: //www.jianshu.com/p/2cd2df5f55d6