The application component of WhereScape's Setup Administrator attempts to list, upgrade or perform an initial install of a third-party supplied data warehouse application.

  1. Click the  Application  tab in the left pane and then click:
    • Application Load - Refer to Loading an Application to load the metadata, tables procedures, scripts etc. provided as part of the application.
    • Change Application Directory - Refer to Changing the Application Directory to change the directory of applications to be installed.
    • List applications in Repository - Refer to Listing Applications to list all applications that have been applied to the chosen metadata repository.

Loading an Application

  1. In  WhereScape's Setup Administrator, click the  Application  tab and then click  Application Load  .


Loading an application inserts various objects into the chosen metadata repository. An application is best defined as a set of objects that are shipped to allow inclusion of those objects into a remote repository.

Note

An application can only be loaded into a metadata repository running on the same database type as the application creator. (e.g. An Oracle application cannot be loaded into a SQL Server metadata repository).

During the load of an application a number of cross environment mappings need to be resolved. These are:


Connections

Connections are normally unique for each metadata repository. They provide the path to the source data and this nearly always varies. Even though an application can ship a set of connections, these connections will nearly always need modification. Alternatively, a connection shipped with an application may map to an existing connection, and this can be done as part of the load process. If you are unsure whether or not a connection is required, it can be added and later modified.


Tablespaces (Filegroups in SQL Server and Databases in Teradata)

If an application ships table or index objects, then these objects will typically have a tablespace (filegroup in SQL Server and database in Teradata) associated with them. During the load, it is necessary to map these tablespaces (filegroups in SQL Server and databases in Teradata) to those available for the metadata repository.


Object Changes

The application may ship objects that already exist in the metadata. In such a case, the process during the load is to create a version of the existing object and then replace it with the new object. At the start of the load, a check is made to see if any objects will be replaced. If the application is a patch or an upgrade of an existing application version, then this will be normal. The load can be stopped at this point to allow for further investigation.


Table Changes

If the load replaces table objects, it may in turn need to alter the physical table in the database to match the new definition. Again, if this is a patch or an application upgrade, this may be desirable. If not, the proposed actions should be reviewed before proceeding.


Procedure Changes

New procedures, scripts, or modifications may be loaded as part of the application load. In the case of procedures, the procedures need to be recompiled. The load can perform this action, but any failures or issues needs to be resolved after the load has been completed.
The following section covers the actual application load process.

Notes

  • It is always a good idea to backup the WhereScape RED metadata before running an application load. Refer to  Backing Up the Metadata before Loading Applications  for details.
  • Some database operations, such as converting existing non-partitioned tables to partitioned tables, cannot be done using a deployment application. In such cases, some manual intervention may be required to update the target databases to match the new metadata.

Backing Up the Metadata before Loading Applications

It is always a good idea to backup the WhereScape RED metadata before running an application load.
A metadata backup can be used to restore the metadata to the state before the application was loaded.
There are three options for backing up the metadata:

  1. In RED, use the  Backup > Unload the metadata to disk  option to unload the metadata to a WhereScape Proprietary backup. Refer to  Unloading Metadata  in the  WhereScape   RED User Guide  for more information.
  2. In RED, use the  Backup > Export the metadata  option to backup the metadata, using the data warehouse database's backup utility. Refer to  Backup using DB Routines  in the  WhereScape   RED User Guide  for more information.
  3. In RED, use the  Tools > Build application tables  option to build an application of the objects being replaced. This is achieved by selecting the new application files you're about to load in the  Previous application  box of the Define and build an application distribution window. Refer to  Application Creation  in the  WhereScape RED User Guide  for more information.

    Note

    If the table changes in the application are being applied to the data warehouse database, then it is also a good idea to backup the data warehouse tables being changed.

Application Load Process

An application consists of multiple files that are loaded from a directory. The default directory is the WhereScape program directory. Another directory may be specified by clicking the  Change Application Directory  button. The last selected application directory is the default directory for the next application load.
Once the directory has been selected, the application load is started by clicking the  Application Load  button. This displays the available applications in the right pane.

Note

