​ORACLE wallet实现无需输入用户名与密码登陆数据库 注意修改目录权限

news2024/5/20 3:19:53

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文件,增加下面几行

 
  1. HTZDG = 
  2.   (DESCRIPTION = 
  3.     (ADDRESS_LIST = 
  4.       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.30)(PORT = 1521)) 
  5.     ) 
  6.     (CONNECT_DATA = 
  7.       (SERVER = DEDICATED) 
  8.       (SERVICE_NAME = htzdg) 
  9.     ) 
  10.   ) 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.

    测试是否可以正常解析

 
  1. C:\Users\luoping>tnsping htzdg 
  2. TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-8月 - 
  3. 2012 21:40:40 
  4. Copyright (c) 1997, 2010, Oracle.  All rights reserved. 
  5. 已使用的参数文件: 
  6. D:\app\luoping\product\11.2.0\client_1\network\admin\sqlnet.ora 
  7. 已使用 TNSNAMES 适配器来解析别名 
  8. 尝试连接 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.1 
  9. 68.100.30)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = h 
  10. tzdg))) 
  11. OK (40 毫秒) 
  12. C:\Users\luoping> 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.

   下面是开始配置wallet

    1,创建一个wallet

 
  1. D:\app\luoping\product\11.2.0\client_1\BIN>mkstore -wrl D:\app\luoping\product\11.2.0\client_1\pstore -create 
  2. Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production 
  3. 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。 
  4. 输入口令: 
  5. 再次输入口令: 
  6. D:\app\luoping\product\11.2.0\client_1\BIN>cd ../ 
  7. D:\app\luoping\product\11.2.0\client_1>cd pstore 
  8. D:\app\luoping\product\11.2.0\client_1\pstore>dir 
  9.  驱动器 D 中的卷是 DATA 
  10.  卷的序列号是 D60C-09BD 
  11.  D:\app\luoping\product\11.2.0\client_1\pstore 的目录 
  12. 2012/08/29  15:39    <DIR>          . 
  13. 2012/08/29  15:39    <DIR>          .. 
  14. 2012/08/29  15:39             3,589 cwallet.sso 
  15. 2012/08/29  15:39             3,512 ewallet.p12 
  16.                2 个文件          7,101 字节 
  17.                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位置

 
  1. D:\app\luoping\product\11.2.0\client_1\network\admin>more sqlnet.ora 
  2. # sqlnet.ora Network Configuration File: D:\app\luoping\product\11.2.0\client_1\ 
  3. network\admin\sqlnet.ora 
  4. # Generated by Oracle configuration tools. 
  5. # This file is actually generated by netca. But if customers choose to 
  6. # install "Software Only", this file wont exist and without the native 
  7. # authentication, they will not be able to connect to the database on NT. 
  8. SQLNET.AUTHENTICATION_SERVICES= (NTS) 
  9. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) 
  10. WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=D:\app\luoping\product\11.2.0\client_1\pstore))) 
  11. SQLNET.WALLET_OVERRIDE=TRUE 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.

     3,增加需要登陆的网络服务名,用户,密码到wallet中

 
  1. D:\app\luoping\product\11.2.0\client_1\BIN>mkstore -wrl D:\app\luoping\product\1 
  2. 1.2.0\client_1\pstore -createCredential htzdg sys oracle 
  3. Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production 
  4. 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。 
  5. 输入 Wallet 口令: 
  6. Create credential oracle.security.client.connect_string1 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.

     4,测试是否成功

 
  1. D:\app\luoping\product\11.2.0\client_1\BIN>sqlplus /@htzdg as sysdba 
  2. SQL*Plus: Release 11.2.0.1.0 Production on 星期三 8月 29 17:48:27 2012 
  3. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  4. 连接到: 
  5. Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production 
  6. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  7. SQL> 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.

    5,查看wallet中配置的网络服务名

 
  1. D:\app\luoping\product\11.2.0\client_1\BIN>mkstore -wrl d:\app\luoping\product\1 
  2. 1.2.0\client_1\pstore -listCredential 
  3. Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production 
  4. 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。 
  5. 输入 Wallet 口令: 
  6. List credential (index: connect_string username) 
  7. 1: htzdg sys 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.

    6,一个网络服务名,只能对应一个用户,如果相同的数据库有多少用户需要在同一个client通过wallet实现时,我们需要每一个用户,创建一个网络服务名。

    下面是测试一个网络服务名,相增加两个用户时,报错。

 
  1. C:\Users\luoping>mkstore -wrl D:\app\luoping\product\11.2.0\client_1\pstore -cre 
  2. ateCredential htzdg scott oracle 
  3. Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production 
  4. 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。 
  5. 输入 Wallet 口令: 
  6. Create credential 出现密钥存储错误: oracle.security.pki.OracleSecretStoreExcepti 
  7. on: Credential already exists 

     7,当密码修改后,要手动更新wallet中相应的密码。不然要报错的。

 
  1. D:\app\luoping\product\11.2.0\client_1\BIN>sqlplus /@htzdg as sysdba 
  2. SQL*Plus: Release 11.2.0.1.0 Production on 星期三 8月 29 17:45:56 2012 
  3. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  4. 连接到: 
  5. Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production 
  6. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  7. SQL> 
  8. SQL> alter user sys identified by htz; 
  9. 用户已更改。 
  10. SQL> exit 
  11. 从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production 
  12. With the Partitioning, OLAP, Data Mining and Real Application Testing options 断 
  13. 开 
  14. D:\app\luoping\product\11.2.0\client_1\BIN>sqlplus /@htzdg as sysdba 
  15. SQL*Plus: Release 11.2.0.1.0 Production on 星期三 8月 29 17:46:25 2012 
  16. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  17. ERROR: 
  18. ORA-01017: invalid username/password; logon denied 
  19. 请输入用户名: 
  20. D:\app\luoping\product\11.2.0\client_1\BIN>mkstore -wrl D:\app\luoping\product\1 
  21. 1.2.0\client_1\pstore -modifyCredential htzdg sys 
  22. Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production 
  23. 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。 
  24. 命令行中缺少您的密钥/口令 
  25. 请输入您的密钥/口令: 
  26. 请重新输入您的密钥/口令: 
  27. 输入 Wallet 口令: 
  28. Modify credential 
  29. Modify 1 
  30. D:\app\luoping\product\11.2.0\client_1\BIN> 
  31. D:\app\luoping\product\11.2.0\client_1\BIN>mkstore -wrl D:\app\luoping\product\1 
  32. 1.2.0\client_1\pstore -modifyCredential htzdg sys 
  33. Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production 
  34. 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。 
  35. 命令行中缺少您的密钥/口令 
  36. 请输入您的密钥/口令: 
  37. 请重新输入您的密钥/口令: 
  38. 输入 Wallet 口令: 
  39. Modify credential 
  40. Modify 1 
  41. D:\app\luoping\product\11.2.0\client_1\BIN> 
  42. D:\app\luoping\product\11.2.0\client_1\BIN>sqlplus /@htzdg as sysdba 
  43. SQL*Plus: Release 11.2.0.1.0 Production on 星期三 8月 29 17:48:27 2012 
  44. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  45. 连接到: 
  46. Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production 
  47. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  48. SQL> 

     8,手动删除wallet中的记录

 
  1. D:\app\luoping\product\11.2.0\client_1\BIN>mkstore -wrl d:\app\luoping\product\1 
  2. 1.2.0\client_1\pstore -deleteCredential htzdg 
  3. Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production 
  4. 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。 
  5. 输入 Wallet 口令: 
  6. Delete credential 
  7. Delete 1 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.

     9,mkstore命令帮忙手册

 
  1. D:\app\luoping\product\11.2.0\client_1\BIN>mkstore 
  2. Oracle Secret Store Tool: 版本 11.2.0.1.0 - Production 
  3. 版权所有 (c) 2004, 2009, Oracle 和/或其子公司。保留所有权利。 
  4. mkstore [-wrl wrl] [-create] [-createSSO] [-createLSSO] [-createALO] [-delete] [ 
  5. -deleteSSO] [-list] [-createEntry alias secret] [-viewEntry alias] [-modifyEntry 
  6.  alias secret] [-deleteEntry alias] [-createCredential connect_string username p 
  7. assword] [-listCredential] [-modifyCredential connect_string username password] 
  8. [-deleteCredential connect_string] [-help] [-nologo] 

