Wednesday, April 29, 2015

Clear the SQL Database Log file


Clear EMO Log File

After the new version update Some offices face the issue of very large log file of eMO database in terms of GB.  This causes eMO time out issues. One simple query to clear log file to 1024 mb is attached herewith. This can be used to clear log of other databases also jut by replacing the database name.

1. Exit all modules.
2. Execute in query analyser(2000)/Management studio(2005)
3. Wait till execution is completed.
eMO Log will be truncated to minimum size.

Query To Clear EMO Database Log

dump transaction eMO with truncate_only
go
declare @filename varchar(50)
select @filename = file_name(2)
dbcc shrinkfile (@filename, 10)
go
dbcc shrinkdatabase (eMO, truncateonly)
go

Note: Kindly Change / Alter the Database Name in the above mentioned query.

Thanks to
Rajesh CR, System Administrator.
Courtesy : Potools blog

No comments:

Post a Comment