SEP sesam extension for Informix

From SEPsesam

Jump to: navigation, search

SEP sesam Extension for Informix

(C)SEP AG

Copyright 1999-2009 by SEP AG. All Rights reserved.

Any form of reproduction of the contents or parts of this manual is allowed only with the express written permission from SEP AG. When compiling and designing user documentation SEP AG uses great diligence and attempts to deliver accurate and correct information. However, SEP AG cannot issue a guarantee for the contents of this manual.


Contents

Introduction

SEP sesam online backup for Informix (sib) provides a XBSA interface between Informix and SEP sesam for saving data of Informix databases to sesam server. XBSA API specifies the access from Informix onbar utility to a backup application. SEP sesam will manage the whole backup media handling like loading the correct tapes, whereas ONBAR decides which data has to be saved or recovered. This document provides information about the sesam specific parts of Informix backups. It's not an Informix/ONBAR adminstration guide. Please read Informix documentation of ONBAR to get familiar with Informix's backup and recovery concepts and tools.

System requirements

  • Informix Dynamic Server 7/9/2000 on Linux, Unix or Windows
  • SEP sesam v3.2
  • SEP sesam Extension for Informix
  • the standard Sesam Backup Client is already installed
  • working SEP sesam file system backups for this client

Installation

The SIB packet includes only one shared library which Informix server loads dynamically during backup or restore. The library has to be copied to Informix server and the full path to it has to be specified under BAR_BSALIB_PATH in the ONBAR configuration file.

For installation we assume the following environment. Please adjust the pathes and variables according to your needs.

  • INFORMIXDIR=/opt/informix
  • ONCONFIG=/opt/informix/etc/onconfig

Installation on Linux or Unix

  • First verify that the standard Sesam Backup Client is already installed
  • File system backup should work with this sesam client
  • Login as informix user
  • Create a new directory sib in \$INFORMIXDIR
  • Unpack the file <OS>_ssib_x.x.x.x.tgz there
  • Create a symbolic link in \$INFORMIXDIR/lib to the unpacked library file ibsad001.so. If file already exists, rename it first.
 informix@linux:~> cd $INFORMIXDIR
 informix@linux:/opt/informix> mkdir sib
 informix@linux:/opt/informix> cd sib
 informix@linux:/opt/informix/sib> tar xzf /tmp/linux_sib.2.3.1.1.tgz
 informix@linux:/opt/informix> cd ../lib
 informix@linux:/opt/informix/lib> ln -s ../sib/ibsad001.so
  • PATH environment variable should include \$INFORMIXDIR/bin
  • Check the backup/restore specific entries in the ONCONFIG file:

BAR_BSALIB_PATH Path to installed SEP sesam library

BAR_MAX_BACKUP Number of parallel backup sessions.

Attention

BAR_MAX_BACKUP must be at least '2'. Else restores will NOT work!

Example:

 ...
 # Backup/Restore variables
 BAR_ACT_LOG             /opt/informix/log/bar_act.log
 #BAR_MAX_BACKUP         0
 BAR_MAX_BACKUP          4
 #BAR_RETRY              3
 BAR_RETRY               2
 BAR_NB_XPORT_COUNT      10
 BAR_XFER_BUF_SIZE       31
 BAR_BSALIB_PATH /opt/informix/lib/ibsad001.so
 BAR_DEBUG       3
 BAR_DEBUG_LOG   /opt/informix/log/xbsa.log
 ....

To set the version of XBSA specification SEP sesam supports, the following entry has to be inserted in table bar_version on sysutils database.


bar_version
Bsa_version
bar_sm
sm_version
1
1.0.1
sesam
1


Instead of inserting this entry into database you can also adopt the INFORMIX template file.

  • Copy template file \$INFORMIDIR/etc/sm_versions.std to \$INFORMIXDIR/etc/sm_versions
  • Add the following line 1|1.0.1|sesam|1|
informix@linux:/opt/informix/> cd $INFORMIDIR/etc>
informix@linux:/opt/informix/etc> cp sm_versions.std sm_versions
informix@linux:/opt/informix/etc> vi sm_versions
informix@linux:/opt/informix/etc> cat sm_versions
#1|1.0.1|ism|1|
1|1.0.1|sesam|1|
informix@linux:/opt/informix/etc>
Info

For the usage of SEP sesam command events, the loginscripts of the Informix users should not expect any inputs!

Configuration on sesam server

Create a new backup task for the Informix server with task type Informix. For backup source you can specify whatever you want, bcs. ONBAR decides which data has to be saved.

Configuration on Informix server

To give ONBAR the necessary information to connect to SEP sesam, the following environment variables have to be set.

Mandantory parameters

  • INFORMIXDIR (set by Informix installation).
  • SESAM_SERVER=<Name of SEPsesam server>
  • SESAM_JOB=<Jobname of Informix backup>
  • Name of an already configured task on sesam server
  • with task type Informix
  • SESAM_POOL=<Media pool name>
  • Name of an already configured media pool on sesam server

Optional parameters

  • XBSA_TRACE=<Trace level> ( 0|1|2 )
  • XBSA_LOGFILE=<Name of trace file>

Although XBSA_TRACE XBSA_LOGFILE are not mandatory, they should be set to get information in case of a problem during backup or restore. For a restore only SESAM_SERVER is mandatory.

ONBAR Backup Configuration

The following examples show, how backup or restores can be started on Informix server. They do not cover all functions of ONBAR, but should give some hints for using ONBAR and SEP sesam together.

Attention

The return code of onbar always has to be checked, bcs. onbar writes no error messages to STDERR! The meaning of the return codes can be found in the Informix Backup and Restore Guide under Appendix A: ON-Bar Messages and Return Codes. You have to be informix or root to use onbar.


  • Backup of tablespace dbspace01
