Manually grow the log file, which is actually modifying the size of the log file in megabytes
The log file size below is set to 2048MB
ALTERDATABASE[GPOSDB] MODIFY FILE (name=gposdb_log,size=2048)
EXEC sys. [sp_helpdb] @dbname = [GPOSDB]--sysname
--Shrink log file use
[Gposdb] Go
ALTER DATABASE [gposdb] SET RECOVERY simple;
Go
--Set the simple recovery model
DBCC shrinkfile (Gposdb_log, 1);
Go
--revert to original mode
ALTER DATABASE [Gposdb] SET RECOVERY full;
Go
--Manually grow the data file, which is actually modifying the size of the data file in megabytes. Set the log file size to be 2048MB
ALTERDATABASE[GPOSDB] MODIFY FILE (name=gposdb_data,size=2048)
EXEC sys. [sp_helpdb] @dbname = [GPOSDB]--sysname
--Shrink data file shrink to 2MB
Use [Gposdb]
go
DBCC shrinkfile (N ' Gposdb_data ', 2)
go
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/