點(diǎn)擊上方“IT那活兒”公眾號(hào),關(guān)注后了解更多內(nèi)容,不管IT什么活兒,干就完了!!!
2. 放置到C:WindowsSystem32。
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:
-- Create date:
-- Description:
-- =============================================
CREATE PROCEDURE
-- Add the parameters for the stored procedure here
<@Param1, sysname, @p1> int> = 0>,
<@Param2, sysname, @p2> int> = 0>
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>
END
GO
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:
-- Create date:
-- Description:
-- =============================================
CREATE PROCEDURE [dbo].[pr_Slowsqllog_Exp]
AS
BEGIN
SELECT
(total_elapsed_time / execution_count)/1000 N平均時(shí)間ms
,total_elapsed_time/1000 N總花費(fèi)時(shí)間ms
,total_worker_time/1000 N所用的CPU總時(shí)間ms
,total_physical_reads N物理讀取總次數(shù)
,total_logical_reads/execution_count N每次邏輯讀次數(shù)
,total_logical_reads N邏輯讀取總次數(shù)
,total_logical_writes N邏輯寫入總次數(shù)
,execution_count N執(zhí)行次數(shù)
,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
((CASE statement_end_offset
WHEN -1 THEN DATALENGTH(st.text)
ELSE qs.statement_end_offset END
- qs.statement_start_offset)/2) + 1) N執(zhí)行語句
,creation_time N語句編譯時(shí)間
,last_execution_time N上次執(zhí)行時(shí)間
FROM
sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
WHERE
SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
((CASE statement_end_offset
WHEN -1 THEN DATALENGTH(st.text)
ELSE qs.statement_end_offset END
- qs.statement_start_offset)/2) + 1) not like %fetch%
AND (total_elapsed_time / execution_count)/1000 > 100
ORDER BY
total_elapsed_time / execution_count DESC;
END
GO
1. 啟動(dòng)SQLserver代理
注意:
send_slow.bat
set DATADIR=D:slowsqllog
set SLOWLOG=crm_mscrm_slowsqlog.txt
set MAIL_SER=mail.xxx.com
set MAIL_FM=was@xxx.com
set MAIL_LIST=aaa@xxx.com
set MAIL_CC1=bbb@xxx.com
set MAIL_CC2=ccc@xxx.com
set MAIL_SUB=slowlog
set MAIL_BODY=This is a SQL server slowsqllog.
sendEmail -s %MAIL_SER% -f %MAIL_FM% -t %MAIL_LIST% -cc %MAIL_CC1% -cc %MAIL_CC2% -u %MAIL_SUB% -m %MAIL_BODY% -xu was -xp 654321 -a %DATADIR%\%SLOWLOG%
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/129353.html
摘要:底層通訊方案優(yōu)化升級(jí)較新版本,由方案調(diào)整為方案,執(zhí)行器內(nèi)嵌提供服務(wù),調(diào)度中心復(fù)用容器端口提供服務(wù)任務(wù)告警邏輯調(diào)整,改為通過掃描失敗日志方式觸發(fā)。 v2.0.2 Release Notes 1、底層通訊方案優(yōu)化:升級(jí)較新版本xxl-rpc,由JETTY方案調(diào)整為NETTY_HTTP方案,執(zhí)行器內(nèi)嵌netty-http-server提供服務(wù),調(diào)度中心復(fù)用容器端口提供服務(wù); 2、任務(wù)告警邏...
摘要:添加接收人監(jiān)控中心支持添加郵箱及微信兩種告警,需要注意的是,添加郵箱告警的話,需要預(yù)先配置發(fā)件服務(wù)器。由于監(jiān)控中心配置了一條告警規(guī)則,只要企業(yè)微信的信息填寫正確,一般分鐘以內(nèi)均可從企業(yè)微信中獲取到告警信息。監(jiān)控中心概述監(jiān)控中心是UK8S提供的產(chǎn)品化監(jiān)控方案,提供基于Prometheus的產(chǎn)品解決方案,涵蓋Prometheus集群的全生命周期管理,以及告警規(guī)則配置、報(bào)警設(shè)置等功能,省去了自行搭...
摘要:此問題稱為查詢問題。您將只執(zhí)行兩個(gè)查詢而不是這是巨大的性能提升。這項(xiàng)工作是通過從數(shù)據(jù)庫中執(zhí)行查詢完成的查詢可能涉及到表以及其他的一些表。比如查詢,視圖,時(shí)間等等另一個(gè)非常酷的工具是,對(duì)應(yīng)用,有優(yōu)雅的調(diào)試助手的美稱。 showImg(https://segmentfault.com/img/remote/1460000018339917?w=1280&h=722); 讓我們開始吧!假若你...
摘要:持久化到中反向代理的負(fù)載均衡基于的集群搭建如何實(shí)現(xiàn)從中訂閱消息轉(zhuǎn)發(fā)到客戶端的擴(kuò)展是阻塞式,使用訂閱發(fā)布模式時(shí),會(huì)導(dǎo)致整個(gè)進(jìn)程進(jìn)入阻塞。緩存是用于解決高并發(fā)場(chǎng)景下系統(tǒng)的性能及穩(wěn)定性問題的銀彈。 showImg(https://segmentfault.com/img/bVYE6k?w=900&h=385); Redis 是由意大利程序員 Salvatore Sanfilippo(昵稱:a...
閱讀 1346·2023-01-11 13:20
閱讀 1684·2023-01-11 13:20
閱讀 1132·2023-01-11 13:20
閱讀 1858·2023-01-11 13:20
閱讀 4100·2023-01-11 13:20
閱讀 2704·2023-01-11 13:20
閱讀 1385·2023-01-11 13:20
閱讀 3597·2023-01-11 13:20