My Google Plus Page

Electricity Bill Calculator

Electricity Bill Calculator

Electricity Bill Cost Calculator. Electricity Usage Consumption Calculator.

Select Country:  
Typical Appliance:
Power Consumption:
Hours Of Use Per Day: Hrs/Day
One Unit Cost (1 kWh ):
 
Electricity Cost Per Day:  
Electricity Cost Per Month:  
Electricity Cost Per Year:  

Note:- 1 Unit = 1 kwh (Kilo Watt Hour)

HTML tutorial

EBC-Ads

Social Message

Social Message
Social Message Useful Health Tips

Wednesday, July 20, 2016

Microsoft SQL Server Databases Stuck in Restoring State

Microsoft SQL Server Databases Stuck in Restoring State


Overview

The RESTORE ... WITH RECOVERY option puts the database into a usable state, so users can access a restored database. 


This is likely caused by the restore script adding the WITH NO RECOVERY parameter to make the database ready for a transaction log apply after the restore. The database is now waiting for the latest transaction log file.
You can either:
  1. Apply the latest transaction log (Using RESTORE LOG... WITH RECOVERY)... or
  2. Restore the database again, but this time using WITH RECOVERY ... or
  3. Force the database out of restoring mode by executing: RESTORE DATABASE YourDb WITH RECOVERY
Before you do this, please make sure you understand the implications of these options. You may cause data loss if you are not careful.

Run below commands in SQL Query windows

RESTORE DATABASE AdventureWorks WITH RECOVERY

Optional more Recovery commands:-
Restore full backup WITH RECOVERY
RESTORE DATABASE AdventureWorks FROM DISK = 'C:\AdventureWorks.BAK'
WITH RECOVERY
GO


Recover a database that is in the "restoring" state


RESTORE DATABASE AdventureWorks WITH RECOVERY
GO


Restore multiple backups using WITH RECOVERY for last backup


RESTORE DATABASE AdventureWorks FROM DISK = 'C:\AdventureWorks.BAK'
WITH NORECOVERY
GO
RESTORE LOG AdventureWorks FROM DISK = 'C:\AdventureWorks.TRN'
WITH RECOVERY
GO