Showing posts with label active. Show all posts
Showing posts with label active. Show all posts

Wednesday, March 28, 2012

How can I clear active connections without disabling the database?

To better explain the question let me build a scenario.
If someone is connected to the database there is an active connection, which does appear in Management Studio. If we try to do a restore of the database, SQL gives us a message saying that it cannot gain exclusive access to the database and the restore fails. To gain exclusive access to the database we need to clear the active connections.
Currently in Management Studio the only ways that I have found to clear the connections are to take the database offline or detach the database completely. What I would like to know is if there is another way to clear the active connections without have to take the database offline or detach it?
In SQL 2000 I could right-click the database, select all tasks, and then select detach database and click clear connections. Of course I would then have to make sure I clicked cancel otherwise I would mistakenly detach the database. This would clear the connections without taking the database offline.
If the only option in Management Studio to clear the connections is to disable the database I would like to request an option under tasks called clear connections. This way the server administrator could click on this to see the current active connections and clear them, either individually, or all of them without having to take the database offline or detach it.
Thanks in advance!

There are several ways you can do this without having to detach the database.
1. run sp_who2 to see all the SPIDs connected to your database. For each SPID, execute kill <spid #>

2. In Object Explorer, Click on Management -> Activity Monitor. RIght-click, select View Processes. From there, you can filter the proccesses any way you want, even by database. After that, you can right-click on each process and select Kill Process.
While it's not a one-shot command, you do have much more control over who gets disconnected.
|||I tried what you suggested and it works. I was curious still though if there are any plans to add a clear connections options that will allow us to clear all connections to a database with one click of a button, similar to SQL 2000.
sql

Monday, March 12, 2012

how ca i do that?

how can i insert an image in a database and how can i show the image for
example in an active server page?
Do you have overwhelming and compelling reasons to store the files in the
database, instead of the filesystem?
http://www.aspfaq.com/2149
http://www.aspfaq.com/
(Reverse address to reply.)
"qwerty" <pompeighuII@.yahoo.com> wrote in message
news:eTTXSChYEHA.212@.TK2MSFTNGP12.phx.gbl...
> how can i insert an image in a database and how can i show the image for
> example in an active server page?
>
>

how ca i do that?

how can i insert an image in a database and how can i show the image for
example in an active server page?Do you have overwhelming and compelling reasons to store the files in the
database, instead of the filesystem?
http://www.aspfaq.com/2149
http://www.aspfaq.com/
(Reverse address to reply.)
"qwerty" <pompeighuII@.yahoo.com> wrote in message
news:eTTXSChYEHA.212@.TK2MSFTNGP12.phx.gbl...
> how can i insert an image in a database and how can i show the image for
> example in an active server page?
>
>

how ca i do that?

how can i insert an image in a database and how can i show the image for
example in an active server page?Do you have overwhelming and compelling reasons to store the files in the
database, instead of the filesystem?
http://www.aspfaq.com/2149
--
http://www.aspfaq.com/
(Reverse address to reply.)
"qwerty" <pompeighuII@.yahoo.com> wrote in message
news:eTTXSChYEHA.212@.TK2MSFTNGP12.phx.gbl...
> how can i insert an image in a database and how can i show the image for
> example in an active server page?
>
>

Friday, February 24, 2012

Hot Swapping Cluster Nodes

We are trying to deploy a two node Active / Passive cluster. But would like to test / ascertain the necessary steps to hot-swap one of the nodes should the need arise. The scenario being that the node is unavailable for longer than the time deemed accep
table to have a node down.
We would aim to bring a spare node into the cluster, install it wil binaries and allow it to replace the original failover node, whilst the original failover node was being fixed.
However, on initial testing SQL Server seems to have problems with this, and basically, for a node to be part of a cluster it must be present at the initial install.
Is there a way around this?
You can have the node ready to join the cluster but it must actually be in
the cluster before SQL can install to it. Once the node is in the cluster,
you can install SQL and any service packs/hotfixes without taking SQL
offline. BOL has the procedure to replace a failed node in a SQL cluster.
So, you can't do exactly what you want but you can get very close.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Beverley" <Bev.Brindle@.barclays.co.uk> wrote in message
news:B41DAA45-424E-4970-ABF9-16243D76CEDC@.microsoft.com...
> We are trying to deploy a two node Active / Passive cluster. But would
like to test / ascertain the necessary steps to hot-swap one of the nodes
should the need arise. The scenario being that the node is unavailable for
longer than the time deemed acceptable to have a node down.
> We would aim to bring a spare node into the cluster, install it wil
binaries and allow it to replace the original failover node, whilst the
original failover node was being fixed.
> However, on initial testing SQL Server seems to have problems with this,
and basically, for a node to be part of a cluster it must be present at the
initial install.
> Is there a way around this?
>
|||Thanks, we're going into a phase of strategic testing for the Cluster, and this is very useful.
Thanks alot.
Bev