适用于MSSQL2000、2005
use databasename BACKUP LOG databasename WITH NO_LOG DUMP TRANSACTION databasename WITH NO_LOG DBCC SHRINKDATABASE(databasename)
--查看数据库日志文件名等信息 select name from sysfiles
适用于MSSQL2008、2012
USE[master] GO ALTER DATABASE databasename SET RECOVERY SIMPLE WITH NO_WAIT GO ALTER DATABASE databasename SET RECOVERY SIMPLE GO USE FDCS_BJLDHX_BSN GO DBCC SHRINKFILE (N'databasename_log' , 1, TRUNCATEONLY) GO USE[master] GO ALTER DATABASE databasename SET RECOVERY FULL WITH NO_WAIT GO ALTER DATABASE databasename SET RECOVERY FULL GO
时间: 2024-10-26 15:06:13