I don't know what happened

I'm not a guru of SQL Server 2005, but some hours ago something has happened. My .mdf denied opening.

Try to look at error log, windows log...maybe you don't have space available, maybe your log is full...

Sounds like a permissions issue on the file or directory

If you can’t open or repair .mdf via any method, in such case was created special instrument like ms sql server repair

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 Like