SyDump 
    Sybase Backup Scripts 
by Edward Barlow

 

 
Introduction Features Directory Layout Program Syntax Rights and Redistribution
Installation Frequently Asked Questions Compression User Interfaces Security

INTRODUCTION

This package is a low cost commercial backup facility for the Sybase SQL Server that can run on both WinNT and UNIX. The package includes all the facilities you will require to perform basic data server management and is written in perl for maximum portability. The individual scripts are small and easy to understand and, as with all perl code, are released as source code.

In addition to a command line interface, the package provides a user interface through an ascii menu (menu.pl) and from a web page (cgi.pl). The web page interface requires that you have a web server on the same machine that you are running your backups from or that you have rsh access (unix only) between your systems. Normal backup operations will be started automatically from your scheduling system (cron on UNIX or any of a number of windows schedulers) using the command line interface.  The menuing systems will provide you the ability to view problems, and to recover from disasters.

This package is released as commercial software from the Sybase shareware web site and this site should be checked periodically to find any future releases.  The latest version of the package can be < A HREF=http://www.edbarlow.com/download/latest.tar.gz> download as a gzipped tar file.  Note that some older browsers strip off multiple extension names.  If the file does not open once it is downloaded, check that the file contains the extension .tar.gz (compressed tar file) and rename the file if it does not. After you have downloaded, follow instructions in the installation section. If you have any comments, please contact SQL Technologies.

This package is intended for "normal" Sybase installations. Specifically, it relies on dumping the databases to disk.  Your system administrator is then responsible for backing up to tape.  No provision is made by this package for very large databases.  If you have huge databases and, for example, require table level dbcc, you will need to create your own scripts to perform these operations.  All operations performed by this package (except rebuilding indexes and bcp_out) are performed on a  full database level.

FEATURES

The following are some of the features of these scripts:
  1. Standard backup processing: including full database dumps, transaction log dumps, update statistics (with sp_recompile), standard DBCC's, and rebuild indexes.
  2. Configuration reports that give you an archive of necessary information that can be used for disaster recovery.
  3. Optional Object Level BCP Backups of critical databases and tables
  4. Extensible error handler that will interface with your error management system
  5. Optional Backup files compression
  6. Graphical menu system that both operators and administrators can use to load backups
  7. Simple installation
  8. Trackable operations log file that allows you to understand what events occurred and when they occurred
  9. Output into an easily understood clean directory structure

DIRECTORY LAYOUT

All output is placed in a nice directory structure, identified to the system when you run the configure command.  The directory identified to configure will be composed of the following sub directories:
 
ftfo.gif (126 bytes) Base Backup Directory  e.g. C:/backups (on NT) or /dbdumps (on UNIX) per config file 
ftln.gif (64 bytes)ftfo.gif (126 bytes) .../$SERVER  Sub directory for your Server 
ftb.gif (135 bytes)ftn.gif (70 bytes)ftfo.gif (126 bytes) .../audits  Directory to put audit results (optional) 
ftb.gif (135 bytes)ftn.gif (70 bytes)ftfo.gif (126 bytes) .../bcp  Directory to put bcp level backups (optional) 
ftb.gif (135 bytes)ftn.gif (70 bytes)ftfo.gif (126 bytes) .../dbcc  Directory for raw dbcc output 
ftb.gif (135 bytes)ftn.gif (70 bytes)ftfo.gif (126 bytes) .../dbdumps  Directory for local server dumps 
ftb.gif (135 bytes)ftn.gif (70 bytes)ftfo.gif (126 bytes) .../errors Directory for error messages 
ftb.gif (135 bytes)ftn.gif (70 bytes)ftfo.gif (126 bytes) .../logdumps  Directory for local server tran log dumps 
ftb.gif (135 bytes)ftln.gif (64 bytes)ftfo.gif (126 bytes) .../sessionlog  Directory for run logs (necessary if you are running from a scheduler like cron) 

