sql 获取诊断信息

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 获取诊断信息相关的知识,希望对你有一定的参考价值。

SELECT
	MEMBER
	,SUBSTR(INSTANCENAME,1,8) AS INSTANCENAME
	,SUBSTR(DBNAME,1,8) AS DBNAME
	,TIMESTAMP
	,LEVEL
	,SUBSTR(IMPACT,1,10) AS IMPACT
	,EDU_ID
	,substr(EDUNAME,1,25) as EDUNAME
	,PID
	,substr(PROCESS_NAME,1,25) as PROCESS_NAME
	,TID
	,substr(APPLICATION_ID,1,35) as APPLICATION_ID
	,APPLHANDLE
	,substr(AUTH_ID,1,8) as AUTH_ID
	,OSERR
	,RETCODE
	,MSGNUM
  ,substr(rtrim(OBJNAME_QUALIFIER)||'.'||OBJNAME,1,65) as object
  ,substr(EVENTTYPE,1,15) as EVENTTYPE
	,CASE
		WHEN LENGTH(MSG) > 407 THEN
				SUBSTR(rtrim(REPLACE(MSG,X'0A',' ')),1,150) || ' (...) ' || SUBSTR(RIGHT(REPLACE(MSG,X'0A',' '),150),1,250)
		ELSE
				SUBSTR(rtrim(REPLACE(MSG,X'0A',' ')),1,407)
		END AS MSG
-- PD_GET_DIAG_HIST--(--facility--,--rectype--,--impact--,--start_time--,--end_time--,--member--)
	FROM TABLE(PD_GET_DIAG_HIST(NULL, NULL, NULL, TIMESTAMP('2007-09-23-15.53.37'), TIMESTAMP('2007-09-24-15.53.37'), -2))

以上是关于sql 获取诊断信息的主要内容,如果未能解决你的问题,请参考以下文章

SQL工具SQL调优和诊断神器SQLTXPLAIN (SQLT)简介

MySQL Workbench - 如何诊断查询失败问题

SQL Server超时诊断

自动化收集SQLSERVER诊断信息

oracle体系-6-自动诊断信息库ADR

从 Pepper QiSDK 获取诊断