Solved

How to restore differential backup file on MS SQL 2000

Posted on 2011-09-18
8
563 Views
Last Modified: 2012-05-12
Hi all,

Having a major issue trying to restore my differential backup file on MS SQL 2000.

I have migrated my SQL over to another server and I did the following:

1.  Created a complete backup of 18GB database file Complete.BAK from Server 1.
2.  Transferred complete.BAK from Server 1 to Server 2.
3.  Used restore function in Server 2 via Device and selected Complete.BAK.
4.  Database restored in Server 2.
5.  I waited 2 more days and created a Differential Backup Diff.Bak from Server 1 which the file was much smaller at 300MB.
6.  Transferred Diff.BAk from Server 1 to Server 2.
7.  Used restore function in Server 2 via Device, selected Diff.Bak and selected Database - Differential.

Error occured in Step 7 where an error said the preceding restore operation did not specify with NORECOVERY or WITH STANDBY..... RESTORE DATABASE is terminating Abnormally.

Need your assistance how to do this. I suspect I need to generate a T-SQL statement but I am unsure what it is. My database name is SECONDARY.

Attached are the screenshots.

Backup-Differential-Database-Err.doc
0
Comment
Question by:cq27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 15

Expert Comment

by:Anuj
ID: 36558479
First you have to restore the full backup(Complete backup) with NORECOVERY , this allows you to restore additional  backup files (diff backups and log backups) over the restoring database. Then you need to apply the latest differential backup with RECOVERY state.

check this

http://msdn.microsoft.com/en-us/library/ms186858.aspx
0
 
LVL 15

Expert Comment

by:Anuj
ID: 36558490
0
 
LVL 5

Expert Comment

by:Alexey Komarov
ID: 36558499
Hi
You must restore full backup with NORECOVERY option.
0
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 

Author Comment

by:cq27
ID: 36558545
HI anujnb

I checked both your links and they are useful, however, I still do not know how to write out the T-SQL statement. Are you able to assist with an example?

I need 1-TSQL on how to restore full backup with NORECOVERY option
And 1 TSQL on how to restore latest differential backup with RECOVERY state
0
 
LVL 5

Accepted Solution

by:
Alexey Komarov earned 125 total points
ID: 36558562
Hi
RESTORE DATABASE Northwind FROM DISK = 'C:\Temp\DatabaseBackups\Northwind_Full.bak' WITH NORECOVERY
GO
RESTORE DATABASE Northwind FROM DISK = 'C:\Temp\DatabaseBackups\Northwind_Diff_1.bak' WITH RECOVERY
GO

0
 
LVL 15

Assisted Solution

by:Anuj
Anuj earned 63 total points
ID: 36558569
-- Restore full backup
-- Assuming file is restored to a new database
RESTORE DATABASE <dbName>
FROM Disk = <your complete backup file path>
WITH NORECOVERY

-- Restoring your Diff backup
RESTORE DATABASE <dbName>
FROM Disk = <your differential backup file path>
WITH RECOVERY
0
 
LVL 10

Assisted Solution

by:Ramesh Babu Vavilla
Ramesh Babu Vavilla earned 62 total points
ID: 36559165
RESTORE DATABASE dbname FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\dbname.bak' WITH FILE = 1, NORECOVERY, REPLACE,
      move 'dbname_log' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\dbname_1.ldf',
      move 'dbname' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\dbname.mdf',
      move 'dbname' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData\dbname.client';
GO
RESTORE DATABASE dbname FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\BANCHDS.BAK' WITH FILE = 1, NORECOVERY ;
GO
RESTORE DATABASE dbname WITH RECOVERY
GO
0
 

Author Closing Comment

by:cq27
ID: 36559857
Thanks all. The TSQL worked well, especially by alexey. I managed to get the differential backup to work.

Appreciate the pointers everyone.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

732 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