Results 1 to 3 of 3

Thread: attach db fails

  1. #1
    Join Date
    Mar 2004
    Posts
    162

    Unanswered: attach db fails

    case: my db was in mode "suspect" and i try to detach db and now i can't attach it at all. I got this error message when im try to attach the db:
    "---------------------------
    Microsoft SQL-DMO (ODBC SQLState: 42000)
    ---------------------------
    Error 1813: Could not open new database 'db_ControlManager'. CREATE DATABASE is aborted.
    Device activation error. The physical file name 'E:\MSSQL\Data\db_ControlManager_log.LDF' may be incorrect.
    ---------------------------"

    The logfile is lost but when i try to attach it says that it might cretate a new log file but it dosen't. There is no problem for me to loose whats in that log file as long as i can access the data in db.

    And of course the backup software dosen't work so i have no backup of the db

    How can i try to repair the db?

    thx in advance for any help

    im using sql 2000 with sp4

  2. #2
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    Try this:
    EXEC sp_resetstatus ‘yourDBname’;
    ALTER DATABASE yourDBname SET EMERGENCY
    DBCC checkdb(’yourDBname’)
    ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
    DBCC CheckDB (’yourDBname’, REPAIR_ALLOW_DATA_LOSS)
    ALTER DATABASE yourDBname SET MULTI_USER

    If it no workee, need to restore from backup.

  3. #3
    Join Date
    Jun 2009
    Location
    CA, USA
    Posts
    59
    There is another option to use undocumented DBCC..
    DBCC rebuild_log...but some time you may endup inconsistent data...
    I used this many times without any issue...

    Check the following thread for complete info about this command...
    REBUILDING LOG
    MohammedU
    SQL Server MVP

Posting Permissions

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