Home » RDBMS Server » Performance Tuning » Oracle Fragmentation script
Oracle Fragmentation script [message #466237] Sun, 18 July 2010 07:53 Go to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
Hi,

Can any one provide me the sql scripts which can help me to identify the fragmented table in oracle 10g.

Thanks
Prashant
Re: Oracle Fragmentation script [message #466240 is a reply to message #466237] Sun, 18 July 2010 08:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The is no table fragmentation in Oracle 10g unless you mean something that you have to detail.

Regards
Michel
Re: Oracle Fragmentation script [message #466247 is a reply to message #466240] Sun, 18 July 2010 10:03 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
Hi,

We have an OLTP SYSTEM runing on oracle 10g database, We are facing some performance issue, may be because of some fragmentation, so I need a sql script which will help me to identify those objects which are fragmented.

Thanks
Prashant
Re: Oracle Fragmentation script [message #466248 is a reply to message #466247] Sun, 18 July 2010 10:11 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>We are facing some performance issue, may be because of some fragmentation,
>so I need a sql script which will help me to identify those objects which are fragmented.
Table "fragmentation" is a figment of your imagination.
Which SQL are slow & why? Post EXPLAIN PLAN for them
Re: Oracle Fragmentation script [message #466250 is a reply to message #466247] Sun, 18 July 2010 10:19 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
We are facing some performance issue, may be because of some fragmentation

Or maybe thousand of other reasons, do you want to verify each one?
You're doing the wrong way.

You can first read:
- OraFAQ Forum Guide, Performance Tuning section
- Performances Tuning sticky
- OraFAQ Performance Tuning

You can also have a look at Database Performance Tuning Guide.

Regards
Michel
icon7.gif  Re: Oracle Fragmentation script [message #466253 is a reply to message #466250] Sun, 18 July 2010 10:48 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
Hi,

Thanks for the suggestion .I posted a very simple question, is there any script which can identify the fragmented objects in oracle 10g. Why I need this this is not a primary issue/concern.

Thanks
Prashant
Re: Oracle Fragmentation script [message #466254 is a reply to message #466253] Sun, 18 July 2010 10:51 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Once again, define "fragmentation".
This is a very simple question.
If you can't or don't know what you mean by this, then there is no script.

Regards
Michel
Re: Oracle Fragmentation script [message #466255 is a reply to message #466253] Sun, 18 July 2010 10:51 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://en.wikipedia.org/wiki/Snipe_hunt
Re: Oracle Fragmentation script [message #466258 is a reply to message #466254] Sun, 18 July 2010 11:01 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
See we have an OLTP system and there are nos of delete and update happens daily on the tables and as a result our table became fragmented , so now i have to identify those table and re-organize them.So if u have any scripts then pl provide me.
Re: Oracle Fragmentation script [message #466262 is a reply to message #466258] Sun, 18 July 2010 11:22 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You still don't define "fragmentation".
What is "fragmentation"? The question is simple and should be answered starting by "fragmentation is...".

Regards
Michel
Re: Oracle Fragmentation script [message #466263 is a reply to message #466262] Sun, 18 July 2010 11:40 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
In 1997 (?) I think, there was a famous white paper called "How to Stop Defragmenting and Start Living: The Definitive Word on Fragmentation". I'll attach a copy, just so anyone who thinks "fragmentation" is an issue can see how out-dated it is. All copies have been removed from Oracle Corp websites long ago, because the whole concept is meaningless since 8.1 introduced locally managed tablespaces.

@OP, in this paper you will find the queries you want, and I hope you also see that none of it is relevant today.
[edit: file uploaded]
  • Attachment: fragment.pdf
    (Size: 62.44KB, Downloaded 2607 times)

[Updated on: Sun, 18 July 2010 11:41]

Report message to a moderator

Re: Oracle Fragmentation script [message #466265 is a reply to message #466263] Sun, 18 July 2010 11:55 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
Thanks John.

I found this query which can tell me the segment name which requires some action:


select segment_owner,segment_name,ALLOCATED_SPACE/1024/1024 alloc_mb,
USED_SPACE/1024/1024 used_mb,RECLAIMABLE_SPACE/1024/1024 rclm_mb
,round(100*RECLAIMABLE_SPACE/ALLOCATED_SPACE,4)recl_pct ,CHAIN_ROWEXCESS,c1,c2,c3
from table(dbms_space.asa_recommendations())
--rclm_pct will be a command line parameter, Using 25% as the default
where 100*RECLAIMABLE_SPACE/ALLOCATED_SPACE>10
--segment_name like 'ROW%'
order by recl_pct desc;
Re: Oracle Fragmentation script [message #466266 is a reply to message #466265] Sun, 18 July 2010 11:56 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
When you start with the wrong question, no matter how good an answer you get, it won't matter very much.
Re: Oracle Fragmentation script [message #466267 is a reply to message #466266] Sun, 18 July 2010 12:14 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
I do not think I posted wrong question, even I posted the same with oracle as they are technology partner with our orgnisation and they are going to provide end to end solution for fragmentation and they also conveyed the message that yes our database have some fragmentation issues.
Re: Oracle Fragmentation script [message #466270 is a reply to message #466267] Sun, 18 July 2010 12:23 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>they also conveyed the message that yes our database have some fragmentation issues.
Which metric at what value signifies when fragmentation exists or not?
Re: Oracle Fragmentation script [message #466275 is a reply to message #466270] Sun, 18 July 2010 12:52 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
Ohhh. If you do not know then please visit this site, it will help u.

http://www.oracle.com/technology/pub/articles/10gdba/week15_10gdba.html
Re: Oracle Fragmentation script [message #466276 is a reply to message #466275] Sun, 18 July 2010 12:55 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Which metric at what value signifies when fragmentation exists or not?
Re: Oracle Fragmentation script [message #466278 is a reply to message #466265] Sun, 18 July 2010 13:21 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
Oh no! I did not want this reply:
prashant_ora wrote on Sun, 18 July 2010 11:55
Thanks John.

I found this query which can tell me the segment name which requires some action:


I posted that article, hoping it would be a polite way of demontrating that the whole concept of fragmentation is totally meaningless now. Any DBA who tells you differently, is showing that his knowledge of Oracle is 4 major releases out of date.
I'll stop trying to help! Over-and-out.
Re: Oracle Fragmentation script [message #466279 is a reply to message #466275] Sun, 18 July 2010 13:36 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
prashant_ora wrote on Sun, 18 July 2010 19:52
Ohhh. If you do not know then please visit this site, it will help u.

http://www.oracle.com/technology/pub/articles/10gdba/week15_10gdba.html

We know but nothing in your posts shows that YOU know. And now are you able to give a definition?

In addition, this will NOT address your real problem (as already said and repeated).

Regards
Michel

Re: Oracle Fragmentation script [message #466289 is a reply to message #466275] Sun, 18 July 2010 15:38 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
prashant_ora wrote on Sun, 18 July 2010 10:52
Ohhh. If you do not know then please visit this site, it will help u.

http://www.oracle.com/technology/pub/articles/10gdba/week15_10gdba.html


This page contains the word "fragmentation" only once.
It does NOT define what "fragmentation is or how to measure it.

You continue to claim that fragmentation exists & that it has a measurable negative impact on performance.

Please provide a reproducible test case that proves your claim is valid.

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: Oracle Fragmentation script [message #466300 is a reply to message #466289] Sun, 18 July 2010 22:04 Go to previous messageGo to next message
rleishman
Messages: 3728
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Some people with an imperfect understanding of databases will sometimes lump a number of issues (incorrectly) under the definition of "fragmentation". Since one of the impacts of fragmentation under Dictionary Managed Tablespaces was to under-utilise disk space, other unrelated issues that also under-utilise disk - such a HWM and the effect of deletions on b-tree indexes with sequentially allocated keys - might incorrectly be described as fragmented.

Here's something I wrote a while ago to identify indexes where updates and deletes have left recoverable space. I have used the term "Fragmented" a little loosely, certainly not to be confused with the fragmentation issue inherent in Dictionary Managed Tablespaces.

Ross Leishman
Re: Oracle Fragmentation script [message #466302 is a reply to message #466289] Sun, 18 July 2010 23:49 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
Ok . If you are not getting the sufficient information about fragmentation, then please visit this site:
http://www.oracle.com/technology/products/manageability/database/pdf/ow04/1241_minhas.pdf

Hope now you can understand .
Re: Oracle Fragmentation script [message #466303 is a reply to message #466302] Sun, 18 July 2010 23:54 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
prashant_ora wrote on Sun, 18 July 2010 21:49


Hope now you can understand .


Which metric at what value signifies when fragmentation exists or not?

Please answer with SQL the answer to my question.
Re: Oracle Fragmentation script [message #466306 is a reply to message #466302] Mon, 19 July 2010 00:58 Go to previous message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
prashant_ora wrote on Mon, 19 July 2010 06:49
Ok . If you are not getting the sufficient information about fragmentation, then please visit this site:
http://www.oracle.com/technology/products/manageability/database/pdf/ow04/1241_minhas.pdf

Hope now you can understand .

And YOU, do you understand?
You are still unable to give a definition of and a metric for it.

Regards
Michel

Previous Topic: TRACE SESSION USING DBMS_APPLICATION_INFO
Next Topic: points to ponder while having Index against any column
Goto Forum:
  


Current Time: Sat May 04 04:06:16 CDT 2024