----------------------------------权限相关 linux  777 windows 需要修改lck文件的owner

ORACLE wallet配置/管理/使用

 推荐 原创

73436962012-09-12 21:40:19博主文章分类:ORACLE 基础©著作权

文章标签ORACLE WALLET文章分类数据库阅读数4803

    昨天在公司配置数据库时,向wallet中增加了一个新的数据库,现实无需输入用户名与密码来登陆数据库,增加完成后,导致整个监控系统都是报用户名与密码的错误,无法登陆来数据库。但是ORACLE用户是能正常登陆数据库,不需要输入密码。其实原因很简单,因为我们的监控系统是nagios,而wallet相关的文件的默认权限是600,除ORACLE外其它的用户都是不可以读写的,正常情况下我们是改成了777的权限,让其它的用户也能使用钱包这个功能,当是我对wallet进行新增加一个数据库时,wallet会自己把cwallet.sso与ewallet.p12文件的权限自己改成600。这就导致了今天我的悲剧。

    下面是wallet的配置/管理/维护/现象的模拟

1.创建wallet

 
  1. [oracle@test db_1]$ mkdir wallet 
  2. [oracle@test db_1]$ pwd 
  3. /u01/app/oracle/product/11.2.0/db_1 
  4. [oracle@test db_1]$ mkstore -wrl /u01/app/oracle/product/11.2.0/db_1/wallet -create 
  5. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  6. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  7. #这里输入wallet的密码,对密码是有限制条件的 
  8. 1.密码长度要是8位以上。 
  9. 2.密码最大长度没有限制。 
  10. 3.密码要有字符与数据。 
  11. Enter password:              
  12. Enter password again:              
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.

