oracle wallet使用与维护---oracle无密码登录(三)
llet 口令:
oracle.security.client.username1 = skate
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>
8.更改wallet里用户认证信息的内容
8.1 更改密码
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -modifyEntry oracle.security.client.password1 skatepwd1
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。
输入 Wallet 口令:
8.2 更改密码
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -modifyEntry oracle.security.client.username1 skate1
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。
输入 Wallet 口令:
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>
和6.3步骤里(-modifyCredential)的区别是,这里不仅仅改密码,连接串和密码都可以改
www.2cto.com
我们这里是本地创建wallet,从本地客户端可以登录,那从其他地方可以吗?
A.
在win7+oracle11g客户端上创建的wallet,无密码访问linux+oracle10g服务服务端没有问题,但是把wallet复制到linux+oracle10g的服务端,再无密码登录是报错“ORA-12534: TNS:operation not supported”,需要用如下命令编辑一下,就可以无密码登录了。虽然语句没有改任何内容。
[oracle@localhost ~]$ mkstore -wrl /tmp/wallet1 -createCredential skate_192.168.1.9 skate skatepwd1
B. 在linux+oracle10g服务端上创建的wallet,无密码访问linux+oracle10g服务服务端没有问题,把wallet复制到win7+oracle11g客户端,无密码登录也没问题。
猜测可能是版本问题。
在客户端使用wallet无密码登录的步骤:
1.创建wallet(tnsname.ora里面的连接串,sqlnet.ora文件内容都要复制到客户端)
2.把wallet复制到客户端指定路径(注意文件权限和属主)
3.修改客户端的tnsname.ora文件里连接服务器的连接串为创建时的连接串,在sqlnet.ora文件里添加如下内容:
WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=e:\temp\wallet)))
SQLNET.WALLET_OVERRIDE = TRUE
4.在sqlplus无密码等里测试
sqlplus /@skate_192.168.1.9
www.2cto.com
在jdbc里连接数据库密码形式如下:
public static Connection getConnection() throws SQLException {
DriverManager.registerDriver(new OracleDriver());
Connection conn = DriverManager
.getConnection("jdbc:oracle:oci:/@tnskate");
conn.setAutoCommit(false);
return conn;
}
参考: [ID 340559.1] [ID 741810.1]
-----end----
作者 冰刀(skate)