cancel
Showing results for 
Search instead for 
Did you mean: 

Database Backup error

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (6)

Answers (6)

reimer_pods
Participant

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.

VolkerBarth
Active Participant
0 Kudos
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.

former_member186998
Contributor
0 Kudos

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


Former Member
0 Kudos

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

reimer_pods
Participant
0 Kudos

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

Former Member
0 Kudos

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

former_member186998
Contributor
0 Kudos

Hi Jonathan,

Can you explain the reproduction procedure of this phenomenon?

Thanks,
Atsushi