Created
July 12, 2017 03:16
-
-
Save johnsonz/793cf3284ec619b287fe002117377616 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [master] | |
GO | |
ALTER DATABASE students SET RECOVERY SIMPLE WITH NO_WAIT | |
GO | |
ALTER DATABASE students SET RECOVERY SIMPLE | |
GO | |
USE students | |
GO | |
--此处需要注意,并非所有数据库的日志文件名都是“数据库名_log” | |
DBCC SHRINKFILE (N'students_log' , 0,TRUNCATEONLY) | |
GO | |
USE [master] | |
GO | |
ALTER DATABASE students SET RECOVERY FULL WITH NO_WAIT | |
GO | |
ALTER DATABASE students SET RECOVERY FULL | |
GO | |
--查询指定数据库的日志文件名称 | |
USE students | |
GO | |
SELECT name FROM SYS.database_files WHERE type_desc='LOG' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment