Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    120

    Unanswered: issue with the drop of a primary key

    Hi all,
    I'm using DB2 10.5 on Linux.

    I have a strange issue with the drop of the primary key (pk_mytable) of a table containing 250.000 rows.
    The table definition is the following:

    CREATE TABLE mytable(
    b SMALLINT NOT NULL,
    f VARCHAR(260) NOT NULL,
    s BIGINT NOT NULL,
    h CHAR(20) FOR BIT DATA,
    h2 CHAR(32) FOR BIT DATA,
    i SMALLINT NOT NULL,
    e CHAR(16) FOR BIT DATA NOT NULL,
    e2 CHAR(16) FOR BIT DATA NOT NULL,
    m VARCHAR(512) FOR BIT DATA NOT NULL,
    s BIGINT NOT NULL,
    o SMALLINT,
    o2 BIGINT,
    CONSTRAINT pk_mytable PRIMARY KEY ( b, f)
    )

    The issue is that the drop of pk_mytable takes more than 4 hours.
    The drop command ("alter table mytable drop constraint pk_mytable") is invoked from a C application where all db instructions are executed via ODBC sequencially and run in their own transaction.

    If the same alter table statement to drop pk_mytable is run from the db2 clp it takes less then 1 second.

    Any idea of what's happening?
    Thanks

  2. #2
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    Is the AUTHID different? Certain that the database+instance is the same? What's in the monitoring output (i.e. what's the drop waiting for, locks?) , what's in the db2diag ? Which fixpack?
    In short, you have all the facts at your disposal if you choose to look for them.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •