Skip to main content
Version: 3.5.0 (Development)

Metadata Install Tool (Batch File)

The ExMeX Core Framework Metadata Install tool (Bat-Install) is a batch-file to install the ExMeX Metadata into the ExMeX Framework Core database. It can be used as an alternative to the 'Metadata Delete And Insert CMD.sql' script, which is executable only in SQL Server Management Studio (SSMS), and run in the command line (cmd.exe).

Main Features

  • Section as argument - Choose section for installing ExMeX Metadata
  • ExMeX Framework Core database as argument - Choose to which ExMeX Framework Core database Metadata will be installed
  • ServerInstance as argument - Choose your Server and Instance Name
  • Port as argument - Choose your Port
  • Error detection and report
  • Exit on in case of an error

The Bat-Install is designed to help data modelers and DevOps teams develop and test metadata installations and compile modules without errors.

Backup ExMeX Core Framework

Before installing metadata in the ExMeX Core Framework database with this tool, back up your database. Skipping this step is at your discretion.

Configuration

If the tool is not available in library/tool/Metadata Install you can download it from the ExMeX - Toolbox

Follow these steps to optimize the tool's functionality:

  1. Go to library/tool/Metadata Install in your root directory.
  2. If it does not exist, create a Metadata Install directory and unzip the previous download archive here.
  3. Rename ./library/tool/Metadata Install/Metadata Install.2.x.x.orig.bat to Metadata Install.bat in your root directory.
  4. Edit Metadata Install.bat and adjust the default settings as needed.

Settings can also be customized with arguments, except for login and password as follows:

Configuration Variables

ExMeX framework settings:

  • ExMeXGlobalEnv=library/env/GlobalVariable.sql
  • ExMeXRootPath=<YourRootDirectory> (example: Y:\ExMeX-Framework-Core)
  • ExMeXMetadataPath=<YourMetadataDirectory> (example: Y:\ExMeX-Framework-Core\var)
  • ExMeXTargetEnv=<YourEnvFile> (example: SetEnvDevelopment.sql)
  • ExMeXConfigPath=<YourConfigDirectory> (example: Y:\ExMeX-Framework-Core\etc\config)
  • ExMeXConfigFile=<YourConfigFile> (example: MetadataDataModels.config)

Database Configuration:

  • Database: set Database=<YourMetadataDatabase> (example: TEDAMOH-ExMeX-Release-Feature)
  • Server and Instance: set ServerInstance=<YourServer\YourInstance> (example: 10.8.0.1)
  • Port: set ServerPort=<YourServerPort> (example: 1401)
  • Credentials (if not using Windows Authentication):
    • set DatabaseUser=<YourLogin>
    • set DatabasePassword=<YourPassword>

Example with Custom Server, Database Instance and Port

Use the settings below as needed:

set ExMeXGlobalEnv=library\env\GlobalVariable.sql
set ExMeXRootPath=Y:\ExMeX-Framework-Core
set ExMeXMetadataPath=Y:\ExMeX-Framework-Core\var
set ExMeXTargetEnv=SetEnvDevelopment.sql
set ExMeXConfigPath=Y:\ExMeX-Framework-Core\etc\config
set ExMeXConfigFile=MetadataDataModels.config
set Database=Tutorial-ExMeX-Metadata
set ServerInstance=10.8.0.1\TutorialInstance
set ServerPort=1401
set DatabaseUser=Dirk
set DatabasePassword=YourEncryptedPassword

Sections Configuration

For large installations, it is possible to divide data models into sections for easier handling:

  1. Copy MetadataDataModels.orig.config to ./etc/config/MetadataDataModels.config.
  2. Adjust sections as needed.

Each section should have a unique name within square brackets (e.g., [All]). Models should be ordered based on dependencies, starting with the least dependent model.

#
# section, which installs all data models for the tutorial
#
[Tutorial]
Tutorial-SourceSystem-A
Tutorial-DWH-StageLayer
Tutorial-DWH-CoreLayer

Using the ExMeX Tool Metadata Install

Open a command line (cmd.exe), navigate to the root directory (./), and execute:

MetadataInstall.bat <section>

Deployment and Syntax

The Bat-Install is compatible with CI/CD deployments. Use --help for command syntax:

Syntax

You can use argument --help to get an overview of all available arguments:

Usage MetadataInstall: [--version] [--help]
[--target-env-file=<name>]
[--exmex-root-path=<path>] [--exmex-metadata-path=<path>]
[--exmex-config-path=<path>] [--exmex-config-file=<name>]
[--metadata-database=<name>] [--server=<server[\instance]>]
[--port=<number>] [--data-model=<name>]
[--metadata-bulk-del] [--no-metadata]
[--no-compile-lps] [--get-settings]
<section>

Remember, if the path contains spaces, then enclose the path in quotes <"path">.

See MetadataInstall.bat help <concept> to read about a specific concept.

Arguments

  • [--version] Displays the current version of MetadataInstall.bat (Current version: 2.7.0)
  • [--help] Displays usage and an overview of all arguments.
  • [--target-env-file=<name>] If set, the specified environment file will be applied
  • [--exmex-root-path=<path>] If set, the specified ExMeX root path will be used. Remember, if the path contains spaces, then enclose the path in quotes "path"!
  • [--exmex-metadata-path=<path>] If set, the specified metadata path will be used to install metadata from. Remember, if the path contains spaces, then enclose the path in quotes "path"!
  • [--exmex-config-path=<path>] If set, the specified ExMeX config path will be used. Remember, if the path contains spaces, then enclose the path in quotes "path"!
  • [--exmex-config-file=<name>] If set, the specified config file will be applied
  • [--metadata-database=<name>] If set, the specified metadata database will be used to install metadata as target
  • [--server=<server[\instance]>] If set, server and/or instance will be used to connect to server
  • [--port=<number>] If set, port will be used to connect to server
  • [--data-model=<name>] If set, the specified single metadata data model will be deleted and installed. Be careful with dependencies like mappings or replica-mappings! The data model must be part of the given section.
  • [--metadata-bulk-del] If set, all metadata database in section will be deleted at once (bulk delete)
  • [--no-metadata] If used, no metadata will be deleted or installed
  • [--no-compile-lps] If used, no modules will be compiled
  • [--get-settings] If used, current settings in MetadataInstall.bat or applied arguments are displayed
  • <section> The section to be installed of the applied config-file

Examples

Install with Default Settings

Only with section 'All' - default settings are used

MetadataInstall.bat All

Different Server, Instance, and Port

Section 'All' with arguments for a different server\instance, port, and database

MetadataInstall.bat --metadata-database=Tutorial-ExMeX-Metadata --server=10.8.0.1\MSSQLSERVER --port=1401 All

Install Metadata Only (No Modules Compilation) with Bulk Delete

Section 'All' with argument to not compile modules. In this example only metadata is installed but no modules are compiled.

MetadataInstall.bat --no-compile-lps --metadata-bulk-del All

Compile Modules Only (No Metadata Installation)

Section 'All' with argument for no metadata installation. In this example no metadata is installed but modules are compiled.

MetadataInstall.bat --no-metadata All

Custom Environment File

Section 'All' with a different target environment file. In this example a different file for the target environment is used.

MetadataInstall.bat --target-env-file=SetEnvTest.sql All

Install Single Data Model

Install only a specific data model from a section

MetadataInstall.bat --data-model=Tutorial-Core All

Display Current Settings

Show the current configuration without executing installation

MetadataInstall.bat --get-settings

Error Handling and Logging

The tool provides comprehensive error detection and logging:

  • Log Files: Created in the temporary directory tmp\<Database>\

    • output.<SECTION>.Metadata.log - Main metadata installation log
    • output.<SECTION>.Module.log - Module compilation log
    • delete.<SECTION>.log - Deletion operations log
    • insert.<SECTION>.log - Insert operations log
  • Error Detection: The tool automatically checks for common SQL Server error patterns and stops execution if critical errors are found

  • Exit Codes: The batch file returns appropriate exit codes for CI/CD pipeline integration

Version History

Version 2.7.0 (Latest)

  • Added: Error and Logfile metadata installation
  • Added: Uniquefy log files for batch installation

Version 2.6.0

  • Added: Export Replica Mapping Information
  • Added: Batch installation with unique log files

Prerequisites

  • SQL Server with accessible instance
  • Valid credentials (Windows Authentication or SQL Server Authentication)
  • Proper file system permissions for log file creation
  • ExMeX Framework Core database setup

Troubleshooting

  1. Path Issues: Ensure all paths are correctly configured and accessible
  2. Permission Issues: Verify the user has appropriate database and file system permissions
  3. Log Analysis: Check the generated log files for detailed error information
  4. Configuration: Use --get-settings to verify current configuration

For detailed error analysis, search for keywords like "Msg", "Meldung", "ERROR:", or "WARNING:" in the respective log files.