Sydney Oracle Meetup Message Board › 90% of the blocks under HWM are over 75% free, but new records are still pus

90% of the blocks under HWM are over 75% free, but new records are still pushing up the HWM

Geoffrey Zhang
Posted Dec 16, 2009 5:12 PM
The-Curiouser
Sydney, AU
Post #: 1
Send an Email Post a Greeting
Hi There,

I've got into this scenario on a production database which is on 10.2.0.1.
There is a history table which we have run cleanup script to delete records older than 7 days. After the cleanup, the table is around 1.5GB, but within 2 day, its usage has been pushed up to 2GB.
After analyze by dbms_space.space_usage we got:
FS1--0-25% free space within a block
FS2--25-50% free space within a block
FS3--50-75% free space within a block
FS4--75-100% free space within a block
FS1 Blocks = 30 Bytes = 245760
FS2 Blocks = 40 Bytes = 327680
FS3 Blocks = 46 Bytes = 376832
FS4 Blocks = 140121 Bytes = 1147871232
Full Blocks = 3514 Bytes = 28786688

The EXTENT_MANAGEMENT, SEGMENT_SPACE_MANAGEMENT are set to LOCAL and AUTO.
I know the solution is to shrink the table segment. But I am still puzzled by how this happened. It comes to 2 topics I am still trying to find a good answer:
1) How does Oracle use the bitmap to allocate/de-allocate free blocks?
2) How INSERT use the bitmap to look up free blocks? More relative to the problem I have, how INSERT skips all free blocks indicated by bitmap and decide to allocate new extent and push up the HWM?

I've read through the concept guide and DBA admin doc but not able to find what I want, if anyone can point me to the right direction, it will be much appreciated.

Regards
Geoffrey
Andre Araujo
Posted Dec 16, 2009 5:51 PM
user 9152160
Sydney, AU
Post #: 1
Send an Email Post a Greeting
How are the inserts being done? Are they direct inserts (/*+ APPEND */)?
Gary Myers
Posted Dec 16, 2009 8:06 PM
Gary_Myers
Sydney, AU
Post #: 1
Send an Email You are unable to greet this member
One thing to consider with such a large delete is that most of the emptied blocks would get pushed back to the data file as dirty blocks, before the commit is done. Not quite sure when Oracle would tidy up the bits that says they are free.

You could try doing a select of the table after the commit forcing a full table scan.

Presumably partitions are not an option for you when purging on a seven day cycle.
Other 'weird' stuff would be an index-organized table where there's less choice about what blocks to use.

Gary
Sergey Kosourikhin
Posted Dec 17, 2009 10:10 PM
kosour
Sydney, AU
Post #: 4
Send an Email Post a Greeting
What is size of pctfree on this table and average length or rows ?
Geoffrey Zhang
Posted Jan 29, 2010 12:28 PM
The-Curiouser
Sydney, AU
Post #: 2
Send an Email Post a Greeting
Got back to look into this issue again and found it similar to an Oracle bug:
Bug 4660718: TABLE GROWTH POSSIBLE USING AUTOMATIC SEGMENT MANAGEMENT AND LONG RAW COLUMN

And the work around:
exec dbms_repair.segment_fix_status('SAPR3', 'VBDATA');

seems to do the trick. I guess somehow the PCTFREE has been changed or the bitmap used to maintain the local manage segment are malfunctioned or corrupted.

Hope this bit will help someone in the future if you encounter the similar scenario.

Regards
Geoffrey
Powered by mvnForum

The Pythian Group

Database services & consulting in Australia. Meetup organizer.

Offer a perk for our members and get exposure.

Offer a perk →
Other nearby
Meetups
Why these groups?
x

The Meetup Groups shown here are topically similar to Sydney Oracle Meetup.

Groups are more likely to be displayed here if they:

  • have a Meetup scheduled
  • have a high rating
  • have a group photo
  • are "public" and not "private"
  • have shown they are likely to stick around (older than 30 days)
Find more Meetup Groups
near Sydney

Log in

  • Not registered with us yet?
or

Log in to Meetup with your Facebook account.

Sign up

or

Join this Meetup Group even quicker with your Facebook account.

By clicking the "Sign up using Facebook" or "Sign up" buttons above, you agree to Meetup's Terms of Service