Results 1 to 14 of 14

Thread: error on attach db

  1. #1
    Join Date
    Jan 2003
    Posts
    6

    error on attach db

    I get this error when i try to attach a db to a sql server:

    The header for file d:\mssql\data\dbname.mdf is not a valid database file header. the page audit property is incorrect.

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    What's sql version on the server? What's sql version of the file? You can't attach sql2k db file to sql7.

  3. #3
    Join Date
    Jan 2003
    Posts
    6
    the version of the file and the server is sql 7.

  4. #4
    Join Date
    Dec 2002
    Posts
    181
    In addition, you might check compatible service pack levels. Is this a system db? 7.0 Sp3 modified the system tables pretty well...


    Jeff

  5. #5
    Join Date
    Jan 2003
    Posts
    6
    no this db was created by a user.

  6. #6
    Join Date
    Dec 2002
    Posts
    181
    I would make sure the source and destination machines are at the same SP. If so, then you might run dbcc checkdb on the database before it is detached to make sure it is clean.

    Jeff

  7. #7
    Join Date
    Sep 2002
    Posts
    5,938
    Better to backup/restore db.

  8. #8
    Join Date
    Jan 2003
    Posts
    6
    can't do restore b/c there weren't any backups and can't run dbcc on source db because it was dettached awhile ago and the sql server that the db was previously on no longer exists. All I have is the .mdf and .ldf files.

  9. #9
    Join Date
    Dec 2002
    Posts
    181
    Sounds like you're stuck. Start with a base 7.0 install on a test machine and keep moving up in service packs until it succeeds. I would still suspect they might be sql 2000 files. You might try that on a test 2k box if you have one.

    Jeff

  10. #10
    Join Date
    Sep 2002
    Posts
    5,938
    Refer KB article Q268481 for the issue.

  11. #11
    Join Date
    Jan 2003
    Posts
    1

    Re: error on attach db

    I just had this problem yesterday while trying to upgrade SQL7 to 2000.

    Our solution was to attach the database to an SQL2000 server, then DTS back to SQL7. You might not have a SQL 2000 server "lying" around...

  12. #12
    Join Date
    Jan 2003
    Posts
    11
    I have recently experienced exactly the same problem. I have a copy of the db files from another server(still running). Get the same error when trying to reattach the files on my own SQLServer7. If I find out anything about this I will let you know.

    -Arthur

  13. #13
    Join Date
    Jan 2003
    Posts
    11

    Thumbs up

    Hi.

    In my case it seems that it is db files from an SQLServer2000, and I then get this error when trying to sp_attach them to my SQLServer7. I have just now installed SQLServer2000 on a test computer and could then sp_attach the db files with no error.

    I've not been able to reach the sender of the db files today so I'm not sure if they actually have an SQLServer2000, but I asume so.

    -Arthur

  14. #14
    Join Date
    Jan 2003
    Posts
    11
    Hi.
    In my case the problem occured because the the db-files that I had recieved and tried to attach on my SQLServer7 was originally from an SQLServer2000.

    -Arthur

Posting Permissions

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