If the Change Application Directory button was used, the list of available applications will already be displayed and the Application Load button doesn't need to be clicked.

An example application list follows:

  • To load an application, either right-click the Application from the list and select  Install Application  from the pop-up menu or double-click the Application. Ensure the Application being installed has the same database type as the Metadata Repository, otherwise installation will fail.
  • Once this menu option is chosen, enter the ODBC data source and logon to the meta repository and click  OK.

    Notes

    Applications created in 3D cannot be loaded into the latest version of RED if they were created in WhereScape 3D before version 2.8.0.0. To complete the application load process; export the XML file from the latest version of 3D OR complete the application load process in a version of RED earlier than 6.8.6.3.


                    1. Teradata Applications
  • When loading an application into Teradata, the TDPID will be tested. If the TDPID test fails at this stage, a dialog will appear asking you to enter the correct TDPID. Click Test and Use after entering the TDPID and relevant credentials. If you skip the test and provide an invalid TDPID, native loads will not work in WhereScape RED. Teradata native loads use bteq which connects natively to the database using its own internal protocols without using the ODBC driver. Therefore, ODBC settings are not relevant in this process and a valid Teradata TDPID is required to load application procedure and scripts successfully using native load.
  • After the TDPID check, an additional dialog is displayed for selecting the metadata repository database. Select the database and click OK.  


                    2. Oracle applications

When loading an application into Oracle, the TNS Name will be tested. If the TNS Name test fails at this stage, a dialog will appear asking you to enter the correct TNS Name.
Click Test and Use after entering the TNS Name. If you skip the test and provide an invalid TNS Name, native loads will not work in WhereScape RED.

A list of all the objects in the application is displayed in the right pane. Each object is identified as either new to the metadata, or as a replacement for an existing object. For example:

A window appears after the list has been displayed, advising of what is to occur. You may cancel the application load at this point and review the objects to be replaced. The load can then be continued by using the right-click menu option when positioned over any object.
Click OK to proceed with the application load. A new window appears providing options for the application load:

If you click  OK, the objects are inserted into the metadata.

Metadata Options


Application Files

Option

Description

Application Identifier

The application identifier is a four character code used to uniquely identify the application. This identifier is used in the naming of the files that are created to contain the application data.

Application Version

The version is a character string that provides a version number for reference purposes. This version number is displayed when applications are being loaded and is used in the naming of the files that are created to contain the application data. As such, it must contain characters that are valid in a Windows file name.

Application Database Type

The database type from which the application was built. An application can only be loaded into a metadata repository running on the same database type from which the application was created—(e.g. An application created from Oracle database cannot be loaded into a SQL Server metadata repository).

General Options

Option

Description

Use Native Load for Metadata Procedures and Scripts

This option causes the metadata for procedures and scripts to be loaded into the target metadata repository, using the target repository's load utility instead of ODBC. This can have significant performance advantages when loading large applications, when loading applications into a slow target database or over a slow network. The loaders used are:  SQL*Loader  for Oracle,  bcp  for SQL Server and  BTEQ  for Teradata data warehouses.

Map Tablespace/Filegroups to the same name

Every table in Oracle is located in a  tablespace. SQL Server tables may be in  filegroups. If this option is set, existing tablespaces and filegroups in the target data warehouse database will automatically be matched to their same ones on the source repository. If the tablespace/filegroup does not exist in the target data warehouse database, a Tablespace selection window pop-ups so a tablespace/filegroup can be selected. This window appears once for each tablespace/filegroup that cannot be matched.

Note

This option is not available for Teradata.


Apply Group/Project/Object Relationships

If this option is set to True, the project group relationships are updated in the target data warehouse database.

Generate load scripts and update routines for objects

If this option is set to True, the deployment will include the generation of load scripts and update routines for the table objects, but only if:

  • the code generation is template based.
  • a default load script and update routine template is set for the object type in the target connection
  • the default build options satisfy the requirements of the default template.

Refer to the Connection Properties and Rebuilding Update Procedures sections of the RED User Guide for details.

This option can be used by Data Vault customers who utilize WhereScape 3D to import table objects into RED via deployment applications.

