zoukankan      html  css  js  c++  java
  • ORA-12532、ORA-12154 SQLPLUS登陆时密码带@怎么办

    都是@惹的祸,要么就别用这个符号作为密码。曾经遇到过就小结一下
    先创建一个带@的密码。创建就失败,加双引号成功。
    [oracle@test59 ~]$ sqlplus / as sysdba
    sys@testa(5634)> alter user test identified by qwer@1234;
    alter user test identified by qwer@1234
    *
    ERROR at line 1:
    ORA-00922: missing or invalid option
    Elapsed: 00:00:00.01
    sys@testa(5634)> alter user test identified by "qwer@1234";
    User altered.
    Elapsed: 00:00:00.01

    连接失败
    sys@testa(5634)> conn test/qwer@1234
    ERROR:
    ORA-12532: TNS:invalid argument
    Warning: You are no longer connected to ORACLE.
    sys@testa(5634)> exit

    加双引号连接成功
    [oracle@test59 ~]$ sqlplus / as sysdba
    sys@testa(5634)> conn test/"qwer@1234"
    Connected.
    Session altered.
    Elapsed: 00:00:00.00
    test@testa(5634)> show user;
    USER is "TEST"
    test@testa(5634)> exit

    直接连接也失败
    [oracle@test59 ~]$ sqlplus test/"qwer@1234"@testa
    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified
    Enter user-name:
    ERROR:
    ORA-01017: invalid username/password; logon denied
    Enter user-name:
    ERROR:
    ORA-01017: invalid username/password; logon denied
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

    正确连接姿势
    [oracle@test59 ~]$ sqlplus 'test/"qwer@1234"'@testa
    Session altered.
    Elapsed: 00:00:00.01
    test@testa(9389)> show user;
    USER is "TEST"
    test@testa(9389)>

    总结:@符号是一个特殊的存在,在登陆时@后面通常接的是数据库名称,所以在sqlplus 或 conn 时会有异常,可以通过加双引号的方式将其视为一个字符串。最好的避免方式是不要在密码里出现@符号

  • 相关阅读:
    了解及使用IPV6
    天气预报API(六):中国气象频道、腾讯天气--“新编码”接口的测试
    天气预报API(五):城市代码--“新编码”和“旧编码” 对比
    天气预报API(三):免费接口测试(“旧编码”)
    nginx 配置反向代理和静态资源
    centos 7 安装mysql5.7
    java 重新学习 (四)
    java 重新学习 (三)
    java 重新学习 (二)
    h5唤醒手机拨打电话
  • 原文地址:https://www.cnblogs.com/ritchy/p/14918925.html
Copyright © 2011-2022 走看看