Shrink SQL Database Failed

  • have a database which size is 40GB, but only 1% is used, so i wanted to shrink this database to a smaller size.

    i tried to shrink the database by using command as below:

    DBCC SHRINKDATABASE (BizTalkDTADb)

    but i got following error message:

    page 1:5141919 could not be moved because the partition to which it belonged was dropped

    is there anybody can tell me what's the problem and how to fix it ?

    Notes:

    the disk space is 41G, this database almost consumed all the spaces, only 800MB free.

    William

  • Execute following command to check database:

    DBCC CHECKDB (BizTalkDTADb)

    This will help to find the consistency of the database.

    Once it is successful again execute the shrinkfile command specifying the file_id.

    HTH

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • free_mascot (12/9/2013)


    Execute following command to check database:

    DBCC CHECKDB (BizTalkDTADb)

    This will help to find the consistency of the database.

    Once it is successful again execute the shrinkfile command specifying the file_id.

    HTH

    i checked the database i got following information: is there any best practice to fix this problem?

    DBCC results for 'BizTalkDTADb'.

    Service Broker Msg 9675, State 1: Message Types analyzed: 14.

    Service Broker Msg 9676, State 1: Service Contracts analyzed: 6.

    Service Broker Msg 9667, State 1: Services analyzed: 3.

    Service Broker Msg 9668, State 1: Service Queues analyzed: 3.

    Service Broker Msg 9669, State 1: Conversation Endpoints analyzed: 0.

    Service Broker Msg 9674, State 1: Conversation Groups analyzed: 0.

    Service Broker Msg 9670, State 1: Remote Service Bindings analyzed: 0.

    Service Broker Msg 9605, State 1: Conversation Priorities analyzed: 0.

    Msg 8905, Level 16, State 1, Line 1

    Extent (1:5141912) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

    CHECKDB found 1 allocation errors and 0 consistency errors not associated with any single object.

    DBCC results for 'sys.sysrscols'.

    There are 1194 rows in 15 pages for object "sys.sysrscols".

  • Is this production database?

    This is corruption issue and you can try different options of DBCC CHECKDB OR DBCC CHECKTABLE to fix the issue.

    http://technet.microsoft.com/en-us/library/ms176064.aspx

    http://technet.microsoft.com/en-us/library/ms174338.aspx

    There might be data loss.

    Also if you do have good backup plan you can restore with all the t-log and tail log backup CONSIDERING your backup is not corrupt.

    Keep in mind solution is purely based on the situation and assess the risk before implementing any solution.

    HTH

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply