1. Space.sql
– space.sql
– To check free, pct_free, and allocated space within a tablespace
– 11/24/98
select tablespace_name, largest_free_chunk, nr_free_chunks, sum_alloc_blocks, sum_free_blocks
, to_char(100*sum_free_blocks/sum_alloc_blocks, ’09.99’) || ’%’ AS pct_free
FROM ( select tablespace_name , sum(blocks) AS sum_alloc_blocks
FROM dba_data_files GROUP BY tablespace_name )
, ( select tablespace_name AS fs_ts_name
, max(blocks) AS largest_free_chunk
, count(blocks) AS nr_free_chunks
, sum(blocks) AS sum_free_blocks FROM dba_free_space
GROUP BY tablespace_name ) where tablespace_name = fs_ts_name;
2. analyze5pct.sql
– analyze5pct.sql
– To analyze tables and indexes quickly, using a 5% sample size
– (do not use this script. if you are performing the overnight collection of volumetric data)
– 11/30/98
BEGIN
DBMS_UTILITY.ANALYZE_SCHEMA (’&OWNER’, ’ESTIMATE’,NULL, 5) ;
END;
/
3. nr_extents.sql
– nr_extents.sql
– To find out any object reaching
– extents, and manually upgrade it to allow unlimited
– max_extents (thus only objects we *expect* to be big
– are allowed to become big)
– 11/30/98
select e.owner, e.segment_type , e.segment_name , count(*) as nr_extents , s.max_extents , to_char ( sum ( e.bytes ) / ( 1024 * 1024 ) , ’999,999.90’) as MB FROM dba_extents e , dba_segments s where e.segment_name = s.segment_name GROUP BY e.owner, e.segment_type , e.segment_name , s.max_extents HAVING count(*) > &THRESHOLD OR ( ( s.max_extents – count(*) ) < &&THRESHOLD ) ORDER BY count(*) desc; |
4. spacebound.sql
spacebound.sql
To identify space-bound objects. If all is well, no rows are returned.
f any space-bound objects are found, look at value of NEXT extent
size to figure out what happened.
Then use coalesce (alter tablespace coalesce .
Lastly, add another datafile to the tablespace if needed.
11/30/98
select a.table_name, a.next_extent, a.tablespace_name FROM all_tables a, ( select tablespace_name, max(bytes) as big_chunk FROM dba_free_space GROUP BY tablespace_name ) f where f.tablespace_name = a.tablespace_name AND a.next_extent > f.big_chunk; |
B.每晚处理程序
1. mk_volfact.sql
mk_volfact.sql (only run this once to set it up; do not run it nightly!)
Table UTL_VOL_FACTS
— Public Synonym |
Grants for UTL_VOL_FACTS
GRANT select ON utl_vol_facts TO public |
我们一直都在努力坚持原创.......请不要一声不吭,就悄悄拿走。
我原创,你原创,我们的内容世界才会更加精彩!
【所有原创内容版权均属TechTarget,欢迎大家转发分享。但未经授权,严禁任何媒体(平面媒体、网络媒体、自媒体等)以及微信公众号复制、转载、摘编或以其他方式进行使用。】
微信公众号
TechTarget
官方微博
TechTarget中国
作者
相关推荐
-
甲骨文自治数据库亮相 带来云计算新希望
早前甲骨文还不在云计算公司之列,而现在该公司正在迅速弥补其失去的时间。甲骨文的云计算核心是甲骨文自治数据库(O […]
-
2017年12月数据库流行度排行榜 定格岁末排名瞬间
数据库知识网站DB-engines最近更新的2017年12月份数据库流行度排名情况是否能提供更多的看点呢?TechTarget数据库网站将与您分享12月份的榜单排名情况,让我们拭目以待。
-
2017年11月数据库流行度排行榜 半数以上数据库积分减少
数据库知识网站DB-engines更新了2016年11月份的数据库流行度排行榜。TechTarget数据库网站将与您一同关注11月份的榜单排名情况。
-
控制合约 不再畏惧Oracle
许多公司都与Oracle有无限制授权协议,他们害怕离开这个协议,所以就证明他们在使用Oracle的软件,即使因为需求单独购买部分授权许可也可能总体是省钱的。