- 浏览: 1321217 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (351)
- Java General (37)
- .net General (2)
- Linux Toy (55)
- Oracle (81)
- Mysql (11)
- Programer Career (12)
- Oh, my living ! (2)
- Shell Script (8)
- Web Service (0)
- Linux Server (22)
- Php/Python/Perl (3P) (2)
- Javascript General (5)
- Saleforce Apex Dev (2)
- Web General (5)
- Xen & VM tech. (17)
- PSP (13)
- OpenSolaris (34)
- php (1)
- RAI/flex/action script (16)
- asterisk/CTI (7)
- 交互设计 (6)
- English (3)
- Lucene (1)
最新评论
-
GuolinLee:
markmark
JVM调优总结 -Xms -Xmx -Xmn -Xss -
di1984HIT:
写的太好啊。
JVM调优总结 -Xms -Xmx -Xmn -Xss -
javajdbc:
javajdbc 写道
JVM调优总结 -Xms -Xmx -Xmn -Xss -
javajdbc:
...
JVM调优总结 -Xms -Xmx -Xmn -Xss -
alvin198761:
非常感谢,国外的被封杀了,你这里还有一份
How to Convert An Image-Based Guest To An LVM-Based Guest
042 第23题 关于动态注册监听器
23.Your database is started with SPFILE. You want the database instance to be dynamically
registered with a listener L2 with the following details:
Protocol: TCP
Host: indl151e
Port: 1525
Which is the correct order of the steps that you would follow to achieve this?
1. Set the LOCAL_LISTENER parameter to L2 dynamically.
2. Make an entry for L2 in tnsnames.ora on the database server.
3. Restart L2.
4. Modify the listener.ora file to add the instance name in SID_LIST of L2.
A: 1, 2, 4, 3
B: 1, 2, 3; 4 is not required.
C: 2, 1; 3 and 4 are not required.
D: 1, 2; 3 and 4 are not required.
Oracle Default Listener
by Nidhi Jain
Prior to Oracle 8i, a listener was statically configured (listener.ora) to service a given set of SIDs. From 8i, PMON dynamically registers a database service with the listener.Further, if the listener is running on the default TCP port of 1521, then there is no need to configure a listener.ora at all.
USING A DEFAULT LISTENER
A listener.ora file is not required in order to use the default listener.
The listener is started in the conventional manner:
$lsnrctl start
This listener will listen on two addresses:
(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)) (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
In order to change parameters to non default values (such as enabling listener tracing), a listener.ora should be created with the relevant parameters specified. The listener then needs to be restarted.
By default, PMON will register the database service with the listener on port 1521.
USING A NON DEFAULT LISTENER
When a non-default listener is used, then a listener.ora must be configured with the relevant listener address. For example,
LISTENER =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL=TCP) (HOST=uksn115) (PORT=2500))
)
This would start a listener on port 2500.
In order for PMON to be able to register the database service(s) with this listener, the init.ora parameter LOCAL_LISTENER must be set.
eg, LOCAL_LISTENER=listener_A
PMON will attempt to resolve LOCAL_LISTENER using some naming method. For example, this may be resolved in tnsnames.ora, as follows:
listener_A =
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)(HOST=uksn155)(PORT=2500))
)
PMON will search for tnsnames.ora in the following order:
- $HOME/.tnsnames.ora
- $TNS_ADMIN/tnsnames.ora
- /var/opt/oracle/tnsnames.ora or /etc/tnsnames.ora (depending on platform)
- $ORACLE_HOME/network/admin/tnsnames.ora
If a tnsnames.ora cannot be found or if LOCAL_LISTENER cannot be resolved, the alert.log will show:
PMON started with pid=2 Syntax error in listener string
If LOCAL_LISTENER can be resolved, but there is a syntax error in the tnsnames.ora specification, the alert log will show:
PMON started with pid=2 Syntax error in listener string (DESCRIPTION =)
The instance will start regardless of PMON errors during registration, unless MTS is enabled. If MTS enabled, then both of the above error scenarios will give:
ORA-00101: invalid specification for system parameter MTS_DISPATCHERS
in addition to the relevant alert log message. The instance will not start.
Note that if 'NAMES.DEFAULT_DOMAIN' is set in sqlnet.ora, then the tnsnames.ora entry should be of the form NAME.DOMAIN. The domain will be appended to LOCAL_LISTENER if not already specified.
eg,
init.ora: LOCAL_LISTENER=listener_A (or listener_A.uk.oracle.com) sqlnet.ora: NAMES.DEFAULT_DOMAIN=uk.oracle.com tnsnames.ora: listener_A.uk.oracle.com=(...)
The search order for the 'system' sqlnet.ora is:
- $TNS_ADMIN/sqlnet.ora
- $ORACLE_HOME/network/admin/sqlnet.ora
Additionally, the 'local' sqlnet.ora is always read from:
- $HOME/.sqlnet.ora
If this file exists, then any parameters defined here will override the ones in the 'system' sqlnet.ora.
Note, /etc or /var/opt/oracle is not searched for the 'system' sqlnet.ora unless TNS_ADMIN happens to be set to this directory.
WHAT INFO IS REGISTERED?
The easiest way to check the information registered by PMON is to enable level 16 (SUPPORT) listener tracing.
Oracle 8.1.5 Registration
In 8.1.5, the listener trace shows that the 'register' command is actually a CONNECT packet. This is of the form:
(CONNECT_DATA= (COMMAND=service_register) ... (SERVICE=) ... (INFO=LOCAL SERVER) (DISPLAY=DEDICATED SERVER) (GLOBAL_NAME=.) ... (ENVS='') .... )
Oracle 8.1.6 Registration
In 8.1.6, this process has changed slightly. PMON initiates registration by sending the following CONNECT packet
(CONNECT_DATA= (COMMAND=service_register_NSGR) )
The listener responds with an ACKnowledgement. PMON and the listener then exchange DATA packets to complete the registration.
Compatibility
The listener is backwards compatible. Therefore, an 8.1.5 instance can register with a 8.1.6 listener.
However, it is not possible to register an 8.1.6 instance with an 8.1.5 listener. This is due to the 8.1.5 listener not recognising the 'service_register_NSGR' command.
This can be seen from a listener trace:
... (CONNECT_DATA= (COMMAND=service_register_NSGR) ) <-- extracted from packet dump nscon: got NSPTCN packet <-- a CONNECT packet is rxed ... nsglfc: The command was not recognized ... nscon: sending NSPTRF packet <-- a REFUSE packet is sent
SPECIFYING MULTIPLE LOCAL_LISTENERS
Multiple LOCAL_LISTENERs can be specified in one of two ways in the init.ora:
- local_listener=listener_A, listener_B
- local_listener=listener_A
local_listener=listener_B
In both cases, v$parameter will show: local_listener=listener_A, listener_B
PMON will register ONLY with the listener that appears first in the v$parameter value for local_listener (ie, listener_A in the above).
The correct method is to specify one local_listener in the init.ora, and to specify multiple listener ADDRESSes in the connect descriptor.
For example,
init.ora: local_listener=all_listeners tnsnames.ora: all_listeners.uk.oracle.com= (DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=2500)) (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=2600)) )
In non-MTS mode, all listeners must be on the same host as the instance (unless pre-spawned servers are used on the remote host). However, even in dedicated mode and no pre-spawned servers, PMON still registers with listeners on another node. But this does not make any sense, as the remote listener will not be able to fork/exec oracle.
Registration in an MTS Environment
Service registration is more flexible if the instance is running in MTS mode. For example,
- PMON can register services with listeners on more than one node
- the dispatchers can register with a different listener than dedicated services
- different dispatchers can register with different listeners
This is illustrated by way of the following examples.
Example 1
init.ora on host1:
local_listener=all_listeners mts_dispatchers="(protocol=tcp)"
tnsnames.ora on host1:
all_listeners.uk.oracle.com= (DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=2500)) (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=2600)) )
output of 'lsnrctl services':
host1, listener on port 2500: ----------------------------- Services Summary... V816 has 2 service handler(s) DEDICATED SERVER established:0 refused:0 LOCAL SERVER DISPATCHER established:0 refused:0 current:0 max:1022 state:ready D000 (ADDRESS=(PROTOCOL=tcp)(HOST=host1)(PORT=59155))
host1, listener on port 2600:
Services Summary... V816 has 2 service handler(s) DEDICATED SERVER established:0 refused:0 LOCAL SERVER DISPATCHER established:0 refused:0 current:0 max:1022 state:ready D000 (ADDRESS=(PROTOCOL=tcp)(HOST=host1)(PORT=59155))
In this case, the dispatcher has registered with the listeners specified by the local_listener parameter.
Example 2
init.ora on host1:
mts_dispatchers="(protocol=tcp)(listener=listener_host2.uk.oracle.com)" local_listener=listener_host1.uk.oracle.com
tnsnames.ora on host1:
listener_host2.uk.oracle.com= (DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=host2)(PORT=2500)) ) listener_host1.uk.oracle.com= (DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=2500)) )
output of 'lsnrctl services':
host1:
Services Summary... Nov10 has 1 service handler(s) DEDICATED SERVER established:0 refused:0 LOCAL SERVER
host2:
Services Summary... V816 has 1 service handler(s) DISPATCHER established:0 refused:0 current:0 max:1022 state:ready D000 (ADDRESS=(PROTOCOL=tcp)(HOST=host1)(PORT=59165))
In this case, the dispatcher explicitly registers with a different listener than the one for the dedicated service.
Example 3
init.ora on host1:
mts_dispatchers="(protocol=tcp)(listener=listenerA.uk.oracle.com)" local_listener=all_listeners
tnsnames.ora on host1:
all_listeners.uk.oracle.com= (DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=2500)) (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=2600)) ) listenerA.uk.oracle.com= (DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=2600)) )
output of 'lsnrctl services':
host1, listener on port 2500:
Services Summary... V816 has 1 service handler(s) DEDICATED SERVER established:0 refused:0 LOCAL SERVER
host1, listener on port 2600:
Services Summary... V816 has 2 service handler(s) DEDICATED SERVER established:0 refused:0 LOCAL SERVER DISPATCHER established:0 refused:0 current:0 max:1022 state:ready D000 (ADDRESS=(PROTOCOL=tcp)(HOST=host1)(PORT=59160))
This illustrates that the 'listener=' part of mts_dispatchers overrides local_listener when registering dispatchers.
Static Info Overwrite
If a listener.ora is used, and a SID_DESC entry exists for an instance, the data within the SID_DESC section is referred to as 'static information' for that instance.
In 8.1.6, all static information in the listener.ora is overwritten when the instance is dynamically registered with the listener.
Therefore, any environment variables set within the listener.ora will not be visible unless the variable is set in the environment used to start the instance (and thus inherited by PMON).
This behaviour is different from 8.1.5. In 8.1.5, the existance of a SID_DESC section results in the listener NOT registering PMON's (and therefore the instances' environment (note that the instance is still registered).
Therefore, in 8.1.5, any environment variables set in the listener.ora would be retained even after dynamic registration.
If there is no SID_DESC section, then the listener WILL register PMON's environment (ie, behaves as 8.1.6).
About the author:
Nidhi Jain is a Senior DBA at Totality.com. He is a certified Oracle and DB2 database administrator.
发表评论
-
About Dedicated and Shared Server Processes
2010-11-29 15:46 1556一句话, shared server 就是为了省 SGA. ... -
oracle11GR2上建立一个新用户的过程,同时更改字符集.
2010-11-15 16:21 2922写道 SQL> create user mygmccr ... -
comment on table and column
2009-11-20 16:16 3367comment [Oracle SQL] ... -
解决ASM无法启动问题
2009-11-07 15:11 7125启动报错如下所 ... -
在Oracle中实现可扩展的多级编目结构
2009-10-23 13:49 13832009-10-16 ... -
用户帐号解锁
2009-10-21 08:06 1286SQL> alter user scott accoun ... -
按上下键调出 sqlplus 中的历史命令
2009-10-21 07:50 1996在sqlplus中不能按上下键不能显示出之前的命令, 也 ... -
简单的oracle物化视图
2009-09-28 22:29 1258物化视图是一种特殊的物理表,“物化”(Mate ... -
PL/SQL 总结(4)
2009-09-19 17:40 1071存储过程 create or replace PROCEDU ... -
PL/SQL 总结(3)
2009-09-19 17:40 1055使用游标 1)显示游标: CURSOR name_curs ... -
PL/SQL 总结(2)
2009-09-19 17:39 1096)将select 嵌入到PL/SQL中 ... -
PL/SQL 总结(1)
2009-09-19 17:38 1280我们开始学习PL/SQL PL/SQ ... -
Oracle 中的 Merge 语句
2008-07-29 15:45 1386Merge Statement Demo MERGE & ... -
SQL*Plus FAQ
2008-07-24 10:04 2183SQL*Pl ... -
自动安装 Oracle 数据库 10g 和 Red Hat Enterprise Linux
2008-07-13 09:52 2326自动安装 Oracle 数据库 10g 和 Red Hat ... -
在 Linux x86 上安装 Oracle 数据库 10g
2008-07-13 09:46 1353... -
Vmware server1.0 + Linux As4 + Oracle 10g RAC
2008-07-05 15:19 3249Vmware server1.0 + Linux A ... -
How To Set Up Oracle ASM on Ubuntu Gutsy Gibbon
2008-07-05 08:51 1968How To Set Up Oracle ASM on Ubu ... -
Installing Oracle10g R2 RAC on vmware suse
2008-07-04 10:47 4925Installing Oracle10g R2 RAC Par ... -
oracle rac 10.2 的在 linux 上的存储选项
2008-07-04 10:20 2723Oracle 集群需要存储的软 ...
相关推荐
### 认识Oracle中的sqlnet.ora、tnsnames.ora与listener.ora三个关键配置文件 #### 一、概述 在Oracle安装过程中,我们常常会在安装目录下的`$HOME/network/admin`文件夹中发现三个重要的配置文件:`sqlnet.ora`、...
### Oracle中的sqlnet.ora、tnsnames.ora与listener.ora详解 #### 一、概述 在Oracle数据库环境中,`sqlnet.ora`、`tnsnames.ora`和`listener.ora`三个文件起着至关重要的作用,分别位于Oracle安装目录下的`$HOME/...
Chapter 3 - Attacking the TNS Listener and Dispatchers Chapter 4 - Attacking the Authentication Process Chapter 5 - Oracle and PL/SQL Chapter 6 - Triggers Chapter 7 - Indirect Privilege ...
1. 查看$ORACLE_HOME/network/admin/listener.ora文件中的“LISTENER”-“DESCRIPTION”-“ADDRESS_LIST”-“ADDRESS”-“PROTOCOL”项目的赋值。 2. SQLPLUS: show parameter remote_login_password。 Oracle 11g...
例如,命令输出可能显示如下信息:“Linux version 2.6.32.12-0.7-default (geeko@buildhost) (gcc version 4.3.4 [gcc-4_3-branch revision”。这表明服务器的操作系统为64位版本,满足安装Oracle 11g R2的需求。 ...
SQL> alter system set local_listener='LISTENER'; ``` 这将将监听器绑定到数据库实例上。 四、Linux 关闭防火墙命令 在 Linux 系统上,需要关闭防火墙以便 Oracle 监听器可以正常工作。使用以下命令来关闭防火墙...
- **listener.ora**:此文件定义了监听器(Oracle Database Listener)的配置,包括监听的端口、数据库实例和服务名等。确保监听器已启动并且配置正确,可以使用`lsnrctl`命令检查和管理监听器状态。 4. **数据库...
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc1)(ORACLE_HOME = /u01/app/oracle/product/8.1.7)(PROGRAM = extproc)) (SID_DESC = (GLOBAL_DBNAME = cams)(ORACLE_HOME = /u01/app/oracle/...
- **NAMES.DEFAULT_DOMAIN=us.oracle.com**:此行为注释状态,如果取消注释,则会为未指定完整域名的服务名自动添加一个默认域名 `us.oracle.com`。 2. **tnsnames.ora** ```plaintext oracle1= (DESCRIPTION=...
- 如果熟悉Oracle的配置文件,也可以直接编辑tnsnames.ora、listener.ora等文件进行手动配置,这可能更灵活且快速。 6. **JDBC连接**: - 对于Java应用,可以通过JDBC Thin驱动连接Oracle数据库,这种模式下不...
`listener.ora`文件是Oracle监听器的核心配置文件,它定义了监听器的服务地址、端口以及其他相关参数。此文件通常位于`$ORACLE_HOME/network/admin`目录下。下面我们将逐步解析一个典型的`listener.ora`配置示例: ...
- 示例参数包括`NAMES.DEFAULT_SERVICE_NAME`(定义默认的服务名)和`NAMES.DIRECT_TLS_SERVER_NAME_MATCH`(启用或禁用基于服务名的TLS匹配)等。 3. **网络服务名参数**: - 在`tnsnames.ora`文件中定义的服务...
- **DEFAULT_SERVICE_LISTENER**: 默认的服务名列表。 - **KEY**: listener.ora 与 tnsnames.ora 文件之间约定的加密协议。 例如,添加一个新的数据库实例到监听器配置文件中可能如下所示: ```plaintext SID_...
### 如何连接Oracle数据库及故障解决办法 在IT领域中,Oracle数据库因其强大的功能和可靠性而备受企业青睐。本文将详细介绍如何安装、调试并成功连接到Oracle数据库,同时提供一些常见的故障解决办法,帮助读者更好...
安装完成后,需要配置Oracle监听器(listener.ora)和数据库服务(tnsnames.ora),以确保客户端可以连接到数据库。 8. **创建数据库** 使用`dbca`(Database Configuration Assistant)工具或SQL*Plus手动创建...
1. **编辑监听器配置文件**:编辑`/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora`文件,定义监听器的服务名和服务地址。 ```bash vi /oracle/app/oracle/product/11.2.0/dbhome_1/...
SQL>select username,default_tablespace from user_users; 查看当前用户的角色 SQL>select * from user_role_privs; 查看当前用户的系统权限和表级权限 SQL>select * from user_sys_privs; SQL>select * ...
3. **配置参数**:"listener.ora"文件包含了各种配置参数,如`SID_LIST_LISTENER`(服务ID列表),`LISTENER`(监听器本身),`ADDRESS`(监听器监听的网络地址和端口),以及`DEFAULT_SERVICE_LISTENER`(默认服务...