Fine Tuning and Scaling Demantra

This chapter covers the following topics:

Overview

Typically you adjust parameters to control your solution's global behavior, including various defaults and performance settings. This chapter provides an overview of most of the parameters, grouped into specific areas.

Basic Parameters

For reference, Demantra stores basic configuration information in the following parameters. Unless otherwise noted, you should not change these parameters after going live:

Parameter Description
active_forecasts_versions Specifies how many forecast versions the Demantra database should store.
You can change this parameter after going live.
FIRSTDAYINWEEK First day of week to use when binning sales data into base time buckets, in a weekly system. It is not generally safe to change this parameter after going live.

Time Zone Support

Global companies often have planning organizations and planners in different time zones. For these customers, the data loaded and planning cycles could be offset by a few hours. When Demantra is deployed as a single global instance, this can create an issue where the last sales date tracked by the system is the most recent sales date, regardless of the location of the planners or organizations. This can lead to the following issues:

When you enable time zone support in Demantra, all data and worksheet calculations are aligned to a planner's current system date, which is important in global daily planning systems. This allows both worksheets and user initiated actions to respect user locality. Worksheets display the first forecast row based on the user's system date.

Enabling Time Zone Support

Time zone support is enabled in Demantra by setting the SetEarliestTimezone parameter. The max_sales_date parameter determines the last history date that is displayed on a worksheet. If SetEarliestTimezone is defined, then the specified time zone is used to convert MaxSalesDate to the local MaxSalesDate. When processing data for a specific region, batch jobs can be configured to use the appropriate MaxSalesDate. Worksheet Level methods pass the user's system time zone to the workflow to be used while running batch jobs.

Time Zone Support Parameters

The following parameters are used to configure time zones.

Parameter Location Description
HistoryLagBuckets init_params Specifies the number of days to move back the last date backup. The last_date_backup parameter determines the last history date that is used by the engine. If this parameter is defined the engine use the value of this parameter instead of the last_date_backup.
SetEarliestTimezone sys_params Specifies the earliest time zone where data will be loaded. This time zone is used convert MaxSalesDate to the local MaxSalesDate.
The value of this parameter is available in the workflow dictionary #Local_Timezone# for use in custom steps. If a workflow is invoked from a method, then the user's system time zone is passed to the workflow and ise used in conjunction with system timezone to support adjustments of process, shifting of dates, and so on.
     

Application Server

The APS queue uses the following parameters:

Parameter Description
QueryMechanisimTimeOut The timeout period for the query notification listener, in milliseconds.
StartUpdateQueue Specifies whether to start the manual update listener.
UpdateQueueTimeout The timeout period for the manual update listener, in milliseconds.

Demantra Local Application

The following parameters control the Demantra Local Application. Also see "Solution Branding" for parameters that control the Demantra Local Application titles.

General

The following parameters control the Demantra Local Application in general:

Parameter Description
collaborator.supportURL URL of the Support link, relative to http://server name/virtual directory/portal/. This link is in the upper right corner of the Demantra Local Application.
collaborator.searchURL URL of the Search link, relative to http://server name/virtual directory/portal/. This link is in the upper right corner of the Demantra Local Application.
dir.onlineHelp URL of the online help, relative to http://server name/virtual directory/portal/. This link is in the upper right corner of the Demantra Local Application.
navBarContentProvider.addNewContentLink.Text Text of the New link, which is shown at the top of the Contents menu.
Server.SessionExpiration This is the time interval (in seconds) between which the current page automatically refreshes itself. If an idle Demantra Local Application session has expired, the current page will not reflect this until the next refresh event, at which time it will automatically redirect itself to the expiration page.expires.

Also see "Customizing Demantra Web Pages".

My Tasks

The following parameter affects the My Tasks pane of Demantra Local Application:

Parameter Description
general.userList.tasks Specifies whether the My Tasks module displays the Create Task button:

Who's Online

The following parameters control the Who's Online pane of Demantra Local Application:

Parameter Description
general.userList.whoisonline Specifies whether the Who's Online module is displayed.
UserListContentProvider.commontitle The title of the Who's Online pane.
UserTitleContentProvider.TimeToSleep The time to wait polling user status for the Who's Online pane.

Content Panes

The following parameters control the default behavior of graph-type content panes:

Parameter Description
Graph.MaxLabelWidth Maximum width of labels in graph-type content panes in the Demantra Local Application. If a label is too longer, the last characters are represented by three periods (...).
Legend.MaxLegendItemWidth Maximum width (in characters) of the legend in a graph-type content pane in the Demantra Local Application. If any lines of the legend are too longer, the last characters of those lines are represented by three periods (...), as follows:

the picture is described in the document text

Query.MaxCombinations Maximum number of combinations that can be displayed in a graph-type content pane in the Demantra Local Application, when you display a single series plotted for multiple combinations. The user receives an error if a content pane contains more than this number of combinations.
Query.MaxSeries Maximum number of series that can be displayed in a graph-type content pane in the Demantra Local Application. The user receives an error if a content pane contains more than this number of series.
Query.TopBottom.MaxCombinations Maximum number of combinations that can be displayed in a content pane that contains a stacked bar chart or pie chart. The user receives an error if a content pane contains more than this number of combinations.

