Results 1 to 2 of 2

Thread: Database is still marked as Restoring after full restore

  1. #1
    Les Smith Guest

    Database is still marked as Restoring after full restore

    After I restore a database with SQL the database I cannot access it. However, after restoring using Enterprise Manager I do not have the same problem. The message I get is:

    Database 'les_test' cannot be opened. It is in the middle of a restore.

    The code I am trying to use for the restore is:

    RESTORE DATABASE les_test
    FROM DISK = 'c:MSSQL7BACKUPiztrobeta_db_200012011201.BAK& #39;
    WITH NORECOVERY,
    REPLACE,
    MOVE 'biztrobeta_PRI' TO 'c:mssql7DATAiztrobeta_PRI.ndf',
    MOVE 'biztrobeta_FGE_Dat1' TO 'c:mssql7DATAiztrobeta_FGE_Dat1.ndf',
    MOVE 'biztrobeta_FGX_Idx1 ' TO 'c:mssql7DATAiztrobeta_FGX_Idx1.ndf',
    MOVE 'biztrobeta_LOG' TO 'c:mssql7Dataiztrobeta_LOG.ldf'
    GO

    I tried changing the status in the master..sysdatabases tables, but the restored database was still not accessible. I tried to do this using the following statment:

    UPDATE sysdatabases
    SET STATUS = 4194316
    WHERE name = 'les_test'
    GO

    Any help is appreciated.

    Thanks,

    Les

  2. #2
    Les Smith Guest

    Database is still marked as Restoring after full restore (reply)

    Using the RECOVERY instead of NORECOVERY option the procedure works:

    RESTORE DATABASE biztrobeta
    FROM DISK = @filename
    WITH RECOVERY,
    REPLACE,
    MOVE 'biztrobeta_PRI' TO 'DATAiztrobeta_PRI.ndf',
    MOVE 'biztrobeta_FGE_Dat1' TO 'DATAiztrobeta_FGE_Dat1.ndf',
    MOVE 'biztrobeta_FGX_Idx1 ' TO 'DATAiztrobeta_FGX_Idx1.ndf',
    MOVE 'biztrobeta_LOG' TO 'Dataiztrobeta_LOG.ldf'

    ------------
    Les Smith at 12/2/00 4:36:10 PM

    After I restore a database with SQL the database I cannot access it. However, after restoring using Enterprise Manager I do not have the same problem. The message I get is:

    Database 'les_test' cannot be opened. It is in the middle of a restore.

    The code I am trying to use for the restore is:

    RESTORE DATABASE les_test
    FROM DISK = 'c:MSSQL7BACKUPiztrobeta_db_200012011201.BAK& #39;
    WITH NORECOVERY,
    REPLACE,
    MOVE 'biztrobeta_PRI' TO 'c:mssql7DATAiztrobeta_PRI.ndf',
    MOVE 'biztrobeta_FGE_Dat1' TO 'c:mssql7DATAiztrobeta_FGE_Dat1.ndf',
    MOVE 'biztrobeta_FGX_Idx1 ' TO 'c:mssql7DATAiztrobeta_FGX_Idx1.ndf',
    MOVE 'biztrobeta_LOG' TO 'c:mssql7Dataiztrobeta_LOG.ldf'
    GO

    I tried changing the status in the master..sysdatabases tables, but the restored database was still not accessible. I tried to do this using the following statment:

    UPDATE sysdatabases
    SET STATUS = 4194316
    WHERE name = 'les_test'
    GO

    Any help is appreciated.

    Thanks,

    Les

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •