| Author |
Topic  |
|
|
ashkan_vpm2
Starting Member
Iran
5 Posts |
Posted - 11/30/2011 : 13:05:41
|
Hi I had a database in SSMS 2008 with name 'SGDB'; When i was in restoring for another database in SSMS 2008, the new database replace on old database with name 'SGDB'; in executing level at 10%, i reset the system to stop restoring but the database replaced and going in this mode: 'SGDB (Restoring...)'
How i can recover my old SGDB? which files i need to restore it? Is that possible to restore it?
Please answer me as soon as possible. Thanks. |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47069 Posts |
Posted - 12/01/2011 : 00:11:03
|
you've old mdf idf stored somewhere? or at least bacup (.bak) of old db?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
tkizer
Almighty SQL Goddess
USA
35007 Posts |
|
|
jassi.singh
Posting Yak Master
122 Posts |
Posted - 12/01/2011 : 05:08:58
|
If your backup file is *.bak file, you can simply restored your database using the below statement:
RESTORE DATABASE [your_database_file] FROM DISK = N'*.bak_physical_path' WITH FILE = 1, NOUNLOAD, STATS = 10 GO
Another way is to right click the database name which you would like to restored, choose tasks--> restore-->database and open the "restored database" window. browse your computer and choose the bak file then click OK. This should be very easy to follow.
Check this also http://blog.sqlauthority.com/2007/07/18/sql-server-restore-database-without-or-with-backup-everything-about-restore-and-backup/
Hope my suggestion helps |
Edited by - jassi.singh on 12/01/2011 05:09:35 |
 |
|
|
ashkan_vpm2
Starting Member
Iran
5 Posts |
Posted - 12/01/2011 : 06:43:05
|
Thanks for all of your great answers.
Is that possible to recover a database in SSMS that replaced with another database? please tell me which files are needed? |
 |
|
|
nigelrivett
Flowing Fount of Yak Knowledge
United Kingdom
3328 Posts |
Posted - 12/01/2011 : 06:55:22
|
You would need the .mdf for the database as a minimum. If you don't have that or a backup then you can't go any further.
========================================== Cursors are useful if you don't know sql. SSIS can be used in a similar way. Beer is not cold and it isn't fizzy. |
 |
|
|
ashkan_vpm2
Starting Member
Iran
5 Posts |
Posted - 12/01/2011 : 07:02:04
|
| when we replace a database to another database, the mdf files replaced to old database mdf files or not? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47069 Posts |
Posted - 12/01/2011 : 07:26:49
|
quote: Originally posted by ashkan_vpm2
when we replace a database to another database, the mdf files replaced to old database mdf files or not?
how did you do the replace? did you select the new db mdf and just gave the name same as old db?
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
ashkan_vpm2
Starting Member
Iran
5 Posts |
Posted - 12/01/2011 : 09:05:58
|
I do select the new db BAK file for restore and just gave the name same as old db that exist in SSMS and previously restored.
When it's start to restore i got that i do mistake, then i restart the system. when again i open the SSMS i got the database same name with this title "SGDB (Restoring...)". "SGDB" is my database name.
Please help me. If i most do find some file please help me how i can find them. Thanks. |
 |
|
|
GilaMonster
Flowing Fount of Yak Knowledge
South Africa
4507 Posts |
Posted - 12/01/2011 : 09:38:33
|
The old DB would have been overwritten as part of the restore. To get the old DB back you need a backup of that old DB or copies of the data and log files taken before the restore started. If you don't have either of those, then the old DB is not recoverable.
-- Gail Shaw SQL Server MVP |
 |
|
|
ashkan_vpm2
Starting Member
Iran
5 Posts |
Posted - 12/01/2011 : 16:44:47
|
Thanks again. where i can found LOG or bak files of my old database? |
 |
|
|
GilaMonster
Flowing Fount of Yak Knowledge
South Africa
4507 Posts |
Posted - 12/01/2011 : 16:56:27
|
Whereever you put them when taking backups. (not Log, you'd need copies of the data and log files)
-- Gail Shaw SQL Server MVP |
Edited by - GilaMonster on 12/01/2011 16:56:56 |
 |
|
|
Kristen
Test
United Kingdom
22191 Posts |
|
| |
Topic  |
|