TNSPING OK but sqlplus gives ORA-12154?

后端 未结 3 1645
别跟我提以往
别跟我提以往 2020-12-10 03:43

I have Oracle 11 running on a Windows server and I\'m logged onto the same server trying to use SQL Plus. When I try to connect I get a ORA-12154 even though TNSPING and var

相关标签:
3条回答
  • 2020-12-10 03:47

    Create an environment variable TNS_ADMIN that points to the directory where your tnsnames.ora file resides. Then try to connect with sqlplus.

    If that works, then my guess is you maybe installed the Oracle client software too, and when you run sqlplus, it looks for the tnsnames.ora file in your client home.

    -- Instructions for Adding the Environment variable TNS_ADMIN in windows
    1. Go to control panel / system
    2. select Advanced system settings
    3. Select "Advanced" tab, and the environment variable button is at the bottom.
    4. create new variable TNS_ADMIN and give the path where the .ora files are stored. e.g. C:\app\oracle\product\11.2.0\client_1\network\admin

    0 讨论(0)
  • 2020-12-10 04:09

    Sqlplus will give this error if you have an at-sign (@) in your password, which you do. Sqlplus thinks you are inputting the connection string as a parameter. Change your password (you can do this with SQL Developer).

    Moral: Don't use at-signs in Oracle passwords.

    0 讨论(0)
  • 2020-12-10 04:13

    tnslsnr is up but database is down.

    Check that database is running

    ps aux | fgrep pmon
    

    If there are no such a process, try to start database manually

    su - oracle
    export ORACLE_SID=XE
    sqlplus sys as sysdba
    

    And then in sql console

    startup
    
    0 讨论(0)
提交回复
热议问题