Note the beauty of this layout.  Because error messages are written to files in an error directory, you only need to peruse this directory on a daily basis.  If any files are in this directory there is a problem!  The other directories contain enough information to resolve the problem (i.e.. a full log of the session is in the sessionlog sub directory and the raw dbcc output is in the dbcc directory...).  The administrator is responsible for cleaning the error directory after reading the files it contains. Remember, files are only created in the error directory if a problem is encountered. Session logs and dbcc output are kept in sessionlog and dbcc sub directories, but will probably never need to be used unless you are debugging a problem. The dbdumps and logdumps sub directories contain the actual dumps. The audits sub directory contains the output of the server configuration reports, and contain system configuration information sufficient to rebuild your server after a system failure. 

RIGHTS AND REDISTRIBUTION

This package and related programs is copyright © 1996-2000 by SQL Technologies and Edward Barlow. All Rights to this program are reserved. The software is released as a shareware product and if the software is used in a production environment, it requires a license for each server it is used on.  The license charge per server is $199 (USD).  If this software is used in commercial environments, you are required to contact SQL Technologies at www.edbarlow.com and pay the license charge.  If you do not wish to pay the license charge, you may use the free shell script backup facility available at www.edbarlow.com or you may write your own backup facility, but you may not legally use this software.

To the best of my knowledge this program works as specified, but there is expressly no warranty with the software. It is ok for you to modify any of the programs (so long as you don't remove any of the copyright notices).  If you make any changes that make the tool better, send the changes to me so all can have them. 

PROGRAM SYNTAX

backup.pl

backup.pl is the main driver script for your operations and will appropriately call the other scripts in this package to get its work done.  It is probably the only program you will add to your scheduler. It reads the configuration file and process servers based on the options you have specified. Operations are performed in the following order:

        Purge Old Dumps (if necessary use rsh)
        Dbcc Databases
        Dump Tran Log
        Full Dump
        Check for Required Database Loads
        Update Statistics
        Run Audit
        Optional Table Level Bcps
        Compress The Dumps (if necesary use rsh)
        Rebuild Indexes

Usage:  Usage: backup_pl -JJOB -t|-f [-dh] 

This is the master driver for the backup scripts.  It relies on the Job being defined in the configure.cfg (located in backup scripts directory or one level above it).  It follows instructions and performs the appropriate tasks as needed.  -t for transaction log dumps only, -f for full backups. -d is debug mode and -h is html output.

You can also specify -DDB_LIST to restrict databases operations are performed on further.

Notes

backup.pl will make system calls to the following programs:
 
  dbcc_db.pl a utility to run dbcc's 
load_database.pl load your databases 
stop_sybase.pl stop Sybase 
update_stats.pl run update statistics 
dump_database.pl dump databases 
config_report.pl configuration reports 
rebuild_index.pl Rebuild your indexes

dbcc_db.pl

Runs dbcc checkdb, checkalloc, and checkcatalog on your databases. Only prints output if there is a problem.

Usage:  dbcc_db.pl -USA_USER -SSERVER -PSA_PASS -DDB_LIST

   -D DB_LIST    (pipe separated list with wildcards of databases)
   -d            (debug mode)
   -h            (html output)
   -e errorlog   (optional)
   -l sessionlog (optional)
 

load_database.pl

Loads a database from either a full backup or a transaction log dump.  The file root of the command is the path name to the dump file.  It should exclude the .S[num] extension for striped dumps. The program attempts to be intelligent about what file to load.  If a tran log is implied and no file exactly matches the file_root, the -i option identifies a file root and ALL files that match the root are loaded in order of timestamp (from the file name).  If there is no file with exactly the correct root on a full load, the LATEST file matching the root of the command will be loaded.  The -r prefix can be used to rename files when they are done loading.  For example, you may use -rloaded to rename SRVR.MYDB.dbdump.20001109.022233 to SRVR.MYDB.loaded.20001109.022233. The database name may NOT contain wildcards.  

Standard naming for dump files should be
      {SERVER}.{DATABASE}.dbdump.yyyymmdd-hhmmss
   or
      {SERVER}.{DATABASE}.dbdump.yyyymmdd.hhmmss.S1
     through
      {SERVER}.{DATABASE}.dbdump.yyyymmdd.hhmmss.SN
if the backups are striped.

Usage:  load_database.pl -nnum_stripes -USA_USER -SSERVER
                           -PSA_PASS -Ddb -ifile_root -tdhk

   -n Num stripes (.SX appendended to dump name)
   -D DB_LIST     (pipe separated list with wildcards of databases)
   -i DIR         (input file root)
   -t             (Dump Transaction Log only)
   -d             (debug mode)
   -h             (html output)
   -r extension   (rename file extension (dbdump part of name) when done)
   -e errorlog    (optional)
   -l sessionlog  (optional)
 

set_dboption.pl

This program can reset database options.

Usage: set_dboption.pl -USA_USER -SSERVER -PSA_PASS -DDB_LIST -Ooption -Vvalue

   -D DB_LIST: may include wildcards or pipe separated list of databases
   -d debug mode
   -h html output
   -l logfile
   -e errorfile
   -V value true or false

stop_sybase.pl

Stops your Sybase server
Usage:  stop_sybase.pl -USA_USER -Sopt_S -PSA_PASS

update_statistics.pl

This program will run update statistics and sp_recompile on tables in the passed in database(s).  If no database name is passed in, it defaults to work on all user databases in the server.  Pass -s if you want no output, otherwise it will print 1 line for each update statistics and sp_recompile line run (which can be quite verbose).  This program only works on dbo objects, because you can not sp_recompile a user object..
USAGE: update_stats.pl -UUSER -SSERVER -PPASS [-DDB]

   -D DB_LIST     (pipe separated list with wildcards of databases)
   -s             (silent mode)
   -d             (debug mode)
   -h             (html output)
   -e errorlog    (optional)
   -l sessionlog  (optional)

dump_database.pl

Backs up database or does a transaction log dump. Can be set for tran log dumps with -t or will, by default, perform full database dumps. Places database dumps in DIRECTORY/$SERVER.$(database)_dbdump.yyyymmdd.hhmmss and tran log dumps into DIRECTORY/$SERVER.$(database).logdump.yyyymmdd.hhmmss It will ignore databases as appropriate, following the following rules:
             1) It will not perfore a transaction log dump if "trunc. log on chkpt" set
             2) model,tempdb, and sybsyntax are not dumped unless specifically identified with -d option
             3) It will not dump transaction logs if data and log on the same device

