SEP sesam Extension for Oracle
From SEPsesam
SEP sesam Extension for Oracle 8i/9i/10g/11g on Linux, Unix and Windows
(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
The SEP sesam online module for Oracle/RMAN provides a Media Management Library (MML) for saving data from Oracle databases to a Sesam server. The API of MML is specified by Oracle to give the Recovery Manager (RMAN) access to a backup application. SEP sesam will manage the whole backup media handling like loading the correct tapes, whereas RMAN decides which data has to be saved or recovered. This document provides information about the Sesam specific parts of Oracle backups. It’s not a Oracle/RMAN administration guide. Please read the documentation of RMAN to get familiar with Oracle’s backup and recovery concepts and tools.
System Requirements
- Oracle 8i/9i/10g/11g on Linux, AIX, Solaris and Windows
- SEPsesam v3.4 (incl. DB-Online-Module for Oracle 8/9/10/11)
- Standard Sesam Backup Client installed
- file system backups should work with this Sesam client
- for Oracle online backups, database has to run in Archive Log mode.
Please consult the Oracle administration guide. For installation we assume the following environment. Please adjust the pathes and variables according to your needs.
ORACLE SID=mydb ORACLE BASE=/opt/oracle ORACLE HOME=/opt/oracle/product/oracle $ORACLE HOME/bin is in the search path
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 oracle user
- Create a new directory sob in $ORACLE HOME
- Unpack the file <OS> sob x.x.x.x.tgz there
- Create a symbolic link in $ORACLE HOME/lib to the unpacked library file libobk.so. If file already exists, rename it first.
oracle@oraclesrv:~> cd $ORACLE_HOME oracle@oraclesrv:/product/oracle> mkdir sob oracle@oraclesrv:/product/oracle> cd sob oracle@oraclesrv:/product/oracle/sob> tar xvzf /tmp/linux_sob.2.3.1.1.tgz oracle@oraclesrv:/product/oracle/sob> cd ../lib oracle@oraclesrv:/product/oracle/lib> ln -s ../sob/libobk.so
Starting with Oracle 9i the Oracle kernel commonly must not be re-linked any more.
Installation verification on Linux or UNIX
The installation can now be checked by the Oracle tool sbttest
oracle@oraclesrv:~/product/10g/lib> sbttest test The sbt function pointers are loaded from libobk.so library. -- sbtinit succeeded -- sbtinit (2nd time) succeeded Note: This SBT library does not handle version 2.0 of SBT. sbtinit: Media manager is version 2.3.1.1 Return code -1 from sbtopen for output, bsercoer = 7012, bsercerrno = 0 sbtopen: Invalid argument(s)
Don’t get confused by the ”Invalid argument(s)”. The call only tests if the library could be loaded successfully.
Installation on Windows
- verify that the standard Sesam Backup Client is already installed
- rename an already existing file ”orasbt.dll” in <ORACLE HOME>\bin directory.
- copy the Sesam file ”orasbt.dll” there.
The database has to be restarted to activate the new DLL.
Complete function test by sbttest program
By using the Oracle program sbttest you can test complete functionality of libobk.so, without interfering with running databases. libobk.so is only available since Oracle version 10g under Windows. For this following environment variables have to be set:
- SESAM SERVER=<Name of SEPsesam server>
- SESAM JOB=<Jobname of Oracle backup> Name of an already configured task on Sesam server with task type Oracle
- SESAM POOL=<Media pool name> Name of a already configured media pool on Sesam server
oracle@oraclesrv:~/product/10g/lib> export SESAM_SERVER=backsrv oracle@oraclesrv:~/product/10g/lib> export SESAM_JOB=oracle_test oracle@oraclesrv:~/product/10g/lib> export SESAM_POOL=DISK oracle@oraclesrv:~/product/10g/lib> sbttest test1 -trace sbttest.log The sbt function pointers are loaded from libobk.so library. -- sbtinit succeeded -- sbtinit (2nd time) succeeded Note: This SBT library does not handle version 2.0 of SBT. sbtinit: Media manager is version 2.3.1.1 sbtopen for output successful sbtwrite successful, wrote 100 buffers sbtclose successful after sbtwrite sbtinfo successful file t1 is on volume 5:3 sbtopen for input successful file was created by this program; seed=27600, bufsize=16384, bufcount=100 sbtread successful, read 100 buffers sbtclose successful after sbtread sbtremove successful *** The SBT API test was successful ***
If the test fails, you will find the Sesam specific trace messages in sbttest.log.
Configuration
RMAN backup
This chapter only explains the SEPsesam specific parts of Oracle RMAN. It’s not a RMAN administration guide. It’s absolutely necessary to consult the Oracle RMAN documentation for setting up a correct backup strategy. The following example script performs a full database backup:
oracle@oraclesrv:/product/oracle/bin> cat ora_full.rman
connect target
run{
allocate channel t1 type ’SBT’
parms ’ENV=(SESAM_SERVER=backup,SESAM_JOB=oracle_full,SESAM_POOL=DISK)’
backup database
format ’O%d_%u.dat’
filesperset 100;
release channel t1;
}
The script is doing the following:
1. Login to target database (database to be saved)
2. Open a backup channel (For parallel backups more channels can be allocated)
- SEPsesam specific parameters
| SESAM SERVER | Name of the SEPsesam server (*) |
| SESAM JOB | Taskname for the Oracle backup (*). The task has to
created on sesam server before, with task type Oracle |
| SESAM POOL | Poolname (*) |
| SESAM DRIVE | Drive number |
| SESAM TAPE SERVER | Name of SEPsesam Tape Server |
| SOB TRACE | Tracelevel (max. 3) |
| SOB LOGFILE | name of logfile. If no logfile is specified trace massges
are written to sbtio.log |
- (*) = mandatory parameters
- format identifier. The format specifier must result in a unique id. Oracle and SEPsesam using this id to identify the correct saveset during restore. Oracle gurantees that the combination of %d%u is unique.
3. include 100 files in one saveset
4. Release the backup channel
When this script is executed with rman cmdfile ora full.rman, the following appears:
oracle@oraclesrv:\~/product/oracle/bin> rman cmdfile ora_full.rman Recovery Manager: Release 9.2.0.1.0 - ProductionCopyright (c) 1995 RMAN> connected to target database: MYDB (DBID=2383580887) RMAN> connected to recovery catalog database RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> allocated channel: t1 channel t1: sid=16 devtype=SBT_TAPE channel t1: MMS Version 1.7.0.1 Starting backup at 30-JUL-02 channel t1: starting full datafile backupset channel t1: specifying datafile(s) in backupset including current SPFILE in backupset including current controlfile in backupset input datafile fno=00001 name=/opt/oracle/oradata/mydb/system01.dbf input datafile fno=00002 name=/opt/oracle/oradata/mydb/undotbs01.dbf input datafile fno=00005 name=/opt/oracle/oradata/mydb/example01.dbf input datafile fno=00010 name=/opt/oracle/oradata/mydb/xdb01.dbf input datafile fno=00006 name=/opt/oracle/oradata/mydb/indx01.dbf input datafile fno=00009 name=/opt/oracle/oradata/mydb/users01.dbf input datafile fno=00003 name=/opt/oracle/oradata/mydb/cwmlite01.dbf input datafile fno=00004 name=/opt/oracle/oradata/mydb/drsys01.dbf input datafile fno=00007 name=/opt/oracle/oradata/mydb/odm01.dbf input datafile fno=00008 name=/opt/oracle/oradata/mydb/tools01.dbf channel t1: starting piece 1 at 30-JUL-02 channel t1: finished piece 1 at 30-JUL-02 piece handle=b_7_1_MYDB.dat comment=API Version 1.1,MMS Version 1.7.0.1 channel t1: backup set complete, elapsed time: 00:07:47 Finished backup at 30-JUL-02 RMAN> Recovery Manager complete.
SEP sbc Oracle client Extension
The archive <OS> sob 3.0.x.x.tgz file contains the SEP module sbc Oracle client. This module is a shell script, which may be called from SEP sesam as a SEP sesam Command Event. Please take a look into SEPsesam Administration documentation for further information abaout Sesam command events. This wrapper script creates a RMAN script with the given arguments and executes RMAN with the generated script.
oracle@orax10:~/product/10.2/db_1/sob> ./sbc_oracle_rman.sh
Usage: ./sbc_oracle_rman.sh -b|r <-l level> -T <TargetDBS> -R <Catalog> -S <SesamServer> \
-j <SesamJob> -m <Mediapool> -o <option> -p <Number of streams> <TableSpace>
Arguments:
-b: Backup operation. By default, this is a full, online, single channel backup
-r: Restore operation. By default, this is a full online, single channel restore.
HINTS:
Before restore database must be set in required state,
e.g. "SHUTDOWN; STARTUP MOUNT;"
After restore an "ALTER DATABASE OPEN RESETLOGS;" may be necessary.
-l <copy|full|diff|incr|arch>: Backup level copy, full, diff, incr and Archivelog
Backup level may be combined with archivelog backup,
e.g. -l copy_arch
-o {option}: The following options are supported:
delete Delete archivelogs after backup
delete_later Delete archivelogs when successfully backed up 3 times
offline WARNING: This option will automatically SHUTDOWN
database before and STARTUP after backup!
controlfile Restore controlfile with rman catalog
controlfile_DBID={DBID} Restore controlfile without rman catalog. Needs DBID
recover Recover after restore
until={YYYYMMDD-HH:MM:SS} Point-in-time recover with until time
-T <Target database connect string>: Default: ORACLE_SID
-R <Recovery catalog connect string>: Default: NoCatalog
-C <SesamServer>: Sesam Server host name
-S <TapeServer>: Tape Server host name
-j <SesamJob>: Sesam Job name, under which backup is running
-v [0|1]: debug on (set -x)
-m <pool name>: Sesam media pool to use for backup
-p <number> defines the number of backup channels
<TableSpace> defines a single tablespace to backup or restore.
If not given, backup/restore whole database
Further Links/Literature
For further reading on the topic we recommend the following books:
- Download SEP sesam Extension for Oracle
- SEP Oracle Whitepaper
- SEP sesam Oracle Administration Guide (PDF)
- Oracle8i Backup & Recovery
by Rama Velpuri, Anand Adkoli, George Williams 1st Edition, November 2000 Osborne - McGraw-Hill, ISBN: 0072127171 - Oracle9i RMAN Backup & Recovery
by Robert G. Freeman, Matthew Hart Configure and Use Oracle Recovery Manager Tutorial for Users, Intermediate and Advanced Level Osborne - McGraw-Hill, ISBN: 0-07-222662-5
