Walter white
Walter white

Reputation: 183

Netezza Error Data partition is full - When calling a Stored Procedure multiple times

I call a procedure several times during a loop, when I run it 4 times there is no problem, but if I run it more than 4 times, I get the following error:

Data partition is full.

I am using distribution keys in my queries like suggested in the following website: https://www.ibm.com/developerworks/community/forums/html/topic?id=35763b32-b40f-4178-8923-0b39edff7c7c

Here is the code that calls the function:

FOR i in  0 .. N
     LOOP
          CALL FUNCTION_X(last_day(ADD_MONTHS(DATE_VAR, i)));
     END LOOP;

I was wondering if there is a way for example that after each call can do some kind of memory flush or another thing in order to get rid of that error...

Upvotes: 0

Views: 2708

Answers (2)

Walter white
Walter white

Reputation: 183

This is how I solved it and now I tested it the function running it 18 times. I only used a Commit after the call function. Here is the code:

FOR i in  0 .. N
    LOOP
         CALL FUNCTION_X(last_day(ADD_MONTHS(DATE_VAR, i)));
         COMMIT;   
    END LOOP;

Hope it helps to anybody that get this error.

Upvotes: 0

Lars G Olsen
Lars G Olsen

Reputation: 1118

If you only need to execute that function (or is it really a stored procedure???) 4 times before it fills a disk, there are two options:

1) your system is 99.9% full on at least one dataslice all the time you need to free up some space (drop tables, repartition and/or ‘groom records all) on a lot of tables) 2) a lot happens inside that function which leads to a dataslice running full. Try commenting out large sections of the code inside it to do a ‘binary search’ to locate the problem and then come back to us

Upvotes: 1

Related Questions