DBA Basics

  • Comments posted to this topic are about the item DBA Basics

    Best,
    Naseer Ahmad
    SQL Server DBA

  • An easy one for Friday!

    I love using Rollback [after specified time].....to warn developers to log-off from the database otherwise they will automatically be logged-off after specified time 🙂

    Thanks for posting the question.

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • Lokesh Vij (9/13/2012)


    An easy one for Friday!

    I love using Rollback [after specified time].....to warn developers to log-off from the database otherwise they will automatically be logged-off after specified time 🙂

    Thanks for posting the question.

    warning , ah , such a polite world we are living.

    Nice question !!

    ~ demonfox
    ___________________________________________________________________
    Wondering what I would do next , when I am done with this one :ermm:

  • Awesome, Great question. 🙂

    Considering there is one transaction which is still not committed ,If executed the below command then

    -- #1

    ALTER DATABASE LOCALWORK SET OFFLINE WITH NO_WAIT

    -- RESULT

    Msg 5070, Level 16, State 2, Line 1

    Database state cannot be changed while other users are using the database 'LocalWork'

    Msg 5069, Level 16, State 1, Line 1

    ALTER DATABASE statement failed.

    -- #2

    ALTER DATABASE LOCALWORK SET OFFLINE WITH ROLLBACK IMMEDIATE

    -- RESULT

    Nonqualified transactions are being rolled back. Estimated rollback completion: 100%.

    -- #3

    ALTER DATABASE LOCALWORK SET OFFLINE

    -- OR

    Going to the menu and tasks and then selecting "Take Offline" (right-click on the specific database)

    -- RESULT

    Msg 5061, Level 16, State 1, Line 1

    ALTER DATABASE failed because a lock could not be placed on database 'LOCALWORK'. Try again later.

    Msg 5069, Level 16, State 1, Line 1

    ALTER DATABASE statement failed.

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • demonfox (9/13/2012)


    Lokesh Vij (9/13/2012)


    An easy one for Friday!

    I love using Rollback [after specified time].....to warn developers to log-off from the database otherwise they will automatically be logged-off after specified time 🙂

    Thanks for posting the question.

    warning , ah , such a polite world we are living.

    Nice question !!

    ... and I am glad that you are also part of it. 😛

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • This was removed by the editor as SPAM

  • Stewart "Arturius" Campbell (9/14/2012)


    Nice simple question to end the week.

    +1

    Thanks

    -------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
    There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
    I would never join a club that would allow me as a member - Groucho Marx

  • Thanks.

  • Raghavendra Mudugal (9/14/2012)


    demonfox (9/13/2012)


    Lokesh Vij (9/13/2012)


    An easy one for Friday!

    I love using Rollback [after specified time].....to warn developers to log-off from the database otherwise they will automatically be logged-off after specified time 🙂

    Thanks for posting the question.

    warning , ah , such a polite world we are living.

    Nice question !!

    ... and I am glad that you are also part of it. 😛

    ...and Raghavendra you toooo:-P 😉 :hehe:

    ~ Lokesh Vij


    Guidelines for quicker answers on T-SQL question[/url]
    Guidelines for answers on Performance questions

    Link to my Blog Post --> www.SQLPathy.com[/url]

    Follow me @Twitter

  • Good question... something many people tend to learn only after running into this for the first time.

  • Naseer, thanks for contributing the question.

    Anyone know why the SMS Take Offline command runs so slowly?

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • Nice question but I enjoy using the KILL command to get rid of connections. Perhaps I should join the polite world. 🙂

  • +1 I usually use the kill command. I will keep this option in mind though. 🙂

  • Thanks

  • Thanks for the question.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply