If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Impact of insert trigger on import or load

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-06, 00:27
dahalkar_p dahalkar_p is offline
Registered User
 
Join Date: Oct 2001
Location: Bangalore
Posts: 186
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
Reply With Quote
  #2 (permalink)  
Old 03-24-06, 00:36
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 03-24-06, 00:38
dahalkar_p dahalkar_p is offline
Registered User
 
Join Date: Oct 2001
Location: Bangalore
Posts: 186
Thanks!

But in that case how is the data integrity taken care of?
__________________
Prashant
Reply With Quote
  #4 (permalink)  
Old 03-24-06, 00:44
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #5 (permalink)  
Old 03-24-06, 09:37
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
Online load resume should fire your triggers. (with z/os v7 or later)
Reply With Quote
  #6 (permalink)  
Old 03-24-06, 23:26
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On