Attach database failed error 9004
Hi,
i need to attach my db, but i receive this error:
an error occurred while processing the log for database 'xyj'.
Could not open database 'xyj' . Create database is aborted. (Microsoft Sql Server,
error 9004).
Can you help me?
[270 byte] By [
Gigi69] at [2008-2-16]
hi gigi,
could it be that
sql server wasn't able to find
the log in the same directory as the db file.
you can use enterprise manager to point to the log files
or specify the location of the log files in the sp attach db command
EXEC sp_attach_db @dbname = N'pubs', @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf',
@filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf'
regards
I have these exact problem but on sql server 2000.
client was not backing up databases and after a power glitch, there is disk corruption - all the files are on the file system but I cannot start the instance
i tried to attach any of the user database files to another instance on another box and get the same error
Error: 9004 An error occurred while processing the log for database
Now, databases were in full recovery mode, no backups ... please advice
sql server 2000 sp4
have these exact problem but on sql server 2000.
client was not backing up databases and after a power glitch, there is disk corruption - all the files are on the file system but I cannot start the instance
i tried to attach any of the user database files to another instance on another box and get the same error
Error: 9004 An error occurred while processing the log for database
Now, databases were in full recovery mode, no backups ... please advice
sql server 2000 sp4
hi maiko,
the solution that i used to solve my proble was:
- create a new db with the same name of the lost db;
- put the db in emergency mode;
- stop sql service and replace the mdf file;
- start sql service;
- the db is probably corrupted for the disk crash...and you have to reindex all table.
bye
Gigi
Thanks Kevin.
Your suggestion saved me.
I did not follow it completely but it point me the right direction.
I had an other machine that crashed, I had the mdf and log file, but the new system did not want to import it.
Also it did refuse to restore the backup because it was a different database (through it had the smae data structure).
After swapping the files, I was able to restore from the backup
Thanks a lot
RNBY