Generate update stats command list, Search event logs for abnormal program termination – HP Neoview Release 2.5 Software User Manual
Page 68
Example A-1 Generate Update Stats Command List
This report generates an executable command list to resolve missing table statistics, based on
two event numbers:
SELECT
COUNT(*) AS CNT,
MIN(LOG_TIMESTAMP_LCT) AS FIRST_TIME,
MAX(LOG_TIMESTAMP_LCT ) AS LAST_TIME,
UPDATE_STATS_COMMAND || ';' as UPDATE_STATS_COMMAND,
EVENT_NUMBER
FROM
(
SELECT
log_timestamp_lct,
trim(trailing '.'
FROM
trim
(
CASE
WHEN locate( 'UPDATE STATISTICS FOR TABLE',TEXT) > 0
THEN
--'GOT A MATCH'
substring(text
FROM
LOCATE ('UPDATE STATISTICS FOR TABLE',TEXT) )
ELSE '/*Unable to create update statistics command. Invalid value in EMS event*/'
END
)
) as UPDATE_STATS_COMMAND,
EVENT_NUMBER
FROM
NEO.HP_METRICS.EVENTS_VW1
WHERE
log_timestamp_lct >= TIMESTAMP '$$_FROM_TIME$$'
AND log_timestamp_lct <= TIMESTAMP '$$_TO_TIME$$'
and SSID like '%SQLMX%'
and (event_number = 6010 or event_number = 6011)
) AS A
GROUP BY UPDATE_STATS_COMMAND, EVENT_NUMBER
ORDER BY
CNT DESC
for read uncommitted access in share mode;
Example A-2 Search Event Logs for Abnormal Program Termination
This report performs a case-insensitive search for all events in which the event text contains the
string 'ABEND' during a given time period.
SELECT
EVENT_NUMBER AS EVENT_NUMBER,
GENERATED_TIMESTAMP_LCT AS GEN_TIME,
SUBSTRING(SUBSTRING(SSID FROM CHAR_LENGTH('TANDEM. '))FOR LOCATE('.' ,SUBSTRING(SSID FROM
CHAR_LENGTH('TANDEM. ')) )-1) AS SUB_SYS,
trim(substring(Text FROM CHAR_LENGTH('00:00 01FEB10 001.01.1000 '))) AS Event_Text,
PROCESS_SEGMENT AS SEGMENT,
TRIM(PROCESS_ID) AS PROCESS_NAME,
NODE_ID AS NODE_ID,
PIN AS PIN,
SEGMENT_ID AS SEGMENT_ID,
SQLCD AS SQLCD,
FSERROR AS FSERROR,
COLLECTOR AS COLLECTOR,
LOG_TIMESTAMP_LCT AS LOG_TIME_LCT,
TEXT AS FULL_TEXT,
SSID
FROM
NEO.HP_METRICS.EVENTS_VW1
WHERE
GENERATED_TIMESTAMP_LCT >= TIMESTAMP '$$__FROM_TIME$$' - interval '1' second and
GENERATED_TIMESTAMP_LCT <= TIMESTAMP '$$__TO_TIME$$' + interval '1' second
AND UPSHIFT(TEXT) LIKE '% ABEND%'
ORDER BY
GEN_TIME DESC
FOR READ UNCOMMITTED ACCESS IN SHARE MODE
68
Sample Queries for Event Information