Link to home
Start Free TrialLog in
Avatar of Jagdish Devaku
Jagdish Devaku

asked on

Issues with DBCC Shrinkdatabase


When I execute the following query...

DBCC shrinkdatabase(PCSystems, 30)

Its giving me an error...

DBCC SHRINKDATABASE: File ID 1 of database ID 11 was skipped because the file does not have enough free space to reclaim.
Msg 651, Level 16, State 1, Line 2
Cannot use the PAGE granularity hint on the table "dbo.tbl_attendance" because locking at the specified granularity is inhibited.
DBCC SHRINKDATABASE: Heap page 3:572 could not be moved.
The statement has been terminated.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

the 'tbl_attendance' table in the error is shifted to a seperate .ndf file.

why it gave me an error....?

Someone help me...
Avatar of aelliso3
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You may even want to use shrinkfile instead of shrinkdatabase.  It seems to give you more control over what's being done.