See also

"Email"

"Workflow"

"Worksheets"

Database

The following parameters control how Demantra connects to and uses the Demantra database.

For additional parameters that specify which database Demantra connects to, see the Oracle Demantra Installation Guide.

General Database Settings

Parameter Description
DBDateFormat Controls the date format used in the database.
LockTimeout Specifies the period (in seconds) between killing a database session and releasing the lock for that session.
Rebuild_Sales_Table Specifies whether the REBUILD_TABLES procedure should rebuild the sales_data table. Applies only to Oracle.

Database Connections

The following parameters control Oracle Demantra's database connections:

Parameter Description
AdditionalConnectionsExpression New for 7.0) Ignore this parameter for now.
DBConnectionTimeout The database connection timeout period.
DBIdleTimeOut The connection idle timeout period. Recommended: 300000 (5 minutes)
MaxDBConnections The maximum number of database connections for the Demantra database user.
Recommended: the number of concurrent users multiplied by 2.
MinDBConnections The minimum number of database connections for the Demantra database user.

Oracle Tablespaces

For Oracle databases, Demantra writes to multiple tablespaces, as specified during installation. The tablespace assignments are controlled by parameters, which you can edit through the Business Modeler. Make sure that these parameters refer to tablespaces within the appropriate database user, and make sure each has enough storage. Additional parameters control the default initial sizes and how much storage is added.

Parameter Description
initial_param Default initial size of system tablespaces.
next_param Incremental amount of storage that is added to a tablespace when more space is needed.
tablespace* Tablespace used for the sales table.
indexspace* Database index space that stores the forecast table indexes, as specified during installation.
simulationspace* Tablespace used for simulation data.
simulationindexspace* Tablespace used for simulation index data.
sales_data_engine_index_space* Tablespace used for the index of sales_data_engine.
sales_data_engine_space* Tablespace used for sales_data_engine table.

* You set these parameters during installation.

Oracle recommends that you use the standard names for these tablespaces, as documented in the Oracle Demantra Installation Guide. Then it is easier for you to share your database with Oracle Support Services in case of problems.

Demantra provides a database procedure that you can run at regular intervals that checks tables for missing primary keys, unoptimized ordering of null columns, and other conditions that may negatively impact database performance. You can set a threshold determining the minimum number of rows a table must have before it is checked. You can also set the frequency at which a reminder to run the thorough check will appear in the 'log_table_reorg' table after running the quick check. For each finding identified by the check, a corresponding message is logged in the 'log_table_reorg' table. The message specifies the table with the particular problem, In some cases a finding can be a recommendation to reorganize a table. For that you can run a sql script on the table that will reorganize and optimize it for better performance.

There are two types of database checks: 1) a quick check that normally runs in less than 20 seconds, and 2) a more thorough one that, depending on system data volume, can run up to several hours.

Both the quick check and the thorough checks can be launched manually using PLSQL by running the procedure TABLE_REORG.check_reorg, and specifying a parameter of 'T' to run the thorough check, or 'Q' to run the quick check. For example, enter CHECK_REORG('Q') to run the quick check.

This script is located in the Demantra installation directory, under \Demand Planner\Database Objects\Oracle Server\admin.

You can also run the script by defining a workflow that contains the 'Stored Procedure' workflow step. Specify 'TABLE_REORG.check_reorg' as the procedure name and either 'T' or 'Q' as the parameter.

All activity of the checks and reorg operation are logged in detail in the log_table_reorg table. Please review this table when troubleshooting (order by log_time) for detailed error output and comments.

Technical Settings

The following parameters should be adjusted only by someone experienced with databases:

Parameter Description
max_records_for_commit The number of records that Demantra will insert into the database before performing a COMMIT operation. If you increase this number, the insertion will run more quickly, but you risk losing all uncommitted records in case of a crash.
oracle_optimization_mode* Oracle only. Optimization mode of the database, either cost-based (most common) or rule-based.
pct_increase_for_analyze Percentage of data increase for a given table, beyond which Demantra automatically increases the table size.
set_rb* (Oracle 8i only) Set Rollback Segment command. This is database dependent. See your database documentation.
*For these parameters, see "Engine Parameters" in the Demantra Analytical Engine Guide.

See also

"Integration"

Overview of Database Health Check

Demantra provides a database procedure that you can run at regular intervals that checks tables for missing primary keys, unoptimized ordering of null columns, and other conditions that may negatively impact database performance. You can set a threshold determining the minimum number of rows a table must have before it is checked. You can also set the frequency at which a reminder to run the thorough check will appear in the 'log_table_reorg' table after running the quick check. For each finding identified by the check, a corresponding message is logged in the 'log_table_reorg' table. The message specifies the table with the particular problem, In some cases a finding can be a recommendation to reorganize a table. For that you can run a sql script on the table that will reorganize and optimize it for better performance.

