Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

how to backup sybase by script on AIX ?

Posted on 2004-09-28
9
533 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains the steps required to use the default Photos screensaver to display branding/corporate images
Many businesses neglect disaster recovery and treat it as an after-thought. I can tell you first hand that data will be lost, hard drives die, servers will be hacked, and careless (or malicious) employees can ruin your data.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

840 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