I have a database with with two filegroups - the primary and one other.
Each filegroup has its own data file. I want to restore the database to a
different database server but restore only the primary filegroup.
When I try to do this, I get the following error for each of the data files
associated with the filegroups that I did not restore - File 'data file name
'
was only partially restored by a database or file restore. The entire file
must be successfully restored before applying the log.
Any ideas?
BACKUP DATABASE test1
FILEGROUP = 'Primary'
TO primfilegroup WITH INIT
BACKUP DATABASE test1
FILEGROUP = 'FG_RW'
TO rwfilegroup WITH INIT
BACKUP LOG test1
TO test1log WITH INIT
--BACKUP LOG test1
-- TO test1log WITH NOINIT
RESTORE DATABASE test2
FILEGROUP = 'Primary'
from primfilegroup WITH NORECOVERY,
MOVE 'test1_Data' TO 'i:\test2_Data.mdf',
MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
GO
--RESTORE DATABASE test2
--FILEGROUP = 'FG_RW'
--from rwfilegroup WITH NORECOVERY,
-- MOVE 'test_RW' TO 'i:\test2_RW_Data.mdf',
-- MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
--GO
--RESTORE LOG test2
-- FROM test1log
-- WITH FILE = 1, NORECOVERY
--go
RESTORE LOG test2
FROM test1log WITH RECOVERY,
MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
GO
ERROR MESSAGE:
Msg 4320, Level 1, State 4320
File 'test_RW' was only partially restored by a database or file restore.
The entire file must be successfully restored before applying the log.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.Hello, spoons
You also need to use the PARTIAL clause in the RESTORE statement. See
"partial restore operation" in Books Online.
Razvan
Showing posts with label filesgroups. Show all posts
Showing posts with label filesgroups. Show all posts
Wednesday, March 7, 2012
Restoring Files and Filesgroups
I have a database with with two filegroups - the primary and one other.
Each filegroup has its own data file. I want to restore the database to a
different database server but restore only the primary filegroup.
When I try to do this, I get the following error for each of the data files
associated with the filegroups that I did not restore - File 'data file name'
was only partially restored by a database or file restore. The entire file
must be successfully restored before applying the log.
Any ideas?
BACKUP DATABASE test1
FILEGROUP = 'Primary'
TO primfilegroup WITH INIT
BACKUP DATABASE test1
FILEGROUP = 'FG_RW'
TO rwfilegroup WITH INIT
BACKUP LOG test1
TO test1log WITH INIT
--BACKUP LOG test1
-- TO test1log WITH NOINIT
RESTORE DATABASE test2
FILEGROUP = 'Primary'
from primfilegroup WITH NORECOVERY,
MOVE 'test1_Data' TO 'i:\test2_Data.mdf',
MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
GO
--RESTORE DATABASE test2
--FILEGROUP = 'FG_RW'
--from rwfilegroup WITH NORECOVERY,
-- MOVE 'test_RW' TO 'i:\test2_RW_Data.mdf',
-- MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
--GO
--RESTORE LOG test2
-- FROM test1log
-- WITH FILE = 1, NORECOVERY
--go
RESTORE LOG test2
FROM test1log WITH RECOVERY,
MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
GO
ERROR MESSAGE:
Msg 4320, Level 1, State 4320
File 'test_RW' was only partially restored by a database or file restore.
The entire file must be successfully restored before applying the log.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.
Hello, spoons
You also need to use the PARTIAL clause in the RESTORE statement. See
"partial restore operation" in Books Online.
Razvan
Each filegroup has its own data file. I want to restore the database to a
different database server but restore only the primary filegroup.
When I try to do this, I get the following error for each of the data files
associated with the filegroups that I did not restore - File 'data file name'
was only partially restored by a database or file restore. The entire file
must be successfully restored before applying the log.
Any ideas?
BACKUP DATABASE test1
FILEGROUP = 'Primary'
TO primfilegroup WITH INIT
BACKUP DATABASE test1
FILEGROUP = 'FG_RW'
TO rwfilegroup WITH INIT
BACKUP LOG test1
TO test1log WITH INIT
--BACKUP LOG test1
-- TO test1log WITH NOINIT
RESTORE DATABASE test2
FILEGROUP = 'Primary'
from primfilegroup WITH NORECOVERY,
MOVE 'test1_Data' TO 'i:\test2_Data.mdf',
MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
GO
--RESTORE DATABASE test2
--FILEGROUP = 'FG_RW'
--from rwfilegroup WITH NORECOVERY,
-- MOVE 'test_RW' TO 'i:\test2_RW_Data.mdf',
-- MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
--GO
--RESTORE LOG test2
-- FROM test1log
-- WITH FILE = 1, NORECOVERY
--go
RESTORE LOG test2
FROM test1log WITH RECOVERY,
MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
GO
ERROR MESSAGE:
Msg 4320, Level 1, State 4320
File 'test_RW' was only partially restored by a database or file restore.
The entire file must be successfully restored before applying the log.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.
Hello, spoons
You also need to use the PARTIAL clause in the RESTORE statement. See
"partial restore operation" in Books Online.
Razvan
Restoring Files and Filesgroups
I have a database with with two filegroups - the primary and one other.
Each filegroup has its own data file. I want to restore the database to a
different database server but restore only the primary filegroup.
When I try to do this, I get the following error for each of the data files
associated with the filegroups that I did not restore - File 'data file name'
was only partially restored by a database or file restore. The entire file
must be successfully restored before applying the log.
Any ideas?
BACKUP DATABASE test1
FILEGROUP = 'Primary'
TO primfilegroup WITH INIT
BACKUP DATABASE test1
FILEGROUP = 'FG_RW'
TO rwfilegroup WITH INIT
BACKUP LOG test1
TO test1log WITH INIT
--BACKUP LOG test1
-- TO test1log WITH NOINIT
RESTORE DATABASE test2
FILEGROUP = 'Primary'
from primfilegroup WITH NORECOVERY,
MOVE 'test1_Data' TO 'i:\test2_Data.mdf',
MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
GO
--RESTORE DATABASE test2
--FILEGROUP = 'FG_RW'
--from rwfilegroup WITH NORECOVERY,
-- MOVE 'test_RW' TO 'i:\test2_RW_Data.mdf',
-- MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
--GO
--RESTORE LOG test2
-- FROM test1log
-- WITH FILE = 1, NORECOVERY
--go
RESTORE LOG test2
FROM test1log WITH RECOVERY,
MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
GO
ERROR MESSAGE:
Msg 4320, Level 1, State 4320
File 'test_RW' was only partially restored by a database or file restore.
The entire file must be successfully restored before applying the log.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.Hello, spoons
You also need to use the PARTIAL clause in the RESTORE statement. See
"partial restore operation" in Books Online.
Razvan
Each filegroup has its own data file. I want to restore the database to a
different database server but restore only the primary filegroup.
When I try to do this, I get the following error for each of the data files
associated with the filegroups that I did not restore - File 'data file name'
was only partially restored by a database or file restore. The entire file
must be successfully restored before applying the log.
Any ideas?
BACKUP DATABASE test1
FILEGROUP = 'Primary'
TO primfilegroup WITH INIT
BACKUP DATABASE test1
FILEGROUP = 'FG_RW'
TO rwfilegroup WITH INIT
BACKUP LOG test1
TO test1log WITH INIT
--BACKUP LOG test1
-- TO test1log WITH NOINIT
RESTORE DATABASE test2
FILEGROUP = 'Primary'
from primfilegroup WITH NORECOVERY,
MOVE 'test1_Data' TO 'i:\test2_Data.mdf',
MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
GO
--RESTORE DATABASE test2
--FILEGROUP = 'FG_RW'
--from rwfilegroup WITH NORECOVERY,
-- MOVE 'test_RW' TO 'i:\test2_RW_Data.mdf',
-- MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
--GO
--RESTORE LOG test2
-- FROM test1log
-- WITH FILE = 1, NORECOVERY
--go
RESTORE LOG test2
FROM test1log WITH RECOVERY,
MOVE 'test1_Log' TO 'i:\test2_Log.ldf'
GO
ERROR MESSAGE:
Msg 4320, Level 1, State 4320
File 'test_RW' was only partially restored by a database or file restore.
The entire file must be successfully restored before applying the log.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.Hello, spoons
You also need to use the PARTIAL clause in the RESTORE statement. See
"partial restore operation" in Books Online.
Razvan
Subscribe to:
Posts (Atom)