how to backup sybase by script on AIX ?


I need a script that backup sybase database (full backup). is it possible ? if yes how ?

Thank you
Who is Participating?
Jan FranekCommented:
Well, I don't know nothing about AIX, but I assume it's just kind of UNIX so it should be possible. You just need to invoke isql with right parameters.

1. create SQL script containing SQL commands to do the backup:

DUMP DATABASE yourdatabasename TO /dev/rmt1

2. invoke isql:

$SYBASE/$SYBASE_OCS/bin/isql -S yourservername -U yourusername -P yourpassword -i yoursqlscriptname

saito1Author Commented:

this script should backup the database to tape device (/dev/rmt1)

Jan FranekCommented:
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

An alternative to invoke isql:


isql -U$username -P$password -S$server -w300 << EOF > output_file

DUMP DATABASE yourdatabasename TO /dev/rmt1


In this way you can keep everything in shell script.
saito1Author Commented:
Thank you very much I will try this...


why do you use "-w300" option what happened if I don't use it ?
and also what is output_file for ? is it something like "/dev/null" ?

I don't have time to try now but I will try the scripts as soon as I have time .

Thank you very much...
"-w 300" is useful if output is longer than 80 character, to get a better output just in case.

output_file is file name to save the messages. You can use any name. Ideally you should check that file whether an error occured or not. In Kourne shell:

if ( egrep -q "Msg|error" output_file ) then
                echo "`date` $server ERRORS found, please check log"

saito1Author Commented:
when I try backup database it gives the error below ?? Thank you.

WARNING: In order to LOAD the master database, the SQL Server must run in single
-user mode.  If the master database dump uses multiple volumes, you must execute
 sp_volchanged on another SQL Server at LOAD time in order to signal volume changes.

Backup Server session id is:  95.  Use this value when executing the 'sp_volchan
ged' system stored procedure after fulfilling any volume change request from the Backup Server.
Backup Server: Warning, unable to open device configuration file /usr/opt/sybase/backup_tape.cfg for reading. Operating system error No such file or directory.
Backup Server: Device /dev/rmt1: not found in tape configuration file.
  Tape configuration will be attempted.
Backup Server: Device /dev/rmt1: Not found in configuration file /usr/opt/sybase/backup_tape.cfg.  INIT needs to be specified to configure the device.
Msg 8009, Level 16, State 1:
Line 1:
Error encountered by Backup Server.  Please refer to Backup Server messages for details.
saito1Author Commented:

OK I have found the solution. thanks...
what is ur solution, please i have the same problem.. thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.