db offline

  • I have to take db offline with immediate effect.

    it should not wait till the connection gets closed.

    how to do it.

  • I want to take offline with connection exist.

  • use Alter database command

    set the mode to offline.

    if app still pointing there ask the app team to stop application.

    :crazy: :alien:

    Umar Iqbal

  • if db offline noone can connect.

    you mean you wan tto take it offline when user are connected.

    use immediate rollback in your alter database command

    :crazy: :alien:

    Umar Iqbal

  • i'm getting this error when trying to put the single user mode with immidiate.

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

  • what command you used .

    did u put imeediate rollback

    :crazy: :alien:

    Umar Iqbal

  • ALTER DATABASE SET SINGLE_USER WITH Rollback Immediate

  • where is database name. you habve to connec tot master and then use it like this

    alter database ---database name ----

    :crazy: :alien:

    Umar Iqbal

  • ALTER DATABASE test01 SET MULTI_USER WITH Rollback Immediate

    :crazy: :alien:

    Umar Iqbal

  • ALTER DATABASE test01 SET SINGLE_USER WITH Rollback Immediate

    :crazy: :alien:

    Umar Iqbal

  • i used "ALTER DATABASE ABC SET SINGLE_USER WITH Rollback Immediate"

    i am getting error as

    Msg 5061, Level 16, State 1, Line 1

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

    Msg 5069, Level 16, State 1, Line 1

    ALTER DATABASE statement failed.

  • i used command below

    ALTER DATABASE ABC SET SINGLE_USER WITH Rollback Immediate

    i am getting error below

    Msg 5061, Level 16, State 1, Line 1

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

    Msg 5069, Level 16, State 1, Line 1

    ALTER DATABASE statement failed.

  • hi umar.........pls help...........its urgent...........

  • humm weired. can u run sp_who2 and se who is connected to this. make sure you are not connected to it. if any application is connected to it ask them to stop apps. immediate should kill and take it offline but that weired.

    just make sure you dont have any Query open against that database.

    Kill all spids connected to it.

    :crazy: :alien:

    Umar Iqbal

  • What database are you in when you run the ALTER DATABASE?

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

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