It will also warn if user databases have select into set but do not have trunc. log on chkpt set.  The dump files will have a .tmp in them until the dump is completed, at which point they will be renamed with the .dbdump or .logdump extension if the -r option is specified.

Usage:    dump_database.pl -nnum_stripes -USA_USER -SSERVER -PSA_PASS
                      -DDB_LIST -oDIRECTORY -tdhf

   -n Num stripes (.SX appendended to dump name)
   -D DB_LIST     (pipe separated list with wildcards of databases)
   -o DIR         (output directory)
   -t             (Dump Transaction Log only)
   -f             (Full Dump - default)
   -d             (debug mode)
   -h             (html output)
   -e errorlog    (optional)
   -l sessionlog  (optional)
 
   Dump a database to the specified directory in with the name
      {SERVER}.{DATABASE}.dbdump.yyyymmdd.hhmmss
   or
      {SERVER}.{DATABASE}.dbdump.yyyymmdd.hhmmss.S?
   where ? is a number 1 to the number of stripes if the backups are striped
 

config_report.pl

This program creates a configuration report for a server that can be used to recreate that server from scratch. This is intended as documentation for use by the system administrator in case your server crashes or has a problem. This program should produce virtually everything about your server that you might care about except user object DDL.

     WHAT IT PRINTS
             SERVER:  srvname
             @@version
             helpdb
             configure
             helpmirror
             vdevno
             helpdevice
             helplogin
             helpuser by db
             all the reverse engineering routines"
             SERVER:  srvname
             @@version
             helpdb
             configure
             helpmirror
             vdevno
             helpdevice
             helplogin
             helpuser by db
             all the reverse engineering routines

