zoukankan      html  css  js  c++  java
  • TNS:no listener error in Oracle XE after changing computer name

    This morning at work when trying to log on to my computer I noticed not my username on login screen but the "admin". Well network IT guys were doing their job setting up their stuff. I changed login to my name and logged in successfully. All was fine until I tried to connect to my local Oracle XE database from my PHP application I was developing. Connection to Oracle on my Windows machine failed with error TNS:no listener.

    What settings needs to be adjusted in Oracle XE after changing computer name on Windows.

    tested to connect to Oracle in CMD using $ sqlplus - all good so database itself was running. So it must be just the listener, which is a separate process that runs on the database server computer, receives incoming client connection requests and manages the traffic of these requests to the database server. I tested listener then $ lsnrctl - tried commands status, start, something was not right ... then I realised the network IT guys must have changed something. Wait, I see, they changed my computer name from VLAD-PC to PC05.

    That's it. Computer name is set as HOST in two Oracle config files: tnsnames.ora and listener.ora located somewhere like: C:oraclexeapporacleproduct11.2.0server etworkADMIN.

    Edit both files (run notepad as administrator) and replace old computer name by new one (in my case VLAD-PC in my case by PC05).

    Restart Oracle XE - from Start menu for Oracle Express Edition Start Stop Database and Start Database.

    Luckily I had this experience before so fixing did not take long time but still took me some time to find out which files needs to be fixed. Finally I do have this blog which helps me next time and hope helps others too.

  • 相关阅读:
    简单字符串处理应避免使用正则表达式
    提高正则表达式的可读性
    用零宽度断言匹配字符串中的特定位置
    避免不必要的回溯
    预编译正则表达式
    用Text::CSV_XS模块处理csv文件
    Ack 类似grep一样的查找
    Apache压力测试
    仅编译正则表达式一次
    排序上下箭头的是实现
  • 原文地址:https://www.cnblogs.com/sos-blue/p/3399120.html
Copyright © 2011-2022 走看看