brokeMyLegBiking
asked on
best way to shrink database file sizes
What is the best and safest way to shrink the mdf and ldf files of my databse? I use the following command:
DBCC SHRINKFILE(sfs_dat, truncateonly)
DBCC SHRINKFILE(sfs_log, truncateonly)
I have also used this command, but I think truncateonly is healthier. Is that correct?
DBCC SHRINKFILE(sfs_dat, 1)
DBCC SHRINKFILE(sfs_log, 1)
I see some people recommend this command. Why the backup log command does that force sqlserver to do some cleanup internally or something?
DBCC SHRINKFILE(<TransactionLog Name>, 1)
BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY
DBCC SHRINKFILE(<TransactionLog Name>, 1)
and final question: Is the only difference between DBCC SHRINKFILE and DBCC SHRINKDATABSE, that DBCC SHRINKDATABASE does all files?
DBCC SHRINKFILE(sfs_dat, truncateonly)
DBCC SHRINKFILE(sfs_log, truncateonly)
I have also used this command, but I think truncateonly is healthier. Is that correct?
DBCC SHRINKFILE(sfs_dat, 1)
DBCC SHRINKFILE(sfs_log, 1)
I see some people recommend this command. Why the backup log command does that force sqlserver to do some cleanup internally or something?
DBCC SHRINKFILE(<TransactionLog
BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY
DBCC SHRINKFILE(<TransactionLog
and final question: Is the only difference between DBCC SHRINKFILE and DBCC SHRINKDATABSE, that DBCC SHRINKDATABASE does all files?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER