Help with shrink database | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Help with shrink database

Hi, Is there any article on the physical space needed to shrink a database. We have 30gb database and 33gb hard disk, do we need to have more hard disk space before trying out SHRINKDATABASE?. Thanks.
As far I know, no.
Luis Martin …Thus mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true.
Bertrand Russell
I agree with Luis and BOL refers :

DBCC SHRINKDATABASE shrinks data files on a per-file basis. However, DBCC SHRINKDATABASE shrinks log files as if all the log files existed in one contiguous log pool. Assume a database named mydb with two data files and two log files. Both data and log files are 10 MB in size. The first data file contains 6 MB of data. For each file, SQL Server calculates a target size, which is the size to which the file is to be shrunk. When DBCC SHRINKDATABASE is specified with target_percent, SQL Server calculates target size to be the target_percent amount of space free in the file after shrinking. For example, if you specify a target_percent of 25 for shrinking mydb. SQL Server calculates the target size for this file to be 8 MB (6 MB of data plus 2 MB of free space). Therefore, SQL Server moves any data from the last 2 MB of the data file to any free space in the first 8 MB of the data file and then shrinks the file.
Have you tried to use the DBCC command or any issues in performing the task?
_________
Satya SKJ
Moderator
SQL-Server-Performance.Com

]]>