SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 High Availability (2008)
 Recover my deleted database
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ashkan_vpm2
Starting Member

Iran
5 Posts

Posted - 11/30/2011 :  13:05:41  Show Profile  Reply with Quote
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
52249 Posts

Posted - 12/01/2011 :  00:11:03  Show Profile  Reply with Quote
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

USA
35932 Posts

Posted - 12/01/2011 :  00:29:39  Show Profile  Visit tkizer's Homepage  Reply with Quote
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 - 12/01/2011 :  05:08:58  Show Profile  Visit jassi.singh's Homepage  Reply with Quote
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
Go to Top of Page

ashkan_vpm2
Starting Member

Iran
5 Posts

Posted - 12/01/2011 :  06:43:05  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

United Kingdom
3355 Posts

Posted - 12/01/2011 :  06:55:22  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
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

Iran
5 Posts

Posted - 12/01/2011 :  07:02:04  Show Profile  Reply with Quote
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

India
52249 Posts

Posted - 12/01/2011 :  07:26:49  Show Profile  Reply with Quote
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

Iran
5 Posts

Posted - 12/01/2011 :  09:05:58  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 12/01/2011 :  09:38:33  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
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

Iran
5 Posts

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

GilaMonster
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 12/01/2011 :  16:56:27  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
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
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 12/01/2011 :  18:00:51  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000