There are two types of database checks: 1) a quick check that normally runs in less than 20 seconds, and 2) a more thorough one that, depending on system data volume, can run up to several hours.

Both the quick check and the thorough checks can be launched manually using PLSQL by running the procedure TABLE_REORG.check_reorg, and specifying a parameter of 'T' to run the thorough check, or 'Q' to run the quick check. For example, enter CHECK_REORG('Q') to run the quick check.

This script is located in the Demantra installation directory, under \Demand Planner\Database Objects\Oracle Server\admin.

You can also run the script by defining a workflow that contains the 'Stored Procedure' workflow step. Specify 'TABLE_REORG.check_reorg' as the procedure name and either 'T' or 'Q' as the parameter.

All activity of the checks and reorg operation are logged in detail in the log_table_reorg table. Please review this table when troubleshooting (order by log_time) for detailed error output and comments.

Health Check System Parameters

The system parameters listed below control the behavior of this database procedure. For details about each parameter, see Non-Engine Parameters.

SYSTEM_PRIMARY_KEY

MIN_NUMROWS_FOR_REORG

QUICK_CHECK_TIMEOUT

THOROUGH _CHECK_INTERVAL

THOROUGH_CHECK_TIMEOUT

Thorough Database Health Check

The "Thorough Database Health Check" is used to launch the thorough health check procedure. It writes output to the log_table_reorg table. This procedure requires more time than the quick check but provides greater accuracy. At the end of the thorough check, purging is done to keep only 2 months of information in the log table. If it recommends reorganizing the database tables, then run the table reorganization utility described below. You should run the thorough check after major changes in data volume, such as large engine runs or changes to table metadata. An example of this would be creating or deleting a series that affects column modification in the table.

Note: In order to run the table reorg, additional privileges are required for the Demantra schema. These privileges can be obtained by running the grant_table_reorg.sql script. This script is located in the Demantra installation directory, under \Demand Planner\Database Objects\Oracle Server\admin.To revoke these privileges, run revoke_table_reorg.sql (same location as the 'grant' script).

For information regarding database privileges that may impact the Table Reorganization Utility, see the sys_grants.sql section of the Demantra Installation Guide.

Running the Table Reorganization Utility

There are several ways to run this utility, including:

You can use SQL*Plus to run the SQL script or to run the TABLE_REORG.REORG stored procedure. In both cases you need to log into the Demantra schema as described below.

  1. Be sure you have a complete and valid backup of the database.

  2. Login with SQL*Plus as SYS (sqlplus sys/demantra@orcl where 'sys' is the system username, 'demantra' is the schema name and 'orcl' is the database name)

  3. Grant Demantra schema the required privileges to run the reorg. For example, run grant_table_reorg.sql in the Demantra installation directory under Demantra_installation\Demand Planner\Database Objects\Oracle Server\admin.

  4. Login with SQL*Plus as the Demantra database schema name (for example: sqlplus demantra/dem1@orcl)

Note: Shutting down the application server is not required. However, running this process during a heavy load will slow down production operations.

Running the Table Reorganization SQL Script

After logging in with SQL*Plus, perform the following steps:

  1. Call the run_table_reorg.sql script (for example: SQL> @run_table_reorg.sql)

  2. Enter the name of the table you want to reorganize.

  3. Enter reorg type 'R' or 'C'. Entering 'R' causes a row reorg. Entering 'C' also causes a row reorg, but additionally re-sequences columns so that null columns come after columns with data.

  4. Enter the value for PCTFREE (see note below). The default value is 20%.

  5. Enter the degree of parallelism. This determines the number of worker threads running. The default value is 4.

  6. Hit any key to start the reorg process (or Ctrl C to abort).

Note: The PCTFREE parameter sets the minimum percentage of a data block to be reserved as free space for possible updates to rows that already exist in that block. For example, setting PCTFREE to 10 causes 10% of each data block in the table's data segment to be kept free and available for possible updates to existing rows. However, this value is considered low and could cause "row chaining." Row chaining occurs when data for a single row must span more than one data block, which slows database performance. At the other end of the spectrum, a value such as 50 would likely prevent row chaining, but also consumes more disk space.

Calling the TABLE_REORG.REORG Stored Procedure

This is another way of performing the reorg process. After logging in with SQL*Plus, execute the table_reorg.reorg procedure, passing in arguments for the REORG procedure. For details refer to the Database Procedures chapter in the Oracle Demantra Implementation Guide.

For example:

BEGIN

table_reorg.reorg('DEMANTRA','SALES_DATA','C',10,4);

END;

This example executes a column reorganization as defined by the following parameters:

