HP Neoview Release 2.3 Software User Manual
Page 66
AND QUERY_START_DATETIME >= DATE_TRUNC('DAY', 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
00:23:59
12:48:46.879774
479
2007–05–23
13:15:14
18:44:05.390777
49
2007–05–22
Queries within the Past 24 Hours, Grouped by Client ID
This example indicates how many queries different clients ran within a 24-hour period.
SELECT client_id, COUNT(*) AS NUM_OF_QUERIES
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 client_id
ORDER BY client_id
FOR READ UNCOMMITTED ACCESS;
NUM_OF_QUERIES
CLIENT_ID
16
EXPTC082205
51
ORDROBERTSC-P2
162
ORDHROTHGAR-P2
28
ordbantam-p2
Queries within the Past 24 Hours, Grouped by Data Source
This example indicates how many queries within the 24-hour period were associated with each
data source.
SELECT datasource, COUNT(*) AS NUM_OF_QUERIES
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 datasource
ORDER BY datasource
FOR READ UNCOMMITTED ACCESS;
NUM_OF_QUERIES
DATASOURCE
51
NEO0101_JOM
44
TDM_Default_DataSource
162
neodb
Queries within the Past 24 Hours, Grouped by Client ID and Including Average and
Maximum Elapsed Time
SELECT client_id,
COUNT(*) AS num_of_queries,
AVG(query_elapsed_time)/1000 AS avg_qry_elapsed_msec,
MAX(query_elapsed_time)/1000 AS max_qry_elapsed_msec
FROM NEO.HP_METRICS.ODBC_QUERY_STATS_V2
WHERE QUERY_START_DATETIME <= CURRENT
66
Examples and Guidelines for Creating Repository Queries