一、找到监听文件,添加红色部分代码即可,如下:
# listener.ora Network Configuration File: E:\oracle\product\10.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\product\10.1.0\db_1)
(PROGRAM = extproc)
)
[color=red](SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = E:\oracle\product\10.1.0\db_1)
)[/color]
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
)
二、执行命令
C:\Documents and Settings\Administrator>lsnrctl stop
.
.
.
C:\Documents and Settings\Administrator>lsnrctl start
若出现如下图所示错误
[img]http://dl2.iteye.com/upload/attachment/0113/5140/6466f058-a1f7-37f2-a397-f4f0b35e8cfe.png[/img]
或
[img]http://dl2.iteye.com/upload/attachment/0113/5142/c71bba7b-acc8-3358-a3e4-579a6ca346b1.png[/img]
可能是文件
E:\oracle\admin\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
E:\oracle\admin\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora
中的IP地址填写错误!
# listener.ora Network Configuration File: E:\oracle\product\10.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\product\10.1.0\db_1)
(PROGRAM = extproc)
)
[color=red](SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = E:\oracle\product\10.1.0\db_1)
)[/color]
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
)
二、执行命令
C:\Documents and Settings\Administrator>lsnrctl stop
.
.
.
C:\Documents and Settings\Administrator>lsnrctl start
若出现如下图所示错误
[img]http://dl2.iteye.com/upload/attachment/0113/5140/6466f058-a1f7-37f2-a397-f4f0b35e8cfe.png[/img]
或
[img]http://dl2.iteye.com/upload/attachment/0113/5142/c71bba7b-acc8-3358-a3e4-579a6ca346b1.png[/img]
可能是文件
E:\oracle\admin\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
E:\oracle\admin\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora
中的IP地址填写错误!