Groups | Blog | Home
all groups > sql server replication > january 2004 >

sql server replication : Differential File/FileGroup Backup


Amin Sobati
1/13/2004 11:22:53 PM
Hi,
I have a problem with creating Differential File/FileGroup Backup.
I use this T-SQL statement:

BACKUP DATABASE MyDB FILEGROUP=3D'MyFG' to MyDevice
WITH DIFFERENTIAL

It creates the backup but when I look MyDevice's properties in =
Enterprise Manager, my backup's type
is Complete Database. But when I use this statement without WITH =
DIFFERENTIAL, it is correct in
properties screen(type is File).

Any help would be greatly appreciated,
Thanks a lot!
Allan Mitchell
1/14/2004 7:56:58 AM
OK so let's create a backup device
Backup a database (FULL)
Backup a database (Differential)

Exec sp_addumpdevice 'disk','MyDevice','d:\Mydevice.bak'
go
BACKUP DATABASE Pubs to MyDevice
GO
BACKUP DATABASE Pubs to MyDevice WITH DIFFERENTIAL
GO
RESTORE HEADERONLY FROM [MyDevice] WITH NOUNLOAD

You will see from the results that BackupType has values of


1. Database.
5. Differential.=20


--=20

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]
Hi,
I have a problem with creating Differential File/FileGroup Backup.
I use this T-SQL statement:

BACKUP DATABASE MyDB FILEGROUP=3D'MyFG' to MyDevice
WITH DIFFERENTIAL

It creates the backup but when I look MyDevice's properties in =
Enterprise Manager, my backup's type
is Complete Database. But when I use this statement without WITH =
DIFFERENTIAL, it is correct in
properties screen(type is File).

Any help would be greatly appreciated,
Thanks a lot!
Amin Sobati
1/14/2004 10:36:41 PM
Allan,
Thank you for your reply.
Please note that I create differential backup from a "filegroup", not =
from all of database.
The beauty is that when I check the backup set with:
RESTORE HEADERONLY FROM [MyDevice]
In the result the backup type is 6 (differential), but in enterprise =
manager when I check MyDevice's properties screen, the type is Complete =
Database!

Amin
[quoted text, click to view]
OK so let's create a backup device
Backup a database (FULL)
Backup a database (Differential)

Exec sp_addumpdevice 'disk','MyDevice','d:\Mydevice.bak'=20
go
BACKUP DATABASE Pubs to MyDevice
GO
BACKUP DATABASE Pubs to MyDevice WITH DIFFERENTIAL
GO
RESTORE HEADERONLY FROM [MyDevice] WITH NOUNLOAD

You will see from the results that BackupType has values of


1. Database.
5. Differential.=20


--=20

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]
Hi,
I have a problem with creating Differential File/FileGroup Backup.
I use this T-SQL statement:

BACKUP DATABASE MyDB FILEGROUP=3D'MyFG' to MyDevice
WITH DIFFERENTIAL

It creates the backup but when I look MyDevice's properties in =
Enterprise Manager, my backup's type
is Complete Database. But when I use this statement without WITH =
DIFFERENTIAL, it is correct in
properties screen(type is File).

Any help would be greatly appreciated,
Thanks a lot!
Allan Mitchell
1/15/2004 11:57:41 AM
Correct here is a better repro

Exec sp_addumpdevice 'disk','Backups','c:\BackupsDevice.bak'
GO
CREATE DATABASE BackupTest
GO
Use BackupTest
Go
ALTER DATABASE BackupTest ADD FILEGROUP BackupFG
GO

ALTER DATABASE backupTest ADD FILE
(NAME='BackupTest_data',
FILENAME='c:\BackupTest.ndf')
TO FILEGROUP BackupFG

CREATE TABLE FirstTable(col1 int) ON BackupFG

BACKUP DATABASE BackupTest
TO Backups
GO
BACKUP DATABASE backuptest
FILE = 'BackupTest_data',
FILEGROUP = 'BackupFG'
TO Backups
WITH DIFFERENTIAL --BackupType = 6 = Differential file

--Now check the Device in EM and view contents

--Statements issued
--Me
RESTORE HEADERONLY FROM Backups
--EM
RESTORE HEADERONLY FROM [Backups] WITH NOUNLOAD

--BackupType in EM is broken out to Complete database


It is an EM thing that is coded behind the scenes (I think). I'll ask for a
definitive answer.

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]
Allan,
Thank you for your reply.
Please note that I create differential backup from a "filegroup", not from
all of database.
The beauty is that when I check the backup set with:
RESTORE HEADERONLY FROM [MyDevice]
In the result the backup type is 6 (differential), but in enterprise manager
when I check MyDevice's properties screen, the type is Complete Database!

Amin
[quoted text, click to view]
OK so let's create a backup device
Backup a database (FULL)
Backup a database (Differential)

Exec sp_addumpdevice 'disk','MyDevice','d:\Mydevice.bak'
go
BACKUP DATABASE Pubs to MyDevice
GO
BACKUP DATABASE Pubs to MyDevice WITH DIFFERENTIAL
GO
RESTORE HEADERONLY FROM [MyDevice] WITH NOUNLOAD

You will see from the results that BackupType has values of


1. Database.
5. Differential.


--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]
Hi,
I have a problem with creating Differential File/FileGroup Backup.
I use this T-SQL statement:

BACKUP DATABASE MyDB FILEGROUP='MyFG' to MyDevice
WITH DIFFERENTIAL

It creates the backup but when I look MyDevice's properties in
Enterprise Manager, my backup's type
is Complete Database. But when I use this statement without WITH
DIFFERENTIAL, it is correct in
properties screen(type is File).

Any help would be greatly appreciated,
Thanks a lot!
Amin

Amin Sobati
1/15/2004 9:16:01 PM
Thank you very much!

[quoted text, click to view]

Allan Mitchell
1/19/2004 7:52:58 AM
It is a "Feature" of EM. If you want the correct results then use Query
Analyser.


--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]

AddThis Social Bookmark Button