BMC Communities Banner

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (5 pts)
2 Replies Last post: May 19, 2009 2:45 PM by bdholm  
jqphantom Participant 2 posts since
May 18, 2009
Currently Being Moderated

May 18, 2009 4:03 PM

Access to Windows Physical Read/Write Stats via Oracle SQL

I am attempting to extract daily averages of the physical read and write rates for all Windows servers. Because the data in the CAXLCLDD table is stored by disk instances, though, I have to write a subquery to sum up the read and write rates across instances, then embed that subquery in a larger query to calculate the averages.This subquery extracts hourly sums (and does so fairly quickly), but I need averages of the sums over one or more dates,  not just the sums:

SELECT  LOWER(CAXNODES.COMPUTER_NAME) AS HOST,
  CAXINTVL.INT_START_TIME,  CAXINTVL.INT_START_DATE,
     SUM(CAXLVLDD.T09READS) AS READS_SUM,
      SUM(CAXLVLDD.T09WRITES) AS WRITES_SUM
FROM CAXDSKS, CAXNODES,  CAXINTVL
JOIN CAXLVLDD ON CAXINTVL.INDEXX = CAXLVLDD.INTVL
WHERE  LOWER(CAXNODES.COMPUTER_NAME) IN ('xyzsrv044', 'xyzsrv045')
AND  CAXINTVL.INT_START_DATE BETWEEN '09/04/07' AND '09/04/07'
  AND  CAXLVLDD.T09READS >= 0
  AND CAXINTVL.INTTYPE='M' AND  CAXINTVL.INT_DURATION = 60
  AND CAXINTVL.INT_START_TIME BETWEEN '0000' AND  '2359'
  AND CAXLVLDD.NTDISKS = CAXDSKS.INDEXX  /* Critical! */
AND  CAXLVLDD.NODES = CAXNODES.INDEXX
GROUP BY CAXNODES.COMPUTER_NAME, 
  CAXINTVL.INT_START_DATE, CAXINTVL.INT_START_TIME

This is where I want to go, more or less,  except that the query performance is quite awful, even limited to a couple of nodes; note the AVG(IOSUM.READS_SUM) and  AVG(IOSUM.WRITES.SUM) in the second and third lines:
SELECT  IOSUM.HOST,
AVG(IOSUM.READS_SUM) AS  READS_MEAN,
AVG(IOSUM.WRITES_SUM) AS WRITES_MEAN

FROM CAXINTVL,  CAXNODES, CAXDSKS,
(SELECT LOWER(CAXNODES.COMPUTER_NAME) AS HOST,      /*  start of subquery */
   CAXINTVL.INT_START_TIME,  CAXINTVL.INT_START_DATE,
    SUM(CAXLVLDD.T09READS) AS READS_SUM,
     SUM(CAXLVLDD.T09WRITES) AS WRITES_SUM
FROM CAXDSKS, CAXNODES,  CAXINTVL
JOIN CAXLVLDD ON CAXINTVL.INDEXX = CAXLVLDD.INTVL
WHERE  CAXNODES.COMPUTER_NAME IN ('xyzsrv044', 'xyzsrv045')
  AND  CAXINTVL.INT_START_DATE BETWEEN '09/04/07' AND '09/04/07'
  AND  CAXLVLDD.T09READS >= 0
  AND CAXINTVL.INTTYPE='M'
  AND  CAXINTVL.INT_START_TIME BETWEEN '0000' AND '2359'
  AND CAXLVLDD.NTDISKS =  CAXDSKS.INDEXX  /* Critical! */
  AND CAXLVLDD.NODES = CAXNODES.INDEXX 
GROUP BY CAXNODES.COMPUTER_NAME,
   CAXINTVL.INT_START_DATE,  CAXINTVL.INT_START_TIME
) IOSUM                                             /* end of subquery */
GROUP BY IOSUM.HOST
ORDER BY  HOST
My basic question: How do I get an average of the sums across disk instances with reasonable query performance? The answer also needs to bear in mind that once I get this working, the eventual query also has to do the same thing for service time and several other Windows metrics (CAXLVLDD.T09SVC_TIME, .T09QUEUE_LEN, .T09AVG_RD_TIME, .T09AVG_WR_TIME, and .T09TOTAL_IO). For some reason, Oracle reports a query plan that includes a bunch of MERGE JOIN CARTESIAN operations, which as we all know is a Bad Thing. Can I use a JOIN to make this thing run faster? Between Oracle and the database, Oracle reports Invalid Identifier if I try to link tables using JOIN, but the query plans are awful if I stick with the examples that use WHERE to link tables.

Thanks!

J Q Phantom
bdholm HotShot 150 posts since
Mar 19, 2002
Currently Being Moderated
2. May 19, 2009 2:45 PM in response to: jqphantom
Re: Access to Windows Physical Read/Write Stats via Oracle SQL

I don't have any suggestions to offer, but I am interested in getting the

same reports at my shop.

 

Brent Holm

503.450.1758

Server Capacity Planning

 

 

 

"The government cannot give to anybody anything that the government does

not first take from somebody else."

 

 

 

From:

jqphantom <forums@developer.bmc.com>

To:

Brent Holm <bdholm@regence.com>

Date:

05/18/2009 02:22 PM

Subject:

Capacity Planning New message on BMC Communities: " Re: Access to

Windows Physical Read/Write Stats via Oracle SQL" dvWIW-1B4-pn4

 

 

 

bdholm,

 

A new message was posted in the following thread "Access to Windows

Physical Read/Write Stats via Oracle SQL":

 

http://communities.bmc.com/communities/message/97530#97530

 

Author: jqphantom

Profile: http://communities.bmc.com/communities/people/jqphantom

 

Message:

Advertisement

More Like This

  • Retrieving data ...