影响service自动注册的问题_MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 5278 | 回复: 0   主题: 影响service自动注册的问题        下一篇 
beckhann
注册用户
等级:中士
经验:228
发帖:25
精华:0
注册:2012-3-20
状态:离线
发送短消息息给beckhann 加好友    发送短消息息给beckhann 发消息
发表于: IP:您无权察看 2012-3-21 8:50:53 | [全部帖] [楼主帖] 楼主

通过命名解决终端的监听
方法,如在数据库服务器上的TNSNAME.ORA文件
例如,如果监听器端口1421,而不是1521时,初始化参数文件中定义的LOCAL_LISTENER参数如下:

LOCAL_LISTENER=listener1


使用同一个监听,listener属性定义如下:

DISPATCHERS="(PROTOCOL=tcp)(LISTENER=listener1)"


listener1必须在解析服务器上,所以它还需要定义,tnsnames.ora文件如下:

listener1=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1421))
)


你还可以动态更新LOCAL_LISTENER参数,使用SQL语句ALTER SYSTEM SET:

SQL> ALTER SYSTEM SET LOCAL_LISTENER='
' SID='';


如果设置的参数为空,默认的本地TCP/IP端口地址1521会被假设。

SQL> ALTER SYSTEM SET LOCAL_LISTENER='';


listener属性覆盖LOCAL_LISTENER参数。结果,SQL语句“ALTER SYSTEM SET LOCAL_LISTENER ...”,不影响监听的属性设置。

1.4注册信息与远程监听
--------------------------------------------------

在oracle9i RAC时,注册远程监听可以配置共享服务器或者专线服务器环境。

如果你想PMON的注册和远程监听,配置REMOTE_LISTENER参数初始化参数文件,定位远程监听

对于一个共享服务器环境中,你也可以使用监听器,在初始化参数文件的Dispatchers参数属性注册任何监听的Dispatcher程序。如果在Oracle8i中运行MTS,监听器的属性会被设置在MTS_DISPATCHERS参数中。

因为双方的REMOTE_LISTENER参数和监听器的属性的启用,PMON会分派信息注册到监听器,它是没有必要同时指定参数和属性,如果监听器的值相同。
设置REMOTE_LISTENER参数如下:

REMOTE_LISTENER=


在Oracle8i中设置listener属性如下:

MTS_DISPATCHERS="(PROTOCOL=tcp)(LISTENER=
)"


在Oracle9i设置listener属性如下:

DISPATCHERS="(PROTOCOL=tcp)(LISTENER=
)"


然后通过命名方法,解决终端监听,如服务器上的TNSNAMES.ORA文件。
例如,在服务器 sales1-server 和 sales2-server上,如果单独的监听器配置侦听端口1521服务器,你可以在sales1-server初始化文件上设置REMOTE_LISTENER参数:

REMOTE_LISTENER=listener_sales2


你可以在sales2-server初始化文件上设置REMOTE_LISTENER参数:

REMOTE_LISTENER=listener_sales1


然后,你可以在sales1-server本地TNSNAME.ORA解决listener_sales2

listener_sales2=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales2-server)(PORT=1521))
)


同样,也可以在listener_sale1上解决本地的TNSNAMES.ORA文件

listener_sales1=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales1-server)(PORT=1521))
)


如果是共享服务器配置,你可以设置DISPATCHERS参数,初始化参数文件如下:

DISPATCHERS="(PROTOCOL=tcp)(LISTENER=listeners_sales)"
You can then resolve listener_sales in the local TNSNAMES.ORA as follows:
listeners_sales=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales1-server)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=sales2-server)(PORT=1521))
)


你还可以动态更新REMOTE_LISTENER参数,使用SQL语句ALTER SYSTEM SET:

SQL> ALTER SYSTEM SET REMOTE_LISTENER='listener_alias';


如果设置参数为空,然后PMON取消远程监听信息与它之前注册的信息。

SQL> ALTER SYSTEM SET REMOTE_LISTENER='';


LISTENER属性覆盖REMOTE_LISTENER参数,结果,设置SQL语句ALTER SYSTEM SET REMOTE_LISTENER不受影响。

2.0 已知问题,例如登记
-------------------------------------------

有几个已知的问题,例如登记。最知名的在9.2.0.2补丁集的问题都解决了。

2.1 ORA-12514错误,连接到已注册的实例
-------------------------------------------------------
当试图连接到Oracle8i中使用一个连接描述符包含SERVICE_NAME的条目,您可能会收到以下错误:ORA-12514:TNS:监听程序不能解析在连接中给出的SERVICE_NAME

