SqlBackupC never finishes
rick.sheeley
Posts: 32
Hey guys,
So I'm using the SqlBackupC cmd line tool for the first time to create a backup/restore file for our test server.
I'll be trying again this weekend, but the first two tests have failed miserably.The first restore never finishes and I ended re-booting the test server and using the GUI to do the restores. Any ideas?
Here's the contents of the batch file:
@echo on
del B:\Restore\*.* /s /q
c:\Robocopy\ROBOCOPY.EXE /JOB:c:\Robocopy\CPOPM2_RESTORE1.RCJ
c:\Robocopy\ROBOCOPY.EXE /JOB:c:\Robocopy\CPOPM2_RESTORE2.RCJ
c:\Robocopy\ROBOCOPY.EXE /JOB:c:\Robocopy\CPOPM2_RESTORE3.RCJ
ren B:\Restore\CentricityPM\*.sqb FULL_CentricityPM.sqb
ren B:\Restore\CPM_Production\*.sqb FULL_CPM_Production.sqb
ren B:\Restore\CPM_Reports\*.sqb FULL_CPM_Reports.sqb
SQL Backup command line interface can only work on local servers.
CD "C:\Program Files\Red Gate\SQL Backup\(LOCAL)"
SqlBackupC -SQL "RESTORE DATABASE [CentricityPM] FROM DISK = 'B:\Restore\CentricityPM\FULL_CentricityPM.sqb' WITH RECOVERY, MOVE 'CentricityPM_DB' TO 'D:\MSSQL\Data\CentricityPM.mdf', MOVE 'PatientVisit_Table' TO 'D:\MSSQL\Data\CentricityPM_1.NDF', MOVE 'PatientVisit_Text' TO 'D:\MSSQL\Data\CentricityPM_2.NDF', MOVE 'PatientVisit_Indexes' TO 'D:\MSSQL\Data\CentricityPM_3.NDF', MOVE 'CentricityPM_Log' TO 'E:\MSSQL\Data\CentricityPM.ldf', REPLACE" -E
SqlBackupC -SQL "RESTORE DATABASE [CPM_Production] FROM DISK = 'B:\Restore\CPM_Production\FULL_CPM_Production.sqb' WITH RECOVERY, MOVE 'CPM_Production_Data' TO 'D:\MSSQL\Data\CPM_Production.MDF', REPLACE" -E
SqlBackupC -SQL "RESTORE DATABASE [CPM_Reports] FROM DISK = 'B:\Restore\CPM_Reports\FULL_CPM_Reports.sqb' WITH RECOVERY, MOVE 'CPM_Reports_Data' TO 'D:\MSSQL\Data\CPM_Reports.MDF', REPLACE" -E
exit
Rick in Phoenix
So I'm using the SqlBackupC cmd line tool for the first time to create a backup/restore file for our test server.
I'll be trying again this weekend, but the first two tests have failed miserably.The first restore never finishes and I ended re-booting the test server and using the GUI to do the restores. Any ideas?
Here's the contents of the batch file:
@echo on
del B:\Restore\*.* /s /q
c:\Robocopy\ROBOCOPY.EXE /JOB:c:\Robocopy\CPOPM2_RESTORE1.RCJ
c:\Robocopy\ROBOCOPY.EXE /JOB:c:\Robocopy\CPOPM2_RESTORE2.RCJ
c:\Robocopy\ROBOCOPY.EXE /JOB:c:\Robocopy\CPOPM2_RESTORE3.RCJ
ren B:\Restore\CentricityPM\*.sqb FULL_CentricityPM.sqb
ren B:\Restore\CPM_Production\*.sqb FULL_CPM_Production.sqb
ren B:\Restore\CPM_Reports\*.sqb FULL_CPM_Reports.sqb
SQL Backup command line interface can only work on local servers.
CD "C:\Program Files\Red Gate\SQL Backup\(LOCAL)"
SqlBackupC -SQL "RESTORE DATABASE [CentricityPM] FROM DISK = 'B:\Restore\CentricityPM\FULL_CentricityPM.sqb' WITH RECOVERY, MOVE 'CentricityPM_DB' TO 'D:\MSSQL\Data\CentricityPM.mdf', MOVE 'PatientVisit_Table' TO 'D:\MSSQL\Data\CentricityPM_1.NDF', MOVE 'PatientVisit_Text' TO 'D:\MSSQL\Data\CentricityPM_2.NDF', MOVE 'PatientVisit_Indexes' TO 'D:\MSSQL\Data\CentricityPM_3.NDF', MOVE 'CentricityPM_Log' TO 'E:\MSSQL\Data\CentricityPM.ldf', REPLACE" -E
SqlBackupC -SQL "RESTORE DATABASE [CPM_Production] FROM DISK = 'B:\Restore\CPM_Production\FULL_CPM_Production.sqb' WITH RECOVERY, MOVE 'CPM_Production_Data' TO 'D:\MSSQL\Data\CPM_Production.MDF', REPLACE" -E
SqlBackupC -SQL "RESTORE DATABASE [CPM_Reports] FROM DISK = 'B:\Restore\CPM_Reports\FULL_CPM_Reports.sqb' WITH RECOVERY, MOVE 'CPM_Reports_Data' TO 'D:\MSSQL\Data\CPM_Reports.MDF', REPLACE" -E
exit
Rick in Phoenix
Eric (Rick) Sheeley, Sr. SQL/Oracle DBA
Sacramento, CA Cell: 602.540.6750
"Those are my principles, and if you don't like them... well, I have others." - Groucho Marx
Sacramento, CA Cell: 602.540.6750
"Those are my principles, and if you don't like them... well, I have others." - Groucho Marx
Comments
I apologise you are encountering issues with the SQL Backup command line.
What version of SQL Backup are you currently running?
Do you have the output of the batch file logged anywhere?
If you could check for SQL Backup log files around the time that this batch file ran that would be great, they can be found here by default :
%allusersprofile%\Application Data\Red Gate\SQL Backup\Log\<instance name>
Thanks,
Redgate Foundry