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
Solved

How to restore differential backup file on MS SQL 2000

Posted on 2011-09-18
8
553 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 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
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…

840 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