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中国
作者
相关推荐
-
控制合约 不再畏惧Oracle
许多公司都与Oracle有无限制授权协议,他们害怕离开这个协议,所以就证明他们在使用Oracle的软件,即使因为需求单独购买部分授权许可也可能总体是省钱的。
-
如何应对Oracle EBS实施中的六个挑战?
在18个月的时间里,Vitamix启动运行了Oracle电子商务套件(E-Business Suite,EBS),而且Vitamix还对诸如Oracle ATG Web Commerce等所有页面属性进行了重新整理,并实现了全球数据中心。
-
Oracle的云产品“砸了自己脚”?
Sparc和Solaris都是Oracle云计划的一部分,但是硬件和支持人员的减少意味着本地Solaris和Sparc将变得更加稀少。
-
2017年3月数据库流行度排行榜 Oracle卫冕之路困难重重
时隔一个月,数据库市场经过一轮“洗牌”,旧的市场格局是否会被打破,曾经占巨大市场份额的企业是否可能失去优势?