Cómo forzar que una base de datos SQL Server 2008 se desconecte
¿Cómo fuerzo mi base de datos a Desconectarse, sin tener en cuenta qué o quién ya la está usando?
Lo intenté:
ALTER DATABASE database-name SET OFFLINE;
Pero sigue colgando después de 7 min.
Quiero esto porque necesito probar el escenario.
Si es posible?
97
2 answers
Desconectarse
USE master
GO
ALTER DATABASE YourDatabaseName
SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
Ir en línea
USE master
GO
ALTER DATABASE YourDatabaseName
SET ONLINE
GO
169
Author: abatishchev,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-06-09 12:21:28
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-06-09 12:21:28
Necesita usar WITH ROLLBACK IMMEDIATE
para arrancar otras conexiones sin tener en cuenta qué o quién ya lo está usando.
O use WITH NO_WAIT
para no colgar y no matar las conexiones existentes. Véase http://www.blackwasp.co.uk/SQLOffline.aspx para más detalles
22
Author: Martin Smith,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-06-09 12:19:37
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-06-09 12:19:37