博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
基于SQL_ID查看对象大小
阅读量:5143 次
发布时间:2019-06-13

本文共 1982 字,大约阅读时间需要 6 分钟。

 
SQL> set echo offset echo offset verify offset serveroutput onset feedback offset lines 200set pages 40col segment_name for a20 heading 'OBJECT_NAME'col segment_size for 99999999999999 heading 'SEGMENT_SIZE(KB)'col block_count for 99999999999 heading 'BLOCK_COUNT'/* Formatted on 2013/12/24 18:52:26 (QP5 v5.240.12305.39446) *//* Formatted on 2013/12/24 19:14:26 (QP5 v5.240.12305.39446) */WITH t     AS (SELECT /*+ materialize */               DISTINCT OBJECT_OWNER, OBJECT_NAME           FROM (SELECT OBJECT_OWNER, OBJECT_NAME                   FROM V$SQL_PLAN                  WHERE SQL_ID = 'gzus7ufvp3xt3' AND OBJECT_NAME IS NOT NULL                 UNION ALL                 SELECT OBJECT_OWNER, OBJECT_NAME                   FROM DBA_HIST_SQL_PLAN                  WHERE SQL_ID = 'gzus7ufvp3xt3' AND OBJECT_NAME IS NOT NULL))SELECT a.owner,       a.segment_name,       a.segment_size,       TRUNC (a.segment_size / 8) block_count  FROM (  SELECT owner, segment_name , TRUNC (SUM (bytes) / 1024) segment_size            FROM dba_segments           WHERE   /*  segment_type LIKE 'TABLE%'                 AND*/ (OWNER, segment_name) IN                        (SELECT table_owner, table_name                           FROM dba_indexes                          WHERE (owner, index_name) IN (SELECT * FROM t)                         UNION ALL                         SELECT * FROM t)        GROUP BY  (owner, segment_name)) a;SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL>   2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24  OWNER			       OBJECT_NAME	    SEGMENT_SIZE(KB)  BLOCK_COUNT------------------------------ -------------------- ---------------- ------------DWF			       F_AGT_LONC_BASIC_INF	      155648	    19456			       O_HDWF			       COMR_INTDIST_H_IDX1	    37282816	  4660352DWF			       F_AGT_COMR_INTDIST_H	   126370816	 15796352
 

转载于:https://www.cnblogs.com/zhaoyangjian724/p/3798021.html

你可能感兴趣的文章
【Nowcoder】玩游戏
查看>>
过滤器(Filter)
查看>>
字符串的操作
查看>>
性能优化之Java(Android)代码优化
查看>>
springMVC相关—文件上传
查看>>
由Oracle 11g SYSAUX 和 SYSTEM 表空间回收引发的联想
查看>>
uva 1416 Warfare And Logistics
查看>>
欲则不达
查看>>
盒子游戏
查看>>
OpenJudgeP1.10.08:病人排队__(刷题)_水题
查看>>
观察者模式
查看>>
Hadoop分布式文件系统中架构和设计要点汇总
查看>>
cout和printf
查看>>
UVa 10088 - Trees on My Island (pick定理)
查看>>
#C++PrimerPlus# Chapter11_Exersice4_mytimeV4
查看>>
iOS8 针对开发者所拥有的新特性汇总如下
查看>>
Jmeter + Grafana搭建实时监控可视化
查看>>
uCGUI字符串显示过程分析和uCGUI字库的组建
查看>>
h5唤起app
查看>>
SQL Server 2008 /SQL Server 2008 R2 配置数据库邮件
查看>>