use master
select * from sysdatabases
---For See the database name
BACKUP LOG databasename WITH TRUNCATE_ONLY
---Right Click on Database Go to files And see the DatabaseLog file name
use Database
DBCC SHRINKFILE(DatabaseLog_log,1)
--If my database name is SS
BACKUP LOG SS WITH TRUNCATE_ONLY
DBCC SHRINKFILE(SS1_log,1)
OR
Shrinking a log file to a specified target size
USE AdventureWorks2012;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE AdventureWorks2012
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (AdventureWorks2012_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE AdventureWorks2012
SET RECOVERY FULL;
GO
No comments:
Post a Comment