informix@linux:/opt/informix/> export SESAM_SERVER=backupsrv
informix@linux:/opt/informix/> export SESAM_JOB=informix_ts
informix@linux:/opt/informix/> export SESAM_POOL=DISK
informix@linux:/opt/informix/> onbar -b -L 0 dbspace01
informix@linux:/opt/informix/> echo $?
0
informix@linux:/opt/informix/>


The commands shown in the following example:

Perform a level 0 backup of "'dbspace01"' on an Online Dynamic Server instance named venus. Backup all logical log files associated with dbspace01, close and backup the current logical log

setenv SESAM_SERVER jupiter 
setenv INFORMIXDIR /usr/informix 
setenv INFORMIXSQLHOSTS \$INFORMIXDIR/etc/sqlhosts 
setenv ONCONFIG onconfig.std
onbar -b -L 0 dbspace01 
onbar -l -c

ONBAR Restore Configuration

ONBAR commands to restore data backed up. The shared XBSA library translates Informix names passed by ONBAR into SESAM server save set (a set of files) for retrieval from the SESAM server's database and restoration to Informix.


Physical Restore:

setenv SESAM_SERVER jupiter 
setenv INFORMIXDIR /usr/informix 
setenv INFORMIXSQLHOSTS \$INFORMIXDIR/etc/sqlhosts 
setenv ONCONFIG onconfig.std
onbar -r -p

Physical restores replace lost or corrupted storage spaces from SESAM backup media.

If a critical storage space is damaged because of a disk failure or corrupted data, Dynamic Server goes off-line.

If a disk failure or the corruption of data does not cause the database server to go to off-line mode you can restore any noncritical storage spaces.


Logical Restore:

SESAM_SERVER=jupiter 
export SESAM_SERVER
onbar -r -1

Logical restores recover the server transactions made since the last storage space backup, followed by a rolling forward of the logical logs backed up for the storage space. If different backup sessions are involved, the log rolls forward transactions made since the backup time recorded for each storage space are restored.


Combined Restore:

SESAM_SERVER=jupiter 
export SESAM_SERVER
onbar -r

Combined restores allow you to issue a single command to perform a physical restore immediately followed by a logical restore. For finer control, use the onbar -l -s command to salvage the logs, then the onbar -r -p command to perform only a physical restore, and then the onbar -r -l command to perform only a logical restore.


Point-in-time Restore:

setenv SESAM_SERVER jupiter
onbar -r -t time -w -p

Point-in-time restores involve performing a whole-system, physical restore of Informix data from a whole-system-backup to a specified time instead of the default, which is time of the last Informix backup.

There are two different kinds of restore you can perform in dependence of Informix Dynamic Server current mode. If the server is in quiescent mode or is on-line, you can perform a warm restore (Use the -O option to restore an on-line storage space). Otherwise, if server resides in off-line mode, the restore operation is called a cold restore.

for example Logical Log:

onbar -l -L 0 dbspace01

Backup and Restore Overview

Here the commands are given for the following scenarios.


Backup of database

Complete backup of database ( if necessary start the database with oninit -v)

onbar -b -w  [-L n]
n - Backup Level (0, 1, 2), default is 0.

Backup of a single dbspace

onbar -b [-L n] 
n - Backup Level (0, 1, 2), default is 0.
dbspace_name - Name of the Informix dbspace instance

Logical Logfiles Backup

onbar -l     - Backup of all full logical logfiles
onbar -l -c  - Backup of the actual logical logfiles and switch to the next logical logfile.
onbar -l -s  - Backup of all logical logs, wich reside on the harddisk after a crash of the database.


Database Restore

Restore of the whole database (cold restore)

onmode -ky   - Shutdown of the database
onbar -r -w  - Restore of all data 

Restore of the down dbspaces and corresponding logical logs (cold)

onbar -r

Restore of the down dbspaces without logical logs (cold)

onbar -r -p

Restore of single dbspaces

onbar -r <dbspace_name_1> <dbspace_name_2> </li>

Restore of the logical logs (for dbspaces, wich have been restored physically)

onbar -r -l</li>
Info

If chunk areas have been deleted the option -O should be used, this could eventually restore the chunk areas:

onbar -r ... -O

Occasionally no checkpoint is written because of the missing chunk. This situation can be avoided with:

onmode -O

or by shutting down the database with a following cold restore.

Trouble shooting

  • ensure, that the following environment variables INFORMIXDIR, INFORMIXSERVER, ONCONFIG, ROOTPATH are correctly set.
  • check the messages on SEPsesam server.
  • more information can be found in the logfiles of ONBAR and SIB.
  • SEP recommends to use only one single log file for ONBAR and XBSA messages.
  • Then you can see all calls from database and sesam in correct order.
  • For this set enviroment variable
XBSA_LOGFILE=<complete path to bar_act.log> and  XBSA_TRACE=1.
  • All SIB (sesam) messages have the prefix SIB.
  • For more information XBSA_TRACE can be set to 2, but then the logfiles can become quite large.
  • To activate the ONBAR log, edit the following line in the onconfig file:
BAR_DEBUG       2    \# where 'num' = 0-9; 9 producing heaps output defaults to /tmp/bar_dbug.log

Further Links/Literature

  • SEP sesam Extension for Informix
  • 'Informix Backup and Restore Guide'
  • 'Backup Services Application Programmer's Interface'
  • 'INFORMIX-OnLine Dynamic Server, Backup and Restore Guide'
  • 'System Management: Backup Services API (XBSA)'
Personal tools