Solved

SQL backup

Posted on 2012-04-06
2
426 Views
Last Modified: 2012-06-27
Hi,

I did a backup of an SQL database using this code:

/* Perform a Full Backup of dbMT*/
Use master
GO
BACKUP DATABASE dbMT
TO DISK =N'C:\SQL_backup\dbMT.BAK'
WITH COMPRESSION
GO

/* Perform a Tail Log Backup of dbMT*/
BACKUP LOG dbMT
TO DISK =N'C:\SQL_backup\dbMT.TRN'
WITH COMPRESSION, NORECOVERY
GO

After that the database was stuck in stuck in “Restoring” state. I had to run this code to release it:

RESTORE DATABASE dbMT
   FROM DISK = N'C:\SQL_backup\dbMT.BAK'
   WITH REPLACE,RECOVERY

How can I do the backup without this happening?

Best regards
RTSol
0
Comment
Question by:RTSol
2 Comments
 
LVL 26

Accepted Solution

by:
Chris Luttrell earned 500 total points
ID: 37815417
Leave off the NORECOVERY when you do the tail log backup
0
 

Author Closing Comment

by:RTSol
ID: 37815492
Thanks - that made the trick.

Best regards
RTSol
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server Designer 19 44
Query Syntax 17 36
SQL Server - Getting the most recent engagement for each contact 9 23
SQL Function NOT ROUND 9 10
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question