How to Capture deadlock in SQL server | Trace deadlock | SQL interview Q&A | Ms SQL

Sdílet
Vložit
  • čas přidán 25. 07. 2024
  • This video focus on how to capture a deadlock in SQL server. If you are a beginner then this video is for you. Please refer below video reference links that are discussed in this video.
    What is a deadlock and how it occurs
    • What is a Deadlock in ...
    How SQL server choses a deadlock victim
    • How SQL server choose ...
    T-SQL script to find How many deadlock occured since server startup
    SELECT 'Deadlocks Occurrence',
    CONVERT(BIGINT,((1.0 * v.cntr_value /
    NULLIF(datediff(DD,w.create_date,CURRENT_TIMESTAMP),0)))) as
    AvgPerDay,
    CAST(v.cntr_value AS NVARCHAR(100)) + ' deadlocks recorded since startup.' AS Details,
    w.create_date as StartupDateAndTime
    FROM sys.dm_os_performance_counters v
    INNER JOIN sys.databases w ON w.name = 'tempdb'
    WHERE RTRIM(v.counter_name) = 'Number of Deadlocks/sec'
    AND RTRIM(v.instance_name) = '_Total'
    Turn on Trace flags
    DBCC TRACEON (1204, -1)
    DBCC TRACEON (1222, -1)
    Analyzing Deadlocks with SQL Server Profiler
    learn.microsoft.com/en-us/pre...)
    Microsoft technet on System health extended event
    social.technet.microsoft.com/...
    Analyze & prevent deadlocks
    a. learn.microsoft.com/en-us/sql...
    b. learn.microsoft.com/en-us/azu...

Komentáře • 15

  • @naveenkumar-nw7ne
    @naveenkumar-nw7ne Před rokem

    Thanks for uploading this video sir

  • @BhupinderSingh-dt6dr
    @BhupinderSingh-dt6dr Před rokem +2

    Hum first hum first

  • @trieutruong2410
    @trieutruong2410 Před rokem +1

    Hello author, thank you so much for your sharing. Can you create a video guide on how to back up from SQL server into other remote hosts (not installed SQL server)?

  • @chithravinodham
    @chithravinodham Před rokem

    100 viewer

  • @damodhardaamu9925
    @damodhardaamu9925 Před 7 měsíci

    excellent explanation dude
    i have a question for u
    secondary replica is disconnected from primary but all are nodes are up, errorlog is not showing perfect reason,end point state is good
    what is behind the reason and how we solve it

    • @righttolearnbk
      @righttolearnbk  Před 6 měsíci

      If your question is about always on configuration then please check this one learn.microsoft.com/en-us/sql/database-engine/availability-groups/windows/availability-replica-is-disconnected?view=sql-server-ver16#possible-causes

  • @molkapurishivakrishna2963

    How will you troubleshoot a log file growth issue that is causing disk space issues?
    Please do a vedio on it sir..

  • @ganeshmanneru
    @ganeshmanneru Před rokem

    Sir are these videos enough to get complete knowledge or still you can provide additional information about sql server dba

    • @righttolearnbk
      @righttolearnbk  Před 11 měsíci

      These videos will help you in your daily work and also in clearing the interviews. I haven't yet uploaded videos on many concepts.

  • @ravinderbg1295
    @ravinderbg1295 Před 4 měsíci +1

    Do. a. full. BOOK

  • @darbardarbar9460
    @darbardarbar9460 Před rokem

    Bhai make a video log shipping mirroring replication difference

  • @molkapurishivakrishna2963

    Do you have any Institute sir