--1.查看当前监听状态:端口为1524,数据库服务名为“xe”,监听文件位置:D:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.ora
C:\Documents and Settings\IBM>lsnrctl status
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 22-1月 -2011 20:22:48
Copyright (c) 1991, 2005, Oracle. All rights reserved.
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
启动日期 22-1月 -2011 20:11:01
正常运行时间 0 天 0 小时 11 分 48 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP OFF
默认服务 XE
监听程序参数文件 D:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.ora
监听程序日志文件 D:\oraclexe\app\oracle\product\10.2.0\server\network\log\listener.log
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hanmeimei)(PORT=1524)))
服务摘要..
服务 "CLRExtProc" 包含 1 个例程。
例程 "CLRExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "PLSExtProc" 包含 1 个例程。
例程 "PLSExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "XEXDB" 包含 1 个例程。
例程 "xe", 状态 READY, 包含此服务的 1 个处理程序...
服务 "XE_XPT" 包含 1 个例程。
例程 "xe", 状态 READY, 包含此服务的 1 个处理程序...
服务 "xe" 包含 1 个例程。
例程 "xe", 状态 READY, 包含此服务的 1 个处理程序...
命令执行成功
--2.停止监听
C:\Documents and Settings\IBM>lsnrctl stop
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 22-1月 -2011 20:23:06
Copyright (c) 1991, 2005, Oracle. All rights reserved.
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
命令执行成功
--3.修改监听文件中的端口号为1524,修改后文件如下:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = hanmeimei)(PORT = 1523))
)
)
--4.修改初始化参数local_listener
C:\Documents and Settings\IBM>sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 1月 22 20:23:39 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> set linesize 1000
SQL> show parameter local_li
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=h
anmeimei)(PORT=1524))
SQL> alter system set local_listener="(ADDRESS=(PROTOCOL=TCP)(HOST=hanmeimei)(PORT=1523))";
系统已更改。
--5.重启监听
SQL> host
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\IBM>lsnrctl start
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 22-1月 -2011 20:24:32
Copyright (c) 1991, 2005, Oracle. All rights reserved.
启动tnslsnr: 请稍候...
TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
系统参数文件为D:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.ora
写入D:\oraclexe\app\oracle\product\10.2.0\server\network\log\listener.log的日志信息
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hanmeiemei)(PORT=1523)))
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
启动日期 22-1月 -2008 20:24:35
正常运行时间 0 天 0 小时 0 分 3 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP OFF
默认服务 XE
监听程序参数文件 D:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.ora
监听程序日志文件 D:\oraclexe\app\oracle\product\10.2.0\server\network\log\listener.log
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hanmeimei)(PORT=1523)))
服务摘要..
服务 "CLRExtProc" 包含 1 个例程。
例程 "CLRExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "PLSExtProc" 包含 1 个例程。
例程 "PLSExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
--6.修改完毕,使用新端口号(1523)登录测试一下:
C:\Documents and Settings\IBM>sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 1月 22 20:24:57 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>