SQL2008 Empty Delete log:
Method One:
Use [master]
to
ALTER DATABASE AFMS set RECOVERY simple and no_wait
go
alter DATABASE AFMS SET RECOVERY S Imple
go
to Afms
go
DBCC shrinkfile (N ' Afms_log ', one, truncateonly) go use
[master]
Go
ALTER DATABASE AFMS set RECOVERY full and no_wait
go
alter DATABASE AFMS SET RECOVERY full
Go
' Clearing the log in SQL2008 must be done in simple mode, until the purge action is complete and then back to full mode.
Use [master]
to
ALTER DATABASE Dnname set RECOVERY simple and no_wait
go
alter DATABASE dnname SET RE Covery Simplicity--Simple mode
go
to Dnname
go
DBCC shrinkfile (N ' Dnname_log ', one, truncateonly)
go< c27/> ' Here's dnname_log if you don't know what the name is in Sys.database_files, you can use the following annotated statement to query
' using Dnname
' Go
' SELECT file_ ID, namefrom sys.database_files;
' Go use
[master]
go
alter DATABASE dnname SET RECOVERY full with no_wait
go
ALTER DATABASE Dnname SET RECOVERY Full-revert to complete mode go
SQL2005 Empty Delete log:
Backup Log dnname with No_log ' Here's dnname is the name of the database you want to shrink, and note that by modifying the database name below, I will not comment anymore.
go
Dump Transaction dnname and No_log go to
dnname
DBCC shrinkfile (2)
go
sqlserver2000 Compressed Log
you can make jb51.ldf files very small, make it easy to back up databases, and so on, and execute them in SQL Server Query Analyzer.
DUMP TRANSACTION [jb51] with no_log
BACKUP LOG [jb51] with no_log