Solved

SQL backup

Posted on 2012-04-06
2
429 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL convert varchar to INT 17 29
Star schema daily updates 2 33
Update the value of table B with value of table A tables inner join 6 74
Need SSIS project 2 23
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article I will describe the Detach & Attach 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.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

679 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