Requires: Requires the extended stored procedure library

Usage: config_report.pl -USA_USER -SSERVER -PSA_PASS -oFILE
      -o FILE       (output file)
      -h            (output in html format)
      -e errorlog   (optional)
      -l sessionlog (optional)
 

rebuild_index.pl

Rebuild indexes on your database based on an extract file.  This extract file can be created from rebuild_index.pl using the -o option and is basically a set of create index statements that you wish to run.  With -r, it will report problems, and with -c it will rebuild indexes.  If duplicate data is found, it will delete the duplicate row.
Usage: rebuild_index.pl -UUSER -PPASS -SSERVER -DDB [-oOUTFILE|-iINFILE] -c

Index Comparator.  Extracts indexes for a DB and then allows you to compare
the saved indexes to the indexes on your servers.

 -o : if outfile specified then creates a file with the indexes from the
      server.  This file can be used as an infile for further comparisons.
 -c : correct duplicate keys in indexes.  Deletes duplicate data.  One random
      row in unique indexes will be kept.
 -r : report only - this will report missing indexes 
      as well as duplicate data but will not rebuild any indexes.

note that this program requires sp__revindex (extended stored proc library)

INSTALLATION

This program is instaled through the general SQL Technologies Shareware package installer. See documentation on that package for directions.

Additional Required Steps

You should install this package as the Sybase account (or whatever account you will use for the backups). The reason for this is so that you have appropriate permissions on dump files (for renaming, compressing, and removing...).

Set Up Configuration File

All utilities in this system read the configuration file configure.cfg in the directory that contains the backup scripts themselves (or in the directory directly above them).. This configuration file is composed of key-value pairs of the form VARIABLE=VALUE.  The following is a list of the variables with appropriate comments on how to set them up.

The colors in this section indicate what type of variables they are.  Most variables are shown in purple and  can be set up on a per server basis by preding an underscore and server name to the variable. Only the last encountered instance of a key will be used.  This overrides the general option. e.g.

        SYBPROD_IGNORE_LIST=model|tempdb|sybsyntax|testdb|testdb23
        SYBPROD_NUM_BACKUPS_TO_KEEP=4

Finally, the following variables MUST be set only on a per server basis. The following example will copy prod_db1 to copy_of_prod_db1 and will copy prod_db2 to copy_of_prod_db2 from SERVER SYBPRODUCTION to SERVER COPYSERV.

       COPYSERV_ XFER_FROM_SERVER=SYBPRODUCTION
       COPYSERV_XFER_FROM_DB=prod_db1|prod_db2
       COPYSERV_XFER_TO_DB=copy_of_prod_db1|copy_of_prod_db2

The BASE_BACKUP DIR should have adequate space for all your backups. If you need multiple file systems for this (due to a system 2GB file system limitation), dont worry at this point. Let the configure script (next step) create the directory tree under the base directory created in this step - and then mount additional file systems into the mount points created by configure. If you have specific error handling in mind, edit on_error.pl, which is the script that handles all errors.  This script is easily modifiable.
You can make special weekend jobs and other special jobs by creating multiple jobs that do that work.

#=============================================================================
#
# PERL BACKUP SCRIPTS CONFIGURATION VARIABLES
#
# Most of these can be overridden on a per "job" basis by prepending the
# job name at the beginning of the variable.  You can then run backup.pl -Sjob
# to get that configuration.  This way you can have multiple schedules for
# a single server (eg.  call the backup of SYBPROD on a nightly basis
# SYBPROD_NIGHTLY and on weekengs SYBPROD_WEEKEND)

