Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 File group backup and restore

Author  Topic 

winman
Starting Member

26 Posts

Posted - 2013-01-19 : 06:04:38

I am new to file group backup and restore .So i am trying something to do with file groups.
Below i have shown some steps which i did one by one. Please ask me if anyone don't understand the steps what i did!!

I have taken following backup

Primary fg backup--pri1.bak

secondary fg backup--sec1.bak

log backup--log1.bak

Inserted some rows to table of primary file group.

Inserted some rows to table of secondary file group.

primary fg backup--pri2.bak

secondary fg backup-- sec2.bak

log backup--log2.bak

What i wanted to acheive is that after all restoration i want all table of primary file group with all data(data which is present in both pri2.bak) and secondary file group tables with the data containing only in sec1.bak i don't want the data which i have inserted to secondary file group tables after taking sec.bak1.So i did following steps.

RESTORE DATABASE [test23] FILE = N'nvt' FROM DISK = N'D:\pri2.bak' WITH NORECOVERY

GO

RESTORE DATABASE [test23] FILE = N'nvt_fg' FROM DISK = N'D:\sec1.bak' WITH NORECOVERY GO

RESTORE LOG [test23] FROM DISK = N'D:\log1.bak' WITH NORECOVERY

GO

RESTORE LOG [test23] FROM DISK = N'D:\log2.bak' WITH RECOVERY

GO

But when log2.bak restored it recovers all data of secondary file group.If i don't restore log2.bak then database will not be recovered. So how can achieve what i have mentioned above ?

Thank you
   

- Advertisement -