Attach Database failed :WAVE: HELP :WAVE:


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Attach Database failed :WAVE: HELP :WAVE:

  1. #1
    Join Date
    Jun 2004
    Posts
    19

    Exclamation Attach Database failed :WAVE: HELP :WAVE:

    Hi,

    I want to attach my database from server to my pc, I'm using sql server 2000. When I attach the .mdb file, I get this error:

    Error 9004: An error occurred while processing the log for database 'MyDatabase'

    So, I found another suggest, which is re-generate the log file. This is the step I follow:

    1.Make sure you have completed sucessfully all the prerequisite steps, i.e.: 1) database, marked as suspect was de-attached 2) failed hard drive was replaced;

    2.Move de-attached database file to any safe location;

    3.Delete a suspect database using SQL Server Enterprise Manager console;

    4.Create a new database with the same (as the suspect database has) logical name and physical *.mdf and *.ldf file names. All the *.mdf and *.ldf files should be located in exactly the same locations (directories) as the suspect database;

    5.Stop SQL Server services;

    6.Replace a valid *.mdf file with suspected one (created on step 1 and 2);

    7.Start SQL Server services;

    8.Run SQL Server Query Analyzer and execute the following script:

    9.Execute the following script:

    select status from sysdatabases where name = 'your database name'


    10.Execute the following script:

    update sysdatabases set status= 32768 where name = 'your database name'


    11.Restart SQL Server services;

    12.Make sure a database (you trying to recover) visible in SQL Server Enterprise Manager console (having Emergency mode?status). After doing this, you can enter the database and SELECT the data or use BCP to get it out. You may encounter errors while doing this, but in most cases much of the data can be retrieved;

    13.Execute the following script: >>>>>>>>Get error here<<<<<<<<<<<

    dbcc rebuild_log ('your database name', 'full path to a new transaction log file')

    >>>>> Error Message <<<<<<<<
    Server: Msg 5180, Level 22, State 1, Line 1
    Could not open FCB for invalid file ID 0 in database 'STS_EDUHQSRV1_1'.

    Connection Broken

    >>>>>>>>>>>>>><<<<<<<<<<<

    14.Execute the following script:

    use 'your database name'
    go
    sp_dboption 'your database name', 'single_user', 'true'
    go
    dbcc checkdb ('your database name', repair_allow_data_loss)
    go


    DBCC CHECKDB with REPAIR_ALLOW_DATA_LOSS clause performs:

    [list=1]

    15.nontime-consuming repair actions such as repairing extra keys in nonclustered indexes. These repairs can be done quickly and without risk of data loss;

    16.time-consuming repairs such as rebuilding indexes. These repairs can be done without risk of data loss;

    17.allocation and deallocation of rows and pages for correcting allocation errors, structural row or page errors. These repairs can result in some data loss;

    18.deletion of corrupted text objects. These repair can result in some data loss, too.

  2. #2
    Join Date
    Jun 2004
    Posts
    19
    How to solve this error?

    >>>>> Error Message <<<<<<<<
    Server: Msg 5180, Level 22, State 1, Line 1
    Could not open FCB for invalid file ID 0 in database 'STS_EDUHQSRV1_1'.

    Connection Broken

    >>>>>>>>>>>>>><<<<<<<<<<<

Similar Threads

  1. Access Database, using VB as front end
    By binnymann in forum Database
    Replies: 3
    Last Post: 04-13-2008, 01:23 AM
  2. Replies: 0
    Last Post: 08-23-2006, 12:21 AM
  3. XML files vs Database
    By Mansoor in forum XML
    Replies: 8
    Last Post: 08-23-2002, 04:35 PM
  4. Locked DB Process when detaching a database in ASP.NET
    By Micah Nasarow in forum ASP.NET
    Replies: 1
    Last Post: 01-21-2002, 01:34 PM
  5. Replies: 5
    Last Post: 03-02-2001, 11:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center