Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Database suspect

Author  Topic 

thelastjohn
Starting Member

6 Posts

Posted - 2007-09-08 : 10:18:39
Hi all , i am facing a problem and don't know how to handle the issue. I created a database in sql server 2000 , gave it to a friend who made certain changes to the database and mailed me back.
Now that i try to open the database , in the enterprise manager the icon of the my database is gray with "suspected" written in brackets after the database name. On expandin it , it shows ("No Items"). Kindly help me out guys , i am totally stuck for the moment.
Regards

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-09-08 : 10:20:42
can you explain what exactly you did ? What are the steps taken ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

thelastjohn
Starting Member

6 Posts

Posted - 2007-09-08 : 10:37:12
Well i am developing an application. The database contained certain tables and thier relationships. The sql server was connected through localhost , the only issue that comes to my mind is , when i mailed it to a friend maybe he had sql server authentication and now as i open the database with localhost , maybe that is the reason.
This is the only thing i can think off , but i dont know how to address the problem.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-09-08 : 10:48:41
I mean what do you mail to your friend ? the database mdf/ldf files ? I assume you either shutdown the sqlserver or take the database offline or detach the database first before copy out the mdf/ldf ? What and how exactly have you done in order to mail the file ?

And when the files are returned, again what have you done ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

thelastjohn
Starting Member

6 Posts

Posted - 2007-09-08 : 11:16:07
i got even more worse now. What i did was shutdown the sql service. Copied the files and mailed. When he mailed the files back , i made the backup of the previous files in another folder , stopped the service and overwrite the database and log file. That's what i did.
I just reinstalled my sql server and it has gone more worse now , it's not even showing the database anymore. I have added the files in Data folder but it's not showing it in enterprise manager.
, totally blocked here , plz help
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-09-08 : 12:02:32
Try attach the db with sp_attach_db if db files are still there.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-09-08 : 12:22:46
If it was a single database and log file then rename the log file and try sp_attach_single_file_db with the mdf.
If that fails then you will have to put the database into emergency mode. If it's v2005 then se alter database other see
http://www.nigelrivett.net/SQLAdmin/RecoverCorruptDatabase.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-09-08 : 12:41:14
"When he mailed the files back , i made the backup of the previous files in another folder"

You should be able to restore from that backup file without any trouble (either overwriting a database, or creating a brand new one)

For the correct syntax see:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20example

Kristen
Go to Top of Page

thelastjohn
Starting Member

6 Posts

Posted - 2007-09-08 : 14:25:05
Thanks guys sp_attach_single_file_db worked ,
very nice of you to reply on such short notice.
PROBLEM SOLVED !!!! CHEERS !!!!!!!!!!!!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-09-08 : 14:31:25
Suggest you now run a DBCC CEHCKDB (See BoL for syntax) to double check that there are no corruptions etc. in the file/database.

Kristen
Go to Top of Page

thelastjohn
Starting Member

6 Posts

Posted - 2007-09-08 : 16:00:18
sure !! doing that right now
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-09-08 : 19:13:41
If you need send db to some again, better to backup the db and send out backup file. Same when get db from others, ask for db backup file. So you can restore it without affecting existing dbs on the server.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-09-09 : 05:46:15
If you are not familiar with RESTORE there are two things to watch out for.

By default RESTORE will put the database using the Path from the ORIGINAL Backup - which may be to a drive that does not exist on the Target machine, and failing that probably to an inappropriate place!

Secondly, the IDs of Database Users will be incompatibility with the Target Server's Logons. These Orphan Users need to be sorted out (this is also true of restoring using Attach database, or just copying the files as you did).

See the link I posted above for further details.

Kristen
Go to Top of Page
   

- Advertisement -