## Setting up a Hot Standby System

### Use

You can only set up a hot standby system suitable for production use if you have installed the requisite cluster software and you have a storage solution approved for MaxDB. For more information, contact MaxDB Support.

The following example is based merely on the use of two compatible Windows computers. Its purpose is only to demonstrate what actions are necessary to set up a hot standby system for development and testing purposes. The system works with network shares from the Windows program that need to be manually modified for the log volume in the example simulation.

A hot standby system intended for production system use should only be set up by an experienced administrator who knows how to use cluster software.

To read the prerequisites, see Database Manager CLI,hss_enable, hss_addstandby, db_standby

See also:

Creating and Configuring a Database Instance

Concepts of the Database System, Hot Standby

### Scenario

You want to set up a hot standby system (consisting of the master instance and a standby instance) with the following properties:

Property | Example
Name of the hot standby system | HOTSTANDBY
Computer of the master instance | GENUA (local computer)
Computer of the standby instance | PARMA
Name of the virtual server | VIRTUAL_SERVER
Operating system user that is valid for the local computer and computer PARMA | User name ANNA, password MAY
Name of the library that is used to access the memory management system, (part of the memory software) | libhsscopy

Procedure

Steps that are only required for the example simulation on Microsoft Windows are shown in italics.

...

1. Call the Database Manager CLI, create the database instance HOTSTANDBY, define the first DBM operator with user name DBM and password DBM.

To simulate the example on Microsoft Windows, you must additionally specify the option –u so that the service for starting the database kernel runs under the name of the operating system user specified at the end of the DBM command, i.e. ANNA with password MAY.

>dbmcli db_create -u HOTSTANDBY DBM,DBM ANNA,MAY

OK

dbmcli on HOTSTANDBY>

2. Open a parameter session:

dbmcli on HOTSTANDBY>param_startsession

OK

dbmcli on HOTSTANDBY>

3. Initialize the database parameters and define the database type OLTP (default value).
dbmcli on HOTSTANDBY>param_init

OK

4. Change the database parameter RUNDIRECTORY to a path that does not contain any spaces:

dbmcli on HOTSTANDBY>param_put RUNDIRECTORY C:\test\wrk

OK

5. Check all database parameters:

dbmcli on HOTSTANDBY>param_checkall

OK

6. Confirm changes to the database parameter file:

dbmcli on HOTSTANDBY>param_commitsession

OK

7. Create data and log volumes

a. Create data volume No. 1 with name DISKD0001, type FILE, size 32768 pages:

dbmcli on HOTSTANDBY>param_addvolume 1 DATA DISKD0001 F 32768

OK

b. Create log volume No. 1 with name DISKL0001, type FILE, size 6400 pages

dbmcli on HOTSTANDBY>param_addvolume 1 LOG DISKL0001 F 6400

OK

8. Define the name of the virtual server:

This makes the database instance part of a hot standby system and simultaneously, according to the default value of the Database Manager, the master instance of the hot standby system:

dbmcli on HOTSTANDBY>hss_enable node=VIRTUAL_SERVER lib=libhsscopy

OK

9. Transfer the master instance to the ADMIN operational state:

dbmcli on DEMODB>db_admin

OK

10. Initialize the master instance and create the database system administrator with user name DBADMIN and password SECRET:

dbmcli on DEMODB>db_activate DBADMIN,SECRET

OK

11. Load the system tables:

dbmcli on DEMODB>load_systab

OK

0,OK: everything works fine

0,""c:\program files\sdb\maxdb1\bin\x_python" "c:\program files\sdb\maxdb1\env

\lsystab.py" -R "c:\program files\sdb\maxdb1" -d HOTSTANDBY -u dbadmin,*"

Removing obsolete objects

Installing Loader tables

...

...

==================================

Installation successfully finished

==================================

12. Modify the log volume path for the example simulation:

a. Transfer the master instance to the OFFLINE operational state:

dbmcli on HOTSTANDBY>db_offline

b. Set the path for the log volume commonly used by the master and standby instances:

dbmcli on HOTSTANDBY>param_addvolume 1 LOG \\GENUA\HSS_HOTSTANDBY\DISKLO001 F 6400

c. Transfer the master instance to the ONLINE operational state:

dbmcli on HOTSTANDBY>db_online

13. Add the standby instance:

dbmcli on HOTSTANDBY>hss_addstandby PARMA login=ANNA,MAY

OK

14. Transfer the standby instance to the STANDBY operational state:

dbmcli on HOTSTANDBY>db_standby node=PARMA

OK

Result

The hot standby system is set up.

The master instance is in the ONLINE operational state. The standby instance is in the STANDBY operational state.