2、DBMS_SPACE
这是另一个Oracle古老支持包,它的SPACE_USAGE存储过程提供关于BasicFile和SecureFile LOB的空间利用率,我在TRBTKT.PKG_SECUREFILES包中引入了两个存储过程:CALC_SPACE_BASICFILES和CALC_SPACE_SECUREFILES。但遗憾的是,这个功能只能在启用了自动段空间管理(ASSM)的表空间上使用,而且,它也不会考虑任何BasicFile LOB块的空间利用率,在清单5中,我对表TRBTKT.TICKETS和TRBTKT.SECURE_TICKETS分别调用了这些存储过程,并返回了相应的输出。
清单5 确定BasicFile和SecureFile LOB的空间利用率
SET SERVEROUTPUT ON — BasicFile存储利用率: BEGIN trbtkt.pkg_securefiles.calc_space_basicfiles ( ownname => ‘TRBTKT’ ,tabname => ‘SECURE_TICKETS’ ,colname => ‘DOCUMENT’ ,partname => ‘STS_OPEN’ ); trbtkt.pkg_securefiles.calc_space_basicfiles ( ownname => ‘TRBTKT’ ,tabname => ‘SECURE_TICKETS’ ,colname => ‘DOCUMENT’ ,partname => ‘STS_PENDING’ ); trbtkt.pkg_securefiles.calc_space_basicfiles ( ownname => ‘TRBTKT’ ,tabname => ‘SECURE_TICKETS’ ,colname => ‘DOCUMENT’ ,partname => ‘STS_CLOSED’ ); trbtkt.pkg_securefiles.calc_space_basicfiles ( ownname => ‘TRBTKT’ ,tabname => ‘SECURE_TICKETS’ ,colname => ‘DOCUMENT’ ,partname => ‘STS_OTHER’ ); trbtkt.pkg_securefiles.calc_space_basicfiles ( ownname => ‘TRBTKT’ ,tabname => ‘SECURE_TICKETS’ ,colname => ‘SCRNIMG’ ,partname => ‘STS_OPEN’ ); trbtkt.pkg_securefiles.calc_space_basicfiles ( ownname => ‘TRBTKT’ ,tabname => ‘SECURE_TICKETS’ ,colname => ‘SCRNIMG’ ,partname => ‘STS_PENDING’ ); trbtkt.pkg_securefiles.calc_space_basicfiles ( ownname => ‘TRBTKT’ ,tabname => ‘SECURE_TICKETS’ ,colname => ‘SCRNIMG’ ,partname => ‘STS_CLOSED’ ); trbtkt.pkg_securefiles.calc_space_basicfiles ( ownname => ‘TRBTKT’ ,tabname => ‘SECURE_TICKETS’ ,colname => ‘SCRNIMG’ ,partname => ‘STS_OTHER’ ); END; / ============================================================ Space Usage for BasicFile LOB TRBTKT.SECURE_TICKETS.DOCUMENT Partition Name: STS_OPEN ———————————————————— Full Blocks: 123 KB: .96 Unformatted Blocks: 379 KB: 2.96 Total Blocks: 123 Total KB: .96 ============================================================ ============================================================ Space Usage for BasicFile LOB TRBTKT.SECURE_TICKETS.DOCUMENT Partition Name: STS_PENDING ———————————————————— Full Blocks: 20 KB: .16 Unformatted Blocks: 482 KB: 3.77 Total Blocks: 20 Total KB: .16 ============================================================ ============================================================ Space Usage for BasicFile LOB TRBTKT.SECURE_TICKETS.DOCUMENT Partition Name: STS_CLOSED ———————————————————— Full Blocks: 37 KB: .29 Unformatted Blocks: 465 KB: 3.63 Total Blocks: 37 Total KB: .29 ============================================================ ============================================================ Space Usage for BasicFile LOB TRBTKT.SECURE_TICKETS.DOCUMENT Partition Name: STS_OTHER ———————————————————— Full Blocks: 0 KB: 0 Unformatted Blocks: 0 KB: 0 Total Blocks: 0 Total KB: 0 ============================================================ ============================================================ Space Usage for BasicFile LOB TRBTKT.SECURE_TICKETS.SCRNIMG Partition Name: STS_OPEN ———————————————————— Full Blocks: 420 KB: 3.28 Unformatted Blocks: 82 KB: .64 Total Blocks: 420 Total KB: 3.28 ============================================================ ============================================================ Space Usage for BasicFile LOB TRBTKT.SECURE_TICKETS.SCRNIMG Partition Name: STS_PENDING ———————————————————— Full Blocks: 66 KB: .52 Unformatted Blocks: 436 KB: 3.41 Total Blocks: 66 Total KB: .52 ============================================================ ============================================================ Space Usage for BasicFile LOB TRBTKT.SECURE_TICKETS.SCRNIMG Partition Name: STS_CLOSED ———————————————————— Full Blocks: 144 KB: 1.13 Unformatted Blocks: 358 KB: 2.8 Total Blocks: 144 Total KB: 1.13 ============================================================ ============================================================ Space Usage for BasicFile LOB TRBTKT.SECURE_TICKETS.SCRNIMG Partition Name: STS_OTHER ———————————————————— Full Blocks: 0 KB: 0 Unformatted Blocks: 0 KB: 0 Total Blocks: 0 Total KB: 0 ============================================================ — SecureFile存储利用率: BEGIN trbtkt.pkg_securefiles.calc_space_securefiles ( ownname => ‘TRBTKT’ ,tabname => ‘TICKETS’ ,colname => ‘DOCUMENT’ ,partname => ‘STS_OPEN’ ); trbtkt.pkg_securefiles.calc_space_securefiles ( ownname => ‘TRBTKT’ ,tabname => ‘TICKETS’ ,colname => ‘DOCUMENT’ ,partname => ‘STS_PENDING’ ); trbtkt.pkg_securefiles.calc_space_securefiles ( ownname => ‘TRBTKT’ ,tabname => ‘TICKETS’ ,colname => ‘DOCUMENT’ ,partname => ‘STS_CLOSED’ ); trbtkt.pkg_securefiles.calc_space_securefiles ( ownname => ‘TRBTKT’ ,tabname => ‘TICKETS’ ,colname => ‘DOCUMENT’ ,partname => ‘STS_OTHER’ ); trbtkt.pkg_securefiles.calc_space_securefiles ( ownname => ‘TRBTKT’ ,tabname => ‘TICKETS’ ,colname => ‘SCRNIMG’ ,partname => ‘STS_OPEN’ ); trbtkt.pkg_securefiles.calc_space_securefiles ( ownname => ‘TRBTKT’ ,tabname => ‘TICKETS’ ,colname => ‘SCRNIMG’ ,partname => ‘STS_PENDING’ ); trbtkt.pkg_securefiles.calc_space_securefiles ( ownname => ‘TRBTKT’ ,tabname => ‘TICKETS’ ,colname => ‘SCRNIMG’ ,partname => ‘STS_CLOSED’ ); trbtkt.pkg_securefiles.calc_space_securefiles ( ownname => ‘TRBTKT’ ,tabname => ‘TICKETS’ ,colname => ‘SCRNIMG’ ,partname => ‘STS_OTHER’ ); END; / ============================================================ Space Usage for SecureFile LOB TRBTKT.TICKETS.DOCUMENT Partition Name: STS_OPEN ———————————————————— Segment Blocks: 1024 KB: 8192 Used Blocks: 124 KB: 992 Expired Blocks: 882 KB: 7056 Unexpired Blocks: 0 KB: 0 ============================================================ ============================================================ Space Usage for SecureFile LOB TRBTKT.TICKETS.DOCUMENT Partition Name: STS_PENDING ———————————————————— Segment Blocks: 1024 KB: 8192 Used Blocks: 21 KB: 168 Expired Blocks: 985 KB: 7880 Unexpired Blocks: 0 KB: 0 ============================================================ ============================================================ Space Usage for SecureFile LOB TRBTKT.TICKETS.DOCUMENT Partition Name: STS_CLOSED ———————————————————— Segment Blocks: 1024 KB: 8192 Used Blocks: 13 KB: 104 Expired Blocks: 993 KB: 7944 Unexpired Blocks: 0 KB: 0 ============================================================ ============================================================ Space Usage for SecureFile LOB TRBTKT.TICKETS.DOCUMENT Partition Name: STS_OTHER ———————————————————— Segment Blocks: 512 KB: 4096 Used Blocks: 501 KB: 4008 Expired Blocks: 0 KB: 0 Unexpired Blocks: 0 KB: 0 ============================================================ ============================================================ Space Usage for SecureFile LOB TRBTKT.TICKETS.SCRNIMG Partition Name: STS_OPEN ———————————————————— Segment Blocks: 2560 KB: 20480 Used Blocks: 405 KB: 3240 Expired Blocks: 2134 KB: 17072 Unexpired Blocks: 0 KB: 0 ============================================================ ============================================================ Space Usage for SecureFile LOB TRBTKT.TICKETS.SCRNIMG Partition Name: STS_PENDING ———————————————————— Segment Blocks: 1024 KB: 8192 Used Blocks: 62 KB: 496 Expired Blocks: 944 KB: 7552 Unexpired Blocks: 0 KB: 0 ============================================================ ============================================================ Space Usage for SecureFile LOB TRBTKT.TICKETS.SCRNIMG Partition Name: STS_CLOSED ———————————————————— Segment Blocks: 1024 KB: 8192 Used Blocks: 142 KB: 1136 Expired Blocks: 864 KB: 6912 Unexpired Blocks: 0 KB: 0 ============================================================ ============================================================ Space Usage for SecureFile LOB TRBTKT.TICKETS.SCRNIMG Partition Name: STS_OTHER ———————————————————— Segment Blocks: 512 KB: 4096 Used Blocks: 501 KB: 4008 Expired Blocks: 0 KB: 0 Unexpired Blocks: 0 KB: 0 ============================================================ SET SERVEROUTPUT ON |
我们一直都在努力坚持原创.......请不要一声不吭,就悄悄拿走。
我原创,你原创,我们的内容世界才会更加精彩!
【所有原创内容版权均属TechTarget,欢迎大家转发分享。但未经授权,严禁任何媒体(平面媒体、网络媒体、自媒体等)以及微信公众号复制、转载、摘编或以其他方式进行使用。】
微信公众号
TechTarget
官方微博
TechTarget中国
翻译
相关推荐
-
甲骨文自治数据库亮相 带来云计算新希望
早前甲骨文还不在云计算公司之列,而现在该公司正在迅速弥补其失去的时间。甲骨文的云计算核心是甲骨文自治数据库(O […]
-
2017年12月数据库流行度排行榜 定格岁末排名瞬间
数据库知识网站DB-engines最近更新的2017年12月份数据库流行度排名情况是否能提供更多的看点呢?TechTarget数据库网站将与您分享12月份的榜单排名情况,让我们拭目以待。
-
2017年11月数据库流行度排行榜 半数以上数据库积分减少
数据库知识网站DB-engines更新了2016年11月份的数据库流行度排行榜。TechTarget数据库网站将与您一同关注11月份的榜单排名情况。
-
控制合约 不再畏惧Oracle
许多公司都与Oracle有无限制授权协议,他们害怕离开这个协议,所以就证明他们在使用Oracle的软件,即使因为需求单独购买部分授权许可也可能总体是省钱的。