Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to restore differential backup file on MS SQL 2000

Posted on 2011-09-18
8
Medium Priority
?
599 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 500 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 252 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 248 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

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 ?
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

715 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