在oracleg上建dblink到g报密码错误问题及oraclegg密码大小写是否区分的讨论

上传人:ji****72 文档编号:39709676 上传时间:2018-05-18 格式:DOCX 页数:7 大小:19.36KB
返回 下载 相关 举报
在oracleg上建dblink到g报密码错误问题及oraclegg密码大小写是否区分的讨论_第1页
第1页 / 共7页
在oracleg上建dblink到g报密码错误问题及oraclegg密码大小写是否区分的讨论_第2页
第2页 / 共7页
在oracleg上建dblink到g报密码错误问题及oraclegg密码大小写是否区分的讨论_第3页
第3页 / 共7页
在oracleg上建dblink到g报密码错误问题及oraclegg密码大小写是否区分的讨论_第4页
第4页 / 共7页
在oracleg上建dblink到g报密码错误问题及oraclegg密码大小写是否区分的讨论_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《在oracleg上建dblink到g报密码错误问题及oraclegg密码大小写是否区分的讨论》由会员分享,可在线阅读,更多相关《在oracleg上建dblink到g报密码错误问题及oraclegg密码大小写是否区分的讨论(7页珍藏版)》请在金锄头文库上搜索。

1、有同事在从 10g 建 db link 到 11g 时,没有报错,但通过 db link 连接时报错如下:ORA-01017: invalid username/password; logon deniedORA-02063: preceding line from 根据 ORA-01017 的提示是连接到另一方的用户密码错误,于是直接使用配置的用户密码登录数据库发现正常登录。对加密 Hash 的反查询得出正确密码,得知原因是当 9i 或 10g 的版本的 Oracle 连接 11g 的时,会自动将密码转化为大写。查阅 oracle 的官方文档解释如下(其实是个 BUG):Bug 673810

2、4: ORA-01017 ORA-02063 WHILE CONNECTING FROM10G TO 11G VIA PUBLIC DBLINKThe following Bug 6738104 was logged for this issue which was closed as not a bug saying the cause being introduction of password case sensitivity feature in 11gWhen one creates a database link connection, a user name and passwo

3、rd for the connection needs to be defined. When the database link is created, the password is case sensitive. Before a user can connect from a pre-release 11g database to a 11g release database and as the password case sensitivity is enabled by default, you must re-create the password for this datab

4、ase link using all uppercase letters.The reason you need to re-create the password using all uppercase letters is so that it will match how Oracle Database stores database link passwords. Oracle Database always stores this type of password in uppercase letters, even if the password had originally be

5、en created using lower or mixed case letters. If case sensitivity is disabled, the user can enter the password using the case the password was created in.解决办法:如果 11g 的数据库用户的密码是小写字母,将其改成大写,然后再去用 10g 去连接,这个方法太过卑劣,影响也比较大不考虑使用。将密码用双引号引起来。如 identified by “test“我们将 dblink 的创建语句稍微改写即可,如下:create public data

6、base link DB_TESTconnect to test identified by “test“using .;不过有关于 oracle 密码大小写的问题,跟 Haier 争论过一次,结果是没说服她。下面是冗长的实验部分(摘自 Dave 的实验),无兴趣的同学直接忽略吧,后面有来自 oracle 官方的结论。我们知道可以用 orapwd 来创建密码文件,我们看下这里面的参数:C: orapwdUsage: orapwd file=entries= force= ignorecase=nosysdba=wherefile - name of password file (require

7、d),password - password for SYS will be prompted if not specified at commandline,entries - maximum number of distinct DBA (optional),force - whether to overwrite existing file (optional),ignorecase - passwords are case-insensitive (optional),nosysdba - whether to shut out the SYSDBA logon (optional D

8、atabase Vaultonly).There must be no spaces around the equal-to (=) character.这个是口令文件创建命令的参数说明, 这里我们看一个参数:ignorecase - passwords are case-insensitive (optional),这个参数用来指定大小写是否敏感,而默认情况是 insentive, 即不敏感,所以对于 Oracle10g 的数据库,默认情况下,密码是不区分大小写的。但是在 Oracle 10g 中,我们无法使用这个参数,在后续的测试用有说明。虽然口令文件里只保存具有 SYSDBA 和OPER

9、 权限的用户,但是其他用户也会受影响。这里我们在 Oracle 10g 上做一个测试,为了避免 OS 认证的影响,我们这里可以禁用 OS 认证。SQL select * from v$version;BANNER-Oracle Database 10g Enterprise EditionRelease 10.2.0.5.0 - 64biPL/SQL Release 10.2.0.5.0 - ProductionCORE 10.2.0.5.0 ProductionTNS for Linux: Version 10.2.0.5.0 -ProductionNLSRTL Version 10.2.0

10、.5.0 - Production-创建 2 个测试用户:SQL create user test1 identified byTest;User created.SQL create user test2 identified byTest;User created.SQL grant connect,resource to test1;Grant succeeded.SQL grant connect,resource to test2;Grant succeeded.SQL grant sysdba,sysoper to test1;Grant succeeded.SQL select

11、* from v$pwfile_users;USERNAME SYSDB SYSOP- - -SYS TRUE TRUETEST1 TRUE TRUESQL conn test1/test;Connected.SQL conn test2/test;Connected.SQL conn test1/test; Connected.SQL conn test1/test1;ERROR:ORA-01017: invalid username/password; logondeniedWarning: You are no longer connected toORACLE.从这里可以看出,在 Or

12、acle 10g 下,密码是不分大小写。这里我们可以继续测试:我们将 sysdba 权限从 test1 用户 revoke,然后测试:SQL conn / as sysdba;Connected.SQL revoke sysdba,sysoper from test1;Revoke succeeded.SQL select * from v$pwfile_users;USERNAME SYSDB SYSOP- - -SYS TRUE TRUE我们继续使用 test1 进行测试:SQL conn test1/test;Connected.SQL conn test1/test1;ERROR:OR

13、A-01017: invalid username/password; logondeniedWarning: You are no longer connected toORACLE.从这里我们可以看出,只是简单的 revoke 并不能解决问题,我们重建一个口令文件,然后测试一下看看:rac2:/u02/app/oracle/product/10.2.0/db_1/dbsorapwd file=orapwanqing password=oracle force=y;SQL conn test1/test;Connected.还是可以继续使用,不分大小写。把 DB 重启一下看看:SQL shu

14、tdown immediateORA-01031: insufficient privilegesSQL conn / as sysdba;Connected.SQL shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL startupORACLE instance started.Total System Global Area 583008256 bytesFixed Size 2097984 bytesVariable Size 159386816 bytesDatabase

15、 Buffers 415236096 bytesRedo Buffers 6287360 bytesDatabase mounted.Database opened.SQL conn test1/test;Connected.所以我们重建口令文件不能解决问题。所以在 Oracle 10g 中,密码是不区分大小写的,这种现状,在 Oracle 11g 里才得到真正的改善。我们可以在 Oracle 10g 中验证一下:rac2:/u02/app/oracle/product/10.2.0/db_1/dbsorapwd file=orapwanqing password=oracle force=y ignorecase=yUsage: orapwdfile= entries= force=ignorecase= nosysdba=w

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号