jump to navigation

Cannot drop database “CompanyProducts” because it is currently in use March 12, 2010

Posted by juanpablo1manrique in DAtabase, SQL SERVER 2008.
Tags:
1 comment so far

Por lo general cuando se intenta borrar una base de datos en SQL 2008 no se puede porque existen procesos iniciados, en SQL 2008 no es tan facil darle Kill a los procesos que se encuentren iniciados que impiden borrar una base de datos, entonces es necesario crearse su propio SP que mate los procesos por uno, asi se ejecute el DROP DATABASE desde la consola aparece el mismo error. Por lo general uno intentaria buscar el Activity Monitor y matar estos procesos, pero desafortuandamente esto no es posible, desde el activity monitor actual, porque por alguna extraña razon no aparecen todos los procesos, y el campo de la Base de datos en el listado esta vacio.

Cannot drop database because it is currently in use. error 3702

CREATE PROCEDURE dbo.clearDBUsers 
    @dbName SYSNAME
AS
BEGIN
    SET NOCOUNT ON
 
    DECLARE @spid INT,
        @cnt INT,
        @sql VARCHAR(255)
 
    SELECT @spid = MIN(spid), @cnt = COUNT(*)
        FROM master..sysprocesses
        WHERE dbid = DB_ID(@dbname)
        AND spid != @@SPID
 
    PRINT ‘Starting to KILL ‘+RTRIM(@cnt)+’ processes.’
    
    WHILE @spid IS NOT NULL
    BEGIN
        PRINT ‘About to KILL ‘+RTRIM(@spid)
 
        SET @sql = ‘KILL ‘+RTRIM(@spid)
        EXEC(@sql)
 
        SELECT @spid = MIN(spid), @cnt = COUNT(*)
            FROM master..sysprocesses
            WHERE dbid = DB_ID(@dbname)
            AND spid != @@SPID
 
        PRINT RTRIM(@cnt)+’ processes remain.’
    END
END
GO

Tomado de http://sqlserver2000.databases.aspfaq.com/how-do-i-drop-a-sql-server-database.html

 

Advertisements

Activity Monitor SQL SERVER 2008 March 12, 2010

Posted by juanpablo1manrique in Activity Monitor, Developer, SQL SERVER, SQL SERVER 2008.
Tags:
add a comment

Para inicar el ACTIVITY MONITOR en SQL SERVER 2008, se da click derecho sobre el SERVER NAME y luego se da click sobre el activity monitor.

Creo que SQL 2008 se olvido de los developers ya que la administración de nosotros es bastante diferente.

Tomado de:

http://social.msdn.microsoft.com/Forums/en/sqlsecurity/thread/288d6f28-5c29-4f2d-8abe-a1ca9a57fc3c

problems installing SQL 2008 in WINDOWS 2008 in cluster February 24, 2010

Posted by juanpablo1manrique in Alta Disponibilidad, Cluster, IT, SQL SERVER 2008, Windows 2008.
1 comment so far

Hello Friends

I have problems installing SQL 2008 in WINDOWS 2008 in cluster, the installation start but not finish.

I see de log …

Detailed results:
Feature: Database Engine Services
Status: Failed: see logs for details
MSI status: Passed
Configuration status: Failed: see details below
Configuration error code: 0x4BDAF9BA@1306@23
Configuration error description: Could not find the Database Engine startup handle.
Configuration log: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20100119_121017\Detail.txt
And in detail you can see.

Error: Action “ConfigEvent_SQL_FullText_Adv_sql_fulltext_Cpu64_CompleteFailoverCluster_ConfigRC_postmsi” failed during execution.
2010-01-19 13:42:59 Slp: Action “ConfigEvent_SQL_Engine_Core_Inst_sql_engine_core_inst_Cpu64_CompleteFailoverCluster_Startup_postmsi” will return false due to the following conditions:
2010-01-19 13:42:59 Slp: Condition “Feature dependency condition for action: ConfigEvent_SQL_Engine_Core_Inst_sql_engine_core_inst_Cpu64_CompleteFailoverCluster_Startup_postmsi The condition tests feature: SQL_Engine_Core_Inst_sql_engine_core_inst_Cpu64. There are 10 dependant features. The feature is tested for results: ValidateResult, Result.” did not pass as it returned false and true was expected.
2010-01-19 13:42:59 Slp: Condition is false because the required feature SQL_Engine_Core_Inst_sql_engine_core_inst_Cpu64 failed in result Result

The solution was unable de recicly bin

– Right click on the “Recycle Bin” icon. A window will open
– Click on the “Do not move files to the Recycle Bin. Remove files immediately when deleted” copy from (http://www.sqlservercentral.com/articles/Clustering/68967/)

Download AdventureWorks 2008 R2 November CTP February 23, 2010

Posted by juanpablo1manrique in Best Practices, BI, Business Inteligent, Developer, Install, OLAP, SQL SERVER, SQL SERVER 2008, Windows 2008.
add a comment

Recordando que en el isntalador de SQL 2008 no viene incluida la base de datos de AdventureWorks para realizar pruebas y para carga los ejemplos como los de BI con los proyectos de Analysis Services listos para ejecutar me encontre este link donde lo pueden desacargar.

http://msftdbprodsamples.codeplex.com/releases/view/24854#DownloadId=91938

El instalador incluye

AdventureWorks OLTP 2008 R2
AdventureWorks Data Warehouse 2008 R2
AdventureWorks LT 2008 R2
AdventureWorks OLAP Standard 2008 R2
AdventureWorks OLAP Enterprise 2008 R2
AdventureWorks OLTP

AdventureWorks Data Warehouse
AdventureWorks LT
AdventureWorks OLAP Standard
AdventureWorks OLAP Enterprise