Scripts

This chapter presents the available scripts. All our scripts have a detailed synopsis please check the option “-h” or “—help”.

O.S Start/Stop script integration until Red Hat/Oracle Linux 7

DMK provides a tiny script, which integrated to the boot procedure serves to start & stop all the mysql services smoothly, source code:

cat ${DMK_HOME}/templates/init.d/mysql.linux

#!/bin/bash
	#...
case "$1" in
'start')
 su - mysql -c "${DMK_HOME:-/u01/app/mysql/local/dmk}/bin/mysql.sh $*"
;;
'stop')
 su - mysql -c "${DMK_HOME:-/u01/app/mysql/local/dmk}/bin/mysql.sh $*"
;;
*)
 echo "usage $0 {start|stop}"
 exit 1
;;
esac

We added the restart feature in ours scripts : mariadb.sh and mysql.sh.

Below, all steps for the implementation & integration into the boot sequence:

  • Firstly, copy the script to the “/etc/init.d” and set the correct privileges

  • Secondly, integrate the new script to the boot sequence

All necessary metadata for the Run-Levels are available within the script.

  • Finally, Verify the integration

O.S Start/Stop script integration since Red Hat/Oracle Linux 7

DMK provides a tiny script, which integrated to the boot procedure serves to start & stop all the mysql services smoothly, source code:

Below, all steps for the implementation & integration into the boot sequence:

  • Firstly, copy the script to the /usr/lib/systemd/systemd” systemd source code repository and set the correct privileges

  • Secondly, reload systemd and enabled the new service

All necessary systemd link and dependencies are automatically performed by the O.S

  • Finally, verify the integration

  • Tail the systemd logfile

mariadb.sh and mysql.sh

This script serves to start, stop and restart either all databases simultaneously or a specific database.

Syntax :

Without MYSQL_SEVER parameter, it will manage all instances on the server.

dmk-run.sh

This script prints the status of MariaDB components. It’s commonly launched with the short aliases “sta”, “ser” or “u”.

Please check the respective platform script as the features differ (i.e. hiding stopped components)

Syntax

housekeeping.sh

dbi services offers an intelligent housekeeping script to perform several types of operations on log files which are valid and identical for Linux/Unix systems.

  • Archive & Truncate the Alert*.log or the dr*.log (Dataguard broker) log fileS

  • Truncate files

  • Delete files older than the threshold

  • Oracle ADRCI (Automatic Diagnostic Repository Command Interpreter) purge. This function is available for any installed oracle products which have a Diagnostic repository.

The implementation consists of

  • Copy the conf. template

  • Adapt the configuration file

This configuration file is composed of three sections:

  1. The Definition section, set default values for all operation types

  1. The Standard section, which is composed as follows

This above line stands for the mysql database error logs of all databases running on the machine.

  1. The Custom section

  • The last feature is the customization of each line by adding digits between the double colons at the end of the line, like the 100 days from above example

  • The option RMDIR remove empty directories which have not been modified since the specified threshold time (keyword section)

Syntax

mysql_dump_backup.ksh

This script allows to create rapidly compressed MariaDB dumps.

Syntax

Last updated