# SYBASE=[ Sybase Directory On This Machine ]
#  - cant be overridden on a per job basis
#  - not currently used
SYBASE=/opt/sybase

# IGNORE_SERVER
# Pipe separated list of servers to ignore

# DSQUERY=[ A Sybase DSQUERY ]
# The dsquery for the given server.  Defaults, if unset, to the server name.
# You will want to override this (ie. SYBPROD_NIGHTLY_DSQUERY=SYBPROD )
# in the case where  the server name is not the same as the job name
DSQUERY=

# BASE_BACKUP_DIR=[ Root Directory of Backup Tree ]
# this is the directory on the local system to store logs and backups in.
# if it is not a remote system, it also is the place where backups go
# if it is a remote system, the rsh_dir is that location
#  - cant be overridden on a per job basis
BASE_BACKUP_DIR=/optapp2/syb_admin

# REMOTE_DIR=[ directory ]
# directory as seen by the Sybase Server that is equivalent to BASE_BACKUP_DIR.
# If not set it defaults to BASE_BACKUP_DIR (it assumes the server is local).
# If local, keep it = to BASE_BACKUP_DIR
# If Remote and NFS cross mounted drives, set this and keep IS_REMOTE=n
# If Remote w/no NFS, then set to where you want backups and be sure to
# set up rsh access as per instructions.
# - This will be overridden for remote servers
REMOTE_DIR=
PORTIA30_REMOTE_DIR=/opt2/sybdump
CLEARPROD2_REMOTE_DIR=/opt2/sybdump
SYBPROD2_REMOTE_DIR=/opt2/sybdump

# IGNORE_SERVER= [ Servers to ignore cause you want backups stopped on em ]
# these servers will not be run with backup.pl -Ssrv And will not be loaded
# from any machines
# - pipe separated as in server1|server2...

# NUM_BACKUPS_TO_KEEP=[ A Number >=1 ]
NUM_BACKUPS_TO_KEEP=1
SYBPROD2_NUM_BACKUPS_TO_KEEP=2

# NUM_DAYS_TO_KEEP
#  For other backup files (log files etc), this is the number of days
#  to keep stuff for prior to removing it)
NUM_DAYS_TO_KEEP=7

# NUMBER_OF_STRIPES=[ A Number ]
# number of stripes for the backups.
NUMBER_OF_STRIPES=5

# COMPRESS=[ external compression program e.g. /usr/local/bin/gzip ]
# should be a full path name on whatever system the backups live on so
# remote systems might have other locations.  i prefer gzip to compress.
COMPRESS=/usr/local/bin/gzip

# UNCOMPRESS=[ external uncompression program e.g. /usr/local/bin/gunzip ]
# Exact opposite of the above
UNCOMPRESS=/usr/local/bin/gunzip

# IGNORE_LIST=[ pipe separated list of databases to ignore ]
# e.g. model|tempdb|sybsyntax
# you will override this on a per job basis with useless/test dbs that you
# dont want to backup or dbcc
IGNORE_LIST=model|tempdb|sybsyntax
SYBPROD2_IGNORE_LIST=model|tempdb|sybsyntax|portia50h_old|sybsystemprocs
CLEARPROD2_IGNORE_LIST=model|tempdb|sybsyntax|wpg_portia
PORTIA30_IGNORE_LIST=model|tempdb|sybsyntax|wpg_portia|dbtest1|dbtest2
SYBPROD2WEEKLY_IGNORE_LIST=model|tempdb|sybsyntax|portia50h_old|sybsystemprocs
CLEARPROD2WEEKLY_IGNORE_LIST=model|tempdb|sybsyntax|wpg_portia
PORTIA30WEEKLY_IGNORE_LIST=model|tempdb|sybsyntax|wpg_portia|dbtest1|dbtest2

# MAIL_TO is comma separated list of email addresses to alert when there is
# a problem.
MAIL_TO='ebarlow@a.com,barlowedward@hotmail.com'

