Solved

how to backup sybase by script on AIX ?

Posted on 2004-09-28
9
530 Views
Last Modified: 2010-08-05
Hi,

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

Thank you
0
Comment
Question by:saito1
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 3

Author Comment

by:saito1
ID: 12167520

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

0
 
LVL 14

Accepted Solution

by:
Jan_Franek earned 325 total points
ID: 12167833
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
GO

2. invoke isql:

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

0
 
LVL 14

Expert Comment

by:Jan_Franek
ID: 12167861
0
 
LVL 13

Assisted Solution

by:alpmoon
alpmoon earned 175 total points
ID: 12186588
An alternative to invoke isql:

username=....
password=....
server=.....

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

DUMP DATABASE yourdatabasename TO /dev/rmt1
GO

EOF

In this way you can keep everything in shell script.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Author Comment

by:saito1
ID: 12187354
Thank you very much I will try this...

alpmoon

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...
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 12196230
"-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"

0
 
LVL 3

Author Comment

by:saito1
ID: 12216140
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: 8.5.1.1: 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: 8.15.1.1: Device /dev/rmt1: not found in tape configuration file.
  Tape configuration will be attempted.
Backup Server: 8.10.2.1: 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.
0
 
LVL 3

Author Comment

by:saito1
ID: 12216386


OK I have found the solution. thanks...
0
 

Expert Comment

by:vsaiviwat
ID: 15020396
what is ur solution, please i have the same problem.. thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Facing problems with you memory card? Cannot access your memory card? All stored data, images, videos are lost? If these are your questions...than this small article might help you out in retrieving your lost or inaccessible data.
We need a new way to communicate time sensitive or critical info.   The best part of my role at xMatters is visiting our clients all over the world to learn about how they operate their businesses, share insights that xMatters has gleaned across…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now