数据库
首页 > 数据库> > Oracle:dba_hist_seg_stat_obj 字典表 初步研究

Oracle:dba_hist_seg_stat_obj 字典表 初步研究

作者:互联网

dba_hist_seg_stat_obj

 

首先,该字典表,是为了配合 dba_hist_seg_stat 而专门抓取的 object信息

接着,抓取的是snap sample 那一特定时刻的object字典信息记录。如果snap sample时刻,对象不存在了,相关的 "???name"信息就会缺失!显示为 :UNDEFINED  、** MISSING **

最后,我们可以利用该表干吗呢?!可以利用它来查询历史中,各种seg对象的生存状态信息!

 

 

 1 with cte as
 2  ( --
 3   select distinct obj#,
 4                    (case
 5                        when o.obj# = 4294967295 then
 6                         o.dataobj#
 7                        else
 8                         o.obj#
 9                    end) obj2#,
10                    o.object_type,
11                    o.owner,
12                    o.object_name,
13                    --o.subobject_name,
14                    o.tablespace_name
15   from dba_hist_seg_stat_obj o
16   -- order by 1 desc, 2 desc
17   --
18   )
19 select o.*, --
20        d.owner,
21        d.object_name,
22        d.created,
23        d.status,
24        d.temporary,
25        d.generated
26 from cte o
27 left join dba_objects d
28 on o.obj# = d.object_id
29 where d.object_id is null
30       or o.object_name != d.object_name
31 order by 1 desc, 2 desc

 

标签:seg,stat,obj,name,dba,object,hist,--
来源: https://www.cnblogs.com/jinzhenshui/p/16551027.html