【方法】Oracle用户密码含特殊字符时的登陆问题

方法Oracle用户密码含特殊字符时的登陆问题

1.1  BLOG文档结构图

1.2.2  相关文章链接

【密码】Oracle用户密码系列:http://blog.itpub.net/26736162/viewspace-2129595/

-------------------------------------------------------------------------

第二章 实验部分

2.1  实验环境介绍


项目


source db


db 类型


RAC


db version


11.2.0.3.0


db 存储


ASM


OS版本及kernel版本


RHEL 6.5

2.2  实验目标

当用户密码含有特殊字符的时候,测试sqlplus和exp、imp及expdp、impdp的登陆及修改密码问题。

2.3  实验过程

2.3.1  sqlplus连接

普通用户连接:


[[email protected] admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 24 09:25:35 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[email protected]> alter user lhr identified by "[email protected]";

User altered.

[email protected]> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[[email protected] ~]$ sqlplus ‘lhr/"[email protected]"‘@LHRDB

SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 24 09:27:05 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[email protected]> EXIT

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[[email protected] ~]$

sys用户连接:


[[email protected] admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 24 09:29:09 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[email protected]>  alter user sys identified by "[email protected]";

User altered.

[email protected]> exit

[[email protected] ~]$ sqlplus ‘sys/"[email protected]"‘@LHRDB as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 24 09:29:35 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[email protected]> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[[email protected]t ~]$

2.3.2  expdp连接

密码用双引号,用户名和密码用单引号括起来,然后【用户名】+【密码】+【tn】+【as sysdba】用单引号括起来,最后的这个单引号用\进行转义


expdp \‘‘sys/"[email protected]"‘@LHRDB as sysdba\‘ DIRECTORY=DATA_PUMP_DIR DUMPFILE=SCOTT%U.dmp SCHEMAS=SCOTT COMPRESSION=all metrics=y


[[email protected] admin]$  expdp \‘‘sys/"[email protected]"‘@LHRDB as sysdba\‘ DIRECTORY=DATA_PUMP_DIR DUMPFILE=SCOTT%U.dmp SCHEMAS=SCOTT COMPRESSION=all metrics=y

Export: Release 11.2.0.3.0 - Production on Fri Feb 24 09:32:22 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

FLASHBACK automatically enabled to preserve database integrity.

Starting "SYS"."SYS_EXPORT_SCHEMA_01":  "sys/********@LHRDB AS SYSDBA" DIRECTORY=DATA_PUMP_DIR DUMPFIL

Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

Completed 4 TABLE_STATISTICS objects in 14 seconds

. . exported "SCOTT"."DEPT"                              4.976 KB       4 rows

. . exported "SCOTT"."EMP"                               5.617 KB      14 rows

. . exported "SCOTT"."SALGRADE"                          4.890 KB       5 rows

. . exported "SCOTT"."BONUS"                                 0 KB       0 rows

Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:

/u02/app/oracle/admin/lhrdb/dpdump/SCOTT01.dmp

Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at 09:33:19

2.3.3  修改密码中含有“@”符号


[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Mar 16 17:10:26 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[email protected]> alter user scott identified by "tiger&123";

Enter value for 123:

old   1: alter user scott identified by "tiger&123"

new   1: alter user scott identified by "tiger"

User altered.

[email protected]>

[email protected]> set define off

[email protected]> alter user scott identified by "tiger&123";

User altered.

[email protected]> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[[email protected] ~]$  sqlplus ‘scott/"tiger&123"‘@LHRDB

SQL*Plus: Release 11.2.0.3.0 Production on Thu Mar 16 17:14:00 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[email protected]>

[email protected]> set define off

[email protected]> alter user scott identified by "$tiger&[email protected]\r/0%s,d$";

User altered.

[email protected]> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[[email protected] ~]$  sqlplus ‘scott/"$tiger&[email protected]\r/0%s,d$"‘@LHRDB

SQL*Plus: Release 11.2.0.3.0 Production on Thu Mar 16 17:20:12 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[email protected]>

2.3.4  修改密码中含有双引号符号

修改scott用户的密码为:a"b


[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Mar 16 17:39:18 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[email protected]> password scott

Changing password for scott

New password:

Retype new password:

Password changed

[email protected]> conn scott/a"b

Connected.

[email protected]>

[[email protected] ~]$ sqlplus scott/a\"b

SQL*Plus: Release 11.2.0.3.0 Production on Thu Mar 16 17:42:34 2017

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

[email protected]>

注:因为一般特殊字符可以使用双引号处理,但是如果密码中含有双引号,就不能用双引号处理,可以直接使用password修改密码。

2.4  本文结论

参考下表:


Linux平台


sqlplus工具


数据泵工具(expexpdp


普通用户


无tns


sqlplus ‘lhr/"[email protected]\r/0"‘


expdp ‘lhr/"[email protected]\r/0"‘


有tns


sqlplus ‘lhr/"[email protected]\r/0"‘@LHRDB


expdp ‘lhr/"[email protected]\r/0"‘@LHRDB


sys用户


无tns


sqlplus / as sysdba


expdp \‘/ AS SYSDBA\‘


有tns


sqlplus ‘sys/"[email protected]\r/0"‘@LHRDB as sysdba


expdp \‘‘sys/"[email protected]\r/0"‘@LHRDB as sysdba\‘


正常密码


sqlplus sys/[email protected] as sysdba


expdp \‘sys/[email protected] as sysdba\‘


备注:含特殊字符密码为:[email protected]\r/0,正常密码为:lhr,tns为:LHRDB,总的原则为:密码用双引号括起来,用户名和密码用单引号括起来,然后【用户名】+【密码】+【tns】+【as sysdba】用单引号括起来,最后的这个单引号用\进行转义

alter user lhr identified by "[email protected]\r/0";

alter user sys identified by "[email protected]\r/0";

set define off

alter user scott identified by "$tiger&[email protected]\r/0%s,d$";

alter user scott identified by "$?`$%*H\@f‘\<a-q [email protected]#<="">`}:H$";

password scott


Windows平台


sqlplus工具


数据泵工具(expexpdp


普通用户


无tns


sqlplus lhr/"""[email protected]\r/0"""

sqlplus lhr/\"[email protected]\r/0\"


expdp lhr/"""[email protected]\r/0"""

expdp lhr/\"[email protected]\r/0\"


有tns


sqlplus lhr/"""[email protected]\r/0"""@LHRDB

sqlplus lhr/\"[email protected]\r/0\"@LHRDB


expdp lhr/"""[email protected]\r/0"""@LHRDB

expdp lhr/\"[email protected]\r/0\"@LHRDB


sys用户


无tns


sqlplus / as sysdba


expdp \"/ as sysdba\"


有tns


sqlplus sys/"""[email protected]\r/0"""@LHRDB as sysdba

sqlplus sys/\"[email protected]\r/0\"@LHRDB as sysdba


正常密码


sqlplus sys/[email protected] as sysdba


expdp \"sys/[email protected] as sysdba\"


备注:含特殊字符密码为:[email protected]\r/0,正常密码为:lhr,tns为:LHRDB,总的原则为:密码用3个双引号括起来,或者用一个双引号括起来,然后用\将双引号进行转义   DIRECTORY=DATA_PUMP_DIR DUMPFILE=dmp_SCOTT.dmp SCHEMAS=SCOTT  reuse_dumpfiles=y



About Me


...............................................................................................................................

● 本文作者:小麦苗,只专注于数据库的技术,更注重技术的运用

● 本文在itpub(http://blog.itpub.net/26736162)、博客园(http://www.cnblogs.com/lhrbest)和个人微信公众号(xiaomaimiaolhr)上有同步更新

● 本文itpub地址:http://blog.itpub.net/26736162/viewspace-2135493/

● 本文博客园地址:http://www.cnblogs.com/lhrbest/p/6560906.html

● 本文pdf版及小麦苗云盘地址:http://blog.itpub.net/26736162/viewspace-1624453/

● QQ群:230161599     微信群:私聊

● 联系我请加QQ好友(642808185),注明添加缘由

● 于 2017-03-16 10:00 ~ 2017-03-16 22:00 在泰兴公寓完成

● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解

● 版权所有,欢迎分享本文,转载请保留出处

...............................................................................................................................

拿起手机使用微信客户端扫描下边的左边图片来关注小麦苗的微信公众号:xiaomaimiaolhr,扫描右边的二维码加入小麦苗的QQ群,学习最实用的数据库技术。

  

时间: 2024-11-09 18:05:44

【方法】Oracle用户密码含特殊字符时的登陆问题的相关文章

Oracle用户密码含有特殊字符应当如何处理

通常我们在设置Oracle密码时会将密码设置的比较复杂,一般有字母数字特殊符号组成但是在有特殊符号时,修改密码或着导入导出数据时会遇到麻烦,下文便是对该情况下的解释说明:本文以特殊符号"/"作为例子一.Linux环境,数据库为Oracle10g1.修改密码 [[email protected] oracle]$ sqlplus '/as sysdba' SQL*Plus: Release 10.2.0.1.0 - Production on Wed May 17 14:33:32 20

sqlplus连接oracle数据库--密码含特殊字符

sqlplus a/password! 登录不进数据库,下面显示的密码不是password! 然后用sqlplus  /nolog;conn a/password!可以正常连接,说明用户名和密码没问题 后来想是不是!特殊符号的问题: 尝试: sqlplus "a/password!" 还是不行,没辙了啊,什么鬼 sqlplus 'a/password!'  竟然OK了. 只能说自己基础不好吧~ 原文地址:https://www.cnblogs.com/cnmarkao/p/124249

Oracle用户密码过期和用户被锁解决方法

[原因/触发因素] 确定是由于oracle11g中默认在default概要文件中设置了"PASSWORD_LIFE_TIME=180天"所导致. [影响和风险] 影响    密码过期后,业务进程连接数据库异常,影响业务使用.    问题发生频率    数据库密码过期后,业务进程一旦重启会提示连接失败. [解决方案] 按照如下步骤进行操作: 1.查看用户的proifle是哪个,一般是default: sql>SELECT username,PROFILE FROM dba_user

oracle用户密码有@符号连接方法

oracle用户密码不小心设置了带有"@"符号,正常登陆总是无法登陆,提示无法解析的连接字符串错误,其实解决办法很简单,转义即可,示例如下: exp system/\"[email protected]\"@localhost:1521/orcl conn system/\"[email protected]\"@localhost:1521/orcl

Oracle用户密码过期问题解决

一.用户密码即将过期,导致autotrace无法打开           如果用户密码即将过期,在登录数据库时会收到如下提示:           ERROR:            ORA-28002: the password will expire within 7 days           当然,此时密码还未真正过期,用户在收到错误提示后依然可以登录数据库.但是,如果当收到密码即将过期的提示,想要开启autotrace就会有问题. SQL> conn darren/darren ER

【密码】Oracle用户密码系列

[密码]Oracle用户密码系列 1.1  BLOG文档结构图 1.2  前言部分 1.2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① 用户的9种状态含义(重点) ② 如何解锁账户 ③ 如何修改密码无效状态 ④ 如何获取密码的密文,如何利用密文修改用户的密码(重点) ⑤ 如何查询失败的登陆次数 ⑥ 11g 密码大小写问题 ⑦ 11g 密码延迟验证 ⑧ 密码复杂性校验 Tips: ① 本文在itpub(htt

oracle 用户密码原则

今天在oracle数据库中修改用户密码的时候发现了一个下面的规律 1  密码只由字母组成,创建成功 SQL> alter user ics identified by password; User changed. 2 密码只由数字组成,创建成功 SQL> alter user ics identified by 123456; User changed. 3 密码由字母+数字组成,创建成功 SQL> alter user ics identified by password123; U

技巧:如何提升Oracle用户密码的安全性

环境:Oracle 11.2.0.4 客户需求:主要背景是数据库中有很多业务用户名,且由于部分用户缺乏安全意识,甚至直接将自己的密码设置为和用户名一样,目前客户期望密码设置不要过于简单,最起码别和用户名一致或相似就好. 1.官方解决方案 2.删减版解决方案 3.测试验证方案 4.用户最近一次的登录时间 1.官方解决方案 实际上Oracle提供有一个非常好用的安全校验函数,来提升用户密码的复杂性.这个在之前的文章<Oracle 11g 安全加固>中的"1.8.数据库密码安全性校验函数&

Oracle用户密码过期的处理方法

受影响版本:Oracle11g以上版本. 导致密码消失的原因:Oracle 11g中默认的DEFAULT概要文件中口令有效期PASSWORD_LIFE_TIME默认值为180天. 当以客户端登陆Oracle提示ORA-28002,则基本可以确定登陆帐号已过有效期,使用具有DBA权限的帐号重置该帐号密码即可. 解决方法: 以下步骤以具有DBA权限用户操作 1.查看口令失效用户的profile文件 SQL>SELECT username,profile FROM dba_users; EM:服务器>