Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2001
    Location
    Bangalore
    Posts
    186

    Unanswered: Impact of insert trigger on import or load

    Hi,

    I have a import command which is taking long and the reason i could find is the insert trigger. I just wanted to know that if i use load then will the load still be firing the trigger or it will fire it only in the end. This is not documented by IBM or atleast i could not find it anywhere.

    Cheers,
    Prashant

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    It is documented, but I am not going to find the exact place for you. Import (which uses inserts) will fire triggers. Load will not fire triggers at any time.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Oct 2001
    Location
    Bangalore
    Posts
    186
    Thanks!

    But in that case how is the data integrity taken care of?
    Prashant

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    If you rely on triggers to maintain data integrity, then you are SOL with a load.

    Referential integrity is not checked with a load, but if there are any foreign keys or other constraints on the table, it will be placed in check pending state after the load, and you must run the "set integrity" command to make the table usable. The set integrity command will check to make sure there are no integrity errors (but does not fire triggers).

    If you use an import, inserts are performed and each row is checked for RI and the triggers fire just like any other insert.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Aug 2004
    Posts
    330
    Online load resume should fire your triggers. (with z/os v7 or later)

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by urquel
    Online load resume should fire your triggers. (with z/os v7 or later)
    Since dahalkar_p mentioned "import" in the original post above, he is probably not using DB2 for z/OS, which is a different product than DB2 for Linux, UNIX, and Windows.

    The load utility/command work differently on these two different products. On DB2 for DB2 for Linux, UNIX, and Windows, triggers will not be fired when using the load command.
    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
  •