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

embedded/2024/10/11 11:21:13/

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.ppmy.cn/embedded/59014.html

相关文章

WGCLOUD登录页面支持输入验证码吗

支持的 v3.5.3版本开始,WGCLOUD支持在登录页面配置输入验证码,我们可以根据自己的场景需要,配置是否在登录页面显示验证码,如下说明 登录页面添加验证码说明 - WGCLOUD

ubuntu 上vscode +cmake的debug调试配置方法

在ubuntu配置pcl点云库以及opencv库的时候,需要在CMakeLists.txt中加入相应的代码。配置完成后,无法调试,与在windows上体验vs studio差别有点大。 找了好多调试debug配置方法,最终能用的有几种,但是有一种特别好用&a…

Navicat Premium 15 for Mac/Win 中文安装包下载

Navicat Premium 15 是一款数据库管理工具,它支持多种类型的数据库,包括 MySQL、MariaDB、MongoDB、SQL Server、Oracle、PostgreSQL 和 SQLite。该软件提供了一个用户友好的图形界面,使得数据库的管理变得更加简单和高效。Navicat Premium 1…

13 - matlab m_map地学绘图工具基础函数 - 介绍创建管理颜色映射的函数m_colmap和轮廓图绘制颜色条的函数m_contfbar

13 - matlab m_map地学绘图工具基础函数 - 介绍创建管理颜色映射的函数m_colmap和轮廓图绘制颜色条的函数m_contfbar 0. 引言1. 关于m_colmap2. 关于m_contfbar3. 结语 0. 引言 本篇介绍下m_map中用于创建和管理颜色映射函数(m_colmap)和 为轮廓图绘制颜…

【STM32 ARM】寄存器操作GPIO的方法

文章目录 前言GPIO的简介GPIO 通过寄存器操作io_mux操作数据寄存器操作寄存器的原则简单操作寄存器高效处理寄存器 总结 前言 在嵌入式系统开发中,GPIO(General Purpose Input/Output,通用输入输出)是一种非常常见的硬件接口&…

阿里云通义千问开源两款语音基座模型分别是SenseVoice和CosyVoice

阿里巴巴近期发布了开源语音大模型项目FunAudioLLM,该项目包含了两个核心模型:SenseVoice和CosyVoice。可以精准多语言识别并且进行语音克隆。 SenseVoice:精准多语言识别与情感辨识 SenseVoice主要致力于高精度多语言语音识别、情感辨识和…

[vite] Pre-transform error: Cannot find package pnpm路径过长导致运行报错

下了套vue3的代码,执行pnpm install初始化,使用vite启动,启动后访问就会报错 报错信息 ERROR 16:40:53 [vite] Pre-transform error: Cannot find package E:\work\VSCodeProjectWork\jeecg\xxxxxxxxx-next\xxxxxxxxx-next-jeecgBoot-vue3\…

Spark调度底层执行原理详解(第35天)

系列文章目录 一、Spark应用程序启动与资源申请 二、DAG(有向无环图)的构建与划分 三、Task的生成与调度 四、Task的执行与结果返回 五、监控与容错 六、优化策略 文章目录 系列文章目录前言一、Spark应用程序启动与资源申请1. SparkContext的创建2. 资…