Schema: DEMANTRA
Table: SALES_DATA
Row or Column Reorganization Column
Min % reserved free space (PCTFREE 10
Degree of parallelism (Num of parallel slaves) 4

After Running the Script or Stored Procedure

  1. After the process completes successfully, verify that the reorganized table is valid by running a worksheet with many series that are related to that table. For example, if the process ran on the PROMOTION_DATA table, you could open the Promotion Comparison worksheet.

  2. After confirming the table is valid, you can drop the original table which the process renames to RDFDDHHMISS$-original table name (where DDHHMISS is date format Day,Month,Hour. The table name is truncated to 30 characters, and the hour format is 24).

  3. If grants were given by running the grant_table_reorg.sql script, revoke the privileges you granted earlier by connecting to SQL*Plus again as SYS and running revoke_table_reorg.sql located in the same directory.

Running the Table Reorganization Procedure Using a Workflow

If desired, the table reorganization procedure can be run using a workflow. If you are implementing the Oracle In-Memory Consumption Driven Planning (CDP) module, the table reorganization procedure TABLE_REORG.REORG can be set up to run periodically using the predefined workflow “CDP Weekly Data Tables Maintenance.” The workflow is set up to reorganize the T_EP_CDP_DATA and SALES_DATA tables by default. Each run of the REORG procedure is logged in a dedicated log table named LOG_TABLE_REORG. For details about this workflow, refer to the Oracle In-Memory Consumption-Driven Planning User's Guide.

To enable this workflow to run periodically, select the 'Enable automated table reorganization' checkbox in the “DBA Details” screen when installing or upgrading Demantra. This check box appears in the 'DBA Details' Installer screen and can be selected even if you are not implementing CDP. However, the CDP Weekly Data Tables Maintenance workflow will not be enabled nor will it be set up to run automatically unless CDP is installed.

If you are not installing CDP, you can either define a workflow to automate the process of running the TABLE_REORG procedure or you can run it manually. When defining a workflow to run the procedure, use the "Stored Procedure" workflow step and specify the table_reorg.reorg procedure, and then enter the Demantra schema name, the table name, reorg level, PCTFREE and degree of parallelism in the Parameters. These parameters are listed in "Calling the TABLE_REORG.REORG stored procedure.”

For details about running the procedure manually, see “Running the Table Reorganization Utility.”

Note: If this option is selected, then a new database role will be created (DEM_SECURE) with additional privileges that are required to reorganize a table. This role is not enabled by default and is password protected. When the REORG procedure is executed, it enables the role, reorganizes the table and then revokes the role so the session has the extra privileges only during the reorganization process.

Database Partitioning

To use the data partitioning tool, in the Business Modeler go to Tools > Database > Create Partitions.

Profile Selection screen

This window displays the “New” icon and all profiles already existing in the system. The list can be displayed as large icons or as a list by pressing either one of the two buttons to the right of the list area. Double clicking any icon starts the wizard by opening the first wizard screen - “Profile Details”. To create a new profile, select the “New Partition Profile” icon.

Profile Details screen

Time-Dimension Partitioning screen

The next screen allows the user to define partitioning of the time dimension. Two different modes can be used: partitioning via an existing time dimension, or partitioning by a custom definition.

Level-based Sub-partitions screen

This screen allows the user to define the sub-partition scheme by selecting a location or product dimension for partitioning. The components of this screen are identical to the components available in the previous screen for time level selection.

Final review and execution screen

This screen displays the partitioning profile definition as well as the load distribution for the selected partitioning scheme.

Date/Time Formats

The following parameters control the formats of date and date/time values throughout Demantra:

Parameter Description
applicationDateFormat The system date format.
applicationDateTimeFormat The system date/time format, used where both a date and time are displayed.
DBDateFormat Controls the date format used in the database.
format.dates.longFormat Long date format.
format.dates.shortFormat Short date format, used in the title bar of the Demantra Local Application.
InsertDateTimeFormat The date-time format that Demantra uses when writing to the database. When you enter dates in a worksheet or import dates, Demantra converts them to this format before writing them to the database.

Adding a New Date Format

If the date format you want in a worksheet is not available be default, a custom Java-compatible date format can be defined. This can be done by an administrator, by defining the format in the TIME_FORMAT table and restarting the application server.

To add a new date format:

  1. Review existing date formats in Demantra. For example:

    1. Open the Demantra Local Application.

    2. Open any worksheet.

    3. Select 'Time' from the toolbar or the Worksheet menu.

    4. Click on the Advanced button.

    5. Review the available date formats.

  2. Using a tool such as SQL Developer, add any Java-compatible date format to the TIME_FORMAT table. For example:

    FORMAT_ID DATE_FORMAT FORMAT_ACTIVE IS_DEFAULT APPLICATION_ID
    9 MMMM: dd yyyy 1 1 My_NEW_FORMAT

    If FORMAT_ACTIVE is '1' then the format is enabled and available for use in Demantra worksheets. If you do not want end users to see a date format in Worksheet Designer, set FORMAT_ACTIVE to '0'.

    If IS_DEFAULT is '1' then the format will be the default in all new worksheets.

  3. Restart the application server.

  4. Log into the Demantra Local Application and open any worksheet.

  5. Select 'Time' from the toolbar or the Worksheet menu.

  6. Click Advanced.

  7. Review the available date formats.

  8. Select the new format and then click OK.

  9. Re-run the worksheet and verify that the new time format appears as expected.

Please note the following:

Email

If you are using any of the Demantra Web-based software, Demantra can automatically send email on specific occasions, for example, within workflows. To enable this, first set up an administrator email account on an SMTP server; this account will be the originator of all Demantra's automatic messages. You will probably need the help of the IT department to get this account configured correctly, depending on the network security.

Then use the parameters in this section to specify that email account for use by Demantra.

Configuring Demantra Email

First, the following parameters specify the email account from which Demantra Web-based software will send email.

Parameter Description
mail* Controls whether email is enabled. Can be set with the Business Modeler at: Parameters > System Parameters > Application Server (tab) > Dp Web (tab).
mail.server* SMTP server that is hosting the email application to be used by Demantra. Can be set with the Business Modeler at: Parameters > System Parameters > Application Server (tab) > Collaborator (tab).
mailAddress* Mail address of the designated Demantra administrator. Can be set with the Business Modeler at: Parameters > System Parameters > Application Server (tab) > Dp Web (tab).
mailProtocol Server used for sending email. Demantra supports only SMTP servers.
mail.strings.from.system Specifies the title of the sender of Demantra email messages, for example "Demantra Solution Manager". Can be set with the Business Modeler at: Parameters > System Parameters > Application Server (tab) > Workflow (tab).
AuditMailAddress Mail address of the BCC recipient of Demantra email messages. Can be set with the Business Modeler at: Parameters > System Parameters > Application Server (tab) > Workflow (tab).
*These can be set via the Demantra installer or later. See the Oracle Demantra Installation Guide.

Strings Used in Demantra Email

In addition, the following parameters control the strings used in the email messages that Demantra sends.

Parameter Description
company.name Name of your company; the Workflow Engine uses this string in email when a workflow step fails.
mail.strings.internalerror.message Text of email message sent in case of error.
mail.strings.internalerror.subject Subject of email message sent in case of error.
mail.strings.from.system Message sent in a fail-to-execute task description.
mail.strings.processfailuresubject Message sent when a process is terminated.
mail.strings.processterminated String included in recovery email message.
mail.strings.recovery Message sent in a fail-to-execute task subject.
mail.strings.taskfailuresubject Message sent when a task is timed out.
mail.strings.taskstimedoutsubject Message sent when a task is timed out in a group step.
mail.strings.timeout.group Message sent when a task is timed out in a user step.
mail.strings.timeout.user Text of email message sent in case of error.

Integration

The following parameters control import and integration in Demantra. These parameters apply only to the core Demantra tools

Parameter Description
accumulatedOrUpdate For integration, this parameter specifies whether the system adds to the existing data (accumulate) or overwrites the existing data (update).
align_sales_data_levels_in_loading Specifies whether to maintain matrix information (combination information that is time-independent) within the sales_data table. If requested, this adjustment is made when data is added via loading, integration, or other mechanisms.
If you set this parameter to yes, it is also necessary to rewrite some database procedures. For additional configuration steps, see Part , "Reconfiguring the sales_data_engine Table".
ImportBlockSize The number of rows for each commit, used during import.
InsertDateTimeFormat The date/time format that Demantra uses when writing to the database. When you enter dates in the worksheet wizard, Demantra converts them to this format.
Insertmissingvalues Specifies whether to insert zero values for dates that have null values.
LoadDataStop Specifies whether Demantra should stop loading data when it finds an error in the data.
RunProportInMdp_add Specifies whether to call the proport mechanism from the MDP_ADD procedure.
update_units_by_items Specifies how to update units for the INSERT_UNITS procedure.
  • By items (faster but less accurate)

  • By combinations (slower but accurate)

Item Aggregation

For improved performance, you can configure Demantra to aggregate data by items and use that aggregated data whenever possible. In this case, Demantra maintains the branch_data_items table in addition to the usual tables. Demantra uses this table whenever possible; it does not use the table whenever you need to view specific locations or filter by location. To configure Demantra in this manner, set the UseItemsAggri parameter.

Note: Also be sure the DYNAMIC_SYNC is scheduled to run periodically to keep the branch_data_items table up to date.

Logs and Old Data

The following parameters control how long Demantra keeps various kinds of historical data:

Parameter Description
audit_history_length Number of months of audit data to keep.
log.history The number of days for which workflow history is kept.

Also see "Logging Messages of the Application Server".

Proport Mechanism

Parameters That Control Behavior

Parameter Purpose
hist_glob_prop Specifies the maximum number of base time buckets to use in calculating glob_prop, the running average demand for any given item-location combination.
def_delta Specifies the default value for the delta field in the mdp_matrix table. If delta equals null for a given combination, the system uses the value of this parameter instead.
In turn, the delta field specifies the month-to-month smoothing of the weekly proportions.
proport_missing Specifies what value to use for dates with null sales (zero or average).
proport_threshold Specifies the number of distinct months needed to compute P1, ... P12 in the usual way.
proport_spread Specifies what value to use for any month that has null data.
last_date Last date of actual sales, to be used by the Analytical Engine and the proport mechanism. No dates after this are used towards the forecast or the proport calculation.
quantity_form Expression that the Analytical Engine uses to select the historical demand from the sales_data table; the result of this expression is the data that the engine uses as input. The default expression transforms negative values to zero and should be modified if business needs require negative demand.
mature_age Controls the mature_date, which is calculated backwards from the current date using the mature_age parameter. A combination is young (rather than active) if it does not have any non-zero sales data for dates on or before the mature_date.
dying_time If no sales occurred during the length of time specified by dying_time, the combination will be marked as dead (0 forecast will be issued).
*For these parameters, see "Engine Parameters" in the Demantra Analytical Engine Guide.

Parameters That Affect Performance

Parameter Purpose
add_zero_combos_to_mdp* If true, add combinations to mdp_matrix even if their historical data consists of zeros. This parameter is used by the proport mechanism.
Run_full_matrix_proport Specifies whether to run the proport mechanism on all the item-location combinations.
  • If no (0), run proport only on the combinations that have prop_changes=1.

  • If yes (1), run proport on all combinations in mdp_matrix.

  • If 2, run proport on all combinations that have new_member=1.

* For these parameters, see "Engine Parameters" in the Demantra Analytical Engine Guide.

Proport Parallelization

Proport handles large amount of data processing and can require a substantial amount of time and system resources. It is possible to improve run time performance using parallelization and by grouping the Proport process into several iterations.

To do this, define the following parameters in the init_params table for each engine profile:

Parameter Description
ProportParallelJobs The number of parallel jobs used when running Proport calculations. This parameter's value should not exceed the number of CPUs on the database server.
ProportTableLabel The name of the level by which the process is broken down. The total number of members in this level is divided into equally sized groups, and one group is processed each time Proport is run.
ProportRunsInCycle The number of groups that the Proport process is broken down into.

Example:

ProportTableLabel = 'Item'

ProportRunsInCycle = 10

ProportParallelJobs = 2

When running Proport with these settings in the example above, processing occurs for all combinations associated with 1/10 of the Item level members. Each execution invokes 2 parallel jobs in the DBMS_JOB queue. Proport is called ten times before all combinations have been processed.

Use caution when choosing the level by which Proport will be broken into separate tasks. The process will treat each member as equal and will not be aware that some members contain far more data than others. Selecting an inappropriate level could result in an uneven processing time between different session runs.

Example:

ProportTableLabel = 'Segment'

ProportRunsInCycle = 5

ProportParallelJobs = 4

If there are 10 segments, then each Proport process will execute on 2 (10/5) segments and use 4 parallel processes. If a specific segment contains a much larger number of items than other segments, then processing of this specific segment require more time to run.

EngineOutputThreshold

The forecast for certain combinations may not change significantly between runs, this typically occurs for steady sellers, or extremely slow moving items. Writing out a new forecast in this case would have only marginal benefit to the supply chain. However, it would add cost in:

  1. Engine I/O processing

  2. The noise of minute variations in the production forecast

The parameter "EngineOutputThreshold" provides control over whether to write the forecast for a combination that has changed very little. Example: If the new value is 3% larger than the old value, and the EngineOutputThreshold is 5%, then the engine will not output the new value, and the old value will remain. In this case the new value would need to be at least 5% larger or smaller than the old value before it replaces the existing forecast value. Note that if either the old value or new value is zero, then the difference will be calculated as 100% (unless they're both zero, in which case the difference would be 0%).

Simulation

When a user starts a large simulation, it is useful to check the size of that simulation and provide a warning if it will take a long time to run. You may also want to prevent simulations that are too long from being run at all.

You can configure Demantra to detect large simulations and display a message to the user, to confirm that this is what the user wants to do. You use the following parameters:

Parameter Purpose
SimWarnSize Specifies the threshold size of a simulation that is large enough to trigger a warning message to the user. Specify this as a percentage of the total number of combinations.
SimMaxSize Specifies the threshold size of a simulation that is too large to run. If a user tries to perform a simulation of this size, Demantra displays a message and does not attempt the simulation. Specify this as a percentage of the total number of combinations.
MatrixCombs Indicates the number of combinations currently in the mdp_matrix table.
This information can be useful in helping you to set SimMaxSize and SimWarnSize.

You should run some trial simulations on the solution hardware and set threshold values that are appropriate for the actual users.

Solution Branding

The following parameters control titles throughout the Demantra solution:

Parameter Description
company.name Name of your company; the Workflow Engine uses this string in email when a workflow step fails.
general.homepage.title Title of the Demantra Local Application home page, as used within the Demantra Local Application title bar, as follows:

the picture is described in the document text

general.title.text Title of the browser window when it displays Demantra Local Application. For example:

the picture is described in the document text

Threading

Demantra uses threading mechanisms in multiple places. Threading is a general mechanism that uses system resources more effectively to run several tasks in parallel.

Threading for the Attribute Update Mechanism

This thread pool uses the following parameters:

Parameter Description
threadpool.attributesUpdate.per_comb Maximum number of threads that a single thread can use.
threadpool.attributesUpdate.size Maximum number of allowed threads for this thread pool. This should be less than MaxDBConnections.
threadpool.attributesUpdate.time-out Idle time-out period. This specifies how long (in milliseconds) a thread is left unused before it is ended automatically.

Threading for the Update Mechanism

The update mechanism saves data to the database. This thread pool uses the following parameters:

Parameter Description
MaxUpdateThreads Maximum number of allowed threads for the update mechanism. You should set this equal to the number of database server CPUs plus 1.
UpdateThreadtime-out Idle time-out period. This specifies how long (in milliseconds) a thread is left unused before it is ended automatically.

Threading for Updating Parallel Values

This thread pool uses the following parameters:

Parameter Description
threadpool.update.size Maximum number of allowed threads for this thread pool. This should be less than MaxDBConnections.
threadpool.update.time-out Idle time-out period. This specifies how long (in milliseconds) a thread is left unused before it is ended automatically.

Threading for Promotion Copy/Paste

Another thread pool handles copying and pasting promotions. This thread pool uses the following parameters:

Parameter Description
threadpool.copy_paste.per_process Maximum number of allowed threads for the copy/paste mechanism in any given process.
threadpool.copy_paste.size Maximum number of allowed threads for the copy/paste mechanism. This should be less than MaxDBConnections.
threadpool.copy_paste.time-out Idle time-out period. This specifies how long (in milliseconds) a copy/paste thread is left unused before it is ended automatically.

Threading for Methods

Another thread pool handles level methods. This thread pool uses the following parameters:

Parameter Description
threadpool.level_method.size Maximum number of allowed threads for methods. This should be less than MaxDBConnections.
threadpool.level_method.time-out Idle time-out period. This specifies how long (in milliseconds) a method thread is left unused before it is ended automatically. Recommended: 300000 (5 minutes).
threadpool.level_method.block Specifies how the level methods should access this thread pool, either:
wait (wait for a free thread)
abort (do not wait for a free thread)

Threading in the Web Worksheets

The Web worksheets also use threading

Parameter Description
threadpool.query_run.size Maximum number of allowed threads that Demantra can use to run a Web worksheet. If this number is missing or negative, the worksheet run mechanism does not use threads.
This should be less than MaxDBConnections. Also be sure to leave room for system processes.
threadpool.query_run.time-out Idle time-out period. This specifies how long (in milliseconds) a worksheet thread is left unused before it is ended automatically.

Threading in the Business Logic Engine

The Business Logic Engine uses threading as follows: The thread pool specifies the number of parallel BLE tasks, each of which loads a different combination of the worksheet, runs the calculation engine on it, and saves the data back to the database. The number of threads in the pool is affected by the system resources, mainly the number of CPUs that the machine has (each thread runs on a different CPU). The following parameters control this threading mechanism:

Parameter Description
BLEThreadPoolSize Maximum number of allowed threads for the Business Logic Engine.
BLEtime-out Idle time-out period. This specifies how long (in milliseconds) a BLE thread is left unused before it is ended automatically.

Workflow

The following parameters control the Workflow module:

Parameter Description
company.name Name of your company; the Workflow Engine uses this string in email when a workflow step fails.
execution.shell Applies to the Executable Step. This parameter specifies any prefix that is needed in order to run executable steps. For example, you may need to specify the following for Unix:
./
log.history The number of days for which workflow history is kept.
server.generalurl URL for the workflow server, not including the portal/workflow directory.
workflow.group Comma-separated list of groups whose users are authorized to log into the Workflow Editor. Use the group names as specified in the Business Modeler.
In order to log into the Workflow Editor, these users also must have System Manager permission level. See "Providing Access to the Workflow Editor".

See also

"Solution Branding" "Demantra Local Application" "Email"

Worksheets

The following parameters affect the Web-based worksheets. They are grouped into several areas:

For another way to improve performance, see also "Managing Level Caching".

General Worksheet Behavior

The following parameters control the default behavior of the Web-based worksheets

Parameter Description
AutoRunMode Specifies whether a worksheet automatically reruns after any change in its definition. This parameter also specifies whether a worksheet is automatically run when it is opened in any way.
client.enableOpenNoteWithDoubleClick Specifies whether users can access the notes dialog box by double-clicking within the worksheet table.
In any case, it is always possible to access this dialog box by using the right-click menu, as in Microsoft Excel.

Worksheet Performance

The following parameters affect the performance of the Web client:

Parameter Description
EnableWorksheetCaching Enables or disables the worksheet caching feature.
EnableIncrementalLoading Enables the Demantra incremental loading feature, for faster worksheet reruns. There is no user impact apart from performance.
client.JREMaxMemory Maximum amount of memory (in MB) that JRE can use. The Web worksheets (Demand Planner Web, Promotion Effectiveness, and Settlement Management) use JRE.
client.MaxCombsLoadChunkSize Maximum number of combinations to load each time the user chooses to rerun a worksheet.
UseDateRangeMatrix Controls whether the system will use new internal data structures to improve the performance of worksheets that include promotions (or other general levels that have population attributes). If you enable this option, the largest benefit occurs in cases where promotions are long (and have many rows of data).
The system uses these structures automatically for other purposes.

Worksheet Designer

The following parameters control the defaults in the worksheet/content designer

Parameter Description
OpenWithContext Specifies the default setting of the Open With Context setting of the worksheet designer.
client.worksheet.privateAccessType Specifies the default setting of the public/private option in the worksheet designer.
WorksheetDefaultDateChoiceMethod Controls the default start date for worksheets, either relative to today or relative to last loaded sales date.
WorksheetDefaultSpan Specifies the default length of time for a worksheet, in base time units. Must be a positive, even number, 2 or greater.
ManualRefreshAsDefault Specifies the default setting of the Refresh Type caching option in the worksheet designer.
WorksheetCachingAsDefault Specifies the default setting of the Cache Worksheet Data check box in the worksheet designer.
PromoDefaultSpan Specifies the default length of time for promotions created within a worksheet.
PromoDefaultStart Specifies the default start date for promotions created within a worksheet. Use one of the following values:
  • today (0)

  • last loaded sales date (1)

  • start date of the worksheet (2)

MaxAvailableFilterMembers Specifies the maximum number of members that can be retrieved in the worksheet filter screen. If the user selects more members than allowed, a message asks the user to add further filtering.
This limit helps to prevent users from creating worksheets with too many members (which can adversely affect performance).
SPF_Enable_Worksheet_Calculations Automatically calculates planning percentages during worksheet updates. Updates to relevant series trigger BOM tree propagation if set to yes.

Note: Enabling this parameter may negatively affect worksheet performance. When set to No (disabled), propagation occurs when the user modifies worksheet values. However, the new planning percentages are only displayed after the end user reruns the worksheet.

See also

"Demantra Local Application"

Parallel Hints for Worksheets

Some worksheets access a large amount of data which can cause them render slowly. A parallel hint can be implemented to improve performance for such worksheets. A hint specifies the number of threads used by the worksheet query and can be applied to two parts of the worksheet: generation of the combinations and retrieval of data to be displayed in the worksheet.

Warning: Use caution when implementing worksheet hints. When a large number of users simultaneously access the database, too many hints can overwhelm the database connection pool and substantially decrease performance.

Setting a hint requires manually adding a row to the WORKSHEET_HINTS table; this task should be performed only by an experienced system or database administrator.

The WORKSHEET¬_HINTS table contains the columns in the table below.

QUERY_ID USER_ID CONTEXT_ID POPULATION_HINT DATA_HINT
Q 0 0 The hint to be used for worksheet Q with any user and any context in the Population SQL The hint to be used for worksheet Q with any user and any context in the Population SQL
Q U 0 The hint to be used for worksheet Q with user U and any context in the Population SQL. For all other users besides U, the generic hint defined above is used, if one exists. The hint to be used for worksheet Q with user U and any context in the Data SQL. For all other users beyond U, the generic hint defined above is used.
Q U C The hint to be used for worksheet Q with user U and context C in the Population SQL. For all other contexts and for the same user U, the above row is used. For all other users, the generic hint is used, if one exists. The hint to be used for worksheet Q with user U and context C in the Data SQL. For all other contexts and for the same user U, the hint in the row above is used. For all other users, the generic hint is used.

The POPULATION_HINT and DATA_HINT columns contain the actual hint as an SQL string. For example, to specify that the query should use 8 threads when accessing the branch_data table, this field would be "parallel(branch_data 8)".

The QUERY_ID, USER_ID, and CONTEXT_ID columns specify the circumstances when this hint would be used.

QUERY_ID specifies the internal ID of the worksheet for which the hint should be applied.

USER_ID specifies for which user the hint will apply when opening the worksheet. When this field is set to zero, the hint will apply to all users.

CONTEXT_ID specifies the level member name; it corresponds to the level member that is selected when a worksheet is opened with the "Open With" menu option. If the CONTEXT_ID is zero, then the hint will apply to all contexts. If the worksheet is opened without “Open With,” this setting is ignored.

Configuring User Productivity Kit (UPK)

If you have licensed and installed UPK, perform the following to launch UPK from Oracle Demantra Web help.

  1. Install and configure UPK on a Web server. Refer to UPK documentation for details.

  2. Launch Business Modeler, and then locate the LaunchUPK parameter.

  3. In the Value field, enter a valid URL to launch UPK.

    For example: http://server name/virtual directory name/index.html

  4. Save the changes.

  5. Log in to Demantra, and then click Help from the Demantra Local Application, Workflow Manager, or from within a worksheet.

  6. Click the “UPK” link. The Player should launch successfully.