cancel
Showing results for 
Search instead for 
Did you mean: 

How do I diagnose dbbackup -x "unable to delete transaction log"?

Breck_Carter
Participant
4,207

How do I find out why the following following 16.0.0.1512 dbbackup command is producing the undocumented error message "unable to delete transaction log"?

... without waving many dead chickens over the keyboard in an ... endless ... search ... for a solution?

It is run from a Windows command file in the C:\\ProgramData\\RisingRoad\\Foxhound3 folder. The BIN environment variable is set to Bin32.

The (almost exact) same dbbackup command runs OK using SQL Anywhere version 12.

"%SQLANY16%\\%BIN%\\dbbackup.exe"^
  -c "ENG=foxhound3;DBN=f;UID=BACKER;PWD=SQL"^
  -o backup\\generation_temp\\backup_log.txt^
  -x^
  backup\\generation_temp

SQL Anywhere Backup Utility Version 16.0.0.1512
 (5859 of estimated 5859 pages, 100% complete)
Unable to delete transaction log
Database backup failed

It ran as far as creating the backup files themselves:

 Volume in drive C is OS
 Volume Serial Number is 5CD7-70E9

Directory of C:\\ProgramData\\RisingRoad\\Foxhound3\\backup\\generation_temp

07/12/2013  01:13 AM    <DIR>          .
07/12/2013  01:13 AM    <DIR>          ..
07/12/2013  01:00 AM               536 backup_log.txt
07/12/2013  01:00 AM        19,890,176 foxhound3.db
07/12/2013  01:00 AM        28,090,368 foxhound3.log
               5 File(s)     47,981,118 bytes


Here goes with the dead chickens...

It fails when launched manually, manually with "Run as administrator", and via the Windows 7 Task Scheduler with or without "Run with highest privileges" set.

It fails whether the database was already running, or was launched by dbsrv16 earlier in the command file.

It fails when (grasping at straws here) the BIN environment variable is set to Bin64.

The user id has GRANT BACKUP TO BACKER;

However, this isn't Kansas any more, this is SQL Anywhere 16.

Let's work our way through the brand-new list of

http://dcx.sybase.com/index.html#sa160/en/dbadmin/sys-privs-function.html System Privileges

...

This did not help: GRANT BACKUP DATABASE TO BACKER;

This did not help: GRANT WRITE FILE TO BACKER;

This did not help: GRANT SERVER OPERATOR TO BACKER;


Aha! This Old School grant works: GRANT DBA TO BACKER;

So let's try again, with the System Privileges list...

REVOKE CONNECT FROM BACKER;
GRANT CONNECT TO BACKER IDENTIFIED BY "SQL";
GRANT BACKUP DATABASE TO BACKER;
GRANT MANAGE ANY DBSPACE TO BACKER;

That works! dbbackup -x runs!

MANAGE ANY DBSPACE does seem excessive, perhaps worth another "Question" on this forum, but it is not the point of this question.

This question is, how do I diagnose the problem "unable to delete transaction log"?

VolkerBarth
Contributor
0 Kudos

Looks like a duplicate...

Breck_Carter
Participant
0 Kudos

This one is the real one, the OTHER one was the duplicate!

Seriously, the forum interface was having sport with me. When I posted a question, then posted a second question, the second question vanished and the first one was duplicated... so I deleted both, and re-posted the two questions... and got THREE postings, two of them duplicates.

Moral of the story: Always create your posts offline, which is what I do with all websites including this one.

johnsmirnios
Participant
0 Kudos

Do you have anti-virus software running? Try disabling it.

VolkerBarth
Contributor
0 Kudos

...the second question vanished...

...or was awaiting active moderation? (Brrr, no, I don't want to think of that posSAPility...)

FWIW, I try to use that "offline editing" method on web sites, too, but tend to forget about that until the next send request gets cancelled, and my contents is lost...

And now we're about to create such valuable comments here that the admired forum administrators won't dare to delete the duplicate, right. I mean, they are not the guys from the typical IT department:)

Accepted Solutions (0)

Answers (1)

Answers (1)

graeme_perrow
Advisor
Advisor

Here are the possible errors raised during the file deletion process:

  • the delete_file secure feature is disabled
  • mirroring is enabled on the database
  • the caller does not have the MANAGE ANY DBSPACE system privilege
  • The sandboxing feature is enabled and this file is not located within the sandbox
  • The specified file does not exist
  • The specified file is in use by the server (shouldn't apply to dbbackup -x or -xo)
  • Deleting the specified file results in an OS error
Breck_Carter
Participant
0 Kudos

Excellent!

Now all you have to do is link the "Unable to delete transaction log" Help topic to this answer.

No, wait, there is no such Help topic 🙂