由于修改计算机名字,使得oracle无法找到主机,因此无法启动监听。
两种解决方法:
1.改回原来的名字,要一模一样。这个方法简单,但是可能不适合某些时候。
2.修改listener.ora文件,tnsnames.ora可能也需要修改
---修改之前的文件listener.ora----------------------
# listener.ora Network Configuration File: F:\app\Administrator\product\11.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = xu)(PORT = 1521))
)
)
---上面的HOST = xu,xu是之前的计算机名,修改之后这里找不到了,所以需要修改成现在的名字。
---修改之后的文件listener.ora-----------------------
# listener.ora Network Configuration File: F:\app\Administrator\product\11.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = newname)(PORT = 1521))
)
)
---这里仅仅修改了HOST的名字------------------------
--另外一个可能需要修改的文件tnsnames.ora----------------------------------
# tnsnames.ora Network Configuration File: F:\app\Administrator\product\11.1.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
YSU =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ysu)
)
)
--如果上面的HOST = xu,那么需要修改为现在的newname
--因为上面HOST使用的localhost(本机地址,修改电脑名不影响他),所以这里不需要修改,这里也可以在Net Manager里面修改