beautypg.com

Retrieving multirow queries – HP Neoview Release 2.3 Software User Manual

Page 68

background image

rstein-xp 31
TDM_Default_DataSource
saxonyw-dc76c 102
TDM_Default_DataSource
tanakas.fargo.c 825
TDM_Default_DataSource
darius-d530 22
smart_msaccess
REVSTADTBR 98

Minor formatting of the columns can yield a more readable result:

select [first 10]
left (datasource, 25) as datasource1,
client_id,
count(*) as query_count
from NEO.HP_METRICS.ODBC_QUERY_STATS_V1
where statement_status = 'START'
group by 1, client_id
order by 1, client_id;

DATASOURCE1 CLIENT_ID QUERY_COUNT
------------------------- --------------- --------------------
RIBE_FIN NWESTABX-DC76C 1
RR FENSTERM-DC76C 6607
RR fensterm-dc76c 1476
JDI_REPOS TXNROGERSOJ-P2 61
Smart_JLverne TXNJLVERNE1 2
TDM_Default_DataSource REVSTADTBR 2629
TDM_Default_DataSource REVKAZUKO 16
TDM_Default_DataSource TXNLAZLON-DC76 86
TDM_Default_DataSource FENSTERM-DC76C 20121
TDM_Default_DataSource golden.fargo.c 20
TDM_Default_DataSource chiarp-d530u 27
TDM_Default_DataSource vleemgar-dc76 2548
TDM_Default_DataSource vleemgar-dc76c 9
TDM_Default_DataSource nwestabx-dc76c 186
TDM_Default_DataSource pdict 3
TDM_Default_DataSource watanabe.fargo. 9994
TDM_Default_DataSource rstein-xp 31
TDM_Default_DataSource saxonyw-dc76c 102
TDM_Default_DataSource tanakas.fargo.c 825
TDM_Default_DataSource darius-d530 22
smart_msaccess REVSTADTBR 98

Retrieving Multirow Queries

Queries that are longer than 3200 bytes are broken into multiple rows. Three fields support
retrieving the complete text of these kinds of queries:

QUERY_TEXT_IS_MULTIROW indicates whether multiple rows are required to
accommodate the text.

SEQUENCE_SIZE gives the number of rows required to accommodate the text.

SEQUENCE_NUM assigns sequential numbers to the rows.

Thus, the following query will retrieve the last 10 multirow entries:

SELECT [first 10]
left(query_id,95) as query_id1,
query_start_date
query_start_time,
sequence_num as seq_num,
sequence_size as seq_size,
statement_state,
query_text_is_multirow as multi_row,
left(sql_text,50) as sql_text1
FROM NEO.HP_METRICS.ODBC_QUERY_STATS_V2
WHERE query_text_is_multirow = 'Y'
ORDER BY QUERY_START_DATE DESC, QUERY_START_TIME DESC, SEQUENCE_NUM ASC;

68

Examples and Guidelines for Creating Repository Queries