Solved

How to restore differential backup file on MS SQL 2000

Posted on 2011-09-18
8
543 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
  • 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 4

Expert Comment

by:alexeykomarov
ID: 36558499
Hi
You must restore full backup with NORECOVERY option.
0
 

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 4

Accepted Solution

by:
alexeykomarov 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:sqlservr
sqlservr 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
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.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now