Showing posts with label static. Show all posts
Showing posts with label static. Show all posts

Tuesday, March 20, 2012

RESTORE DATABASE ... WITH PARTIAL

I've been having some issues so forgive me if this double-posts.

Because I have some large but static Filegroups within a database I
prefer to backup my filegroups instead of everything at once. This is
SQL Server 2000.

The other day I backed up a file with this command:

BACKUP DATABASE Thomasville
FILEGROUP = 'PRIMARY'
TO DISK = 'D:\SQLBackups\2 - Monday\Full-Thomasville-
PRIMARY-070409-1528h.bak'
WITH FORMAT

The backup worked flawlessly. But when I try to restore it into
another database:

RESTORE DATABASE Thomas
FILEGROUP = 'PRIMARY'
FROM DISK = 'D:\SQLBackups\2 - Monday\Full-Thomasville-
PRIMARY-070409-1528h.bak'
WITH PARTIAL,
MOVE 'Thomasville_Data' TO 'd:\SQLServerData\MSSQL\data
\Thomasville_Data_Thomas.MDF',
MOVE 'Thomasville_Log' TO 'd:\SQLServerData\MSSQL\data
\Thomasville_Log_Thomas.LDF',
NORECOVERY

I get this:

Server: Msg 3135, Level 16, State 2, Line 1
The backup set in file 'D:\SQLBackups\2 - Monday\Full-Thomasville-
PRIMARY-070409-1528h.bak' was created by BACKUP DATABASE...FILE=<name>
and cannot be used for this restore operation.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

It works if I remove the PARTIAL clause but then I can't recover my
database afterwards. I need the PARTIAL because I'm only restoring
one filegroup and not the entire database.

Please help.

-UtahduckOn Apr 12, 3:21 am, "Utahduck" <Utahd...@.hotmail.comwrote:

Quote:

Originally Posted by

I've been having some issues so forgive me if this double-posts.
>
Because I have some large but static Filegroups within a database I
prefer to backup my filegroups instead of everything at once. This is
SQL Server 2000.
>
The other day I backed up a file with this command:
>
BACKUP DATABASE Thomasville
FILEGROUP = 'PRIMARY'
TO DISK = 'D:\SQLBackups\2 - Monday\Full-Thomasville-
PRIMARY-070409-1528h.bak'
WITH FORMAT
>
The backup worked flawlessly. But when I try to restore it into
another database:
>
RESTORE DATABASE Thomas
FILEGROUP = 'PRIMARY'
FROM DISK = 'D:\SQLBackups\2 - Monday\Full-Thomasville-
PRIMARY-070409-1528h.bak'
WITH PARTIAL,
MOVE 'Thomasville_Data' TO 'd:\SQLServerData\MSSQL\data
\Thomasville_Data_Thomas.MDF',
MOVE 'Thomasville_Log' TO 'd:\SQLServerData\MSSQL\data
\Thomasville_Log_Thomas.LDF',
NORECOVERY
>
I get this:
>
Server: Msg 3135, Level 16, State 2, Line 1
The backup set in file 'D:\SQLBackups\2 - Monday\Full-Thomasville-
PRIMARY-070409-1528h.bak' was created by BACKUP DATABASE...FILE=<name>
and cannot be used for this restore operation.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
>
It works if I remove the PARTIAL clause but then I can't recover my
database afterwards. I need the PARTIAL because I'm only restoring
one filegroup and not the entire database.
>
Please help.
>
-Utahduck


tnnx