SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DBA Basics


DBA Basics

Author
Message
Error Handler
Error Handler
SSC Eights!
SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)SSC Eights! (828 reputation)

Group: General Forum Members
Points: 828 Visits: 339
Comments posted to this topic are about the item DBA Basics

Best,
Naseer Ahmad
SQL Server DBA
Lokesh Vij
Lokesh Vij
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3804 Visits: 1599
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
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter


demonfox
demonfox
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2447 Visits: 1192
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
Raghavendra Mudugal
Raghavendra Mudugal
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3828 Visits: 2958
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.
Raghavendra Mudugal
Raghavendra Mudugal
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3828 Visits: 2958
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. :-P

ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20777 Visits: 7451
Nice simple question to end the week.

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Stuart Davies
Stuart Davies
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8177 Visits: 4831
Stewart "Arturius" Campbell (9/14/2012)
Nice simple question to end the week.

+1

Thanks

-------------------------------Posting Data Etiquette - Jeff Moden Smart way to ask a questionThere 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
(Bob Brown)
(Bob Brown)
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1127 Visits: 1145
Thanks.
Lokesh Vij
Lokesh Vij
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3804 Visits: 1599
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. :-P


...and Raghavendra you toooo:-P ;-) Hehe

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter


sestell1
sestell1
Hall of Fame
Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)

Group: General Forum Members
Points: 3962 Visits: 3529
Good question... something many people tend to learn only after running into this for the first time.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search