diff --git a/hanatool.sh b/hanatool.sh index 046fb8e..ceb4c02 100644 --- a/hanatool.sh +++ b/hanatool.sh @@ -3,7 +3,7 @@ # ============================================================================== # SAP HANA Schema Management Tool (hanatool.sh) # -# A command-line utility to quickly export, restore, or import-and-rename +# A command-line utility to quickly export, restore, or restore-and-rename # a SAP HANA schema. # ============================================================================== @@ -17,17 +17,17 @@ usage() { echo "SAP HANA Schema Management Tool" echo "" echo "Usage: $0 [USER_KEY] [ACTION] [SCHEMA_NAME] [PATH] [OPTIONS]" - echo " $0 [USER_KEY] import-rename [SCHEMA_NAME] [NEW_SCHEMA_NAME] [PATH] [OPTIONS]" + echo " $0 [USER_KEY] restore-rename [SCHEMA_NAME] [NEW_SCHEMA_NAME] [PATH] [OPTIONS]" echo "" echo "Actions:" echo " export Export a schema to a specified path." echo " restore Restore a schema from a specified path." - echo " import-rename Restore a schema from a path to a new schema name." + echo " restore-rename Restore a schema from a path to a new schema name." echo "" echo "Arguments:" echo " USER_KEY The user key from hdbuserstore for DB connection." echo " SCHEMA_NAME The name of the source schema." - echo " NEW_SCHEMA_NAME (Required for import-rename only) The target schema name." + echo " NEW_SCHEMA_NAME (Required for restore-rename only) The target schema name." echo " PATH The file system path for the export/import data." echo "" echo "Options:" @@ -44,7 +44,7 @@ usage() { echo " $0 MYKEY restore MYSCHEMA /hana/backups/MYSCHEMA_20240101.tar.gz -c" echo "" echo " # Import MYSCHEMA as MYSCHEMA_TEST using a custom hdbsql path" - echo " $0 MYKEY import-rename MYSCHEMA MYSCHEMA_TEST /hana/backups/temp_export --hdbsql /sap/custom/hdbsql" + echo " $0 MYKEY restore-rename MYSCHEMA MYSCHEMA_TEST /hana/backups/temp_export --hdbsql /sap/custom/hdbsql" } # --- Argument Parsing --- @@ -153,7 +153,7 @@ case "$ACTION" in fi ;; - restore|import-rename) + restore|restore-rename) if [[ "$ACTION" == "restore" ]]; then SOURCE_PATH="$4" NEW_SCHEMA_NAME="" @@ -162,11 +162,11 @@ case "$ACTION" in usage exit 1 fi - else # import-rename + else # restore-rename NEW_SCHEMA_NAME="$4" SOURCE_PATH="$5" if [[ -z "$USER_KEY" || -z "$SCHEMA_NAME" || -z "$NEW_SCHEMA_NAME" || -z "$SOURCE_PATH" ]]; then - echo "❌ Error: Missing arguments for 'import-rename' action." + echo "❌ Error: Missing arguments for 'restore-rename' action." usage exit 1 fi @@ -205,7 +205,7 @@ case "$ACTION" in fi QUERY_RENAME_PART="" - if [[ "$ACTION" == "import-rename" ]]; then + if [[ "$ACTION" == "restore-rename" ]]; then QUERY_RENAME_PART="WITH RENAME SCHEMA \"${SCHEMA_NAME}\" TO \"${NEW_SCHEMA_NAME}\"" fi diff --git a/packages.conf b/packages.conf index c8dc5b1..8bfbb69 100644 --- a/packages.conf +++ b/packages.conf @@ -11,6 +11,6 @@ SCRIPT_PACKAGES["Aurora Suite"]="1.1.0|https://git.technopunk.space/tomi/Scripts SCRIPT_PACKAGES["Backup Suite"]="1.0.0|https://git.technopunk.space/tomi/Scripts/raw/branch/main/backup/backup.sh https://git.technopunk.space/tomi/Scripts/raw/branch/main/backup/backup.conf" SCRIPT_PACKAGES["Key Manager"]="1.2.1|https://git.technopunk.space/tomi/Scripts/raw/branch/main/hdb_keymanager.sh" SCRIPT_PACKAGES["File Cleaner"]="1.1.0|https://git.technopunk.space/tomi/Scripts/raw/branch/main/clean.sh" -SCRIPT_PACKAGES["HANA Tool"]="1.0.0|https://git.technopunk.space/tomi/Scripts/raw/branch/main/hanatool.sh" +SCRIPT_PACKAGES["HANA Tool"]="1.0.4|https://git.technopunk.space/tomi/Scripts/raw/branch/main/hanatool.sh" # Example: Add a new script with its version. # SCRIPT_PACKAGES["My Other Script"]="1.0.0|https://path/to/my-other-script.sh"