wallet权限 linux 777 windows 需要修改.lck文件的owner
在ORACLE 10G前,我们在SHELL或JDBC中连接数据库时,都需要输入用户名与密码,并且都是明文。从1OGR2开始,ORACLE提供wallet这个工具,可以实现无需输入用户名与密码就可以登陆数据库,如下:
一般情况:sqlplus scott/oracle@htzdg
用wallet后:sqlplus /@htzdg
测试环境:
server :solaris 10,oracle 11gr2
client :win 7,oracle11gr2
登陆端配置tnsnames.ora文件,增加下面几行
- HTZDG =
- (DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.30)(PORT = 1521))
- )
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = htzdg)
- )
- )
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
测试是否可以正常解析
- C:\Users\luoping>tnsping htzdg
- TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-8月 -
- 2012 21:40:40
- Copyright (c) 1997, 2010, Oracle. All rights reserved.
- 已使用的参数文件:
- D:\app\luoping\product\11.2.0\client_1\network\admin\sqlnet.ora
- 已使用 TNSNAMES 适配器来解析别名
- 尝试连接 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.1
- 68.100.30)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = h
- tzdg)))
- OK (40 毫秒)
- C:\Users\luoping>
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
下面是开始配置wallet
1,创建一个wallet
- D:\app\luoping\product\11.2.0\client_1\BIN>mkstore -wrl D:\app\luoping\product\11.2.0\client_1\pstore -create
- Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
- 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。
- 输入口令:
- 再次输入口令:
- D:\app\luoping\product\11.2.0\client_1\BIN>cd ../
- D:\app\luoping\product\11.2.0\client_1>cd pstore
- D:\app\luoping\product\11.2.0\client_1\pstore>dir
- 驱动器 D 中的卷是 DATA
- 卷的序列号是 D60C-09BD
- D:\app\luoping\product\11.2.0\client_1\pstore 的目录
- 2012/08/29 15:39 <DIR> .
- 2012/08/29 15:39 <DIR> ..
- 2012/08/29 15:39 3,589 cwallet.sso
- 2012/08/29 15:39 3,512 ewallet.p12
- 2 个文件 7,101 字节
- 2 个目录 368,717,893,632 可用字节
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
2,启动wallet与指定wallet位置
- D:\app\luoping\product\11.2.0\client_1\network\admin>more sqlnet.ora
- # sqlnet.ora Network Configuration File: D:\app\luoping\product\11.2.0\client_1\
- network\admin\sqlnet.ora
- # Generated by Oracle configuration tools.
- # This file is actually generated by netca. But if customers choose to
- # install "Software Only", this file wont exist and without the native
- # authentication, they will not be able to connect to the database on NT.
- SQLNET.AUTHENTICATION_SERVICES= (NTS)
- NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
- WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=D:\app\luoping\product\11.2.0\client_1\pstore)))
- SQLNET.WALLET_OVERRIDE=TRUE
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
3,增加需要登陆的网络服务名,用户,密码到wallet中
- D:\app\luoping\product\11.2.0\client_1\BIN>mkstore -wrl D:\app\luoping\product\1
- 1.2.0\client_1\pstore -createCredential htzdg sys oracle
- Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
- 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。
- 输入 Wallet 口令:
- Create credential oracle.security.client.connect_string1
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
4,测试是否成功
- D:\app\luoping\product\11.2.0\client_1\BIN>sqlplus /@htzdg as sysdba
- SQL*Plus: Release 11.2.0.1.0 Production on 星期三 8月 29 17:48:27 2012
- Copyright (c) 1982, 2010, Oracle. All rights reserved.
- 连接到:
- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
- SQL>
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
5,查看wallet中配置的网络服务名
- D:\app\luoping\product\11.2.0\client_1\BIN>mkstore -wrl d:\app\luoping\product\1
- 1.2.0\client_1\pstore -listCredential
- Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
- 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。
- 输入 Wallet 口令:
- List credential (index: connect_string username)
- 1: htzdg sys
- 1.
- 2.
- 3.
- 4.
- 5.

本文介绍了Oracle Wallet的权限设置,在Linux和Windows系统中的不同要求。详细说明了从Oracle 10GR2开始,使用Wallet可免密登录数据库。还给出了测试环境,以及Wallet的配置步骤,包括创建、启动、添加凭据等,同时提及使用中的注意事项,如密码修改需更新等。
最低0.47元/天 解锁文章
1646

被折叠的 条评论
为什么被折叠?