描述

错误是指客户端已连接到监听器,但请求连接的SERVICE_NAME,监听没有服务处理器。这通常是不与服务登记的问题,但因为客户端试图连接到的SERVICE_NAME条目几乎始终是一个动态注册的服务,它需要解决在这里。

有几个原因,可能会发生错误ORA-12514:

1)客户端试图连接到该实例未注册监听器,因为实例不能找到正确的监听以注册自己的姓名和地址。

如果LOCAL_LISTENER参数是在init.ora文件中,它会试图解决一个地址。该实例将尝试连接到该地址上的侦听器,并且注册。

如果LOCAL_LISTENER参数是init.ora文件中不存在,例如将尝试使用默认连接到默认的监听器TCP/IP端口1521或IPC关键PNPKEY地址。

2)实例注册到监听器,但客户端试图连接那个不匹配的SERVICE,这个SERVICE是PMON已经注册的那个listener。

下列步骤显示其中service_name是正在注册在listener上:

- 运行监听器控制实用程序(LSNRCTL)

- 在LSNRCTL提示符下,键入“set displaymode verbose”,然后按Enter。

- 在LSNRCTL提示符,键入“services”,然后按Enter键。

确保tnsnames.ora的条目中的SERVICE_NAME参数完全相同一个监听器注册的服务相匹配。

3)实例挂掉
使用服务注册的好处之一是,监听知道实例的状态。当实例是,它注册的监听器本身,使监听器,为它服务的传入请求。当实例关闭时,它不会被注册监听器。如果实例未注册的监听器,监听器将拒绝传入请求,客户收到ORA-12514错误。

4)实例和监听都起来,但尚未实例注册到监听器。

当实例启动时,它试图连接到注册本地监听。大约每隔60秒它继续监听检查。

If the Listener is up when the instance is started, service registration
should take place as the instance starts. If the Listener comes up after
the instance, it will take up to a minute or so for the instance to
register itself with the Listener. This is usually not an issue, but if
the Listener is stopped then started, users may fail to connect until the
the instance successfully re-registers with the Listener.
You can check to see whether the instance has registered itself using the
lsnrctl commands described in 2).


如果监听器是实例启动时,服务登记作为实例启动时,应采取本地。如果监听后例如,它会占用一分钟左右的实例注册监听器本身。这通常不是一个问题,但如果停止,然后开始监听,用户可能无法连接,直到成功的实例重新注册的监听。你可以检查实例是否已注册

To resolve the ORA-12514 errors, you need to either resolve the registration
problems, resolve the problems with the SERVICE_NAME not matching what the name
that is actually registering with the listener, or define a static service
handler in the LISTENER.ORA file and modify the TNSNAMES.ORA file to connect
to the newly defined SID instead of the SERVICE_NAME.


为了解决ORA-12514错误,你需要解决的注册问题,解决问题的SERVICE_NAME不匹配名字实际上是注册监听器,或定义一个静态服务在listener.ora文件中的处理程序和修改tnsnames.ora文件连接新定义的SID,而不是的SERVICE_NAME。

2.2监听器,间歇性崩溃

-------------------------------------
Instance registration can cause listeners to intermittently crash.
In a hybrid setup with a 64-bit Listener and a 32-bit instance, the Listener
can intermittently hang or crash during Service Registration or updates. This
may occurs after the Listener has been running for some time.
In the event of a Listener intermittently crashing, one of the first things
to check is whether the Listener has service handlers for multiple instances.
The easiest way to do this is to run the ‘lsnrctl services’ command and check
whether other instances are registered with the Listener. If there are other
instances registering with the Listener, the service updates will also appear
in the LISTENER.LOG file.


实例注册可引起监听间歇性崩溃。在一个64位的监听器的混合设置和一个32位实例,监听器可以间歇性地挂起或崩溃在服务注册或更新。这五月监听器已经运行一段时间后发生。一个监听事件中的间歇性崩溃,第一件事情之一检查监听是否有服务处理程序的多个实例。要做到这一点最简单的方式来运行“LSNRCTL服务”命令,并检查是否有其他实例注册到监听器。如果有其他注册监听器的实例,服务的更新也将出现在LISTENER.LOG文件
这有几个变通办法:
- 禁用服务的注册和使用只有静态的服务处理器。请禁用自动服务登记的详细信息见下文。
- 强制32位实例专门注册一个32位的监听器,最好的实例的同一版本

