Professional Documents
Culture Documents
Usually in OLTP environment like EBS Applications, tables are often get fragmented
due to multiple DML activities that happens.Fragmented tables cause queries on
those tables to slow down. It is very important to de-fragment this table and to
reclaim the fragmented space from these objects.
For EBS we have also seen that usually gathered statistics, indexing and proper
SQL tuning is plenty to improve and maintain acceptable performance but sometime it
is required to reorg the table.
One primary cause of fragmentation is that when you run delete command on the
tables it delete the rows but doesn�t frees up the memory and also do not changes
the high water mark.
We have also seen that this requirement for doing reorg is more required in
Demantra applications and since Demantra is both OLTP and data warehouse the
applications we must tune accordingly so that query run time can be optimum.
Although this article focus on the EBS/Demantra application tables but it is true
for all oracle databases.
As rows are added to tables, the table expands into unused space within the space.
It will naturally fragment as discontiguous data blocks are fetched to receive new
rows. Updating table records may also cause row chaining if the updated row can�t
fit into same data block.
At deletion, a table may coalesce extents, releasing unused space back into the
tablespace. A lot of deletes leaves high-water mark behind at a high value. It will
cause slower full-table-scan performance since Oracle must read to the high water
mark.
a) Negative Performance impact � SQL statements that performs full-scan and large
index range scans may run more slowly in a fragmented table. When rows are not
stored contiguously, or if rows are split onto more than one block, performance
decreases because these rows require additional block accesses.
b) Wasted Disk Space � It means you have space in your disk which your database can
not use.
REORG PROCESS
The main goal of table reorganization is to reduce IO when accessing the big
database tables.
We usually follow below process for counter table fragmentation. We have also
mentioned some good scripts related to data fragmentation at that end of this
article.
METHOD 1. Alter table move (to another tablespace, or same tablespace) and rebuild
indexes:-
METHOD 2. Export and import the table
METHOD 3. Shrink command . (applicable for tables which are tablespace with auto
segment space management)