Operating System - HP-UX
1752422 Members
5718 Online
108788 Solutions
New Discussion юеВ

Managing LOB Segments in Oracle 8i

 
Brian Bientz
Advisor

Managing LOB Segments in Oracle 8i

We have an application that writes to a table that has a BLOB column. In order to manage the space usage, we only want to keep the BLOB for 5-7 days but the remainder of the record for up to 90 days. We wrote a cleanup procedure to update the table and set the BLOB column to null.

Once the BLOB is set to NULL, are the blocks allocated in the LOB segment immediately made available for re-use? Based on the calculations I have done, it does not seem that this is the case. If this is not the case, when will those blocks be made available for re-use?
3 REPLIES 3
Yogeeraj_1
Honored Contributor

Re: Managing LOB Segments in Oracle 8i

hi,

a few clarifications:

blobs, when they get beyond 4,000 bytes, are stored out of line in their OWN
segment. They are not stored in the table. the raw(16) is not any different
then a varchar2(16) and we won't even consider that.

So, sizing the table is done the "old fashioned way" -- load up representative
data, and analyze it -- then multiply. (i've never ever found a formula that
actually works -- you have to load it up and see -- somewhere between 0.1% and
10% of the data depending on the size of the eventual table).

Then, you need to size the blob segments themselves. I would use a show_space
script I have to determine your needs there. You'll
load up representative data and see what it takes. Remember with lobs however,
we store them in chunks. So, say you have:

o 8k database
o 32k chunksize on the lob (you PICK)


Each of your lobs will take 32k of space -- no two lobs will share the same chunk. In your case, you might decide on an 8k chunk for col1 and a 16k chunk
for col2.

To end, it is recommended that you use Locally managed tablespaces to eliminate the space problems that you might be facing.

If you need any further clarifications, please let us know.

Hope this helps!
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
T G Manikandan
Honored Contributor

Re: Managing LOB Segments in Oracle 8i

check 162345.1 & 66431.1 at metalink

Indira Aramandla
Honored Contributor

Re: Managing LOB Segments in Oracle 8i

Yes after the delete and commit, you should be able to use the lob segments space.

Refer to the attachment for more detailed explaination of LOBS, BLOBS....
Never give up, Keep Trying