Discussion on Sybase system maintenance experience

Source: Internet
Author: User
Tags sybase sybase database dsquery
Sybase database system as the main products of C/s framework has been widely used in China, so the maintenance of Sybase system is
Appears to be vital. The author of the Sybase system maintenance work, summed up a number of skills and experience, are introduced to everyone.

1. Automatically load Sybase database when power-on

To enable Sybase SQL Server to start, you typically have to log in as a Sybase user and then run the $sybase/install directory
StartServer command to start the SYBASE_XXXX service process and the SYB_BACKUP_XXXX backup service process.

To enable the UNIX system to load Sybase in the background while booting, we can create a new file S99sybase in the/etc/rc2.d/directory.
The contents are as follows:

Sybase=/usr/sybase

Path= $PATH: $SYBASE/bin

Export $SYBASE $PATH

$SYBASE/install/startserver-f $SYBASE/install/run_sybase_xxxx >/dev/null

$SYBASE/install/startserver-f $SYBASE/install/run_syb_backup_xxx >/dev/null

Then change Sybase's permissions and reboot the system.

2. Automatically uninstall the Sybase database when the shutdown is implemented

To keep the Sybase system running, the Sybase SQL Server service process is terminated every time the UNIX system is shut down, from the mitigation
The System Manager operation Angle establishes a user halt, modifies the/etc/passwd file, changes the halt user's UID to 0 (or other operational
Shutdown user ID), add the following statement in/usr/halt/.profile:

Sybase=/usr/sybase

Dsquery=sybase_xxxx

Path= $PATH: $SYBASE/bin

Export SYBASE DSQUERY PATH

Isql-usa-pabcabc-ihalt.sql >/dev/null

Shutdown-y-g0

where "ABCABC" is the password of the SA user, Halt.sql is a simple text file that reads as follows:

Shutdown

Go

This allows you to automatically remove the Sybase database and then shut down the UNIX system whenever you log on as a halt user.

3.Sybase Library Backup Skills

Typically, a backup of the Sybase library is made with tape media, but there is a better way to back up to the hard disk and then compress it,
Copy to tape to make it easy to recover, one backup copy, and backup time saved. The following steps are implemented:

(1) Establish a disk backup device

Run isql, take SA into Sybase system, and run the following:

Sp_addumpdevice "Disk", Disk_bkupdevice,/tmp/dumpdb, 2

Go

This creates a backup device called "Disk_bkupdevice" in Sybase that corresponds to the/tmp/dumpdb file under the UNIX system.

(2) Create a backup user

Enter the UNIX system as root, create new user backupdb, and belong to Sybase group.

(3) Modify the relevant documents

Add the following statement to the/usr/backupdb/.profile:

Sybase=/usr/sybase

Dsquery=sybase_xxxx

Path= $PATH: $SYBASE/bin

Export SYBASE DSQUERY PATH

Rm/tmp/backupdb. Z

echo "starts backing up Sybase database ..."

Isql-usa-pabcabc-ibackup.sql >/tmp/dbbackup.log

echo "HDD backup complete, compressing backed-up data files ..."

Compress/tmp/backupdb

ECHO is copying compressed data from backup to tape ...

Tar c8v/tmp/backupdb. Z

echo "Backup complete! "

where "ABCABC" is the password of the SA user, Backup.sql is a simple text file that reads as follows:

Dump Database Db_main to Disk_bkupdevice

Go

The execution log of the backup is recorded in/tmp/dbbackup.log, and of course the system administrator can also view the $sybase/install/backup.log
Learn about Backup logs.

This backup method requires hard disk space to be large enough for the system administrator to pay special attention when building the UNIX partition.

On the SCO Open Server 5.0.4, Sybase 11.0.3 platform, the above several tips have been applied successfully for the author's Daily maintenance save Xu
A lot of time, and achieved very good results

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.