## Automatic Log Backup After Event LOGABOVELIMIT

### Use

You can use the event mechanism of the database system to monitor the fill level of the log area of the database instance.

Using the Database Manager CLI, first you activate the event LOGABOVELIMIT, so that it can be triggered by the database system when the fill level you define is exceeded. You configure the event dispatcher so that it switches automatic log backup on when the event LOGABOVELIMIT is triggered. To do this, you have to enter a definition for this event in the configuration file of the event dispatcher.

If you use placeholders in this event definition, you can use this event dispatcher configuration file for any database instance, database computer or user. When you start the event dispatcher with a configuration file defined this way, the placeholders in the configuration file are filled with the data you specified in the start command of the event dispatcher.

To switch on automatic log backup, the system requires a backup template to use for backing up the log area.

To read the prerequisites, see Database Manager CLI, event_set

See also:

Defining Backup Templates

Concepts of the Database System, Automating Administration Tasks

Utilities, Event Dispatcher

### Scenario

If the fill level of the log area of the database instance DEMODB on the remote computer PARMA exceeds 80%, the database instance should trigger the event LOGABOVELIMIT. Then, in the Database Manager, an event dispatcher should execute the DBM command for switching on automatic log backup.

You create a configuration file for this event dispatcher locally in C:\test\testconfig.cfg and enter the corresponding event definition.

Then you start the event dispatcher on database computer PARMA.

You have the backup template DemoFileLog for log backup to a file.

### Procedure

...

1. Call the Database Manager CLI, log on as operator OLEG with password MONDAY, connect to the database instance DEMODB on computer PARMA,

activate the event LOGABOVELIMIT with the priority HIGH and a value at which the database instance is to trigger the event, 80 %:

>dbmcli -u OLEG,MONDAY -d DEMODB -n PARMA event_set LOGABOVELIMIT HIGH 80

OK

2. Enter the event definition in the configuration file testconfig.cfg in the local directory C:\test using placeholders:

>dbmevtdisp add C:\test\testconfig.cfg Name == LOGABOVELIMIT Priority == HIGH Value1 == 80 Command == "dbmcli -u $DBMUSERPW$ -d $DBNAME$ –n $SERVERNAME$ autolog_on DemoFileLog"

OK

0

3. Start the event dispatcher with the current logon data for the DBM operator name and the password, the name of the database instance and the database computer:

>dbmevtdisp start C:\test\testconfig.cfg –l C:\test\test.log –u OLEG,MONDAY –d DEMODB –n PARMA

Event Dispatcher instance 1 running

using configuration file C:\test\testconfig.cfg

event with name DISPINFO:DISPSTART not dispatched (count 0)

### Result

An event dispatcher with the name ID 1 (instance 1) has been started.

It uses the configuration file C:\test\testconfig.cfg. In the event definition, the values OLEG, MONDAY, DEMODB and PARMA are used instead of the placeholders $DBMUSERPW$, $DBNAME$ and $SERVERNAME$.

The event dispatcher monitors the database instance and logs event dispatcher actions in the log file C:\test\test.log.

The event dispatcher triggers the special event DISPINFO:DISPSTART every time it is started (system default). As you have not added an entry to the configuration file for this event, you receive the message not dispatched.

To stop the event dispatcher, you open a new command prompt and execute the command dbmevtdisp stop.

See also:

Utilities, Overview of Event Dispatcher Commands