Oracle 静态监听注冊具体解释

网上有非常多关于oracle 监听静态注冊的文章。但大多都是简单说说,并没有具体的样例。这里,将结合linux as4 下的oracle 10gR2.0.1 举一个具体的样例

1、在 $ORACLE_HOME/network/admin/listener.ora 文件里增加一个静态注冊的节点

[oracle@prudent oracle]$ cd $ORACLE_HOME/network/admin
[oracle@prudent admin]$ vi listener.ora
# listener.ora Network Configuration File: /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /mydatafile2/app/oracle/oracle/product/11.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = ORCL)
(ORACLE_HOME = /mydatafile2/app/oracle/oracle/product/11.2.0/db_1)
(GLOBAL_DBNAME=WOO.COM)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = prudent)(PORT = 1521))
)
)

注意这里的GLOBAL_DBNAME=WOO.COM

SID_NAME=ORCL 

这个SID_NAME 应与你对外提供服务的 $ORACLE_SID 一致

[oracle@prudent admin]$ echo $ORACLE_SID
ORCL

2、配置相应的tnsnames.ora 中的节点

[oracle@prudent admin]$ vi tnsnames.ora
# tnsnames.ora Network Configuration File: /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prudent)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
)
) WOOORCL=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prudent)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = WOO.COM)
)
)

tnsname WOOORCL 中的 SERVICE_NAME=WOO.COM

这里的服务名为 WOO.COM 而不是通常的 ORCL,由于在 listener.ora 中已经注冊了 WOO.COM,lsnrctl 启动时会监听 WOO.COM 。并相应到 SID_NAME=ORCL 上。



3、启动监听和服务

[oracle@prudent oracle]$ cat dbstart
lsnrctl start
sqlplus /nolog <<EOF
connect /as sysdba
startup
EOF
[oracle@prudent oracle]$ ./dbstart
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 13-FEB-2011 20:11:15
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prudent)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 13-FEB-2011 20:11:15
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prudent)(PORT=1521)))
Services Summary...
Service "WOO.COM" has 1 instance(s).
Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
SQL*Plus: Release 11.2.0.1.0 - Production on Sun Feb 13 20:11:16 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> Connected to an idle instance.
SQL> ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.
Total System Global Area 461373440 bytes
Fixed Size 1220000 bytes
Variable Size 75498080 bytes
Database Buffers 381681664 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

能够看到  

Service "WOO.COM" has 1 instance(s).

  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...

正在被监听。

4、验证该服务能够到达

[oracle@prudent oracle]$ tnsping WOOORCL
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 13-FEB-2011 20:14:59
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
/mydatafile2/app/oracle/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = prudent)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = WOO.COM)))
OK (10 msec)

5、利用静态注冊的服务登入oracle

[oracle@prudent oracle]$ sqlplus system/oracle@WOOORCL
SQL*Plus: Release 11.2.0.1.0 - Production on Sun Feb 13 20:17:27 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to:
Oracle Database 10g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select count(*) from date_log;
COUNT(*)
----------
SQL>

至此:已验证该静态注冊能够成功的被解析,监听,连接。

