这篇文章将为大家详细讲解有关如何监听甲骨文,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
Oracle 监听
一:没有listener.ora监听文件
监听文件listener.ora文件丢失;没有listener.ora文件情况时,以默认方式运行监听器,此时,监听器将在解析为计算机主机名(端口1521)的任何地址上进行监听;建议始终配置listener.ora文件,使Oracle Net环境可以自我记录;
[oracle@chen admin]$ pwd
/u01/app/Oracle/product/11。2 .0 .4/网络/admin
[oracle@chen admin]$ ls
样品来自没有配置listener.ora时,自动使用动态注册
[oracle@chen admin]$
lsnrctl status
适用于Linux:的LSNRCTL版本11 .2 .0 .4 .0-2017年七月20日生产15:05:25
版权所有(c) 1991年、2013年,甲骨文。保留所有权利。
正在连接到(ADdress=(PROTOCOL=TCP)(HOST=)(PORT=1521))
侦听器的状态
-
别名听众
适用于Linux:的TNSLSNR版本11.2.0.4.0版-生产
开始日期2017年七月20日15:0:54
正常运行时间0天0小时一分钟。30秒
跟踪水平
安全性:本地操作系统身份验证
简单网络管理协议关闭
监听器日志文件/u01/app/Oracle/diag/tnslsnr/Chen/监听器/警报/日志。可扩展标记语言
监听端点摘要.
(DESCRIPTION=(ADdress=(PROTOCOL=TCP)(HOST=Chen)(PORT=1521)))
服务摘要.
服务" orcl "有一个实例。
实例“orcl”,状态为 READY,对此服务有一个处理程序.
服务" orclXDB "有一个实例。
实例orcl ',状态
READY有一名处理员负责这项服务.
命令成功完成
二:监听静态注册
[oracle@chen admin]$ pwd
/u01/app/Oracle/product/11。2 .0 .4/netwo
rk/admin
[oracle@chen admin]$ cat listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0.4)
(SID_NAME = orcl)
)
)
静态注册时:
可以远程启动数据库(需要有口令文件);
C:\Users\Administrator>sqlplus sys/oracle@10.1.233.100:1521/orcl as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on 星期四 7月 20 13:33:09 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
已连接到空闲例程。
SQL>
startup
ORACLE 例程已经启动。
Total System Global Area 839282688 bytes
Fixed Size 2257880 bytes
Variable Size 545262632 bytes
Database Buffers 289406976 bytes
Redo Buffers 2355200 bytes
数据库装载完毕。
数据库已经打开。 [oracle@chen admin]$ lsnrctl status
.....
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=chen)(PORT=1521)))
Services Summary...
Service "orcl" has 2 instance(s).
Instance "orcl", status
UNKNOWN, has 1 handler(s) for this service...
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
配置DG,EM等建议使用静态注册
三:监听动态注册
[oracle@chen admin]$ cat listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = chen)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SQL> alter system register;
System altered.
[oracle@chen admin]$ lsnrctl status
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status
READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status
READY, has 1 handler(s) for this service...
The command completed successfully
实例未启动时,注册不了服务
Services Summary...
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=chen)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
动态注册时无法远程启动数据库
C:\Users\Administrator>sqlplus sys/oracle@10.1.233.100:1521/orcl as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on 星期四 7月 20 14:26:57 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务
请输入用户名:
四:监听动态注册+静态注册
[oracle@chen admin]$ cat listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0.4)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = chen)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
[oracle@chen admin]$ lsnrctl status
......
Services Summary...
Service "orcl" has 2 instance(s).
Instance "orcl", status
UNKNOWN, has 1 handler(s) for this service...
Instance "orcl", status
READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status
READY, has 1 handler(s) for this service...
The command completed successfully
可以远程启动数据库
C:\Users\Administrator>sqlplus sys/oracle@10.1.233.100:1521/orcl as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on 星期四 7月 20 14:22:59 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
已连接到空闲例程。
SQL>
startup
ORACLE 例程已经启动。
Total System Global Area 839282688 bytes
Fixed Size 2257880 bytes
Variable Size 545262632 bytes
Database Buffers 289406976 bytes
Redo Buffers 2355200 bytes
数据库装载完毕。
数据库已经打开。官方文档位置如下:
Oracle Database Net Services Reference
http://docs.oracle.com/cd/E11882_01/network.112/e10835/listener.htm#NETRF008
Oracle Net Listener Parameters (listener.ora)
http://docs.oracle.com/cd/E11882_01/network.112/e10835/listener.htm#NETRF008
关于“如何监听Oracle”这篇文章就分享到这里了,希望
内容来源网络,如有侵权,联系删除,本文地址:https://www.230890.com/zhan/129598.html