# DO_COMPRESS=[y|n]  - should you do compression on backups
DO_COMPRESS=y

# DO_UPDSTATS=[y|n]  - should you do update statistics as part of normal backup
DO_UPDSTATS=n
SYBPROD2WEEKLY_DO_DBCC=y
PORTIA30WEEKLY_DO_DBCC=y
CLEARPROD2WEEKLY_DO_DBCC=y

# DO_AUDIT=[y|n]  - should you do audit as part of normal backup
DO_AUDIT=y

# DO_DBCC=[y|n]  - should you do dbcc's as part of normal backup
DO_DBCC=n
SYBPROD2WEEKLY_DO_DBCC=y
PORTIA30WEEKLY_DO_DBCC=y
CLEARPROD2WEEKLY_DO_DBCC=y

# DO_BCP=[y|n]  - should you do bcp's as part of normal backup
DO_BCP=n

# if DO_BCP=y then this is a | separated list of tables to bcp out
BCP_TABLES=

# DO_INDEXES=[y|n]  - should you do indexes as part of normal backup
DO_INDEXES=y

# DO_DUMP=[y|n]  - should you do backups as part of normal backup
DO_DUMP=y

# DO_LOAD=[y|n]  - should you do loads (if defined) as part of normal backup
DO_LOAD=y

# DO_PURGE=[y|n]  - should you do purges as part of normal backup
DO_PURGE=y

# IS_REMOTE=[y|n]  - is this system remote.  ie.  the current machine does
#  not have direct access to the disks that will store the
IS_REMOTE=n
PORTIA30_IS_REMOTE=y
PORTIA30WEEKLY_IS_REMOTE=y
CLEARPROD2_IS_REMOTE=y
CLEARPROD2WEEKLY_IS_REMOTE=y
SYBPROD2_IS_REMOTE=y
SYBPROD2WEEKLY_IS_REMOTE=y

#
#RSH_HOST=host
# The host this server lives on that you can rsh to.  Only useful if IS_REMOTE
# and only used in conjunction with REMOTE_DIR
RSH_HOST=
PORTIA30_RSH_HOST=customer2
CLEARPROD2_RSH_HOST=customer2
PORTIA30WEEKLY_RSH_HOST=customer2
CLEARPROD2WEEKLY_RSH_HOST=customer2

#
# REBUILD_INDEX_DB=db|db|db - list of databases to rebuild indexes on
# REBUILD_INDEX_FILE=file|file|file File to rebuild indexes for given database
REBUILD_INDEX_DB=
REBUILD_INDEX_FILE=

# END CONFIGURATION OF BACKUP SCRIPTS
#
#=============================================================================
 

REMOTE PURGING AND COMPRESSION

If you are scheduling your dumps out of a central location and are, therefore, dumping on to systems that are remote, you will have problems with purging and compression.  Two solutions to this are provided.  The first is to cross mount the dump directories using NFS (or windows networking).  You can then directly purge/compress files created by the backup server.  To do this, simply identify the server as local (IS_LOCAL=y) and set up a REMOTE_DIR to the appropriate directory path.  Note, under windows you do not need to map drives, you may simply specify the full drive path in the REMOTE_DIR specification. The drawback here is that the remote dump directories must be mounted read/write across the network and that compression is done over the network.  The other option is to use rsh to issue the compress command.  This will require UNIX and will require you to create a .rhost file on each of your remote systems in the Sybase account.

Compression is optional.  There are some gotcha's if you do compression.  Firstly, to compress you need double the disk space of the dump files (it makes a copy).  This can cause all  kinds of disk errors if you are not careful.  Secondly, the compression will fail on UNIX due to permission violations when run by any account except Sybase or root (not recommended).  The error will be : permission violation (cant modify to file).

SETTING UP YOUR CRONTAB

