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 > MQT Refresh Deferred Automated

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-22-10, 23:44
db2pro db2pro is offline
Banned
 
Join Date: Mar 2009
Posts: 36
MQT Refresh Deferred Automated



Hello,

I have created MQT on DB2 AIX. I have used the option refresh deffered. And each time when I issue refresh table command the table is refreshed. But I need to know ..How can I automate this refresh? as the users are asking?

I have tried refresh immediate option but the MQT is not getting created as we used Left out join of Many tables (nearly 40 tables) in the sql query. I need to use Inner joins to use Immediate refresh..which is little hard to rewrite the query again..

Please help me with this to use refresh deferred option or any other best apporach to refresh the table in regular intervals..I need this process to get automated is there any option in DB2?

Please provide me any material/manuals.

Thanks in Advance.

DB2 version 9.5

OS version AIX 5.3
Reply With Quote
  #2 (permalink)  
Old 03-23-10, 05:23
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Why not create a cron job to refesh the MQT at periodic interval?
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 03-23-10, 12:55
db2pro db2pro is offline
Banned
 
Join Date: Mar 2009
Posts: 36
Thanks Satya!

I am thinking of creating the cronjob..but I just want to know is there any other automated process in db2 itself to make this run at regular intervals..

Please let me know if we have anything like that in db2..

Thanks much for your support!
Reply With Quote
  #4 (permalink)  
Old 03-23-10, 14:07
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
haven't tried, but what about trigger on the 40 tables you are outer joined to? That way if there is a change that neccessitates the refresh, then it is triggered.
Dave
Reply With Quote
  #5 (permalink)  
Old 03-23-10, 23:19
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
according to this page, it is not possible to include REFRESH statement in a trigger

IBM DB2 9.7 for Linux, UNIX and Windows Information Center
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #6 (permalink)  
Old 03-23-10, 23:22
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
BTW, if you have a trigger call a stored proc , the statements/operations not supported by a trigger cannot be used in the proc.

hth

sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
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