Skip to Content
0

Database Backup error

Nov 03, 2016 at 03:02 PM

93

avatar image

We are getting the following error message when running a backup: SQL Anywhere Backup Utility Version 12.0.1.3726 Error writing backup file "Invalid argument"

Database backup failedAny assistance would be appreciated.
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Reimer Pods Nov 08, 2016 at 04:06 PM
1

Hi Jonathan,

It could be helpfull to extend the batch script to echo the issued commands and parameters to the log file.

Example:

ECHO dbbackup -r -y -c "dsn=%CONNECTIONIFO%" -o %ERRORLOGDIR%\%ERRORFILE% %BACKUPDIR% >>%ERRORLOGDIR%\%ERRORFILE%

dbbackup -r -y -c "dsn=%CONNECTIONIFO%" -o %ERRORLOGDIR%\%ERRORFILE% %BACKUPDIR%

While testing the example I noticed one missing argument for DBBACKUP: the target directory is not specified. Without that it won't backup anything.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
the target directory is not specified.

Hm, in my understanding, the last parameter of the command

dbbackup -r -y -c "dsn=%CONNECTIONIFO%" -o %ERRORLOGDIR%\%ERRORFILE% %BACKUPDIR%

namely %BACKUPDIR% should specify the target directory, so it should work unless that parameter is not filled as expected.

However, I would

  1. agree that it would be helpful to ECHO the command and
  2. make sure that the absolute PATH to DBBACKUP is used, i.e. to make sure it is the desired product version (although in this case it is, according to the ERRORLOG.TXT shown above listing version 12.0.1.3726), i.e. I would recommend to use "%SQLANY12%\bin64\DBBACKUP" - r - y... (or \bin32, whatever fits better).

Note the double quotes around the command name because of possibly spaces in the SQL Anywhere 12 install dir.

0
Atsushi Asano
Nov 04, 2016 at 12:25 AM
0

Hi Jonathan,

Can you explain the reproduction procedure of this phenomenon?

Thanks,
Atsushi

Share
10 |10000 characters needed characters left characters exceeded
Jonathan Owens Nov 04, 2016 at 01:18 PM
0

Hi Atsushi. They run the batch file below to run a nightly backup of the .db and .log file. They upgraded their server a month ago and since then, the backup has been failing occasionally with the message previously provided (Error writing backup file "Invalid argument". Database backup failed). Thanks for your help!

REM OBDC Connection Name
SET DSN=RPS

SET BACKUPDIRROOT=D:\DBBACKUP

REM Create backup directory if it does not exist.
IF NOT EXIST %BACKUPDIRROOT% mkdir %BACKUPDIRROOT%

REM Create backup directory if it does not exist.
SET BACKUPDIR=%BACKUPDIRROOT%

REM ===================================================================================
REM Directory used to store to log information of the backup
SET ERRORLOGDIR=D:\DBBACKUP\LOG
REM Log file name
SET ERRORFILE=ERRORLOG.TXT

IF NOT EXIST %ERRORLOGDIR%\%ERRORFILE% mkdir %ERRORLOGDIR%
del %backupdirroot%/*.db
REM ===================================================================================
Rem Start logging information on backup
rem ECHO DATE : >> %ERRORLOGDIR%\%ERRORFILE%
DATE /T >> %ERRORLOGDIR%\%ERRORFILE%
rem ECHO TIME : >> %ERRORLOGDIR%\%ERRORFILE%
TIME /T >> %ERRORLOGDIR%\%ERRORFILE%
:1_SKIP_TIME_INFO

REM ===================================================================================
REM RPS

SET CONNECTIONIFO=%DSN%
ECHO DATABASE CONNECTION : %DSN% >> %ERRORLOGDIR%\%ERRORFILE%
dbvalid -c "DSN=%CONNECTIONIFO%" -o %ERRORLOGDIR%\%ERRORFILE%
dbinfo -c "DSN=%CONNECTIONIFO%" -o %ERRORLOGDIR%\%ERRORFILE%
dbbackup -r -y -c "dsn=%CONNECTIONIFO%" -o %ERRORLOGDIR%\%ERRORFILE% %BACKUPDIR%

rem ECHO Backup completed >> %ERRORLOGDIR%\%ERRORFILE%
rem ECHO TIME : >> %ERRORLOGDIR%\%ERRORFILE%
TIME /T >> %ERRORLOGDIR%\%ERRORFILE%
:2_SKIP_TIME_INFO

GOTO ENDPROC
:ERROR_ROT

:ENDPROC

Share
10 |10000 characters needed characters left characters exceeded
Reimer Pods Nov 04, 2016 at 01:40 PM
0

The script creates a file to log errors. Has it been created and does it contain any infos?

Share
10 |10000 characters needed characters left characters exceeded
Jonathan Owens Nov 04, 2016 at 04:56 PM
0

Yes, it's been created. Here is a piece of it. Let mw know if you need anything else. Thanks!

SQL Anywhere Information Utility Version 12.0.1.3726
Database : d:\database\rps.db
Log file : d:\database\rps.log
Log mirror: none
Page size : 4096
Encrypted : No
Strings padded with blanks for comparisons: No
CHAR collation sequence: 1252LATIN1(CaseSensitivity=Ignore)
CHAR character set encoding: windows-1252
NCHAR collation sequence: UCA(CaseSensitivity=Ignore;AccentSensitivity=Ignore;PunctuationSensitivity=Primary)
NCHAR character set encoding: UTF-8
Database checksums enabled: Yes
Encrypted tables supported: No
SQL Anywhere Backup Utility Version 12.0.1.3726
Error writing backup file "Invalid argument"
Database backup failed
12:12 AM

Share
10 |10000 characters needed characters left characters exceeded
Atsushi Asano
Nov 07, 2016 at 04:49 AM
0

Hi Jonathan,

> They upgraded their server a month ago and since then,
What did they upgrade?
Can you execute this batch file in other environment? At first, I doubt environment.

Secondly, the SQL Anywhere 12 fixed some problems after this version.
For example,
================(Build #4211 - Engineering Case #777043)================
If the Backup utility (dbbackup) was used to back up a database that had
no transaction log, and the -n and -r switches were used, dbbackup would
crash. This has been fixed.

The latest edition of version 12 is 4436 now.
Please confirm the following.

2374897 - SQLAnywhere 12.0.1 SP109 Build 4436 Release Notes Information
https://launchpad.support.sap.com/#/notes/0002374897

I recommend upgrading to the latest build.

Thanks,
Atsushi


Share
10 |10000 characters needed characters left characters exceeded