加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

发现什么进程/查询使用oracle临时表空间

发布时间:2020-12-12 15:12:23 所属栏目:百科 来源:网络整理
导读:Oracle常见问题解答定义临时表空间如下: Temporary tablespaces are used to manage space for database sort operations and for storing global temporary tables. For example,if you join two large tables,and Oracle cannot do the sort in memory,sp
Oracle常见问题解答定义临时表空间如下:

Temporary tablespaces are used to
manage space for database sort
operations and for storing global
temporary tables. For example,if you
join two large tables,and Oracle
cannot do the sort in memory,space
will be allocated in a temporary
tablespace for doing the sort
operation.

这很棒,但是我需要更多关于使用这个空间的细节.由于应用程序设计的怪癖,大多数查询都会进行某种排序,因此我需要将其缩小到客户端可执行文件,目标表或SQL语句.

从本质上说,我正在寻找线索来更准确地告诉我这个(相当大的应用程序)可能是什么问题.任何线索可能是有用的,只要它比“排序”更精确.

我不确定你已经有什么信息,但使用以下查询将指出哪些程序/用户/会话等当前正在使用您的临时空间.
SELECT   b.TABLESPACE,b.segfile#,b.segblk#,ROUND (  (  ( b.blocks * p.VALUE ) / 1024 / 1024 ),2 ) size_mb,a.SID,a.serial#,a.username,a.osuser,a.program,a.status
    FROM v$session a,v$sort_usage b,v$process c,v$parameter p
   WHERE p.NAME = 'db_block_size'
     AND a.saddr = b.session_addr
     AND a.paddr = c.addr
ORDER BY b.TABLESPACE,b.blocks;

一旦找出哪个会话正在损坏,那么看看正在执行的SQL,你应该在正确的路径上.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读