重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 196|回复: 0
打印 上一主题 下一主题

[Oracle] 'SQL*Net message from dblink' Waits On ALTER SESSION Commands

[复制链接]
跳转到指定楼层
楼主
发表于 2024-5-26 13:06:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
现象:
Noticed a high number of ALTER SESSION commands, especially when modifying NLS parameters, waiting on either "SQL*Net message from dblink" or "SQL*Net message to dblink"

For example, when tracing the session (10046 SQL trace), the tkprof output displays several sections like this:

SQL ID: 090ux6wjw3as5 Plan Hash: 0

alter session set NLS_LANGUAGE = 'AMERICAN'


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse       15      0.00       0.00          0          0          0           0
Execute     15      0.03       6.85          0         15         71           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       30      0.04       6.85          0         15         71           0

Misses in library cache during parse: 0
Parsing user id: 263     (recursive depth: 1)

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to dblink                     135        0.00          0.00
  SQL*Net message from dblink                   135        0.51          6.82



and



SQL ID: 2mwu6j6vvd3js Plan Hash: 0

alter session set NLS_CALENDAR = 'GREGORIAN'


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse       11      0.00       0.00          0          0          0           0
Execute     11      0.02       5.11          0         11         50           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       22      0.02       5.11          0         11         50           0

Misses in library cache during parse: 0
Parsing user id: 263     (recursive depth: 1)

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to dblink                      99        0.00          0.00
  SQL*Net message from dblink                    99        1.08          5.08
etc...



原因:
There is an open database link within the current user session.

Every ALTER SESSION executed locally will be executed at remote site as well if dblink is being used and has not been closed.

处理方法:
Explicit close the database link. You can close an open dblink in two different ways,

i. Using alter session command:

ALTER SESSION CLOSE DATABASE LINK [dblink name];

or


ii. Calling PL/SQL procedure:

  DBMS_SESSION.CLOSE_DATABASE_LINK ( dblink_name )

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-6-29 10:52 , Processed in 0.083790 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表