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 are
- 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 downloading it from the ExMeX - Toolbox
Follow these steps to optimize the tool’s functionality:
- Got to
library/tool/Metadata Installin your root directory. - If it does not exist, create a
Metadata Installdirectory and unzip the previous download archive here. - Rename
./library/tool/Metadata Install/Metadata Install.2.x.x.orig.battoMetadata Install.batin your root directory. - Edit
Metadata Install.batand 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.sqlExMeXRootPath=<YourRootDirectory>(example:/GitRepos/ExMeX-Framework-Core)ExMeXMetadataPath=<YourMetadataDirectory>ExMeXTargetEnv=<YourEnvFile>ExMeXConfigPath=<YourConfigDirectory>ExMeXConfigFile=<YourConfigFile>
-
Database Configuration:
- Database:
set Database=<YourMetadataDatabase> - Server and Instance:
set ServerInstance=<YourServer\YourInstance> - Port:
set ServerPort=<YourServerPort> - Credentials (if not using Windows Authentication):
set DatabaseUser=<YourLogin>set DatabasePassword=<YourPassword>
- Database:
Example with custom server, database instance and port
Use the settings below as needed:
set ExMeXGlobalEnv=library\env\GlobalVariable.sql
set ExMeXRootPath=C:\GitRepos\Tutorial ExMeX Framework Core
set ExMeXMetadataPath=C:\GitRepos\Tutorial ExMeX Framework Core\var
set ExMeXTargetEnv=SetEnvDevelopment.sql
set Database=Tutorial-ExMeX-Metadata
set ServerInstance=10.8.0.1\TutorialInstance
set ServerPort=1431
Sections configuration
For large installations, it is possible to divide data models into sections for easier handling:
- Copy
MetadataDataModels.orig.configto./etc/config/MetadataDataModels.config. - 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:
MetadataInstall [--version] [--help]
Arguments include --target-env-file, --exmex-root-path, --server, and more for flexibility. Examples:
Syntax
You can use argument --help to get an overview of all available arguments:
Usage MetadataInstall: [--version] [--help [-w|--web]]
[--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[--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-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[--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"![--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 with 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 metadate 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