Skip navigation
18303 Views 14 Replies Latest reply: Mar 18, 2010 9:09 AM by David Birmingham RSS
mali New Enzee 20 posts since
Feb 17, 2010
Currently Being Moderated

Mar 11, 2010 8:08 AM

Unable to reclaim space on my NETEZZA server

Hi All,

I am unable to reclaim space on my NETEZZA server.

This is the Scenario: I created a table:
CREATE TABLE ABCD ( column1 smallint NULL ) distribute on random;

--INserted Data to this table
INSERT INTO ABCD select 1234
INSERT INTO ABCD select 1234
INSERT INTO ABCD select 1234
INSERT INTO ABCD select 1234

--Updated the Table
update abcd
SET column1 = 12345
Now while I run the following nzreclaim command to scanRecords for the no of Rows and Size it will reclaim from the table:

nzreclaim -scanRecords -u admin -pw admin -host host_sample -db database1 -t abcd;

I get '0' No of rows.Which I know is not correct and something that is happening nowdays on my server... Some days back it use to reclaim the space while I run the reclaim command after any update happens on the tables;

Kindly assist why I am not able to reclaim space after an update and nzreclaim ???????

  • David Birmingham Active Enzee 426 posts since
    Sep 24, 2007
    Currently Being Moderated
    1. Mar 11, 2010 9:09 AM (in response to mali)
    Re: Unable to reclaim space on my NETEZZA server

    Each Netezza table has a minimum size. When you first instantiate the table, it will take up this minimum amount of space, which is significantly larger than the several records you are placing into it. Even when doing a reclaim, you probably won't see any movement in the table size if it has not breached the minimum.

     

    Try the same scenario with several millions of records where the data size hits into the tens of gb's. Then set aside the reclaim as a viable option for tables this small.

     

    The reclaim is an option of last resort, reserved for tables that are too large to rebuild with a simple CTAS (that is, there's not enough space on the machine for a CTAS, not that it has "too many records"). For a table this small, you should be using the CTAS.

  • Shawn Fox Enzee Exraordinaire 1,333 posts since
    Aug 15, 2006
    Currently Being Moderated
    3. Mar 11, 2010 10:39 AM (in response to mali)
    Re: Unable to reclaim space on my NETEZZA server

    Given this information, the cause is almost certainly that you have an open transaction on the server.  If someone started a transaction several days ago and never committed it or aborted the session, you cannot reclaim any records in any table that would be visible to that transaction.  This is because Netezza is trying to conserve the data as it was at the time that old transaction started.   Netezza prevents you from reclaiming records which would be visible to a transaction if that transaction were to access the table (even if the transaction has not yet accessed the table).  Once you abort this transaction you should be able to reclaim records as normal.

  • Shawn Fox Enzee Exraordinaire 1,333 posts since
    Aug 15, 2006
    Currently Being Moderated
    5. Mar 11, 2010 10:57 AM (in response to mali)
    Re: Unable to reclaim space on my NETEZZA server

    A transaction does not have to access the table to prevent you from reclaiming records.  A transaction only has to be active on the system.  If there is any transacation which started prior to you deleting rows, NPS will not allow you to reclaim any records which were deleted after that transaction started.  I thought I was clear about that on my prior post, hopefully this one clears up it up completely.

     

    For example, if I connect to NPS, start a transaction, and never commit/rollback or disconnect, no records which are deleted after my transaction began can be reclaimed until my transaction is completed.  I've seen sitations where a transaction has been left open for weeks and it can cause all sorts of problems in this way.  To repeat again, it does not matter if my session accesses a table.  No records from *any* table can be reclaimed until my transaction completes regardless of if my transaction has accessed the tables.

  • David Birmingham Active Enzee 426 posts since
    Sep 24, 2007
    Currently Being Moderated
    7. Mar 11, 2010 11:57 AM (in response to Shawn Fox)
    Re: Unable to reclaim space on my NETEZZA server

    It almost sounds like there is a safety-net necessity to jump into single-user mode to accomplish the reclaim, such that no transactions can accidentally sneak-inside the machine before I can launch the reclaim.

     

    Either way, these are all good reasons to keep the reclaim in a back pocket for a rainy day, or when the box runs out of space to support a CTAS. However, if the box is this close to runnng out of space, there is another problem looming - capacity. So in the end, the need to use a reclaim at all could be a symptom of a larger capacity issue.

  • Greg New Enzee 8 posts since
    Aug 7, 2009
    Currently Being Moderated
    8. Mar 11, 2010 12:03 PM (in response to mali)
    Re: Unable to reclaim space on my NETEZZA server

    Have you backed up your data?  I believe in 4.5 or 4.6, nzreclaim will no longer reclaim data unless it is backed up or you use the switch -backupset NONE.

  • David Birmingham Active Enzee 426 posts since
    Sep 24, 2007
    Currently Being Moderated
    10. Mar 11, 2010 3:07 PM (in response to mali)
    Re: Unable to reclaim space on my NETEZZA server

    On a separate question, you did not say how many records had been updated when you ran the update command. Are you sure it applied updated values?

  • mpothen New Enzee 1 posts since
    Mar 12, 2010

    Hi,

     

    can you do a show locks and verify that there are no locks? or nzession to see who was what locks?

    If you can, you can stop and start the database open the database in exclusive lock mode. this will ensure that there are no zombie transactions out there

    then run nz_reclaim from the contrib and check the estimates

    and then run nzreclaim on the table

  • stacy long New Enzee 1 posts since
    Oct 17, 2008
    Currently Being Moderated
    12. Mar 15, 2010 3:45 PM (in response to mpothen)
    Re: Unable to reclaim space on my NETEZZA server

    I had a similar situation recently.  nzreclaim wasn't reclaiming any rows and nzsession showed no active sessions.  However when I ran "nzstats -type query" I could see a query that looked like it had been running for weeks.  I ended up doing an nzstop/nzstart and that cleared up the session and afterwards nzreclaim did reclaim rows.

  • David Birmingham Active Enzee 426 posts since
    Sep 24, 2007
    Currently Being Moderated
    14. Mar 18, 2010 9:09 AM (in response to mali)
    Re: Unable to reclaim space on my NETEZZA server

    At this point it is time to engage with your assigned product engineer, who can troubleshoot the problem with higher visibility. Something subtle is afoot and none of us have hands-on access to your machine.

     

    Also as a note, this community is all-volunteer. Your product engineer is not. .

More Like This

  • Retrieving data ...

Bookmarked By (0)