Oracle用户密码中含有特殊字符的登录办法

在日常工作中如果遇到密码含有特殊字符的情况,使用sqlplus,expdp等工具进行登陆时可能会遇到各种麻烦。

比如下面的:
SQL> alter user user1 identified by "a@(^_^)p!";
User altered.
SQL> exit

oracle@lzstix0itest12:~> sqlplus user1/"a@(^_^)p!"
-bash: !": event not found

SQL> conn user1/"a@(^_^)p!"
ERROR:
ORA-12560: TNS:protocol adapter error

下面记录下解决办法,以备不时之需
1.如果客户端是Linux或Unix平台,则可以采用下面的方法,用单引号将用户名和密码括起来

oracle@testtest12:~> sqlplus 'user1/"a@(^_^)p!"'@test
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>    

2. 如果客户端是 Windows 平台,则可以采用下面的方法,在密码的前后加3个“双引号

C:\Users>sqlplus user1/"""a@(^_^)p!"""@test
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26753337/viewspace-2131808/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26753337/viewspace-2131808/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值