Author |
Topic |
shinobigoh
Starting Member
13 Posts |
Posted - 2010-04-13 : 22:15:16
|
I have a problemMy sql server 2000 database crashed but data files are still there.I want to reinstall the sql server 2000 on a new hard disk and want to try attach the data files without detach them but I would like to know any impacts of attaching the data files without detaching them in the first place |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2010-04-13 : 22:32:31
|
Well the database might be corrupt as the files weren't closed during the server crashing. You'll know if it's corrupt if during the attach it errors out about the files being a problem or if after they attach successfully and you run DBCC CHECKDB which comes up with errors. If the attach works successfully and DBCC CHECKDB comes up clean, then the database is good. Good luck!Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
shinobigoh
Starting Member
13 Posts |
Posted - 2010-04-13 : 23:40:47
|
if I am unable to attach the data files, any other way to restore the database?thank you |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
shinobigoh
Starting Member
13 Posts |
Posted - 2010-04-13 : 23:47:43
|
my customer did not have backups for the database |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
shinobigoh
Starting Member
13 Posts |
Posted - 2010-04-14 : 03:54:54
|
Is it possible for me to get the structure of the tables using the data files |
 |
|
Kristen
Test
22859 Posts |
Posted - 2010-04-14 : 04:33:54
|
If you cannot attach the files try:After reinstall SQL Server etc / on new machine / etc.Create a new database with the same name as the old one, and the same filenames as before.STOP the SQL service.Copy the files you rescued to overwrite the MDF and LDF files that were created for the new databaseRestart SQL Service - maybe your original database will show upIf the database appears then use DBCC CHECKDB to check if it is healthy. Do NOT use the repair option at this stage. If the database is healthy you are good to go if not then you may be able to export data from some (and maybe "all") tables. You may also be able to see the structure from some/maybe-all tables. Try creating a Script of the DDL - that would allow you to create a clean database with identical structure, and you could then try copying over the data table-by-table. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tosscrosby
Aged Yak Warrior
676 Posts |
Posted - 2010-04-16 : 10:21:42
|
And if it's your customer (I'm assuming a paying customer!), why did you not ensure a backup routine was in place? That is one of the most basic of steps as a service provider, whether a developer or DBA. You surely cannot use a customer who may be totally screwed by your lack of attention to detail as a reference for future, potential customers, now can you?Sorry, my Friday morning rant is now officially over! (Beware Monday mornings!)Terry-- The problem with socialism is that you eventually run out of other people’s money. -- Margaret Thatcher |
 |
|
|