This setting is enabled by default for 3D applications so that when the objects are loaded into RED during deployment, their initial update scripts or routines are also generated. This option defaults to 'OFF' during the deployment of applications generated by RED.

Enable auto generation of indexes

If this option is set to True, the deployment will also include the generation of indexes for the table objects after the update routines are generated.

Existing Parameters will be

Enables you to specify the action for existing parameters.The options are:

  • Updated/Overwritten
  • Retained
  • Renamed

User Name

Enables you to enter a username which is included in the versioning comments.

Permanent Stage Table Options Hidden

Enables you hide the Permanent Stage Table object options in the window.  Save Settings  must be used to save the option selection.This window does not refresh upon changing this option.

Connections

Option

Description

Map Connection References to the same name

During deployment, objects need to be associated with a Connection. Setting this option to False causes the user to be prompted to choose a Connection for each object. Setting this option to True causes the WhereScape RED Setup Administrator to compare the name of all existing connections within the Data Warehouse with the Connection name defined in the deployment application for the current object. If the names match, then the WhereScape RED Setup Administrator deploys the object to this Connection. If no Connection name matches, then the user is prompted to choose a Connection.

Map Target References to the same name

During deployment, objects need to be associated with a target within a Connection. Setting this option to False causes the user to be prompted to choose a Target for each object. Setting this option to True causes the WhereScape RED Setup Administrator to compare the name of all existing Targets within the Connection that has been either selected by the user or matched automatically.If the names match, then the WhereScape RED Setup Administrator deploys the object to this Target. If no Target name matches, then the user is prompted to choose a Target. Choosing a Target involves choosing a Connection—the WhereScape Setup Administrator automatically selects a Connection. If required, the WhereScape RED Setup Administrator selected Connection can be overridden using the GUI.

Add Connections as required

If this option is set to True, all Connection objects included in the application that do not exist in the Target metadata repository which are used by objects in the application will be added to the Target metadata repository.

Jobs

Option

Description

Assign Jobs to User

All jobs in the WhereScape RED scheduler belong to a user. If this option is marked as true, the user name specified in the  User name for any jobs added by the application  drop-down is set as the user name of all jobs loaded by the application. If the specified user name does not exist, it is then created.

Existing Jobs will be

Enables you to specify the action for existing jobs.The options are:

  • Updated/Overwritten
  • Retained
  • Renamed

Object Source Mapping Sets

This option is only available when applications are being deployed from 3D to RED.

Option

Description

Existing Source Mapping Sets will be

Existing Source Mappings Sets for an Object have three merge strategies:
Replaced:   Replaces the entire Source Mapping Set (Source Mappings can be removed in this mode)
Merged using Application:   Merges the Sets, resolving conflicts by deploying Source Mappings from this Application.
Merged using Repository : Merges the Sets, resolving conflicts by retaining Source Mappings in the Repository, in other words, only deploy new Source Mappings.

Data Warehouse Options

Option

Description

Apply Metadata Changes to Data Warehouse Objects

If this option is marked as True, the changes contained in the application are applied to the metadata according to the options selected for each object type.

Log Metadata DML and Data Warehouse DDL to a File

If this option is marked as True, the changes contained in the application are written to a file.

  • DDL File  - Option to enter or select the file name/path for the DDL file.
  • DDL File Statement Terminator  - Option to specify the statement terminator.
  • Terminate lines with carriage return as well as new line  - Option to terminate DDL file lines with a carriage return, as well as a new line.
  • Select encoding for DDL and Procedure files  - Option to specify the encoding to be used for the DDL and Procedure files—options are UNICODE, ASCII or UTF-8.

Compile New and Changed Procedures

If this option is marked as true, then all procedure objects loaded by the application load are compiled in the target data warehouse database.


Note

Depending on the type of database, invalid procedures may not compile.


Data Warehouse Table/View Options

For each table and view object loaded by the application load, it is possible to specify whether the metadata changes should be applied to the data warehouse table or view; and to the indexes on these objects. The change action can be specified by object type. New objects can have a different action to existing objects of the same type. Possible actions are:

  • Created  - available for new tables and indexes of any object type
  • Recreated  - available for existing tables and indexes of any object type
  • Altered  - available for existing tables and indexes of most object types (not available for load tables or views)
  • Nothing  - available for all new and existing object types and indexes.

The following additional settings can be configured when importing Load table objects from 3D to RED:

  • New Table Default Load Type, if not set in Source Connection
  • New Table Default Load Script Connection, if not set in Source Connection
  • New Table Default Load Script Template, if not set in Source Connection

    Note

    The above default settings are only applied for new Load table objects, if these attributes are not defined in the Source Connection. They only apply for new Load table objects and Connections from 3D.

This window also enables you to set whether or not new or existing objects are to be versioned. Set to  True  to use versioning, else set to  False.


Other options:

  • Alter allows columns to be dropped  - This option enables you to set whether or not columns are allowed to be dropped by object type, for tables being altered. Set to  True  to allow columns that are not in the metadata, to be dropped; else set to  False.
  • Allow alter table processing with non-compliant DDL  - This option is used for custom database targets and sets whether or not to allow DDL statements that do not use a substitutable format for the table name to be used during validation, and subsequent alter table processing. Default setting is  True. The DDL statements are set in the template that is defined in the custom database Connection properties (Connection > Target Settings > Default Table Create DDL Template) in RED. Refer to Connection Target Settings for Custom Database in the RED User Guide for details.

    Warning

    Setting this option to TRUE can lead to the DDL being run against the actual data warehouse table.

The above options applies to Stage, Permanent Stage, Dimension/Model, ODS, Normal, Fact and Aggregate tables.
Object action settings may be saved and reloaded later for another application using the  Save Settings  and  Load Settings  buttons. Supplied default settings may also be loaded by clicking the  Default Settings  button.
 
The Connection Build Window
The  Connection Build  window appears when the connection used by an imported table does not exist in the destination Data Warehouse.


The  Connection Build  window is displayed if the following criteria are met:

  • If the connection the table uses is included in the exported files, but the  Add Connections   as required  setting is disabled, the window is displayed with the  Add Connection  button. Clicking the  Add Connection  button adds the connection included in the exported files to the destination Data Warehouse.
  • If the connection the table uses is not included in the exported files, the window is displayed without the  Add Connection  button. The user is required to select an existing connection in the destination Data Warehouse.

Tip

If a new connection is added then it will need to be modified to match the database and user names of the new environment, on the relevant Connection Properties' dialog in WhereScape RED.

Loading Applications with Targets

When importing tables that contain Targets which do not exist in the destination Data Warehouse, users can select existing Targets from the list or add new ones, using the  Add Connection/Target  in the  Resolve Target  window, see the topic below for more information.

Adding Connections and Targets

On the  Add Connections and Targets  screen, click the  Add  button to add your desired connection.


Setup Administrator recognizes you are trying to import a table that references a specific connection type and that option will be selected by default in the  Connection Type  drop-down list. In the example below, Setup Administrator recognizes a tabular table imported from a Microsoft Analysis Services 2005+ connection and selects it.
Type in the connection details and then click  OK  to create the connection.


The Filegroup /Tablespace Selection window
Filegroups/Tablespaces may need to be manually remapped to the corresponding Filegroup/Tablespace available to the metadata repository.
A window is displayed for each Filegroup/Tablespace encountered that is not automatically mapped (refer to Filegroup/Tablespace options above).


The  New Filegroup  drop-down lists all filegroups visible to the repository.
A window appears when the application load has been completed. The full results should be reviewed by scrolling back, or you can right-click and click  Excel It  to send the results to Microsoft Excel.

Creating and Loading Applications from the Command Line

It is possible to create and load applications from the command line by running a batch file. The WhereScape RED Application directory contains an example batch file  WSL_Application_Create_Restore_Point_and_Load.bat for creating and loading.
If you right-click this file and select  Edit  you will see the steps outlined, as well as the details on the options available.
The first step  creates  a restore point application (R) based on objects about to be loaded. This process calls the command line functionality of RED and creates the application file.
The second step  loads  an application (A) into a test WhereScape RED repository. It uses an XML Options File to specify various options, calls the command line automation functionality of Setup Administrator and loads the application (A). Ensure that you have already created and properly defined the XML Options File. Refer to XML Options File for Application Loads for details.
The WhereScape RED Application directory contains example XML files:

  • WSL_Application_Load_SQL.xml for SQL Server
  • WSL_Application_Load_ORA.xml for Oracle
  • WSL_Application_Load_TER.xml for Teradata

The tags in the XML Options File need to be edited because the login/connection details, etc. need to be set. Refer to XML Options File for Application Loads for details.
The Batch Application Create options and the Batch Application Load options (described below) are listed at the end of the batch file. The values for these variables also needs to be customized before running this file.

The process typically involves the following steps:

  1. Create an application (A) in RED containing your data warehouse changes.
  2. RUN WSL_Application_Create_Restore_Point_and_Load.bat from the command line; which creates a restore point application (R) and applies application (A) to a test WhereScape RED repository.
  3. If the changes are incorrect, they can be undone by loading the restore point application (R).

Batch Application CREATE Options
The following options are available on RED to create applications.

Option

Description

/BA

Selects batch application create.

/U

ODBC user name.

/P

ODBC password.

/C

ODBC DSN name.

/A

DSN Architecture

/M

meta database for Teradata logon.

/N

RED User name.

/D

Directory to save application files.

/I

New application files identifier.

/V

New application files version.

/AP

Project name - all objects in a Project; and associated jobs.

/AG

Group name - all objects in a Group; and associated jobs.

/ALL

All objects - all objects, jobs and parameters.

/RC

Remove connections - drop all connections from the application.

/RJ

Remove jobs - drop all jobs from the application.

/RP

Remove parameters - drop all parameters from the application.

/AF

Absolute application id file name which restore point is being created for.

If using a trusted connection, the user name and password are not necessary.

Batch Application LOAD Options
The following options are available on Setup Administrator to load applications.

Option

Description

/AL

Select application load.

/AF

Absolute application ID file name.

/LF

Absolute log file name.

/PF

Absolute xml parameter file name.

/SO

Stay open - Setup Administrator does not close after the application has been created. Relevant for /AL LOAD option. Relevant for -QA, -QR, -WS, -QL and -QV application switch options. Not relevant for -QS switch option. For switch options, refer to   SQL Server Quick Application   for details.

Setup Administrator Process Exit Codes

When installing an application using the command line, the Setup Administrator process returns one value from a set of exit codes from its process when exiting.
After an application install, when the Setup Administrator process exits, users can check the exit codes to determine the cause for a possible problem with the application install.
The set of Setup Administrator exit codes are described below:

Exit Code Name

Exit Code

Description

AdmExitedNormally

0

The user clicked the main window's X button in the top right, the Exit item from the File menu, or the task that ran completed without error.

InternalError

1

An unexpected internal error occurred. The user should contact WhereScape support and supply any relevant log files.

CommandCancelled

2

The user clicked the cancel button from one of the presented dialog boxes, thus aborting the running task.

RequiredParameterMissing

3

One or more required parameters is missing, e.g. a name for the Scheduler, an ODBC DSN, a user name, a password.

OdbcError

4

An error was reported from the RDBMS that Setup Administrator was communicating with.

FileIoError

5

A specified file or directory was unable to be opened, read from or written to.

ServiceControlManagerError

6

An error was reported from the Windows Service Control Manager. Often, this is because Setup Administrator needs to be run "As Admin" when dealing with the SCM.

OracleCompilationError

7

An Oracle stored procedure has failed to compile.

MetaDataError

8

Metadata was or was not found in the specified RDBMS, or the metadata failed to upgrade, or the metadata is corrupt, or the metadata type mismatches, i.e. trying to import an Oracle application into Teradata metadata.

ItemsCheckedOut

9

In batch mode, if you want to overwrite checked out items, you must explicitly state so by setting the option to true in the settings.

NotLicensed

10

License does not permit objects of a specific type to be imported.

Users can test for these values, using a batch file and take action accordingly.
Below is an example batch file that can be used to check Setup Administrator's exit code.

Example batch file - SQL: 

@echo off
 
Adm.exe /AL /AF "app_con_SQLT_base_1.wst" /LF "ImportLog.txt" /PF 
"WSL_Application_Load_SQL.xml"
 
if errorlevel 8 goto MetaDataError 
if errorlevel 5 goto FileIoError 
if not errorlevel 0 goto ImportError
 
echo Successfully imported 
goto end


:MetaDataError 
sendmail -recipient admin@company.com -subject "Import failed" -body "Corrupt meta data found during application import. Re-install the Data Warehouse" 
goto end

:FileIoError sendmail -recipient admin@company.com -subject "Import failed" -body "ExportedDiagram.xml is missing, re-generate it then re-run this process" 
goto end

:ImportError sendmail -recipient admin@company.com -subject "Import failed" -body "Unable to import the application file ExportedDiagram.xml" 
goto end
 
:end

Example batch file - 3D: 

@echo off
Start /wait /D "C:\Program Files (x86)\WhereScape\Adm.exe" /AL /AF "ExportedDiagram.xml" /LF "C:\temp\test\ImportLog.txt"
if %errorlevel% equ 8 goto MetaDataError
if %errorlevel% equ 5 goto FileIoError
if not %errorlevel% equ 0 goto ImportError
echo Successfully imported
goto end

:MetaDataErrorsendmail -recipient admin@company.com -subject "Import failed" -body
"Corrupt meta data found during application import. Re-install the Data Warehouse"
goto end


:FileIoErrorsendmail -recipient admin@company.com -subject "Import failed" -body
"ExportedDiagram.xml is missing, re-generate it then re-run this process"
goto end


:ImportErrorsendmail -recipient admin@company.com -subject "Import failed" -body
"Unable to import the application file ExportedDiagram.xml"
goto end
 
:end

Changing the Application Directory

1. In WhereScape's Setup Administrator, click the  Application  tab and then click  Change Application Directory.

2. Browse and select a new application directory.

Listing Applications

1. In  WhereScape's Setup Administrator, click the  Application  tab in the left pane and then click  List applications in Repository.

2. The  List applications in Repository  menu option prompts for a logon to the required metadata repository. Applications are applied to a specific metadata repository.Once logged on a list of the applications that have been installed into that repository is shown. If no applications have been loaded, then the list is empty. An example output is as follows:

 


This example shows that the tutorial_2 application has been loaded into the metadata.

Testing Applications

A testing application set consists of a Procedure and an XML script and provides the ability to define a series of tests against data warehouse objects; either comparing them to an expected value or to the results of a query.
The XML script contains the test definitions. Each test is a new XML node in the XML script and contains a name, a test query, an expected value, or a comparison query.
The procedure simply runs the tests and determines whether the tests are passed or not. This is most likely to be run as a scheduled job within WhereScape RED.

XML Options File for Application Loads

If applications are being loaded using the command line, the saved application load options in the local registry can be outputted to an XML Options File for use in the application load. Refer to Creating and Loading Applications from the Command Line for details

  1. To create the options file, click  Create XML Options File  in the left pane.

    Tip

    You can also access the Create XML Options File from the Applications menu.


  2. If the load options have not yet been saved into the local registry, a message appears prompting you to select the application to be loaded and to save the load settings for that application.
      • Type in the location where you want to save the XML Options File in the  XML Options File Name  field.
      • Type in the details of the  XML Elements  that are added to the destination details of the XML Options File.

        Metadata Repository Type

        The RDBMS type of the metadata repository.

        DSN

        The value to be written in the <DSN/> element of the XML Options File.

        DSN architecture

        The value to be written in the <DSNArchitecture> element of the XML Options File.

        User ID

        The value to be written in the <UserID/> element of the XML Options File.

        Password

        The value to be written in the <Password/> element of the XML Options File.

         
  3. Click  Create File, the results confirm that the XML Options File has been created.

  • No labels