zoukankan      html  css  js  c++  java
  • 还是SQL Server profiler

     I tries to check the SQL Scripts  several months ago, actually I didn't run any application which connected my database and also didn't run SQL Script manually, meanwhile, there is no any jobs in the back-end; but I found there were many pieces of SQL scripts captured by SQL Server profiler, such as the follwoing T-SQL;  then I checked the jobs of my database and no job was working at that time, it made me surprised, then I double checked the the result of SQL Server profiler, finally found I installed  the plugin of reportserver and its services was working.   so that was the root reason.

    AIM:

    1. once you install reportserver in your computer if the status of its service running,  even if you don't do anything in it, it will take up some some resource of your server. if not used, please disable its service.


    declare @BatchID uniqueidentifier

    set @BatchID = newid()

    UPDATE [Notifications] WITH (TABLOCKX)
    SET [BatchID] = @BatchID,
    [ProcessStart] = GETUTCDATE(),
    [ProcessHeartbeat] = GETUTCDATE()
    FROM (
    SELECT TOP 4 [NotificationID] FROM [Notifications] WITH (TABLOCKX) WHERE ProcessStart is NULL and
    (ProcessAfter is NULL or ProcessAfter < GETUTCDATE()) ORDER BY [NotificationEntered]
    ) AS t1
    WHERE [Notifications].[NotificationID] = t1.[NotificationID]

    select top 4
    -- Notification data
    N.[NotificationID],
    N.[SubscriptionID],
    N.[ActivationID],
    N.[ReportID],
    N.[SnapShotDate],
    N.[DeliveryExtension],
    N.[ExtensionSettings],
    N.[Locale],
    N.[Parameters],
    N.[SubscriptionLastRunTime],
    N.[ProcessStart],
    N.[NotificationEntered],
    N.[Attempt],
    N.[IsDataDriven],
    SUSER_SNAME(Owner.[Sid]),
    Owner.[UserName],
    -- Report Data
    O.[Path],
    N.[ReportZone],
    O.[Type],
    SD.NtSecDescPrimary,
    N.[Version],
    Owner.[AuthType]
    from
    [Notifications] N with (TABLOCKX) inner join [Catalog] O on O.[ItemID] = N.[ReportID]
    inner join [Users] Owner on N.SubscriptionOwnerID = Owner.UserID
    left outer join [SecData] SD on O.[PolicyID] = SD.[PolicyID] AND SD.AuthType = Owner.AuthType
    where
    N.[BatchID] = @BatchID
    ORDER BY [NotificationEntered]

  • 相关阅读:
    ASP.NET MVC URL重写与优化(进阶篇)-继承RouteBase玩转URL
    MVC Razor模板引擎 @RenderBody、@RenderPage、@RenderSection及Html.RenderPartial、Html.RenderAction
    二叉树的建立&&前中后遍历(递归实现)&&层次遍历
    实现一个简单的散列表(HashMap)
    单向链表的删除及插入操作(以头插入法建立单向链表)
    单向链表的建立(头插入法)
    单向链表的建立(尾部插入法)
    链式队列(单向列表实现)
    顺序队列(数组实现)
    链式栈(单向链表实现)
  • 原文地址:https://www.cnblogs.com/TerryX168/p/5631268.html
Copyright © 2011-2022 走看看