2.配置wallet到sqlnet.ora中

 
  1. [oracle@test db_1]$ cat $ORACLE_HOME/network/admin/sqlnet.ora 
  2. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) 
  3. #DIRECTORY这里就是指定wallet所在的目录
  4. WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=/u01/app/oracle/product/11.2.0/db_1/wallet))) 
  5. SQLNET.WALLET_OVERRIDE=TRUE 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.

3.查看wallet的命令帮忙

wallet这个很好,因为直接用help就可以看到命令的帮忙了,不需要我们再去记复杂的参数,只用记住mkstore这个命令来管理wallet就可以了。

 
  1. [oracle@test db_1]$ mkstore -help 
  2. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  3. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  4. mkstore [-wrl wrl] [-create] [-createSSO] [-createLSSO] [-createALO] [-delete] 
  5. [-deleteSSO] [-list] [-createEntry alias secret] [-viewEntry alias] 
  6. [-modifyEntry alias secret] [-deleteEntry alias] 
  7. [-createCredential connect_string username password] [-listCredential] 
  8. [-modifyCredential connect_string username password] [-deleteCredential connect_string] [-help] [-nologo] 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.

4.增加数据库到wallet中去,并测试是否成功

 
  1. 3.1#增加net service为htz scott为用户 oracle为用户的密码。 
  2. #建议密码用''引起来,因为在生产环境中的密码基本上都是特殊字符的。 
  3. [oracle@test db_1]$ mkstore -wrl  /u01/app/oracle/product/11.2.0/db_1/wallet -createCredential htz scott 'oracle' 
  4. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  5. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  6. Enter wallet password:              
  7. Create credential oracle.security.client.connect_string1 
  8. 3.2 #查看是否增加成功。 
  9. [oracle@test db_1]$ mkstore -wrl  /u01/app/oracle/product/11.2.0/db_1/wallet -listCredential  
  10. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  11. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  12. Enter wallet password:              
  13. List credential (index: connect_string username) 
  14. 1: htz scott 
  15. 3.3 测试是否可以实现无需要输入用户与密码登陆 
  16. [oracle@test db_1]$ sqlplus /@htz 
  17. SQL*Plus: Release 11.2.0.2.0 Production on Sat Sep 8 09:19:15 2012 
  18. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  19. Connected to: 
  20. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  21. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  22. #显示的是scott,成功了。 
  23. SQL> show user; 
  24. USER is "SCOTT" 
  25. SQL> exit 
  26. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  27. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.

