• Performace Guard (Shehap) (10/11/2011)


    In order to save current Emergency situation , you have to follow up the next steps by the same order:

    1.Switch DB into Simple mode ..and wait for few seconds to ensure truncate log file has been done.

    2.Then Try to shrink log file

    3.If you got much free unused space within the log file itself >>Then it is good and shrink could succeed to return this free space to O.S

    4.If not >>>open 2008 activity monitor >> Try to kill manually any relevant transaction to this DB

    5.If much activities & transactions there , you could do it through the below query.

    USE [master]

    declare @Sessionsid int

    declare @sql nvarchar (300)

    Declare Tablecursor cursor for select t.session_id from sys.dm_exec_connections t inner join sys.dm_exec_sessions s on t.session_id=s.session_id where s.login_name ='APP user name'

    open Tablecursor

    fetch next from Tablecursor into @Sessionsid

    while (@@FETCH_STATUS =0)

    BEGIN

    set @sql =N'Kill '+convert (nvarchar (10),@Sessionsid)+' '

    exec sp_executesql @sql

    print ('The sessionid = '+CONVERT (NVARCHAR (50) ,@Sessionsid)+' has been killed')

    fetch next from Tablecursor into @Sessionsid

    end

    close Tablecursor

    DEALLOCATE Tablecursor

    6.This is just to expedite the resolution of this emergency (Other specific solutions are there ).

    7.Then try to shrink DB again.

    8.If not possible by anyway , try to take full backup to ensure more a check point has been taken there to enable truncate log file>>>then try to shrink again

    This seems like quite dangerous advice with killing all the connections and all the rest.

    For the Error log simply cycle it as Leeland suggested