Re: Partitions expanding above the HWM

From: Kellyn Pedersen <kjped1313_at_yahoo.com>
Date: Tue, 12 Jan 2010 07:23:40 -0800 (PST)
Message-ID: <283051.44742.qm_at_web32003.mail.mud.yahoo.com>



OK, I know I'm going off very little sleep this last week, so forgive me if I'm just oblivious today...:) The main issue is, you are concerned about the free space not be re-utilized by the next insert after the delete... "INSERT INTO table SELECT * FROM staging_table"
 

THEN
 

"DELETE FROM table WHERE EXISTS"
 

but I have to ask-  Where are you committing your transactions, both after the inserts and the deletes? 
 

If this is running in parallel, until a commit is issued, this isn't goint to be seen as freespace and I would foresee continual fragmentation in the object.  I've always recommended bulk deletes of data separate from and data loads, whenever possible.  Even with a change in the load process, I still often experience blocks that aren't re-used if there is high parallel inserts and deletes on an object.
 

Again, apologies if I'm missing the point here, but until I perform the steps that Surachart listed below, I wouldn't expect the HWM to shrink and I would expect it to grow due to the logic in the code. 
 

Kellyn Pedersen
Multi-Platform DBA
I-Behavior Inc.
http://www.linkedin.com/in/kellynpedersen www.dbakevlar.blogspot.com
 

"Go away before I replace you with a very small and efficient shell script..."
  • On Mon, 1/11/10, Thomas Roach <troach_at_gmail.com> wrote:

From: Thomas Roach <troach_at_gmail.com> Subject: Re: Partitions expanding above the HWM To: "Surachart Opun" <surachart_at_gmail.com> Cc: "Oracle Discussion List" <oracle-l_at_freelists.org> Date: Monday, January 11, 2010, 7:29 PM

Thanks for the assistance. The blocksize for the whole DB is 16kb. The partition is hash by customer with a sub partition so the range I do not get help with, but it is definitely an option. What happens is the insert (and we have 7 processes running in parallel, so there is some contention on these heavy inserts), then each one cleans up the old copies of the records. We only delete old records when new ones are uploaded, so if we insert 50,000 records, and only 30,000 of them are updates, then it inserts all 50k, then drops the old 30k ones, so we could still have 20k from the old run. So as more records are inserted, the old blocks look like swiss cheese, but the old space does not appear to be used. With ASSM, I wonder if I am hitting some sort of bug because the operations I see don't tell me that it is avoiding previously used blocks.

On Mon, Jan 11, 2010 at 9:13 PM, Surachart Opun <surachart_at_gmail.com> wrote:

ASSM - PCTUSED is no need (ignore)

If you use tablespace (ASSM), you can shrink segment (each partition) http://www.oracle.com/technology/pub/articles/10gdba/week15_10gdba.html

ALTER TABLE [TABLE_NAME] ENABLE ROW MOVEMENT;
ALTER TABLE [TABLE_NAME] MODIFY PARTITION [PARTITION_NAME] SHRINK SPACE COMPACT; -- shrink segment, but no reduce HWM
ALTER TABLE [TABLE_NAME] MODIFY PARTITION [PARTITION_NAME] SHRINK SPACE; -- reduce HWM


This case may occur, if you have many insert sessions(and have session to delete HIGH values). But if 640 GB and then shrunk to 17 GB

How about block_size in this tablespace? -- I have grew up like this on big block_size(32K)

I have some question - How about delete data process? If you delete old day ... you may point to make table partition by RANGE (and then truncate old day)

Good Luck
Surachart Opun
http://surachartopun.com

On Tue, Jan 12, 2010 at 5:55 AM, Thomas Roach <troach_at_gmail.com> wrote:

4 node RAC - 10.2.0.4
Linux x86_64 RHEL 5.3
 

Tablespace
ASSM on the Tablespaces (but the table has PCTFREE of 10 and PCTUSED of 0 "which should be ignored because of ASSM."
 

Reporting Table
Partitioned by hash into 16 partitions.
Degree of parallel is 1.
PCTUSED 0
PCTFREE 10
 

Staging Table
Partitioned by server name (7 partitions) Parallelization is enabled
 

I am having an issue with a table that is just using way too much disk space. As of today, it was using 640GB. I shrunk it down to about 17GB by using the move partition command with update indexes. As data is inserted, it appears to be
 

I initially thought I had it when I saw PCTUSED 0, but then I found the tablespace was ASSM, so this value "should" be ignored. I found the package that loads this table from a staging table.
 

What happens is this.
 

"INSERT INTO table SELECT * FROM staging_table"
 

THEN
 

"DELETE FROM table WHERE EXISTS"
 

So, I set up a little test case, and I can't seem to replicate the data. This is not doing anything with APPEND in this package that does the ETL. I tested with parallel dml enabled at the session level and that yielded no results. Does anyone have any ideas what I might be missing? Could this be a bug with ASSM? Any help would greatly be appreciated as I have banged my head against the monitor all day (not literally).
 

Thanks!

-- 
Thomas Roach
813-404-6066
troach_at_gmail.com



      
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jan 12 2010 - 09:23:40 CST

Original text of this message