5.查看entry

 
  1. #这里看到我们增加一个数据进来就会增加3个entries。 
  2. #分别是一个连接符,一个用户名,一个密码。 
  3. #当我们增加了很多数据库与用户进来后,数据库与用户还有密码他们是怎么关联的呢?其实他们就是通过后面的这个数字来关键的。 
  4. [oracle@test db_1]$ mkstore -wrl  /u01/app/oracle/product/11.2.0/db_1/wallet -list 
  5. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  6. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  7. Enter wallet password:              
  8. Oracle Secret Store entries:  
  9. oracle.security.client.connect_string1 
  10. oracle.security.client.password1 
  11. oracle.security.client.username1 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.

6.创建默认用户与密码

这样可以实现,登陆所以的数据库都可以使用默认的用户与密码

 
  1. 6.1 #创建默认的用户。 
  2. [oracle@test db_1]$ mkstore -wrl  /u01/app/oracle/product/11.2.0/db_1/wallet -createEntry  oracle.security.client.default_username scott 
  3. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  4. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  5. Enter wallet password:              
  6. 6.2 #创建默认用户的密码。 
  7. [oracle@test db_1]$ mkstore -wrl  /u01/app/oracle/product/11.2.0/db_1/wallet -createEntry  oracle.security.client.default_password oracle 
  8. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  9. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  10. Enter wallet password:              
  11. 6.3 #查看是否创建成功 
  12. [oracle@test db_1]$ mkstore -wrl  /u01/app/oracle/product/11.2.0/db_1/wallet -list 
  13. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  14. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  15. Enter wallet password:              
  16. Oracle Secret Store entries:  
  17. oracle.security.client.connect_string1 
  18. oracle.security.client.default_password 
  19. oracle.security.client.default_username 
  20. oracle.security.client.password1 
  21. oracle.security.client.username1 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.

7.当默认用户与手动增加的数据库信息到wallet中时,那一个生效呢?

下面我们测试一下,当wallet里面创建了默认的用户与密码时,手动再增加一个增加的信息到wallet时,到底是默认用户还是手动增加的生效呢?其实是手动增加的生效。

 
  1. 7.1 #由于默认用户增加的SCOTT普通用户,所以这里我们增加sys这个用户来做测试,net service名是htzb 
  2. [oracle@test db_1]$ mkstore -wrl $ORACLE_HOME/wallet -createCredential htzb sys 'oracle' 
  3. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  4. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  5. Enter wallet password:              
  6. Create credential oracle.security.client.connect_string1 
  7. 7.2 #登陆测试。 
  8. 这里没有增加as sysdba就是为了能区别普通用户与sys用户登陆的区别。如果是sys用户生效,就会报没有增加as sysdba登陆,如果是scott这个默认用户生效,就会登陆成功。 
  9. [oracle@test db_1]$ sqlplus /@htzb 
  10. SQL*Plus: Release 11.2.0.2.0 Production on Sat Sep 8 09:33:07 2012 
  11. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  12. #这里报错,说明手动增加的SYS用户的生效。默认用户没有生效 
  13. ERROR: 
  14. ORA-28009: connection as SYS should be as SYSDBA or SYSOPER 
  15. Enter user-name:   
  16. 7.3 #这里我们再登陆htz,登陆成功。说明我们默认用户在其它的net service是生效的。 
  17. [oracle@test db_1]$ sqlplus /@htz 
  18. SQL*Plus: Release 11.2.0.2.0 Production on Sat Sep 8 09:33:23 2012 
  19. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  20. Connected to: 
  21. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  22. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  23. SQL> exit 
  24. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  25. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  26. 7.4 #以sys as sysdba登陆成功 
  27. [oracle@test db_1]$ sqlplus /@htzb as sysdba 
  28. SQL*Plus: Release 11.2.0.2.0 Production on Sat Sep 8 09:33:30 2012 
  29. Copyright (c) 1982, 2010, Oracle.  All rights reserved. 
  30. Connected to: 
  31. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  32. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  33. SQL> show user 
  34. USER is "SYS" 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.

8.下面测试的是通过mkstore修改wallet中的内容后,导致wallet相关的文件,权限自动改成600.

 
  1. 8.1 #把wallet的文件权限改成777 
  2. [oracle@test db_1]$ chmod 777 $ORACLE_HOME/wallet/* 
  3. [oracle@test db_1]$ ls -l $ORACLE_HOME/wallet 
  4. total 16 
  5. -rwxrwxrwx 1 oracle oinstall 4565 Sep  8 09:38 cwallet.sso 
  6. -rwxrwxrwx 1 oracle oinstall 4488 Sep  8 09:38 ewallet.p12 
  7. 8.2 #手动在wallet中增加一个net service的配置信息 
  8. [oracle@test db_1]$ mkstore -wrl $ORACLE_HOME/wallet -deleteCredential htz  
  9. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  10. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  11. Enter wallet password:              
  12. Delete credential  
  13. Delete 2 
  14. 8.3 #再次查看权限时发现权限已经自己改成了600了 
  15. [oracle@test db_1]$ ls -l $ORACLE_HOME/wallet 
  16. total 16 
  17. -rw------- 1 oracle oinstall 4205 Sep  8 09:39 cwallet.sso 
  18. -rw------- 1 oracle oinstall 4128 Sep  8 09:39 ewallet.p12 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.

9. 当用户的密码发生变化的时候需要修改wallet中的密码

 
  1. [oracle@test ~]$ mkstore -wrl $ORACLE_HOME/wallet -modifyCredential htz scott 'oracleoracle'; 
  2. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  3. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  4. Enter wallet password:              
  5. Modify credential  
  6. Modify 1 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.

10.查看wallet中有那些认证的信息

 
  1. [oracle@test ~]$ mkstore -wrl $ORACLE_HOME/wallet -listCredential  
  2. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  3. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  4. Enter wallet password:              
  5. List credential (index: connect_string username) 
  6. 1: htz scott 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.

11 从wallet删除一个net service的配置信息

 
  1. [oracle@test ~]$ mkstore -wrl $ORACLE_HOME/wallet -deleteCredential  htz 
  2. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  3. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  4. Enter wallet password:              
  5. Delete credential  
  6. Delete 1 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.

12.修改默认的用户名

修改默认的用户名的密码的方法也一样。

 
  1. [oracle@test ~]$ mkstore -wrl $ORACLE_HOME/wallet -viewEntry oracle.security.client.default_username 
  2. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  3. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  4. Enter wallet password:              
  5. oracle.security.client.default_username = scott 
  6. [oracle@test ~]$ mkstore -wrl $ORACLE_HOME/wallet -modifyEntry oracle.security.client.default_username 
  7. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  8. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  9. Your secret/Password is missing in the command line  
  10. Enter your secret/Password:          
  11. Re-enter your secret/Password:          
  12. Enter wallet password:              
  13. [oracle@test ~]$ mkstore -wrl $ORACLE_HOME/wallet -viewEntry oracle.security.client.default_username 
  14. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  15. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  16. Enter wallet password:              
  17. oracle.security.client.default_username = oracle 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.

13 删除默认的用户名

登录后复制 

 
  1. [oracle@test ~]$ mkstore -wrl $ORACLE_HOME/wallet -deleteEntry oracle.security.client.default_username 
  2. Oracle Secret Store Tool : Version 11.2.0.2.0 - Production 
  3. Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 
  4. Enter wallet password:   
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.

我们一般的维护就这么多。

--------linux 界面操作

 

--创建钱包,或者alter system set encryption key identified by "oracle"; 

 

orapki wallet change_pwd -wallet /home/sysrls/wallet/

 

#维护小脚本,应该用dos2unix转换或者在linux中手工编辑

#!/bin/bash

echo -e "Useful action\n"

echo -e "1)create wallet"

echo -e "2)create Credential"

echo -e "3)check the created Credential"

echo -e "4)modify the created Credential"

echo -e "5)delete the created Credential"

echo -e "6)list Credential item"

echo -e "7)list Credential Entry value "

echo -e "8)modify wallet password"

echo -e "9)exit"

read -p "choose your action:" num1

case $num1 in

1)

echo -e "Please enter wallet password:\n"

read -s password

printf "$password\n$password\n" | /u01/app/oracle/product/11.2/db_1/bin/mkstore -wrl /u01/app/oracle/product/11.2/db_1/wallet/ -create

echo -e "wallet create success\n"

;;

2)

echo -e "Please enter wallet password:"

read -s password

read -p "Please enter database tnsname:" tnsname

read -p "Please enter database user:" user

echo -n "Please enter database user's password:"

read -s dbpass

printf "$dbpass\n$dbpass\n$password\n" | /u01/app/oracle/product/11.2/db_1/bin/mkstore -wrl /u01/app/oracle/product/11.2/db_1/wallet/ -createCredential $tnsname $user

echo -e "Credential create success\n"

;;

3)

echo -e "Please enter wallet password:\n"

read -s password

printf "$password\n" | /u01/app/oracle/product/11.2/db_1/bin/mkstore -wrl /u01/app/oracle/product/11.2/db_1/wallet/ -listCredential

;;

4)

echo -e "Please enter wallet password:"

read -s password

read -p "Please enter database tnsname:" tnsname

read -p "Please enter database user:" user

echo -n "Please enter database user's password:"

read -s dbpass

printf "$dbpass\n$dbpass\n$password\n" | /u01/app/oracle/product/11.2/db_1/bin/mkstore -wrl /u01/app/oracle/product/11.2/db_1/wallet/ -modifyCredential $tnsname $user

echo -e "modify Credential success\n"

;;

5)

echo -e "Please enter wallet password:"

read -s password

read -p "Please enter database tnsname:" tnsname

printf "$password\n" | /u01/app/oracle/product/11.2/db_1/bin/mkstore -wrl /u01/app/oracle/product/11.2/db_1/wallet/ -deleteCredential $tnsname

echo -e "delete Credential success\n"

;;

6)

echo -e "Please enter wallet password:"

read -s password

printf "$password\n" | /u01/app/oracle/product/11.2/db_1/bin/mkstore -wrl /u01/app/oracle/product/11.2/db_1/wallet/ -list

;;

7)

echo -e "Please enter wallet password:"

read -s password

read -p "Please enter Entryname type:" type

if [ "$type" == "connect" ];then

printf "$password\n" | /u01/app/oracle/product/11.2/db_1/bin/mkstore -wrl /u01/app/oracle/product/11.2/db_1/wallet/ -viewEntry oracle.security.client.connect_string1

fi

if [ "$type" == "user" ];then

printf "$password\n" | /u01/app/oracle/product/11.2/db_1/bin/mkstore -wrl /u01/app/oracle/product/11.2/db_1/wallet/ -viewEntry oracle.security.client.username1

fi

if [ "$type" == "password" ];then

printf "$password\n" | /u01/app/oracle/product/11.2/db_1/bin/mkstore -wrl /u01/app/oracle/product/11.2/db_1/wallet/ -viewEntry oracle.security.client.password1

fi

;;

8)

/u01/app/oracle/product/11.2/db_1/bin/orapki wallet change_pwd -wallet /u01/app/oracle/product/11.2/db_1/wallet/

;;

9)

exit 0

esac

 

12.修改默认的用户名

修改默认的用户名的密码的方法也一样。

[oracle@test ~]$ mkstore -wrl $ORACLE_HOME/wallet -viewEntry oracle.security.client.default_username

--oracle.security.client.default_username = scott

mkstore -wrl $ORACLE_HOME/wallet -modifyEntry oracle.security.client.default_username

mkstore -wrl $ORACLE_HOME/wallet -viewEntry oracle.security.client.default_username

--oracle.security.client.default_username = oracle

13 删除默认的用户名

[oracle@test ~]$ mkstore -wrl $ORACLE_HOME/wallet -deleteEntry oracle.security.client.default_username

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/857208.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

docker基本使用方法

docker使用 1. Docker 介绍 Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中&#xff0c;然后发布到任何流行的 Linux 机器上&#xff0c;也可以实现虚拟化。Docker 使您能够将应用程序与基础架构分开&#xff0c;从而可以快速交付软件。通过利用 …

Blockchain投资:是否是实现财务自由的捷径?

随着Blockchain技术的不断发展和应用&#xff0c;越来越多的人开始探索Blockchain投资的机会。Blockchain作为一种分布式记账技术&#xff0c;以其去中心化、透明性和安全性等特点&#xff0c;吸引了众多投资者的关注。但是&#xff0c;Blockchain投资是否真的可以成为实现财务…

unity 修改默认脚本

using System.Collections; using System.Collections.Generic; using UnityEngine; //***************************************** //创建人&#xff1a; xxxx //功能说明&#xff1a; //***************************************** #ROOTNAMESPACEBEGIN# public class #SCRI…

0基础学习VR全景平台篇 第82篇:智慧眼-角色是什么?如何运用呢?

一、功能说明 角色是指城市运营工作开展时所需要设定的成员职称或者人物定位&#xff0c;如管理员、督察员、镇街主管、镇接干事、网格员等等。 后台编辑界面 点击【新增】&#xff0c;填写角色的名称&#xff0c;若有上级&#xff0c;还需选择对应的父级角色。如管理员为最…

Python(七十五)集合的生成式

❤️ 专栏简介&#xff1a;本专栏记录了我个人从零开始学习Python编程的过程。在这个专栏中&#xff0c;我将分享我在学习Python的过程中的学习笔记、学习路线以及各个知识点。 ☀️ 专栏适用人群 &#xff1a;本专栏适用于希望学习Python编程的初学者和有一定编程基础的人。无…

山东布谷科技直播软件源码探索高效、稳定直播传输的技术介绍:流媒体传输技术

今天我们探索的是让直播软件源码平台在直播时能够高效、稳定的进行直播传输的技术&#xff0c;而这个技术就是直播软件源码平台的流媒体传输技术&#xff0c;在直播软件源码平台中&#xff0c;流媒体传输技术会将直播的图像、视频、音频等相关的流媒体信号通过网络传递到用户的…

SQL-每日一题【1251. 平均售价】

题目 Table: Prices Table: UnitsSold 编写SQL查询以查找每种产品的平均售价。average_price 应该四舍五入到小数点后两位。 查询结果格式如下例所示&#xff1a; 解题思路 1.题目要求查询每种产品的平均售价。给出了两个表&#xff0c;我们用聚合查询来解决此问题。 2.首先我…

从 OBJ 到 FBX:图扑新一代飞机模型、动画、漫游

相信大多数图扑 HT 用户都曾见过这个飞机的 Demo&#xff0c;在图扑发展的这十年&#xff0c;这个 Demo 是许多学习 HT 用户一定会参考的经典 Demo 之一。 这个 Demo 用简洁的代码生动地展示了 OBJ 模型加载、数据绑定、动画和漫游等功能的实现。许多用户参考这个简单的 Demo 后…

通过Shinami快速使用赞助交易(Gas代付)

Web3中对钱包和tokens的要求对于新用户来说是最大的挑战。Sui上的赞助交易不仅为用户提供丝滑的体验&#xff0c;还为构建者开辟了更多的收入模式。 按需付费的区块链模型直接支持网络基础设施&#xff0c;但对于那些已经习惯了Web2世界中看似免费服务的用户来说&#xff0c;这…

{errcode“:-106,“errmsg“:“token check fail“} 微信公众号测试号接口配置报错Django版

准备写个公众号做消息提醒的工具&#xff0c;&#xff0c;于是去了微信公众平台&#xff0c;准备用测试号接口试试。代码写的没问题&#xff0c;服务器也是已经部署了的。基本上所有问题都排查了还是显示配置失败。最后发现是请求头的问题 先列举一下需要注意的问题&#xff0…

自媒体行业深度解析:挖掘收入潜力,洞察未来趋势

随着社交网络和移动互联网的快速发展&#xff0c;自媒体行业成为了越来越多人的职业选择。那么&#xff0c;自媒体行业到底怎么样&#xff1f;自媒体人的收入和前景如何&#xff1f;本文将为大家带来一些关于自媒体行业的介绍和分析。 一、自媒体的定义 自媒体是指个人或组织利…

【ES】笔记-箭头函数的实践于应用场景

箭头函数的实践于应用场景 需求-1 点击 div 2s后颜色变成[粉色]从数组中返回偶数的元素 需求-1 点击 div 2s后颜色变成[粉色] html <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport…

论文解读《Adversarial training methods for semi-supervised text classification》

1 背景 1.1 对抗性实例&#xff08;Adversarial examples&#xff09; 通过对输入进行小扰动创建的实例&#xff0c;可显著增加机器学习模型所引起的损失对抗性实例的存在暴露了机器学习模型的脆弱性和局限性&#xff0c;也对安全敏感的应用场景带来了潜在的威胁&#xff1b;…

前端开发的工作职责精选【10篇】

前端开发的工作职责1 1、使用Divcss并结合Javascript负责产品的前端开发和页面制作; 2、熟悉W3C标准和各主流浏览器在前端开发中的差异&#xff0c;能熟练运用DIVCSS&#xff0c;提供针对不同浏览器的前端页面解决方案; 3、负责相关产品的需求以及前端程序的实现&#xff0c…

IDEA 配置 eslint

第一步 第二步 然后就去试一下啦&#xff0c;理论上到这一步就没问题了&#xff0c;有问题在留言吧。

超低延时直播技术的前世今生

作者&#xff1a;李晨光、匡建鑫、陈鉴平 卷首语&#xff1a; 据中国互联网络信息中心发布的《中国互联网络发展状况统计报告》显示&#xff0c;截止到 2022 年 6 月我国网络直播用户规模达到了 7.16 亿&#xff0c;占网民整体的 68.1% 。最主要原因是 2020 年度疫情期间导致居…

C++入门(小白篇2-标识符定义-关键词-变量类型)

前言 在上一节课中&#xff0c;我们学习到C软件的安装&#xff0c;也知道C运行的各种软件&#xff0c;以及运行第一个程序 今天我们来学习一下 1、C中标识符(变量)的命名规则 2、认识C中的关键词 3、认识C中的数据类型 每天学一点&#xff0c;不要太多不然脑子装不下&#xff0…

vscode终端背景颜色修改以及报错信息颜色修改

引言 刚从pycharm转到vscode上时&#xff0c;很不喜欢vscode终端信息一片白色&#xff0c;于是想尽办法去修改vscode终端风格 这里提供vscode终端背景颜色的修改和vscode终端报错提示信息颜色的修改方法 (1)vscode终端背景颜色优化 步骤一&#xff0c;ctrlshiftp打开设置搜索…

【python 深度学习】解决遇到的问题

目录 一、RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb 二、AttributeError: module ‘tensorflow’ has no attribute ‘flags’ 三、conda 更新 Please update conda by running 四、to search for alternate channels that…

项目启动会为什么很重要? 要确定哪些事宜?

项目启动会议及事项安排 1、领导致辞 2、项目目标 3、项目范围及关键交付物 4、项目里程碑 5、项目组织架构及人员工作安排 6、项目管理机制 7、联系人列表 8、Q&A 进主页获取更多资料