Archive:SEP sesam Extension for MySQL: Difference between revisions

From SEPsesam
Line 25: Line 25:
* Functioning SEP sesam filesystem backup
* Functioning SEP sesam filesystem backup


=Installation=
=Installation Sesam Client 3.4 =


== RPM ==
== RPM ==
Line 49: Line 49:
  tar xvzf sesam-mysql.tgz
  tar xvzf sesam-mysql.tgz
  cp /tmp/sesam-mysql/* /opt/sesam/bin/sesam/
  cp /tmp/sesam-mysql/* /opt/sesam/bin/sesam/
=Installation Sesam Client 3.6=
As with Sesam Client 3.6 the MySQL Extension is included in the Client
package, no further Extensions have to be installed!


=Backup Configuration=
=Backup Configuration=

Revision as of 17:42, 24 November 2009

SEP sesam Extension for MySQL

(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.


Introduction

The SEP sesam extension for MySQL allows an online backup of one or more MySQL databases at run time. This includes the backup and restore of one or all databases of a MySQL database server. For backup the MySQL backup program mysqldump and for restore the program mysql will be be used. Only the programs of the database manufacturer can guarantee that the data can backup in a consistent status.


ATTENTION

All database backup options in the documentation are neither parts nor components of SEP sesam. These are only recommendations and examples of how you can backup a MySQL database. There are many different fields of application for using a MySQL database. Therefore we can only show a few parameters to using during backup. Additional information of MySQL backup policies and strategies please see the MySQL documentation and the man pages of mysqldump und mysql.

Prerequisites

  • MySQL server version > 4.1 auf Linux (e.g. RHEL 4/5 und SLES 9/10)
  • SEP Sesam server version >= 3.4.1.X
  • Sesam client >= 3.4.1.51 on the MySQL database host
  • SEP sesam Extension for MySQL only, if the version of the installed Sesam client <3.6. The Sesam client >= version 3.6 already includes the MySQL extension. In this case the installation steps can be skipped.
  • Functioning SEP sesam filesystem backup

Installation Sesam Client 3.4

RPM

The RPM installation is the privileged installation method of the MySQL extension.

  • Please make sure that the Sesam client RPM is already installed
  • A path backup has to be possible with this client

Install or update the SEP sesam MySQL online extension by:

rpm -Uhv sesam_mysql-3.4.1-100.i386.rpm

Tarball

  • Be sure that the Sesam client is already installed
  • A path backup has to be possible with this client
  • Log in as user root
  • Unpack the Tarball to a temporary location (e.g. /tmp
  • Copy the MySQL components to binary directory of the Sesam client

Example:

cd /tmp
tar xvzf sesam-mysql.tgz
cp /tmp/sesam-mysql/* /opt/sesam/bin/sesam/

Installation Sesam Client 3.6

As with Sesam Client 3.6 the MySQL Extension is included in the Client package, no further Extensions have to be installed!

Backup Configuration

The configuration will be executed in the SEP sesam GUI.

  • Create a new backup task
  • Select MySQL as Backup type
  • Enter the MySQL database name in the field Source
  • On the page Options 1 you can define additional parameters for backup and restore. Details described in the section "Backup & Restore".


Info

It is recommend to set the user and password options of restore to the same values as the backup options. If necessary you can set the restore options in the Restore Wizard at the time of restore.

  • As Source you can enter the following values:
    • <DB_NAME>
      Backup of single database (e.g. my_db) Watched: the database name has to be entered case sensitive
    • DB:<DB_NAME>
      Backup of a single database (e.g. DB:my_db). The difference to the statement above in the backuped dump is that a CREATE DATABASE statement will be inserted
    • all
      Backup of all databases of the MySQL server
  • On the page Options 1 you can define additional parameters for backup and restore
    Here are some examples:

a) To set user and password to log on at the database:

-a user=<DBuser>,password=<Passwort_DBusers>


Info

The previous configuration of the username and password by entries in the sm.ini-file of the client is not necessary anymore. These settings will be executed in the Sesam GUI.

b) For a better throughput during backup of MySQL database type ISAM. Do not use this option for InnoDB:

-a opt

c) For a consistent backup of a MySQL database of type InnoDB:

-a single-transaction

d) You can combine different parameters into one statement:

-a user=<DBuser>,password=<Passwort_DBusers>,opt,single-transaction


ATTENTION
  1. Specify the mysqldump parameter without any double hyphen. Sesam translates the given parameter into the right format when calling the MySQL program.
  2. The option line behind the -a may not contain any blanks.

Restore Configuration

A restore will be started by calling the restore wizard. First, select the backup job, then the period of time and then select the desired backup job for restore. There are 2 options:

  • No recover after restore
    The restore stores the data as a Dump file in the Sesam Work directory (usually /var/opt/sesam/var/work of the Sesam client or in older versions in /opt/sesam/bin/sesam). The name of the file comprise of the prefix mysql-, the Saveset-ID and the suffix .tmp. This file can import into the database by MySQL command mysql.
 Example: mysql < /var/opt/sesam/var/work/mysql-SF20081128224529.tmp
  • Auto recover after restore
    The data will be stored directly into the database without caching in the filesystem.


ATTENTION

If you use the option Auto recover after restore the database has to exist already, if not the restore will fail. Also, set the option overwrite existing files to overwrite an existing database.

If the CREATE DATABASE Statement is not in the backuped data, the data can only be restored into the same database. It's not possible to change the restore target.

In the case of a restore to a different database only the option no recover after restore is possible. Then you can edit the Dump file in the filesystem manually and import it as described above.

Backup Configuration for special MySQL 5.0 Features (Stored Procedures, Triggers)

By default the SEP Sesam Software does not backup Stored Procedures or defined Triggers. However, there exists the Possibility to tell the Sesam Backup Client to also Backup the Stored Procedures and Triggers defined in a database.

This Works by Defining Additional Backup Options in the Task Definition

Backup Stored Procedures

The Following Example shows how to make the Sesam client also backup Stored Procedures. This Works by Setting the Option

-a routines

in the Additional Save Set Options field for a Backup task, like shown in this Screenshot:

Mysql stored procedures.jpg

Backup defined Triggers

Just like Stored Procedures, it is also possible to pass additional Options to the Sesam Backup client. This works with:

-a triggers

Like Shown in this Screenshot:

Mysql triggers.jpg

Of course it is also possible to define multiple statements, backing up both Stored Procedures and Triggers with:

-a routines -a triggers

Further Links/Literature