Backup process does not end
Ulfius
Posts: 15
I've setup a job to backup a database and the job process is never ending. I've also tried the same command in QA and it also never completes. Even canceling the job results in a waiting 10 minutes at "Attempting to cancel query. Please wait...".
The command is:
master..sqlbackup '-SQL "BACKUP DATABASE [ISI] TO DISK = [d:\sql_data\MSSQL\BACKUP\<AUTO>]" WITH LOGTO = [d:\sql_data\MSSQL\BACKUP\Logs\] '
Running master..sqlbackup '-SQL'
gives:
SQL Backup 3.2.0, (c) Red Gate Software Ltd 2004 - 2005
Trial - 9 days remaining
login parameters:
[-U login id] [-P password] [-E] use trusted connection
[-I instance name]
common parameters:
[-SQL command]
[-USE setting description]
Warning 110: Failed to save primary log file: Cannot create file "C:\Program Files\Red Gate\SQL Backup\20050609 112747 01.log".
Would not having access to the log folder cause this?
The command is:
master..sqlbackup '-SQL "BACKUP DATABASE [ISI] TO DISK = [d:\sql_data\MSSQL\BACKUP\<AUTO>]" WITH LOGTO = [d:\sql_data\MSSQL\BACKUP\Logs\] '
Running master..sqlbackup '-SQL'
gives:
SQL Backup 3.2.0, (c) Red Gate Software Ltd 2004 - 2005
Trial - 9 days remaining
login parameters:
[-U login id] [-P password] [-E] use trusted connection
[-I instance name]
common parameters:
[-SQL command]
[-USE setting description]
Warning 110: Failed to save primary log file: Cannot create file "C:\Program Files\Red Gate\SQL Backup\20050609 112747 01.log".
Would not having access to the log folder cause this?
Comments
The command you have given is slightly incorrect. Here is an amended version.
master..sqlbackup '-SQL "BACKUP DATABASE [ISI] TO DISK = [d:\sql_data\MSSQL\BACKUP\<AUTO>] WITH LOGTO = [d:\sql_data\MSSQL\BACKUP\Logs\]" -E'
The with logto, and other options, must be within the quotes (")
You are also missing the credentials to login. Please use the -E option (as above) or -P and -U.
Regards
Dan
Red Gate Software Ltd
This directory should be accessible to all users, can you check the permissions as it sounds like there is an access issue.
Regards
Dan
Red Gate Software Ltd
The log file is empty, no matter if I run from GUI or command line.
6/13/2005 7:48:20 AM: SQL Backup 3.2.0, (c) Red Gate Software Ltd 2004 - 2005
6/13/2005 7:48:20 AM:
If you run the same command from the cmd line but without the LOGTO option, do you encounter the same error?
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
6/13/2005 7:48:20 AM: SQL Backup 3.2.0, (c) Red Gate Software Ltd 2004 - 2005
6/13/2005 7:48:20 AM:
I don't receive an error any longer, just the process never ends when ran command line, but finishes in two seconds using the GUI.
sqlbackupc -sql "RESTORE SQBHEADERONLY FROM DISK = '<your backup file>'"
Do the LSN numbers have any values? Thanks.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
master..sqlbackup '-SQL "RESTORE SQBHEADERONLY FROM DISK = [d:\sql_data\MSSQL\BACKUP\FULL_(local)_ISI_20050613 093646.sqb]" '
==============
SQL Backup 3.2.0, (c) Red Gate Software Ltd 2004 - 2005
Trial - 2 days remaining
Reading SQB file header of "d:\sql_data\MSSQL\BACKUP\FULL_(local)_ISI_20050613 093646.sqb"
Backup group ID : 149794717
File number : 1 of 1
Backup type : 1 (Database)
Backup size : 1.875 MB
Backup start : Monday, June 13, 2005 9:36:52 AM
Backup end : Monday, June 13, 2005 9:36:53 AM
Server name : MARLIN
Instance : (local)
Database name : ISI
First LSN : 18000000077600001
Last LSN : 18000000077800001
Checkpoint LSN : 18000000077600002
Differential base LSN : 18000000077100003
================
Then I ran this from QA and it would never finish.
master..sqlbackup '-SQL "BACKUP DATABASE [ISI] TO DISK = [d:\sql_data\MSSQL\BACKUP\<AUTO>]" -E'
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
C:\Program Files\Red Gate\SQL Backup>sqlbackupc -SQL "BACKUP DATABASE [ISI] TO D
ISK = 'D:\SQL_DATA\MSSQL\BACKUP\<AUTO>'" -E
SQL Backup 3.2.0, (c) Red Gate Software Ltd 2004 - 2005
Serial number: <removed>
Backing up ISI (full database) to \SQL_DATA\MSSQL\BACKUP\FULL_(local)_ISI_2005
0628 105414.sqb ...
Backup data size : 1.875 MB
Compressed data size: 198.500 KB
Compression rate : 89.66%
Process completed successfully.
Processed 152 pages for database 'ISI', file 'ISI_dat' on file 1.
Processed 1 pages for database 'ISI', file 'ISI_log' on file 1.
BACKUP DATABASE successfully processed 153 pages in 0.129 seconds (9.660 MB/sec)
.
(1 row affected)
When using the command line and the process completes, are you returned to the prompt immediately, or does it pause, waiting for you to hit a key before it returns to the prompt?
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
Can you try running a simple backup process from Query Analyzer using the NOWRITE option e.g.
sqlbackup '-sql "BACKUP DATABASE pubs TO DISK = [c:\pubs.sqb] WITH INIT, NOWRITE"'
This will cause SQL Backup to skip updating the local activity history table, assuming that is the problem.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
This hung:
master..sqlbackup '-sql "BACKUP DATABASE isi TO DISK = [D:\SQL_DATA\MSSQL\BACKUP\isi.sqb] WITH INIT"'
This did not:
master..sqlbackup '-sql "BACKUP DATABASE isi TO DISK = [D:\SQL_DATA\MSSQL\BACKUP\isi.sqb] WITH INIT, NOWRITE"'
=======
SQL Backup 3.2.0, (c) Red Gate Software Ltd 2004 - 2005
Serial number: <removed>
Backing up isi (full database) to \SQL_DATA\MSSQL\BACKUP\isi.sqb ...
Processed 152 pages for database 'isi', file 'ISI_dat' on file 1.
Processed 1 pages for database 'isi', file 'ISI_log' on file 1.
BACKUP DATABASE successfully processed 153 pages in 0.144 seconds (8.654 MB/sec).
=========
Is there a solution?
A possibility is that the SQL Server service startup account does not have 'write' rights to this folder.
Try this in Query Analyzer:
master..xp_cmdshell 'dir c: > "C:\Documents and Settings\All Users\Application Data\Red Gate\SQL Backup\Data\dir.txt"'
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8