Blog Of Sem: Sql Server Shrink Database and Log

Sql Server Shrink Database and Log

  --log dosyasını bul     
 SELECT name FROM sys.master_files WHERE type_desc = 'LOG' and physical_name like '%Jam%'

        ALTER DATABASE DevJamieS
        SET RECOVERY SIMPLE
        GO
        DBCC SHRINKFILE (DevJamieS_log, 1)
        GO
        ALTER DATABASE DevJamieS
        SET RECOVERY FULL
     

------------

USE LKSDB;
GO
ALTER DATABASE LKSDB
SET RECOVERY SIMPLE;
GO


--datadakı log dosyasını shrınk yap

ALTER DATABASE LKSDB
SET RECOVERY FULL;
GO