Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Shared pool fragmentation

519163Oct 4 2006 — edited Oct 5 2006
Find below a modified version of a script retrieved from Metalink 146599.1 to check for shared pool fragmentation

I am not sure if it is possible, but is there any way to incorporate into this script a query that will show the effectiveness of using an ALTER SYSTEM FLUSH SHARED_POOL command .


select bucket, freespace,
ROUND(ratio_to_report(freespace) over () * 100, 5) AS "Percentage"
from
(select '0 (<140)' BUCKET, sum(KSMCHSIZ) freespace
from x$ksmsp
where KSMCHSIZ<140
and KSMCHCLS='free'
UNION ALL
select '1 (140-267)' BUCKET, sum(KSMCHSIZ) freespace
from x$ksmsp
where KSMCHSIZ between 140 and 267
and KSMCHCLS='free'
UNION ALL
select '2 (268-523)' BUCKET, sum(KSMCHSIZ) freespace
from x$ksmsp
where KSMCHSIZ between 268 and 523
and KSMCHCLS='free'
UNION ALL
select '3-5 (524-4107)' BUCKET, sum(KSMCHSIZ) freespace
from x$ksmsp
where KSMCHSIZ between 524 and 4107
and KSMCHCLS='free'
UNION ALL
select '6+ (4108+)' BUCKET, sum(KSMCHSIZ) freespace
from x$ksmsp
where KSMCHSIZ >= 4108
and KSMCHCLS='free');
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 2 2006
Added on Oct 4 2006
9 comments
977 views