Issue with shrink database. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Issue with shrink database.

When i try to shrink my database i am getting the following error:
Cannot use the PAGE granularity hint on the table "dbo.Tablename" because locking at the specified granularity is inhibited.
DBCC SHRINKDATABASE: Heap page 1:422421 could not be moved.
The statement has been terminated.
DBCC execution completed. If DBCC printed error messages, contact your system administrator. (.Net SqlClient Data Provider) any help apreciated. kIRAN
SQL DBA
Looks like table has no clustered indexes which might be cuasing this when moving the data…Try to run backup log if the db recovery model is full or checkpoint if it is simple then run shrink again…. Other wise you can try after creating the clustered on the tables…
http://blogs.msdn.com/sqlserverstorageengine/rss_tag_Shrink.xml
MohammedU.
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

Thanks a lot..I created the cluster Index and tried shrink database, i am not geting error now.. kIRAN
SQL DBA
Other question is why you are trying to SHRINK the database if the storage is not a problem, I can see if the processess are contributing the size to the database why not leave it as it is without any further usage of SQL resource that are not required. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. The greatest discovery of my generation is that a human being can alter his life by altering his attitudes of mind.
]]>