Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2009
    Posts
    36

    Unanswered: 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

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  3. #3
    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!

  4. #4
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    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

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  6. #6
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

Posting Permissions

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