Solved

how to backup sybase by script on AIX ?

Posted on 2004-09-28
9
531 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sybase, how do we check what privileges granted or cover by role ? 2 1,696
sybase license issue 6 537
sql anywhere query 5 141
SQL Query Producing decimal places when it shouldn;t be 8 44
Read about the importance of offline branding in the digital age.
In this increasingly digital world, security hacks are no longer just a threat, but a reality. As we've witnessed with Target's big identity hack 2013, Heartbleed in 2015, and now Cloudbleed, companies and their leaders need to prepare for the unthi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

832 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