Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2005

    Unanswered: DB2 primary index

    I am a DB2 novice and cannot understand the concept when people in my team say that dropping a primary index on db2 table will cause damage to the data.Is it really true ? I know we can do a drop/alter a primary index on an oracle or sybase table.

  2. #2
    Join Date
    May 2003
    DB2 requires that a unique index exist on the primary key. If a unique index does not already exist when the PK is defined, then DB2 will create one for you. If one already exists, then DB2 will use it.

    Some other databases may just do a table scan making sure there are no duplicates if no unique index exists on the PK, but DB2 always uses the unique index to do make sure there are no duplicates.

    You can drop the index if you first remove the PK.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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