分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

author:skate
time:2012/07/24

oracle wallet使用与维护

从Oracle10gR2开始, 通过使用Oracle Wallet达到任意用户不使用密码登录数据库(非操作系统认证方式),这对于用脚本登录数据库进行操作来说是非常有用的;尤其对于企业安全要求很高,不希望用户名和密码明文存在配置文件中,而且对于密码的维护是极为方便的,比如我把wallet放在指定路径下,当修改密码时,只需统一覆盖wallet即可,对于有大量应用服务器尤为方便。

在客户端创建一个wallet

用法:
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore --help
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

未指定 Wallet 的位置。
mkstore [-wrl wrl] [-create] [-createSSO] [-createLSSO] [-createALO] [-delete] [
-deleteSSO] [-list] [-createEntry alias secret] [-viewEntry alias] [-modifyEntry
 alias secret] [-deleteEntry alias] [-createCredential connect_string username p
assword] [-listCredential] [-modifyCredential connect_string username password]
[-deleteCredential connect_string] [-help] [-nologo]

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>

1. 创建wallet
 语法: mkstore -wrl <wallet_location> -create

eg:
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -create
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入口令:(输入wallet的密码,要设置的复杂些,否则失败)

再次输入口令:(输入wallet的密码)

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>

查看创建wallet

e:\temp\wallet>dir
 驱动器 E 中的卷是 data
 卷的序列号是 DCEE-F1D9

e:\temp\wallet 的目录

2012/07/24  17:19    <DIR>          .
2012/07/24  17:19    <DIR>          ..
2012/07/24  17:19             3,589 cwallet.sso
2012/07/24  17:19             3,512 ewallet.p12
               2 个文件          7,101 字节
               2 个目录 212,962,336,768 可用字节

e:\temp\wallet>

2.创建客户端连接服务端的网络连接串,每个连接串对应一个数据库用户
skate_192.168.1.9 =
  (DESCRIPTION =      
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.9)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = skate)
    )
  )
 
 
 
3.把登入数据库的用户认证信息添加到wallet中

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -createCredential skate_192.168.1.9 skate skatepwd
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

Create credential oracle.security.client.connect_string1

4.在客户端的sqlnet.ora文件里,编辑参数“WALLET_LOCATION ”

WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=e:\temp\wallet)))
SQLNET.WALLET_OVERRIDE = TRUE

5.测试在客户端无需密码连接数据库测试

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>sqlplus /@skate_192.168.1.9

SQL*Plus: Release 11.2.0.1.0 Production on 星期二 7月 24 17:59:21 2012

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show user;
USER 为 "SKATE"
SQL>

6.如何管理wallet

6.1 查看wallet里的连接认证信息
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -listCredential
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

List credential (index: connect_string username)
1: skate_192.168.1.9 skate

6.2 添加一个新的认证信息到wallet里,在wallet是以连接串为唯一标识的
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -createCredential test_skate_s_192.168.1.9 skate skatepwd
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

Create credential oracle.security.client.connect_string2

查看已经添加用户认证信息
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -listCredential
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

List credential (index: connect_string username)
2: test_skate_s_192.168.1.9 skate
1: skate_192.168.1.9 skate

6.3 编辑wallet里的用户密码
E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -modifyCredential test_skate_s_192.168.1.9 skate skatepwd1
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

Modify credential
Modify 2

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>

6.4 删除wallet的用户认证信息

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -listCredential
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

List credential (index: connect_string username)
2: test_skate_s_192.168.1.9 skate
1: skate_192.168.1.9 skate

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -deleteCredential test_prodb_s_192.168.1.9
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

Delete credential
Delete 2

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -listCredential
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

List credential (index: connect_string username)
1: skate_192.168.1.9 skate

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>

7.查看wallet里的详细认证信息

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -list
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

Oracle 密钥存储条目:
oracle.security.client.connect_string1
oracle.security.client.password1
oracle.security.client.username1

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -viewEntry oracle.security.client.connect_string1
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

oracle.security.client.connect_string1 = skate_192.168.1.9

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -viewEntry oracle.security.client.password1
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

oracle.security.client.password1 = skatepwd

E:\app\Administrator\product\11.2.0\dbhome_1\BIN>mkstore -wrl e:\temp\wallet -viewEntry oracle.security.client.username1
Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production
版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。

输入 Wallet 口令:

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)的区别是,这里不仅仅改密码,连接串和密码都可以改