Oracle 静态监听注冊具体解释的更多相关文章

  1. Oracle静态监听与动态监听概念全解析

    基于11g,linux5.5做出的测试,单实例数据库做出的测试. 1.注册 Instance到监听器去注册自己的Instance_name与ORACLE_HOME,还可以选择添加global_dbna ...

  2. Oracle静态监听和动态监听

    一.静态注册 静态注册指实例启动时读取listener.ora配置文件,将实例和服务注册到监听程序.无论何时启动一个数据库,默认都有两条信息注册到监听器中:实例和服务.SID_LIST_LISTENE ...

  3. Oracle体系结构之Oracle静态监听配置模板

    1.监听程序配置:[oracle@localhost admin]$ vim listener.ora# listener.ora Network Configuration File: /u01/a ...

  4. 配置静态监听解决ORA-12514错误的案例(转)

    今天做Linux下DG配置的时候,遇到一个现象,tnsname.ora文件配置都正常,tnsping也正常,监听也正常,但是仍然报ORA-12514错误:   SQL> set lin 130 ...

  5. 问题1:Oracle数据库监听启动失败(重启监听,提示The listener supports no services)

    编辑监听文件:/home/DB/oracle/11gR2/db/network/admin/listener.ora 在文件内添加静态监听实例,如下内容: SID_LIST_LISTENER =(SI ...

  6. 配置静态监听解决ORA-12514错误的案例

    今天做Linux下DG配置的时候,遇到一个现象.tnsname.ora文件配置都正常,tnsping也正常,监听也正常.可是仍然报ORA-12514错误: SQL> set lin 130 pa ...

  7. Oracle修改监听端口号1521[转]

    在oracle中,默认的监听端口号为1521,一旦有人扫描出这个端口号就会知道此服务器为oracle数据库服务器,存在极其大的安全隐患,在这里,教大家如何修改oracle默认端口号为9999: 1.查 ...

  8. Oracle 数据库监听配置和服务

    -- 补充说明 如果要远程连接192.168.10.44上的oracle,那么192.168.10.44服务器必须启动TNSListener.(配置文件 listener.ora) PLSQL Dev ...

  9. Oracle修改监听端口教程

    Oracle默认监听端口1521,一众扫描器通常通过探测1521端口是否开启来探测是否存在Oracle服务,如果修改默认监听端口在一定程度上可以提升数据库和主机的安全性. 比如这里我们修改成2521为 ...

随机推荐

  1. SSH Secure Shell Client连接centos6.5时中文字乱码处理

    在学习Linux的过程中,最先碰到的是通过SSH终端连接时发现有乱码出现,使用这篇文章先从这里说起. 在 ssh , telnet 终端中文显示乱码解决办法#vim /etc/sysconfig/i1 ...

  2. Less文件的建立

    1.打开DreamWeaver 2.选择 新建 Less       文件名为.less,保存于Less文件夹中 3.声明文档头:@charset "utf-8"; 4.将Less ...

  3. ScrollView在调试状态一点击就挂的原因(OnMouseActivate)

    这几天做的一个任务是做一个Dialog,需要在这个Dialog中添加一个自定义的CSrollvew类,但是遇到一个比较扯淡的问题,程序直接运行时可以的,调试状态下一点击CSrollview就挂了.而且 ...

  4. cmd 启动mysql环境变量配置

    win10系统:(其他系统类似,改环境变量就可以) 1.我的电脑,右键选择属性,进入系统页面 2.点击高级系统设置,进入系统属性页面 3.点击高级选项卡,点击环境变量,进入环境变量设置 4.选择系统变 ...

  5. Python三方库xlrd,xlwd-Excel读写

    恩,我是翻译汪,主要内容来自http://www.python-excel.org/ 在xlrd,xlwt这两个库中,Excel的结构表示为workbook整个Excel对象,sheet工作表,row ...

  6. windows编译MaskRCNN

    1.代码修改为3.0语言版本 2.setup_windows.py 文件内容为 #!/usr/bin/env python import numpy as np import os # on Wind ...

  7. 通过python xlsxwriter模块生成EXCEL柱状图、饼图

    xlsxwriter模块不是python自带的,使用pip下载 import xlsxwriter #新建一个excel文件,起名为expense01.xlsx workbook = xlsxwrit ...

  8. 创建全局函数 匹配查找 std::map

    std::map<CString, CString> m_NameToType; 所有文件之外声明一个函数 在要用到的地方  加入存储的东西 extern std::map<CStr ...

  9. HTML5轻松实现全屏视频背景

    想在你的网页首页中全屏播放一段视频吗?而这段视频是作为网页的背景,不影响网页内容的正常浏览.那么我告诉你有一款Javascript库正合你意,它就是Bideo.js. 参考网址: https://ww ...

  10. 2018年为什么要学习Linux?Linux运维的前景还好吗?

    Linux一直是很多人入行IT的首选,无论是从入行难度还是职业寿命来说,Linux运维都比开发有着更大的优势.为了得到高薪工作,很多人在Linux学习过程中付出了非常大的努力,最终也得到了不错的收获. ...