?
Solved

How do you generate DB2 Tables that mirrors the DB2 administative MON_* views?

Posted on 2015-02-20
3
Medium Priority
?
247 Views
Last Modified: 2015-03-09
Hello,

Is there an easier way to create DB2 tables like the administrative MON_* views? I have tried doing this from data studio by selecting the views generating the ddl that way but what I got looks like I have to manually striping everything off but the list of column elements that is returned if the view is called. That seems a long way to do this.

Any recommendation will be highly appreciated.

Thanks

Enyimba
0
Comment
Question by:Enyimba
  • 2
3 Comments
 
LVL 26

Accepted Solution

by:
Tomas Helgi Johannsson earned 2000 total points
ID: 40624820
HI!

If you want some sort of historical tables for the adminstrative views then you can look
at this link
http://www.ebenner.com/db2dba_blog/?p=9

It has DDL's for certain history tables as well as how to populate them.
For other adminstrative views that are not covered there you could
try to issue

create table mon..._hist like mon...view
or
CREATE TABLE SCHEMA.MON_..._HIST AS (
    SELECT *
    FROM SCHEMA.MON_...VIEW
) WITH NO DATA

Hope this helps.

Regards,
     Tomas Helgi
0
 

Author Comment

by:Enyimba
ID: 40629841
TomasHelgi,

Thank you for the link. I have had the chance to read through the content and what I find is that the snapshop monitoring strategy is slowly being abandoned in favor of the new MON_GET_* monitor views introduced in DB2 9.7 and later. That is the way I wish to go in building my performance database warehouse tables. Having said that, the SQL pseudo code you have provided gives me something towork with. I will try to gn the tables from what you have shown.

Again thank you for writing...

Enyimba
0
 

Author Closing Comment

by:Enyimba
ID: 40655377
Again, thanks Tomas
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question