Solved

How to restore differential backup file on MS SQL 2000

Posted on 2011-09-18
8
559 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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: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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

756 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