locked
How to restore CRM 4.0 Database? (Restore Failed) RRS feed

  • Question

  • Hi Expert,

    I've uninstall CRM 4.0 yesterday, but before that i make my backup for the database (MSCRM_CONFIG & Organization_MSCRM) 

    Then i install a new CRM 4.0 at the same machine and reboot,

    After that i try to restore my old database at SQL Studio 2005 but get an error. May i know y?? did i need to restore the database 1st before install CRM 4.0?? Please assits and below is the error message:

     

     

    TITLE: Microsoft SQL Server Management Studio

    ------------------------------

     

    Restore failed for Server 'PAHANG'.  (Microsoft.SqlServer.Smo)

     

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.4035.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

     

    ------------------------------

    ADDITIONAL INFORMATION:

     

    System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Smo)

     

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.4035.00&LinkId=20476

     

    ------------------------------

    BUTTONS:

     

    OK

    ------------------------------


     

    Thursday, November 11, 2010 6:28 AM

Answers

  • System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Smo)

    That's a SQL Server issue.  In order to be able to restore a database, you must first have exclusive access to the database; it cannot be used whilst the restore is in progress as the database will be in an indeterminate state.

    Put the database in single-user mode; in SQL Server Management Studio:

    • Right-click on the database name
    • Click on Properties context menu item
    • Click on Options menu item on the left
    • In the grid, scroll down to the bottom
    • Change 'Restrict Access' to SINGLE_USER

    You'll now have exclusive access and can complete the restore.


    --pogo (pat)
    • Marked as answer by Adi Zahari Thursday, November 11, 2010 7:17 AM
    Thursday, November 11, 2010 6:42 AM
  • Hi,

    Other suggestion can be that if you need to add your old ms crm database you need to redeploy it using the redeployment option.

    Regards

    TGB


    Microsoft Certified Business Management Solutions Specialist
    • Marked as answer by Adi Zahari Thursday, November 11, 2010 7:17 AM
    Thursday, November 11, 2010 6:51 AM

All replies

  • System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Smo)

    That's a SQL Server issue.  In order to be able to restore a database, you must first have exclusive access to the database; it cannot be used whilst the restore is in progress as the database will be in an indeterminate state.

    Put the database in single-user mode; in SQL Server Management Studio:

    • Right-click on the database name
    • Click on Properties context menu item
    • Click on Options menu item on the left
    • In the grid, scroll down to the bottom
    • Change 'Restrict Access' to SINGLE_USER

    You'll now have exclusive access and can complete the restore.


    --pogo (pat)
    • Marked as answer by Adi Zahari Thursday, November 11, 2010 7:17 AM
    Thursday, November 11, 2010 6:42 AM
  • Hi,

    Other suggestion can be that if you need to add your old ms crm database you need to redeploy it using the redeployment option.

    Regards

    TGB


    Microsoft Certified Business Management Solutions Specialist
    • Marked as answer by Adi Zahari Thursday, November 11, 2010 7:17 AM
    Thursday, November 11, 2010 6:51 AM
  • Hi all,

    Just want to add, the other round to solved this issue is by stop the "SQL Server VSS Writer" service. Hope this we help for anybody in the future. TQ

    • Proposed as answer by Mahesh Ghori Saturday, November 20, 2010 9:52 AM
    Friday, November 12, 2010 9:07 AM
  • hi,

    good one .. now after change 'Restrict Access' from MutiUesr to SingleUser , restore backup successfully.


    Mahesh A. Ghori
    Saturday, November 20, 2010 9:54 AM