Restore log error
Thrall
Posts: 6
Here is my code:
DECLARE @RestoreCommand VARCHAR(1000)
SET @RestoreCommand = N'-SQL "RESTORE LOG [MSN_Doc]
FROM DISK = ''c:\filename.sqb''
WITH MOVETO = ''D:\SQL_Data\''"'
PRINT @RestoreCommand
EXECUTE master..sqlbackup @RestoreCommand
SET @RestoreCommand = NULL
I get this error:
Warning 220: No log files found to be restored.
SQL Backup exit code: 220
I know that the file is there I checked th directory name and filename multiple times and had a co-worker to check it too so I am unsure of what the problem is?
DECLARE @RestoreCommand VARCHAR(1000)
SET @RestoreCommand = N'-SQL "RESTORE LOG [MSN_Doc]
FROM DISK = ''c:\filename.sqb''
WITH MOVETO = ''D:\SQL_Data\''"'
PRINT @RestoreCommand
EXECUTE master..sqlbackup @RestoreCommand
SET @RestoreCommand = NULL
I get this error:
Warning 220: No log files found to be restored.
SQL Backup exit code: 220
I know that the file is there I checked th directory name and filename multiple times and had a co-worker to check it too so I am unsure of what the problem is?
Comments
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
Is this true? If so how do you provide the same funtionality without the move command? MOVETO seems to have issues if there are other ldfs in the folder.
EXEC master..sqlbackup '-sql "RESTORE SQBHEADERONLY FROM DISK = [<file name>]"'
SQL Backup does not support the MOVE command with log restores, but does with full database restores. It was common for MOVE to be used with full database restores.
If you really need to use MOVE with a log restore, I would suggest converting the log backup to the native format, then performing the log restore using SQL Server commands.
MOVETO does not provide the same functionality as the native MOVE command. MOVETO moves a backup file from the original location specified in the DISK parameters, to the MOVETO folder.
E.g. SQL Backup will perform the trx log restore using the log.sqb file in e:\backups\pubs\. Once the restore has completed, log.sqb is moved to the e:\backups\pubs\processed folder.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8