This was patched in 8.1.7.4 and 9.0.1.3 on Solaris and is fixed in 9.2.0.2.
Refer Bug:2187760.
2.3 Instance fails to register with instance if ASO in use


2.3如果ASO在使用中,实例注册失败
----------------------------------------------------------
安装Oracle安全选项(ASO),原名甲骨文网络选项 - ANO,可能会出现问题。


如果下列条目sqlnet.ora文件中的数据库服务器,自动实例注册不会发生:
SQLNET.ENCRYPTION_CLIENT=必填
SQLNET.ENCRYPTION_SERVER=必填

如果禁用加密或更改这些值被接受的或要求的,例如注册将正常工作:

SQLNET.ENCRYPTION_CLIENT=REQUESTED
SQLNET.ENCRYPTION_SERVER=REQUESTED
The other workaround is to use static service handlers instead of Service
Registration.


其他的解决方法是使用静态的服务处理器,而不是服务注册。

As of Oracle9i, this issue still exists.
Refer Bug:887753.


2.4 SDU和TDU是动态注册的实例覆盖

-------------------------------------------------------------------
Dedicated service handlers registered dynamically with a TNS listener will
always use the default maximum SDU size (usually 2048 bytes).
The SDU parameters are configured in the LISTENER.ORA file in the sid_desc
section. When the Listener is started, the service handler that is started
based on the SID_DESC section will reflect the specified SDU size.
The problem is that with Service Registration, there is no place to set the
SDU size for dedicated service handlers, so the default value (2048) is
always used.


专用的服务器与TNS监听器动态注册的处理程序始终使用默认的最大SDU大小(通常是2048字节)。SDU参数配置在listener.ora文件中的SID_DESC章节。监听器启动时,启动服务处理器SID_DESC节的基础上,将反映指定的SDU大小。问题是,服务注册,也没有地方设置SDU专用服务处理程序的大小,所以经常使用默认值(2048)。
也有这个问题的解决方法:
1)禁用服务注册和使用静态的服务处理器。
2)使用共享服务器/ MTS。您可以设置SDU或MTS_DISPATCHERS参数。

DISPATCHERS="(description=(SDU=8192)(address=(protocol=tcp)\
(host=)))(dispatchers=1)"


当DISPATCHERS开始,他们将反映指定的SDU大小。

Refer Bug:1113588
IMPORTANT NOTE: Beginning with version 9.2.0.4, it is possible to workaround
the SDU issue mentioned above by setting the following sqlnet.ora file parameter:
DEFAULT_SDU_SIZE
Example:
DEFAULT_SDU_SIZE=32767
Please refer to Note:1113588.8 New SQLNET.ORA parameter DEFAULT_SDU_SIZE


2.5动态注册的情况下不工作的prespawned服务器
------------------------------------------------------------------------

专用服务器与TNS监听器动态注册的处理程序不会使用prespawned服务器。在listener.ora文件中的配置PRESPAWN参数SID_DESC部分。 Prespawned专用服务器进程已预先启动任何传入的连接请求前监听。问题是,服务注册,有没有地方配置prespawn。

解决的办法是,以确保动态注册,使用不同的静态注册的服务名称。客户可以选择静态prespawned服务,如果需要重视的prespawned专用服务器。从Oracle9i开始,预启动专用服务器进程不再被支持。相反,配置共享服务器,以提高可扩展性和系统资源的使用。

2.6 Environment picked up from the registered instance, not the Listener
2.6环境变量从注册的实例提起,而不是监听器

------------------------------------------------------------------------
A server process that has been spawned by the Listener will inherit TNS_ADMIN
from the Listener. If this server process itself needs to create a new
connection, such as when opening a database link, the value of TNS_ADMIN is
checked in order to locate Net configuration files. If the Net
configuration files are not found, or incorrect files read, a TNS-12154 error
could result.


监听器已经产生一个服务器进程将从监听器继承TNS_ADMIN。如果这台服务器的过程本身需要创建一个新的连接,如开放数据库链接时,TNS_ADMIN的值会被检查,以找到网络配置文件。如果Net配置文件都没有发现,或不正确的文件读取,TNS-12154错误可能会导致。

在实例启动时,PMON得到TNS_ADMIN环境变量。当PMON随后注册监听器的实例时,TNS_ADMIN的值会传递给监听器,造成的PMON的TNS_ADMIN的值被覆盖。如果TNS_ADMIN的未设置时,当PMON启动时,实例注册后,监听的TNS_ADMIN的值被清除

