Oracle9i重启监听一步搞定(oracle9i重启监听)

Oracle9i重启监听:一步搞定

作为一名Oracle数据库管理员,我们经常需要处理各种数据库问题,其中重启监听是比较常见的一种操作。本文将介绍一种简单、快捷的方法来实现Oracle9i重启监听。

我们需要登录到数据库服务器,以SYSDBA身份连接到Oracle数据库。登录成功后,我们需要先确认监听的状态,可以通过以下命令查看:

LSNRCTL> status

如果监听状态正常,则可以直接重启监听。如果监听状态异常,则需要根据异常情况进行处理。

重启监听的命令如下:

LSNRCTL> stop
LSNRCTL> start

执行上述命令后,我们需要等待一段时间,以确保监听已经启动。如果在启动过程中遇到问题,则需要根据错误提示进行处理。

以下是一份示例代码:

[oracle@database ~]$ sqlplus / as sysdba
SQL*Plus: Release 9.2.0.1.0 - Production on Tue Aug 10 09:12:01 2021

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> alter system set LOCAL_LISTENER='(ADDRESS = (PROTOCOL = TCP)(HOST = database.example.com)(PORT = 1521))' scope=both;

System altered.

SQL> alter system register;

System altered.

SQL> exit

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

[oracle@database ~]$ lsnrctl status

LSNRCTL for Linux: Version 9.2.0.1.0 - Production on 10-AUG-2021 09:13:46

Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 9.2.0.1.0 - Production
Start Date 10-AUG-2021 09:08:54
Uptime 0 days 0 hr. 4 min. 55 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/product/9.2/network/admin/listener.ora
Listener Log File /home/oracle/product/9.2/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=database.example.com)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@database ~]$ lsnrctl stop

LSNRCTL for Linux: Version 9.2.0.1.0 - Production on 10-AUG-2021 09:14:02

Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
[oracle@database ~]$ lsnrctl start

LSNRCTL for Linux: Version 9.2.0.1.0 - Production on 10-AUG-2021 09:14:15

Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.

Starting /home/oracle/product/9.2/bin/tnslsnr: please wt...

TNSLSNR for Linux: Version 9.2.0.1.0 - Production
System parameter file is /home/oracle/product/9.2/network/admin/listener.ora
Log messages written to /home/oracle/product/9.2/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=database.example.com)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 9.2.0.1.0 - Production
Start Date 10-AUG-2021 09:14:15
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/product/9.2/network/admin/listener.ora
Listener Log File /home/oracle/product/9.2/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=database.example.com)(PORT=1521)))
The listener supports no services
The command completed successfully

重启Oracle9i监听的方法非常简单,只需运行几个命令即可完成。但是,在执行时要注意相关错误提示,遇到问题需要及时处理。同时,建议备份数据库相关数据,以免意外事故发生。


数据运维技术 » Oracle9i重启监听一步搞定(oracle9i重启监听)