Unix Technical Forum

MQTs under z/OS - how to get IMMEDIATE REFRESH functionality

This is a discussion on MQTs under z/OS - how to get IMMEDIATE REFRESH functionality within the DB2 forums, part of the Database Server Software category; --> I'm doing some cross-platform development, under LUW 8.2 (Windows) for z/OS 8. I have some fairly complex queries which ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 09:31 PM
BD
 
Posts: n/a
Default MQTs under z/OS - how to get IMMEDIATE REFRESH functionality

I'm doing some cross-platform development, under LUW 8.2 (Windows) for
z/OS 8.

I have some fairly complex queries which address some rather large
tables.

One query takes approximately 30 seconds to complete, once the result
set has been loaded into buffer caches. The initial run of the query
is about 2 minutes.

I created an MQT, and that sped up the performance of my query
considerably.

Although I was able to structure the fullselect to 'obey the laws' for
'REFRESH IMMEDIATE' MQTs under LUW, I appear to be out of luck under z/
OS, simply because, according to the dox I've read, z/OS does not
offer REFRESH IMMEDIATE as an option. It's important that the MQT is
kept well up-to-date with its source tables.

I thought of putting a trigger on the source tables to initiate a
REFRESH TABLE command, but the list of 'allowed' statements which a
trigger can, well, trigger - does not appear to include 'REFRESH
TABLE'.

Best I can find, by scouring the group and other forums, is a solution
that involves creating a trigger that calls a stored procedure, which
initiates a REFRESH TABLE.

Has anyone else found a slightly more intuitive solution for this
problem? Am I incorrect in my conclusion that IMMEDIATE REFRESH is not
supported under z/OS UDB?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-25-2008, 01:42 AM
BD
 
Posts: n/a
Default Re: MQTs under z/OS - how to get IMMEDIATE REFRESH functionality


> Has anyone else found a slightly more intuitive solution for this
> problem? Am I incorrect in my conclusion thatIMMEDIATEREFRESH is not
> supported underz/OSUDB?


Anyone? Anyone?? ...Beuller?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-25-2008, 01:42 AM
Serge Rielau
 
Posts: n/a
Default Re: MQTs under z/OS - how to get IMMEDIATE REFRESH functionality

BD wrote:
>> Has anyone else found a slightly more intuitive solution for this
>> problem? Am I incorrect in my conclusion thatIMMEDIATEREFRESH is not
>> supported underz/OSUDB?

>
> Anyone? Anyone?? ...Beuller?

To the best of my knowledge REFRESH IMMEDIATE is not supported in DB2
for zOS.


--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-29-2008, 09:26 PM
BD
 
Posts: n/a
Default Re: MQTs under z/OS - how to get IMMEDIATE REFRESH functionality


> To the best of my knowledge REFRESH IMMEDIATE is not supported in DB2
> for zOS.


This is my understanding as well - what I'm trying to establish is a
mechanism of maintaining an MQT with some assurance that updates to it
will remain closely tied with updates to its source tables. I'm okay
with relying on triggers and stored procs, but have not (for example)
had success in coding a stored proc which calls a 'refresh table'
statement, even though it's mentioned in the z/OS SQL guide as a
supported statement for a stored proc.

I recognize that I cannot initiate a REFRESH TABLE from within a
trigger directly - I've read in the SQL dox about the dozen-or-so
valid statements for triggers.

I believe I should be able to code a stored proc to do it, but the
following proc does not compile:

CREATE PROCEDURE MYSCHEMA.MQTREFRESH ()
LANGUAGE SQL
BEGIN
REFRESH TABLE MQT1;
END

It returns an 'unexpected token "REFRESH TABLE"' message, expecting a
token of "SPACE"

If I schema-qualify the MQT name, returns an "unexpected token
MQT1...following MYSCHEMA." message.

Please don't misunderstand - I'm not looking for help coding a stored
proc (I recognize I'm not particularly experienced with them, either).
I'm simply trying to understand how, under z/OS, do DBAs who want the
IMMEDIATE REFRESH functionality of an MQT, get that kind of
functionality? If I want an MQT with some assurance that updates to it
will occur as closely as possible in time to the updates on the source
tables, what's the best strategy, in the absence of an IMMEDIATE
REFRESH MQT?

Do people build tables manually, and rely on manually-coded triggers,
somehow 'emulating' the immediate functionality?

Thanks kindly for the response...

BD
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:34 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com