Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

Filegroups - are different backup/restore strategies possible?

$
0
0

Dear All,

We have:

Database: X
FILEGROUP: PRIMARY
    File - Logical Name:X, File Name:x.mdf
    Tables: ...
FILEGROUP: BIG
    File - Logical Name:X_big, File Name:X_big.mdf
    Table: LargeTable

A backup of PRIMARY is ~200mB
LargeTable is ~60gB

Database X has a full backup at 21:00, then hourly (on the half hour) log backups (at 21:30 the first log backup is ~2gB)
The 21:00 full backup is off-site by supplier so we don't have access to it.

We want to have a copy of X (we'll call that Y for the moment) so we can run reports against it.
It doesn't matter if Y is a day behind X.
We can only pull from X's server using FTP onto Y's server.

It will not be possible to do a full backup to disk (space-wise) and FTP it (time-wise).

The thought was to:
Initially do a full backup of X using a temporarily assigned drive.
Transfer
Restore to Y (though will actually have same db name).

Then subsequently (at e.g. 03:00) do a copy backup (so as not to disturb log chain etc.) of PRIMARY filegroup
    plus an export of any records in LargeTable changed in last day.
    Restore PRIMARY filegroup to Y
    Update LargeTable changes on Y

..in essence full backup/restore of PRIMARY and (after one-time only backup/restore) only ever difference backup/restore of BIG.

Am trying :

Initial restore (OK)
RESTORE DATABASE [X] FROM DISK = N'X_ALL.bak'
WITH FILE = 1,
MOVE N'X' TO N'X.mdf',
MOVE N'X_big' TO N'X_big.mdf',
MOVE N'X_log' TO N'X_1.ldf',
REPLACE, NOUNLOAD,  STATS = 10

Then.. do some stuff on X

Then (OK)
BACKUP DATABASE X FILEGROUP = 'PRIMARY'
TO DISK = 'X_primary.bak'
WITH COPY_ONLY, NOFORMAT, INIT

Then transfer and (ok)
RESTORE DATABASE X FILEGROUP = 'PRIMARY'
FROM DISK = 'X_primary.bak'
WITH
PARTIAL, RECOVERY, REPLACE

Messages:
Processed pages for database 'X', file 'X' on file 1.
Processed pages for database 'X', file 'X_log' on file 1.
RESTORE DATABASE ... FILE=<name> successfully processed

When try to access tables in PRIMARY.. ok
in BIG, get "The query processor is unable to produce a plan for the table or view 'LargeTable' because the table resides in a filegroup which is not online."

Can anyone suggest anything to help?


Viewing all articles
Browse latest Browse all 15889

Trending Articles