Unlock Faster DB Maintenance with dbm_lite and mysql_mgr_test Scripts
This article introduces two open‑source script collections—dbm_lite for Oracle database administration and mysql_mgr_test for rapid MySQL Group Replication deployment—detailing their features, supported platforms, usage instructions, and how to obtain them from GitHub.
dbm_lite – Oracle Database Maintenance Scripts
dbm_lite is a collection of shell scripts that embed SQL*Plus commands to perform routine Oracle database tasks without a graphical client. The repository is https://github.com/jeanron100/dbm_lite.
Supported environments
Oracle Database versions 10g, 11g, 12c (single‑instance; RAC not fully tested)
Unix‑like platforms: Linux, Solaris, AIX (no Windows testing)
Core capabilities
Basic database management (startup/shutdown, status checks)
Performance‑related utilities (statistics collection, AWR snapshots)
Data migration helpers (exp/imp wrappers)
SQL tuning assistance (explain plan, optimizer statistics)
Typical usage pattern
# Example: check database status
./db_status.sh
# Example: collect AWR snapshot
./awr_collect.sh -sid ORCL -snap 1
# Example: run a quick data copy
./data_migrate.sh -src user1/pwd@srcdb -dst user2/pwd@tgtdbAll scripts are plain sh files that invoke sqlplus with embedded SQL. Users can extend the collection by adding new scripts following the same pattern.
mysql_mgr_test – Fast MySQL Group Replication Test Cluster
The mysql_mgr_test repository (https://github.com/jeanron100/mysql_mgr_test) provides a set of shell scripts that create a MySQL Group Replication (MGR) test environment on a single host in roughly one minute.
Prerequisites
MySQL binary distribution (e.g., 5.7.19) extracted to a directory such as /usr/local/mysql without running the installer.
Editable /etc/hosts entry mapping the test IP to a hostname (e.g., 10.127.1.18 mysqltestdb).
A configuration file auto.cnf that defines the base directory and data directory:
export base_dir=/usr/local/mysql
export base_data_dir=/home/dataNode list definition
Create a plain‑text file (e.g., node_list.txt) where each line contains four fields separated by whitespace:
Client port (used by applications)
Node alias (arbitrary short name)
Internal port (used for MGR communication)
Role flag – Y for read‑write (primary) node, N for read‑only replica
Example for a single‑primary, four‑replica setup:
24801 s1 24901 Y
24802 s2 24902 N
24803 s3 24903 N
24804 s4 24904 N
24805 s5 24905 NFor a multi‑primary configuration set the role flag to Y for every node.
Cluster initialization
Run the initialization script without arguments:
sh init.shThe script creates the data directories, initializes each MySQL instance, configures Group Replication, and starts the nodes. This step is the most time‑consuming part of the process.
Node management helpers
check_node.sh <alias>– prints the node’s status (running, replication state, error log). start_node.sh <alias> – starts the MySQL instance for the given alias. stop_node.sh <alias> – stops the instance. reset_node.sh <alias> – removes the node from the group and re‑adds it (useful after a crash). conn_node.sh <alias> – opens a mysql client session connected to the specified node.
Example to verify that node s2 is online:
sh check_node.sh s2Feedback
Issues and questions can be submitted via the GitHub issue tracker of each repository.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
dbaplus Community
Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
