ORA-12505, TNS:listener does not currently know of SID given in connect descriptor. Eclipse and Fedora 20 via JDBC

前端 未结 3 615
梦如初夏
梦如初夏 2020-12-11 10:19

I\'ve installed Oracle 11g XE on a Fedora 20 Virtual Machine, configured it and set the enviroment variables (running the oracle_env.sh). I\'ve got this error w

相关标签:
3条回答
  • 2020-12-11 10:51

    This sounds like your database is trying to register using the wrong IP address to contact the listener. Your listener is configured to listen on 192.168.88.134, but perhaps the DB is assuming localhost (127.0.0.1), or an old IP value if the configuration has ever changed.

    By default the database will attempt to register against the server's external host name (the default when local_listener is blank), but you may be getting an unexpected value from that - so what is in /etc/hosts for the machine name matters. Whatever has caused that, registration seems to be failing.

    You can explicitly tell the DB to register using the actual listener address:

    alter system set local_listener = '192.168.88.134:1521' scope=memory;
    alter system register;
    

    If that works and lsnrctl services now shows XE, then repeat the set command with scope=both to make it stick on the next DB restart.

    0 讨论(0)
  • 2020-12-11 10:52

    In your listener.ora:

    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.134)(PORT = 1521))

    Usually here by default there is a hostname instead of IP address. Did you do something special so that you have that IP there (192.168.88.134)?

    0 讨论(0)
  • 2020-12-11 10:59

    Troubleshooting:

    1. remove listener.ora (for this initial setup, you don't need it. make a backup of it)
    2. lsnrctl reload

    or

    add XE to your SID_LIST like:

    SID_LIST_LISTENER = 
      (SID_LIST = 
         (SID_DESC =
           (SID_NAME = XE)
           (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
         )    
         (SID_DESC = 
          (SID_NAME = PLSExtProc) 
          (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe) 
          (PROGRAM = extproc) 
        ) 
      )
    

    lsnrctl reload

    check the alert log for messages.

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