Add your script to sybase's crontab on UNIX (or whatever scheduler you use).  On unix this is done with crontab -eIf your editor doesn't work here, set the environment variable EDITOR (e.g. export EDITOR=/bin/vi).  If you get a permission violation when running crontab -e, contact your unix support person and have them set you up to run cron jobs.  A sample cron can be found in crontab.sample.  Note that you must run the scripts as the SYBASE account.  As the output of backup.pl already goes to the session file,  redirect cron output to /dev/null so you dont get voluminous mail. (ie. /home/programs/bin/backup.pl -JMYSERVER >/dev/null). You probably want to dump tran logs every ten-twenty minutes on production systems.

You probably want it to run as a user in group Sybase (so you can use Sybase for something else). If this is the case, test starting a server - you could easily bomb on permissions. To set up as a member of group Sybase, remember that permissions should be set for group.

ERROR HANDLING

These scripts use an easily configured error handler to do error handling.  The scripts run the perl module Log::Dispatcher out of the file on_error.pl.  If you wish to modify the default behavior of this error handler (which is to put errors in the errors sub directory and session logs in the sessionlog sub directory, and then to mail errors to a specified set of users), you simply need modify the on_error.pl.  Log::Dispatcher is easy to use and supports a variety of log and error handling options.

FREQUENTLY ASKED QUESTIONS

The package does not work from your scheduler, but runs fine from the command line: There could well be some environmental difference that is breaking things.  Specifically, check that the environment variable SYBASE is defined.

I get permission violations when running: The scheduler should run out of the same account that runs the Sybase server.  On UNIX it should not run as root (if you run out of root, you should do a "su - Sybase -c" but this is not recommended).  In fact to make this a little more clear, almost every real problem I have ever encountered with the scripts has been by people using "su - Sybase -c..." instead of running out of sybase's crontab (so just dont do it).

How can i find if there were problems last night: A session log AND a separate error log are created for each run.  The error log is removed after the run if it is empty.  So, to tell if there were problems just look in the errors subdirectories in the output file tree.  If there are any files there, there were problems.  Remove these files each day and you will know if there are any events that need attention.  Additionally, the default error handler sends you mail with any problems.

I need to set up paging for problems:  You will need a script that sends pages and to add it to the on_error.pl file.  See the section on error handling.

The cood looks funny (tabbing is wierd): All scripts can be viewed and edited best with tabstop=3.

Are there any bad table names? If you have tables with the string corrupt in it, you may have trouble with the dbcc program. corrupt is a keyword for dbcc errors.

MENU.PL / CGI.PL

The user interface for this program is provided either from the command line or from a cgi script.  The basic menu flow is:

IF THERE ARE MULTIPLE SERVERS DEFINED

WELCOME SCREEN
  1. SELECT SERVER XXX
  2. SELECT SERVER YYY
IF ONLY ONE SERVER IS DEFINED OR YOU HAVE SELECTED A SERVER FROM THE ABOVE LIST
SERVER XXX BACKUP MENU
  1. Test Connectivity
  2. Test RSH Access
  3. Check Configuration
  4. Perform Full Server Backups
  5. Backup A Single Database
  6. Restore A Database
  7. Start Database Server
  8. Stop Database Server
  9. Start Backup Server
  10. Stop Backup Server
  11. View Backup Error Logs
  12. Cleanup Backup Log Files
  13. Show Database Server Error Log (Filtered)
  14. Show Database Server Error Log (Filtered, Last 2 Days Only)
  15. Show Backup Server Errorlog
  16. Debug This Server
  17. QUIT

SECURITY

Keep these scripts secure using unix permissioning - they should be owned by Sybase and NOT accessible by group other. Everything should run as Sybase (the user or the group) for safety. If you do not pass a User or Password, those values are looked up with the GetPassword perl library. This will prevent people using buggy versions of 'ps' can not discover them.

TODO

Queryable Log File of All operations
Dump File Renaming for Multi Server Configuration
MENU.PL
BCP LEVEL BACKUPS



Author: Ed Barlow
barlowedward@hotmail.com
The current home for future releases is:  http://www.edbarlow.com