我们这里是本地创建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

在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----

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow

oracle wallet使用与维护---oracle无密码登录相关推荐

  1. oracle wallet使用与维护

    oracle wallet使用与维护 2015年05月26日 17:58:55 SilenceRiver 阅读数:1614 oracle wallet使用与维护---oracle无密码登录 分类: O ...

  2. oracle wallet相关的bug|oracle wallet使用注意事项|ORA-28374: typed master key not found in wa

    ### Code Reference URL:https://blog.csdn.net/cpongo6/article/details/88793610 DESC:oracle wallet相关的b ...

  3. oracle wallet java_Java JDBC和Oracle Wallet Connection

    使用此作为参考.我仍然无法连接到Oracle Wallet.示例代码如下. 错误 -- java.sql.SQLException: encountered a problem with the Se ...

  4. oracle wallet无密码认证,Oracle Wallet 无密码登录

    --1.查看oracle home系统变量 c:\>echo %ORACLE_HOME% C:\Oracle\product\11.2.0\dbhome_1 --2.找到合适的位置创建walle ...

  5. oracle wallet java_Oracle Wallet初探

    初探 1.什么是Wallet A datastructure used to store and manage security credentials for an individualentity ...

  6. oracle无+密码登陆,Oracle 11g通过wallet实现无密码登录

    创建一个目录来存放wallet [oracle@localhost trace]$ mkdir -p/u01/app/oracle/wallets 在客户端通过下面命令创建一个wallet [orac ...

  7. oracle wallet java_oracle wallet实践及常用维护操作

    Wallet作用 从Oracle 10g R2开始, 通过使用Oracle Wallet达到任意用户不使用密码登录数据库(非操作系统认证方式), 这对在shell中要使用用户密码登录数据库进行操作的脚 ...

  8. oracle 监听加密 tcps,通过oracle wallet配置listener tcps加密

    一 配置客户端和服务端的wallet 2端配置方法一致,相互添加证书 orapki wallet create -wallet "/u01/oracle/wallet" -pwd ...

  9. oracle wallet,Oracle Wallet的使用

    从Oracle10gR2开始, 通过使用Oracle Wallet达到任意用户不使用密码登录数据库(非操作系统认证方式), 这对在shell中要使用用户密码登录数据库进行操作的脚本来说是非常有用的, ...

  10. oracle wallet java_使用Oracle客户端wallet实现匿名登录

    我们无论是通过Oracle客户端的各种工具.还是应用系统链接数据库,链接用户名和密码都是不可缺少的验证环节.这些敏感信息的保存方式其实一直是一个比较纠结的问题,最常用的方法就是通过硬编码或者配置文件保 ...

最新文章

  1. Scrapy爬取IT之家
  2. cookie存值和page分页
  3. ftp、sftp、vsftp、ssh、vsftpd、sshd
  4. Redis哨兵主备切换的数据丢失及Redis数据持久化
  5. 触发器与job的配合使用oracle,oracle 对象管理 10_触发器job
  6. python安装环境配置
  7. linux centeros下Redis的安装
  8. JSP中用request.setAttribute()后,在action中为什么取不到值?
  9. jQuery 写的简单打字游戏
  10. macos虚拟机鼠标不能移动和键盘不能使用
  11. 手机蓝牙绑定pc,离开电脑自动锁屏
  12. 读书和实践是学习Verilog的正确途径
  13. 国际著名黑客大赛介绍与比较
  14. gis与一般计算机应用系统有哪些异同,gis概论各章练习题..doc
  15. Vue-cli 打包CSS、JS找不到路径问题,解决方案
  16. ADGUARD——去除广告利器
  17. Linux下移动anaconda虚拟环境的位置
  18. 微信企业支付到个人银行卡
  19. 微信小程序踩坑之微信支付提示商户未开通支付权限
  20. MySQL中三种表关系的建立

热门文章

  1. Java Se 、JavaEE、JavaME区别
  2. h5 Table表格
  3. 用二维数组打印杨辉三角
  4. 重装/重置系统后,针对于虚拟机需要输入许可证,仍无法打不开问题
  5. 2020 工业机器人行业研究报告
  6. 三调数据库标准和输出表格
  7. 分享一个影视解析接口
  8. 阿里云实现首个云上量子加密通讯服务
  9. 打代码太苦,你需要一个鼓励师
  10. TextView常用属性