My server crashed and when it came back it has database marked as suspect, I
detached the database , delete the log file and try to attach it again using
enterprise manager however it saying it can't do it.
I have no backup of log or database for the day our backup was also not
working.
What I can do to recover the database.
Thanks for the help
TanweerHi,
Why did you delete the transaction log file before analyzing the cause for
suspect? I feel that cause for the suspect is because some
file (MDF or LDF) was using by some other process (backup or anti virus)
during startup. This would have been easily resolved by
running the system proc sp_resetstatus. Now since you deleted the LDF file
from query analyzer you could try sp_attach_single_file_db (see books online
for usage). If this fails then:-
You could try the below steps to make your database online using MDF file
only. Since in this processes the LDF file willnot be used on startup
(Emergency mode) , the data integrity might be an issue. (This step can be
used if you do not have any backups). Once the database become online move
the objects to a new database using DTS.
Steps:
1. Create a new database with the same name and same MDF and LDF files
2. Stop sql server and rename the existing MDF to a new one and copy the
original MDF to this location and delete the LDF files.
3. Start SQL Server
4. Now your database will be marked suspect
5. Update the sysdatabases to update to Emergency mode. This will not use
LOG files in start up
Sp_configure "allow updates", 1
go
Reconfigure with override
GO
Update sysdatabases set status = 32768 where name = "BadDbName"
go
Sp_configure "allow updates", 0
go
Reconfigure with override
GO
6. Restart sql server. now the database will be in emergency mode
7. Create a new database and use DTS to copy the objects and data to new
database.
You can use this new database.
Note:
If you have the backup file, it is always recommended to use the backup file
to restore the database. SO that data integrity will be maintained.
.
Thanks
Hari
SQL Server MVP
"Tanweer" <Tanweer@.discussions.microsoft.com> wrote in message
news:F86755A1-3C2A-4CC8-9463-F2E4E5E5F7D6@.microsoft.com...
> My server crashed and when it came back it has database marked as suspect,
> I
> detached the database , delete the log file and try to attach it again
> using
> enterprise manager however it saying it can't do it.
> I have no backup of log or database for the day our backup was also not
> working.
> What I can do to recover the database.
>
> Thanks for the help
> Tanweer|||Have a look here:
http://www.karaszi.com/SQLServer/info_corrupt_suspect_db.asp
--
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Tanweer" <Tanweer@.discussions.microsoft.com> schrieb im Newsbeitrag
news:F86755A1-3C2A-4CC8-9463-F2E4E5E5F7D6@.microsoft.com...
> My server crashed and when it came back it has database marked as suspect,
> I
> detached the database , delete the log file and try to attach it again
> using
> enterprise manager however it saying it can't do it.
> I have no backup of log or database for the day our backup was also not
> working.
> What I can do to recover the database.
>
> Thanks for the help
> Tanweer
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment