question

AurelieDevillers avatar image
AurelieDevillers asked

My database with many tables

I'm on SQL Server 2008. I'm working with it during some years. Some time ago, something happened, and at effort of opening .mdf nothing happens, SQL Server neither open nor gives messages.
sql-server-2008databasemdf
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image JohnM commented ·
When you say "open" what do you mean by that? Are you attempting to attach a database? Expand the database in object explorer? Restore it? Is the instance running or down?
0 Likes 0 ·

1 Answer

·
GheysarZohrab avatar image
GheysarZohrab answered
If you can’t open or repair .mdf via any method, in such case was created special instrument like [how to restore data from mdf file][1] Here are represented the models of sql recovery - [ https://www.mssqltips.com/sqlservertutorial/2/sql-server-recovery-models/][2] It is the address of the guide below: [ https://www.mssqltips.com/sqlservertutorial/112/recovering-a-database-that-is-in-the-restoring-state/][3] Restore full backup WITH RECOVERY As mentioned above this option is the default, but you can specify as follows. RESTORE DATABASE AdventureWorks FROM DISK = 'C:\AdventureWorks.BAK' WITH RECOVERY GO Recover a database that is in the "restoring" state The following command will take a database that is in the "restoring" state and make it available for end users. RESTORE DATABASE AdventureWorks WITH RECOVERY GO Restore multiple backups using WITH RECOVERY for last backup The first restore uses the NORECOVERY option so additional restores can be done. The second command restores the transaction log and then brings the database online for end user use. RESTORE DATABASE AdventureWorks FROM DISK = 'C:\AdventureWorks.BAK' WITH NORECOVERY GO RESTORE LOG AdventureWorks FROM DISK = 'C:\AdventureWorks.TRN' WITH RECOVERY GO [1]: https://www.restoretools.com/sqlserverrestore.html [2]: https://www.mssqltips.com/sqlservertutorial/2/sql-server-recovery-models/ [3]: https://www.mssqltips.com/sqlservertutorial/112/recovering-a-database-that-is-in-the-restoring-state/
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.