beautypg.com

HP Neoview Release 2.3 Software User Manual

Page 65

background image

this example, an ODBC session that executed a single query saturated the system from
approximately 19:25:00 to 19:35:00 and then was inactive.

reset param
set param ?segment_id 1;
set param ?node_id 0;
set param ?pin 863;
show param;

select
segment_id,
node_id,
pin,
sample_date, sample_time
metric_type,
child_count,
child_system_busy_pct as sys_busy
from NEO.HP_METRICS.PROCESS_AGGR_LEVEL1_STATS_V1
where segment_id = ?segment_id
and node_id = ?node_id
and pin = ?pin
order by segment_id, node_id, pin, metric_type, sample_date, sample_time FOR READ UNCOMMITTED ACCESS;

SYS_BUSY

CHILD_COUNT

METRIC_TYPE

SAMPLE_TIME

SAMPLE_DATE

PIN

NODE_ID

SEGMENT_ID

99.13

19

MXESP

06:30:00.000000

2007–05–29

863

0

1

99.47

19

MXESP

06:35:00.000000

2007–05–29

863

0

1

35.99

19

MXESP

06:50:00.000000

2007–05–29

863

0

1

0.00

19

MXESP

06:35:00.000000

2007–05–29

863

0

1

0.00

19

MXESP

07:00:00.000000

2007–05–29

863

0

1

Count Completed Queries, According to Specified Criteria

The following queries all return the number of completed queries, but they break down the
number in different ways.

Completed Queries Executed on a System in the Last 24 Hours

SELECT DISTINCT(QUERY_START_DATE) AS START_DATE,
COUNT(*) AS NUM_OF_QUERIES,
MAX(QUERY_START_TIME) AS MAX_START_TIME,
MIN(QUERY_START_TIME) AS MIN_START_TIME
FROM NEO.HP_METRICS.ODBC_QUERY_STATS_V2
WHERE QUERY_START_DATETIME <= CURRENT
AND QUERY_START_DATETIME >= CURRENT - INTERVAL '1' DAY
AND STATEMENT_STATE = 'COMPLETE'
GROUP BY 1
FOR READ UNCOMMITTED ACCESS;

MIN_START_TIME

MAX_START_TIME

NUM_OF_QUERIES

START_DATE

08:51:01

12:48:46.879774

243

2007–05–23

13:15:14

18:44:05.390777

49

2007–05–22

Completed Queries Executed on a System in the Previous Two Days

To count queries that executed from one midnight to the next, instead of within a 24 hour period
relative to the current time, the following query uses the Neoview DATE_TRUNC function in
the SQL WHERE clause.

SELECT DISTINCT(QUERY_START_DATE) AS START_DATE,
COUNT(*) AS NUM_OF_QUERIES,
MAX(QUERY_START_TIME) AS MAX_START_TIME,
MIN(QUERY_START_TIME) AS MIN_START_TIME
FROM NEO.HP_METRICS.ODBC_QUERY_STATS_V2
WHERE QUERY_START_DATETIME <= CURRENT

Count Completed Queries, According to Specified Criteria

65