This is only a problem if the user that starts the database and Listener do
not have the same value of TNS_ADMIN set in their environment.
The way to resolve this is to either disable Instance Registration or ensure
that the users that start the database and Listener have the same value for
TNS_ADMIN.


这仅仅是一个问题,如果用户启动数据库和Listener没有在自己的环境设置TNS_ADMIN的相同值。这个方式解决的问题是禁用实例注册或确保启动数据库和Listener,用户有相同值TNS_ADMIN。
2.7 ORA-00119 Error starting a 9.x instance with LOCAL_LISTENER defined
-----------------------------------------------------------------------

如果禁用实例注册的一个常用的方法是设置LOCAL_LISTENER参数到一个虚拟的别名或地址。具有参数设置保持接触监听器的监听,因此禁用默认注册的发生。

在8.x版,LOCAL_LISTENER可以设置一个虚拟的别名和实例是否解析或别名。

在9.x版本,LOCAL_LISTENER必须解析或实例会失败,返回以下错误:

ORA-00119: invalid specification for system parameter local_listener
ORA-00132: syntax error or unresolved network name 'DUMMY'
ORA-01078: failure in processing system parameters


要解决这些错误,无论是实际地址在LOCAL_LISTENER使用参数或在服务器上设置在tnsnames.ora文件中的别名,以解决地址的别名。

为了使实例注册到一个非默认的监听器,这个地址应该与监听器的地址相匹配

To disable default instance registration, this address should not match the
listener's address.


要禁用默认实例注册,这个地址不应该与监听的地址匹配。

3.0如何禁用自动实例注册
--------------------------------------------------

在某些情况下,例如解决已知问题,当它可能需要禁用实例自动服务注册防止监听登记的实例

By default, PMON registers with the local Listener at the default local
address of TCP/IP port 1521. This behavior can only be disabled for Oracle8i
versions 8.1.5 and 8.1.7.


默认情况下,PMON的寄存器默认的本地与本地监听TCP/IP的1521端口的地址。这种行为只能被禁用,对于Oracle8i8.1.5和8.1.7版本。

有几种方法来避免这种行为:
1)只适用于8.1.5和8.1.7版本中,设置以下的INIT.ORA事件禁用自动服务登记:

EVENT="10258 TRACE NAME CONTEXT FOREVER, LEVEL 4"
Note: Due to Bug:1278836, the event does not apply for 8.1.6.
2) Do not run any Listeners on port 1521. PMON will not be able to locate the
Listener if it is not either specified in the LOCAL_LISTENER parameter or
located on this default port. If PMON cannot find the Listener, it cannot
register with it.


2)不要任何侦听端口1521上运行。 PMON将无法找到监听者,如果没有任何在LOCAL_LISTENER参数指定或位于这个默认的端口上。如果PMON找不到监听器,它不能注册。
3) Use the INIT.ORA LOCAL_LISTENER parameter to define a dummy address.

Automatic Service Registration will not occur if the LOCAL_LISTENER
parameter is present. PMON will reject the invalid address and will not
attempt to register with port 1521. In version 8.x, LOCAL_LISTENER can be
set to either a dummy alias or an address other than the address that the
listener is running on. In 9.x, LOCAL_LISTENER can still be set to an
address, but if it is set to a dummy alias, the alias must be resolvable
to an address other than the address that the listener is running on.


3)使用在INIT.ORA LOCAL_LISTENER参数来定义一个虚拟地址。自动服务注册不会发生,如果LOCAL_LISTENER参数存在。 PMON会拒绝无效的地址,不会尝试注册端口1521。在8.x版,可以LOCAL_LISTENER设置为一个虚拟的别名或在地址以外的侦听器上运行。 LOCAL_LISTENER在9.x中,仍可以被设置为地址,但如果它被设置为一个虚拟的别名,别名必须是解析一个侦听器上运行的地址以外的地址。

For version 8.x, add the following parameter to the init.ora file:
LOCAL_LISTENER=dummy
-or-
LOCAL_LISTENER="(address=(protocol=tcp)(host=)(port=
))"
For version 9.x, run the following:
SQL> ALTER SYSTEM SET LOCAL_LISTENER=dummy SCOPE=SPFILE;
-or-
SQL> ALTER SYSTEM SET LOCAL_LISTENER="(address=(protocol=tcp)
(host=)(port=
))" SCOPE=SPF




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论