当前位置: 首页 > news >正文

sql monitoring 长SQL ASH AWR 都没有 未Commit or export to csv

Duration 4小时, Database Time 22.5, Session Inactive,

1.未Commit原因,

2.慢慢导出成csv文件?

How is v$session status = 'INACTIVE' and v$sql_monitor status = 'EXECUTING' concurrently

2641811 Posts: 8

Jan 11, 2016 6:47PM edited Jan 19, 2016 6:07PM 6 commentsAnswered

Can someone please explain a scenario where v$session status = 'INACTIVE' and v$sql_monitor status = 'EXECUTING'. 

I am seeing this currently in one of my databases and do not understand this scenario?

Thanks for your help.

FlagQuoteOff TopicLike

Answers

  • Mark D Powell DBA Posts: 17,366 Rubellite

    Jan 11, 2016 7:19PM edited Jan 11, 2016 7:19PM

    user2641811, I haven't really used this view but I note from the manual that the view can retain data until the space is necessary for reuse so what you see may be related to this.  The view V$SESSION only shows ACTIVE when a SQL statement is actually executing.  Once a statement completes the session is officially INCACTIVE till the next SQL statement is executed.

    - -

    "When the SQL statement being monitored is executing, statistics in V$SQL_MONITOR are generally refreshed in near real time, once every second. Once the execution ends, monitoring information is not deleted immediately. Instead, it is kept in V$SQL_MONITOR for at least one minute. The entry will eventually be deleted to reclaim its space as new statements are monitored"

    Ref: V$SQL_MONITOR

    - -

    Your exact version of Oracle may make a difference to the expected behavior but I did not search support for any bug or usage notes that may exist.

    - -

    HTH -- Mark D Powell --

    HTH -- Mark D Powell --

    FlagQuoteOff TopicLike

  • 2641811 Posts: 8

    Jan 11, 2016 8:05PM edited Jan 11, 2016 8:05PM

    Thanks for your reply Mark.

    I am running Oracle version 12.1.0.2.3 on Linux.

    I have been monitoring v$sesstat as well and do not see any statistics changes for that session.

    I started tracing the session to look at activity from that angle and see the following constantly being written:

    WAIT #140323598165824: nam='SQL*Net message from client' ela= 24995 driver id=1413697536 #bytes=1 p3=0 obj#=1971587 tim=317089128562

    WAIT #140323598165824: nam='SQL*Net message to client' ela= 13 driver id=1413697536 #bytes=1 p3=0 obj#=1971587 tim=317089128737

    FETCH #140323598165824:c=0,e=76,p=0,cr=0,cu=0,mis=0,r=10,dep=0,og=1,plh=2205593993,tim=317089128786

    So, does this mean that when a session is done executing and is only fetching data that the session is marked as "INACTIVE" in v$session whereas fetching data is still considered "EXECUTING" in v$sql_monitor?

    FlagQuoteOff TopicLike

  • top.gun Posts: 4,778 Gold Crown

    Jan 11, 2016 8:11PM edited Jan 11, 2016 8:11PM

    You would need to determine what the session is currently waiting for.

    I could take a guess....

    What if your session was waiting for a lock, so it's executing, but at the same time waiting for the lock.....

    FlagQuoteOff TopicLike

  • 2641811 Posts: 8

    Jan 11, 2016 8:23PM edited Jan 11, 2016 8:23PM

    There are no blocking locks in the database.  I monitored v$session for a bit and the only wait events for that session are "SQL*Net message from client" and "SQL*Net message to client".

    FlagQuoteOff TopicLike

  • Mark D Powell DBA Posts: 17,366 Rubellite

    Jan 11, 2016 9:09PM edited Jan 11, 2016 9:09PM

    The FETCH line indicates that a cursor row was obtained so if you see new FETCHes in the trace then either the SQL is very fast and the application is likely executing the same SQL statement with different bind variables or it previously executed a cursor and is now passing back a row at a time from what would appear to be a large result set.

    - -

    You can query the SQL associated with the session via the V$SESSION sql_address, sql_hash_value or sql_id columns used in a join to one of the V$SQL views such as V$SQLAREA or V$SQLTEXT.  If there is no current SQL statement check the PREV_* statement columns.

http://www.lryc.cn/news/399868.html

相关文章:

  • 算法学习day12(动态规划)
  • Vue 3 <script setup> 使用v-bind(或简写为 :)来动态绑定图片的 src 属性
  • ​前端Vue自定义签到获取积分弹框组件设计与实现
  • 闲置服务器废物利用_离线下载_私人影院_个人博客_私人云笔记_文件服务器
  • 【Python学习笔记】调参工具Optuna + 泰坦尼克号案例
  • GPT带我学-设计模式13-策略模式
  • 【Linux】Ubuntu配置JDK环境、MySQL环境
  • 【ElasticSearch】ES 5.6.15 向量插件支持
  • Kafka 高并发设计之数据压缩与批量消息处理
  • 设计模式使用场景实现示例及优缺点(行为型模式——模板方法模式)
  • ETL数据集成丨主流ETL工具(ETLCloud、DataX、Kettle)数据传输性能大PK
  • eNSP:防火墙设置模拟公司配置(二)
  • vue3 两个组件之间传值
  • 基于matlab的深度学习案例及基础知识专栏前言
  • 机器学习——L1 L2 范数 —>L1 L2正则化
  • 大模型时代,还需要跨端framework吗?
  • ASP.NET Core----基础学习05----将数据传递给视图文件的五种情况
  • Flutter实现局部刷新的几种方式
  • 力扣题解(回文子串)
  • 对数的基本概念
  • C双指针滑动窗口算法
  • WPF学习(6) -- WPF命令和通知
  • 升级到LVGL9的一些变化(后续发现再补充)
  • 当在多线程环境中使用 C++进行编程时,怎样确保线程安全以及如何处理线程之间的同步和通信?
  • 博物馆地图导航系统:高精度地图引擎与AR/VR融合,实现博物馆数字化转型
  • liunx作业笔记1
  • 大话C语言:第31篇 指针和数组的关系
  • Mysql-索引应用
  • Facebook 开源计算机视觉 (CV) 和 增强现实 (AR) 框架 Ocean
  • 【接口自动化_13课_接口自动化总结】