Oracle数据库监听注册完美指南(oracle监听注册)

Oracle数据库监听注册是Oracle数据库用户学习和使用的前提。与其他数据库管理系统类似,Oracle数据库的监听注册的正确性决定了Oracle数据库的使用。以下是Oracle数据库产品的完美监听注册指南,以便用户可以依据指南进行指导,使用Oracle数据库监听注册的方法。

首先,Oracle数据库的监听器注册是由Oracle数据库的安装程序自动完成的,因此Oracle数据库的安装首先需要完成。安装好Oracle数据库之后,数据库管理员就可以开始进行其他数据库设置了。要将Oracle监听器注册到数据库,需要使用lsnrctl工具,如下代码:

$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 02-JAN-2013 17:12:31

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Starting /opt/oracle/product/11.2.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /opt/oracle/product/11.2.0/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/unknown-linux/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=unknown-linux)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=unknown-linux)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 02-JAN-2013 17:12:31
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/unknown-linux/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=unknown-linux)(PORT=1521)))
The listener supports no services
The command completed successfully

然后,需要编辑listener.ora文件,也就是监听器参数文件,此文件包含有关监听器的所有信息,例如服务器端口号,监控密码等,如下实例:

LISTENER = 
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)

ADR_BASE_LISTENER = /opt/oracle

在编辑完listener.ora文件之后,需要使用lsnrctl重新启动监听器,如下所示:

$ lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 02-JAN-2013 17:12:31

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=unknown-linux)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=unknown-linux)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 02-JAN-2013 17:12:31
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /opt/oracle/diag/tnslsnr/unknown-linux/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=unknown-linux)(PORT=1521)))
The listener supports no services

The command completed successfully

最后,在完成监听器注册后,可以使用以下四个lsnrctl命令来管理它:

1、lsnrctl start:用于启动监听器

2、lsnrctl stop:用于停止监听器

3、lsnrctl status:用于检查监听器状态

4、lsnrctl reload:重新加载listener.ora文件

以上就是Oracle数据库监听注册完美指南,希望该指南对Oracle数据库用户有所帮助,能够更好地了解Oracle数据库监听注册,更好地使用监听器管理Oracle数据库。


数据运维技术 » Oracle数据库监听注册完美指南(oracle监听注册)