sql Erros没有诊断

Posted

tags:

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

SELECT
    '===INFO=> '
	,SUBSTR(INSTANCENAME,1,8) AS INSTANCENAME
	,SUBSTR(DBNAME,1,8) AS DBNAME
	,LEVEL
	,SUBSTR(IMPACT,1,10) AS IMPACT
	,MIN(HIST.TIMESTAMP) AS FIRST_OCCUR
	,MAX(HIST.TIMESTAMP) AS LAST_OCCUR
	,COUNT(*) AS COUNT
	,CASE
		WHEN LENGTH(MAX(VARCHAR(MSG))) > 407 THEN
				X'0A' || '====MSG=> ' || SUBSTR(rtrim(REPLACE(MAX(VARCHAR(MSG)),X'0A',' ')),1,150) || ' (...) ' || SUBSTR(RIGHT(REPLACE(MAX(VARCHAR(MSG)),X'0A',' '),150),1,250)
		ELSE
				X'0A' || '====MSG=> ' || SUBSTR(rtrim(REPLACE(MAX(VARCHAR(MSG)),X'0A',' ')),1,407)
		END AS MSG_LIKE
	FROM TABLE(PD_GET_DIAG_HIST('MAIN', CAST(NULL AS CHAR(1)), CAST(NULL AS CHAR(1)), CURRENT TIMESTAMP - 7 DAYS, CAST(NULL AS TIMESTAMP))) as HIST
		WHERE (LEVEL IN ('C','E','S','W') OR IMPACT IN ('CRITICAL','IMMEDIATE','POTENTIAL')) and MSG is not NULL
			GROUP BY INSTANCENAME, DBNAME, LEVEL, IMPACT, SUBSTR(SUBSTR(VARCHAR(LEFT(MSG,150)),1, LOCATE(' ',VARCHAR(LEFT(MSG,150))) -1),1,70)
			ORDER BY 7 DESC, INSTANCENAME, DBNAME
SELECT
    '===INFO=> '
	,MEMBER
	,SUBSTR(INSTANCENAME,1,8) AS INSTANCENAME
	,SUBSTR(DBNAME,1,8) AS DBNAME
	,LEVEL
	,SUBSTR(IMPACT,1,10) AS IMPACT
	,MIN(HIST.TIMESTAMP) AS FIRST_OCCUR
	,MAX(HIST.TIMESTAMP) AS LAST_OCCUR
	,COUNT(*) AS COUNT
	,CASE
		WHEN LENGTH(MAX(VARCHAR(MSG))) > 407 THEN
				X'0A' || '====MSG=> ' || SUBSTR(rtrim(REPLACE(MAX(VARCHAR(MSG)),X'0A',' ')),1,150) || ' (...) ' || SUBSTR(RIGHT(REPLACE(MAX(VARCHAR(MSG)),X'0A',' '),150),1,250)
		ELSE
				X'0A' || '====MSG=> ' || SUBSTR(rtrim(REPLACE(MAX(VARCHAR(MSG)),X'0A',' ')),1,407)
		END AS MSG_LIKE
	FROM TABLE(PD_GET_DIAG_HIST('MAIN', NULL, NULL, CURRENT TIMESTAMP - 7 DAYS, NULL, -2)) as HIST
		WHERE (LEVEL IN ('C','E','S','W') OR IMPACT IN ('CRITICAL','IMMEDIATE','POTENTIAL')) and MSG is not NULL
			GROUP BY INSTANCENAME, DBNAME, MEMBER, LEVEL, IMPACT, SUBSTR(SUBSTR(VARCHAR(LEFT(MSG,150)),1, LOCATE(' ',VARCHAR(LEFT(MSG,150))) -1),1,70)
			ORDER BY 7 DESC, INSTANCENAME, DBNAME, MEMBER

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

在 xdebug 中激活 PHP html_erros 链接

一条sql导致数据库整体性能下降的诊断和解决的全过程

Oracle ODBC 插入失败,没有任何错误诊断

apache_conf Para erros de import dos produtos configuraveis do magento(Quando sefazadmandárioro

关于 国产麒麟系统上长时间运行Qt程序.xsession-erros文件占满磁盘导致无法写入 的解决方法

关于 国产麒麟系统上长时间运行Qt程序.xsession-erros文件占满磁盘导致无法写入 的解决方法