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
 SQL Server 2008 Forums
 High Availability (2008)
 Recover my deleted database

Author  Topic 

ashkan_vpm2
Starting Member

5 Posts

Posted - 2011-11-30 : 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

52326 Posts

Posted - 2011-12-01 : 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/

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-12-01 : 00:29:39
But please start with a backup first. Resorting to an mdf file should only be done after you've exhausted the backups.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jassi.singh
Posting Yak Master

122 Posts

Posted - 2011-12-01 : 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
Go to Top of Page

ashkan_vpm2
Starting Member

5 Posts

Posted - 2011-12-01 : 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?
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-12-01 : 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.
Go to Top of Page

ashkan_vpm2
Starting Member

5 Posts

Posted - 2011-12-01 : 07:02:04
when we replace a database to another database, the mdf files replaced to old database mdf files or not?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-01 : 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/

Go to Top of Page

ashkan_vpm2
Starting Member

5 Posts

Posted - 2011-12-01 : 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.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-12-01 : 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
Go to Top of Page

ashkan_vpm2
Starting Member

5 Posts

Posted - 2011-12-01 : 16:44:47
Thanks again.
where i can found LOG or bak files of my old database?
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-12-01 : 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
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-12-01 : 18:00:51
quote:
Originally posted by ashkan_vpm2

Thanks again.
where i can found LOG or bak files of my old database?



You can see what backups were made, and the filename etc., in the Backup History table:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54300#273265
Go to Top of Page
   

- Advertisement -