Tomi Eckert d428def0a2 feat(hanatool): Improve compressed tenant backup logic
Refactored the compressed tenant backup process to use a temporary directory within the specified TARGET_PATH, aligning its behavior with schema exports. This change avoids the use of the /tmp directory, which can be too small for large backups.

- Create a temporary directory in TARGET_PATH for the backup.
- Perform the tenant backup into this temporary directory.
- Compress the backup files to a .tar.gz archive in TARGET_PATH.
- Clean up the temporary backup directory after compression.
- Bumped hanatool.sh version to 1.5.2.
- Updated hanatool version in packages.conf to 1.5.2.
2025-10-08 19:26:39 +02:00
2025-09-09 11:25:24 +02:00

🚀 SAP HANA Automation Scripts

A collection of powerful Bash scripts designed to automate and simplify SAP HANA administration, monitoring, and management tasks.

Key Features

  • Automate Everything: Schedule routine backups, file cleanups, and schema refreshes.
  • Monitor Proactively: Keep an eye on system health, disk space, and backup status with automated alerts.
  • Simplify Management: Use powerful command-line tools and interactive menus for common tasks.
  • Secure: Integrates with SAP's secure user store (hdbuserstore) for credential management.
  • Get Notified: Receive completion and failure alerts via ntfy.sh.

⚙️ Quick Install

Get started in seconds. The interactive installer will guide you through selecting the tools you need.

bash -c "$(curl -sSL https://install.technopunk.space)"

🛠️ Tools Overview

The following scripts and suites are included. Suites are configured via a .conf file in their respective directories.

Tool Purpose & Core Function
cleaner 🧹 File Cleaner: Deletes files older than a specified retention period. Ideal for managing logs and temporary files.
hanatool 🗄️ HANA Management: A powerful CLI tool to export/import schemas, perform full tenant backups, and compress artifacts.
keymanager 🔑 Key Manager: An interactive menu to easily create, delete, and test hdbuserstore keys with an automatic rollback safety feature.
aurora 🌅 Schema Refresh Suite: Automates refreshing a non-production schema from a production source.
backup 💾 Backup Suite: A complete, cron-friendly solution for scheduling schema exports and/or full tenant backups with configurable compression.
monitor 📊 Monitoring Suite: Continuously checks HANA process status, disk usage, log segments, and backup age, sending alerts when thresholds are breached.

📖 Tool Details

1. cleaner.sh (File Cleaner) 🧹

  • Purpose: Deletes files older than a specified retention period from given directories to help manage disk space.

2. hanatool.sh (SAP HANA Schema & Tenant Management) 🗄️

  • Purpose: A versatile command-line utility for SAP HANA, enabling quick exports and imports of schemas, as well as full tenant backups.
  • Features:
    • Export/Import schemas (with optional renaming).
    • Perform full tenant backups.
    • Dry-run mode to preview commands.
    • ntfy.sh notifications for task completion/failure.
  • Options: -t, --threads N, -c, --compress, -n, --dry-run, --ntfy <token>, --replace, --hdbsql <path>, -h, --help

3. keymanager.sh (Secure User Store Key Manager) 🔑

  • Purpose: An interactive script to simplify the creation, deletion, and testing of SAP HANA hdbuserstore keys.
  • Features:
    • Interactive menu for easy key management.
    • Connection testing for existing keys.
    • Automatic rollback of a newly created key if its connection test fails.

4. aurora.sh (HANA Aurora Refresh Suite) 🌅

  • Purpose: Automates the refresh of a "copy" schema from a production source, ensuring non-production environments stay up-to-date.
  • Process:
    1. Drops the existing target schema (optional).
    2. Exports the source schema from production.
    3. Imports and renames the data to the target schema.
    4. Runs post-import configurations and grants privileges.

5. backup.sh (SAP HANA Automated Backup Suite) 💾

  • Purpose: Provides automated, scheduled backups for SAP HANA databases.
  • Features:
    • Supports schema exports, full tenant data backups, or both.
    • Configurable compression to save disk space.
    • Uses secure hdbuserstore keys for connections.

6. monitor.sh (SAP HANA Monitoring Suite) 📊

  • Purpose: Continuously monitors critical aspects of SAP HANA and sends proactive alerts via ntfy.sh when predefined thresholds are exceeded.
  • Checks Performed:
    • Verifies all HANA processes have a 'GREEN' status.
    • Monitors disk usage against a set threshold.
    • Analyzes log segment state.
    • Checks the age of the last successful data backup.
Description
QOL Scripts for work
Readme 408 KiB
Languages
Shell 99.8%
Batchfile 0.2%