When running a maintenance plan, it does not succeed or fail, but status is continues to running

준영 이 40 Reputation points
2024-01-13T17:11:05.2166667+00:00

It used to be used normally, but it has been operating in the same state as the title since some time ago.. Even a simple query will last for several days. I ask for your help. ex query) select 1

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,004 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 112.7K Reputation points MVP
    2024-01-13T17:17:57.02+00:00

    What I would do If I were to run into this situation is to run my beta_lockinfo, which shows the current activity in the server. It would tell me if the maintenance plan is stuck somewhere in SQL Server. For instance, an index rebuild being blocked by a transaction left open.


  2. RahulRandive 9,901 Reputation points
    2024-01-13T17:36:31.09+00:00

    Hi 준영 이 •, Verify if there have been any changes to the maintenance schedule or the introduction of new activities during the same time, which might be causing interference with maintenance and other routine queries. If blocking is happening on your server, please refer document “Understand and resolve SQL Server blocking problems” Blocking on SQL Server occurs when one transaction holds a lock on a resource, such as a table or a row, and another transaction is blocked from accessing that resource. This can cause performance issues and can lead to deadlocks if not resolved. Identify the blocking process: Use the sp_who2 or sp_whoisactive stored procedures to identify the blocking process and the process that is being blocked. Thank you!


  3. LiHongMSFT-4306 28,041 Reputation points
    2024-01-15T02:54:27.6266667+00:00

    Hi @준영 이

    Use sys.dm_exec_requests which returns information about each request that is executing in SQL Server.

    Run the query below while the Maintenance Plan is running and check if there are any blocks or anything that the process is waiting on.

    SELECT * FROM sys.dm_exec_requests
    

    Best regards, Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.