You are on page 1of 15

Oracle Demand Management

Baseline forecast

An Oracle White Paper


August 2014
Table of Contents

1. OVERVIEW ...................................................................................................................................................................................................................................... 3

2. FORECAST TREE ............................................................................................................................................................................................................................ 3

3. FORECAST RESULTS .................................................................................................................................................................................................................... 6

4. ENGINE ISSUES - ISSUES WHEN STARTING UP THE ENGINE ............................................................................................................................................ 8

5. ISSUES/ ERRORS DURING ENGINE RUN ............................................................................................................................................................................... 12

6. DOCUMENTS ABOUT ENGINE ................................................................................................................................................................................................. 13

2
1. Overview

The scope of this document is to provide a general line on engine behavior regarding the
baseline forecast generation. Also, I would like to provide some starting points on the engine
errors and how to investigate those or where from to start the investigation.
The main points on those documents are:

Forecast tree
levels of the forecast tree
how engine will scan through the forecast tree, starting at the minimum
forecast level

Forecast results
engine completed successfully but no forecast was generated
forecast was generated but is wrong

Engine issues
There are different kinds of issues:
Issues when starting up engine
Windows engine
Unix engine
Starting engine from workflow
Issues/errors during engine run

Documents

2. Forecast tree

The Forecast Tree controls how the Analytical Engine aggregates and splits.
The engine generates the forecast at the lowest possible allowed level
Aggregates data so that it can generate a forecast at a HL and then split it to the LL
Within the forecast tree, all item levels of the tree must belong to the same item
hierarchy of the same item dimension, and all location levels must belong to the
location hierarchy of the same location dimension

3
The TLMO (the level just below the top level, called top level minus one), affects performance.

In our case: Product Category / Customer Class

4
Each engine task receives one or more nodes of the TLMO.

TLMO should have many nodes and to ensure that none of them contains too many lowest level
combinations. (1000 to 2000 active combinations per branch)

Prod Cat 16

Cust Class 5

Item 139
Item 121

Cust Class 5 Item 75


Cust Class 5

Cust Class 5

Item 139
Item 139 Item 139 Item 121 Item 121 Item 75 Item 75

Site 3
Site 89 Site 46 Site 3 Site 46 Site 3 Site 46

- Engine iterate through the forecast tree, starting at the minimum forecast level.
- Read and validate historical data and causal factors
- Estimate the fit base on demand and causal factors
- Perform and validate the forecast

5
- When working on a forecast tree node, the engine uses a set of models. It considers how
well each of those models works for that node and it statistically combines the best results
- Generate the forecast
- If a node is left with no suitable model, the Analytical Engine will not forecast on that node.
Instead it will forecast at a higher level, if possible
- Split the forecast base on Matrix proportions
- Causal Factors provide information about historical events that are expected to recur in the
future.
- Causal Factors cause demand to deviate from a trend.
- Causal Factors is a time-varying quantity (such as price, season, or day of the week) that
affects demand.
- Require historical and future data - expected occurrences that will affect demand.
- Not an error:

16:03:34:214 [2,139,3] has a usable number of observations.(25)

16:03:34:214 Forecasting [2,139,3]

16:03:34:915 [2,139,3] forecast failed.

3. Forecast results
Engine completed but no forecast was generated
Check do_fore and prediction_status for all the combinations we need active
combinations with prediction_status =1
do_fore: 0Do Not Do Forecast, 1Do Forecast (the default), 2Do Zero
Forecast.
prediction_status : 1 (Live or Active) , 99 (Dead), 98 (Young), 97 (Create Zero
Forecast), 96 (No Forecast)
Execute proport procedure
BEGIN
UPDATE mdp_matrix SET prop_changes = 1;COMMIT;
proport;
END;
prediction_status should be set by proport procedure only
Check quantity_form formula combinations may not have demand
If forecast was generated in data table but is not available is worksheets, setup
AppServerURL parameter and restart the application server
Check the dates from engine manager log or from forecast_history table
15:06:32:309 Calculated first forecast date: 2013-09-09 (41526)
15:06:32:309 Calculated last forecast date: 2013-09-16 (41533)
FillMissingDates() - rows were not inserted into sales_data table

6
Level_id is null of fictive level for prediction_status =1 means that engine failed
recheck the logs
select level_id, count(*) from mdp_matrix
where prediction_status = 1
group by level_id;
Forecast was generated but is wrong
We need to clarify what is the expected forecast
Customer should provide: Demand , Statistical Forecast and Forecast Override
Understanding Poor Forecast Results, Bad Forecast Results, or Confusing
Forecast Results generated by the Demantra Analytical Engine (Doc ID 744602.1)
The forecast tuning should be done by an Analytical Consultant
Run a simulation
Customer should have 2 years of history data for a good forecast
In the worksheet where you verify the forecast , use the same levels as in
forecast tree definition
Check causal factors
d1, .., d12 cf could not be define in inputs
Verify the Level where engine had succeeded, the models used
Around 85% of the combinations should succeed at min_fore_level
Check the proportions p1, p2, .. p12 from mdp_matrix when forecast was
generated at upper levels
Do_aggri, aggri_98, aggri_99 - specifies whether to aggregate data for this
combination during forecasting
Check engine parameters in init_params_% tables
Need_spread controls whether the final result should be given in the form of
spikes or it will produce continuous forecast. This applies only to intermittent
models.
UpTime functionality - used to flag whether each date in sales_data should be
considered a sales date or not - Demantra UpTime Up_Time FillMethod
FillParameter Analytical Engine Behavior (Doc ID 1370244.1)

Debug enable extra logs from Engine Administrator or Settings.xml file


Examples: To produce detailed output for node [2,1,1] and [2,1,4] for groups
100,101 and 120
Fill into the Analytical Log Groups field:
100,101,120 [2,1,1];[2,1,4]
Enable DebugPro

Existing groups:

1. Group 0 - This is the super group, selecting it will log output for ALL
processors, this should be used either when filtered or when schema is

7
minimized and in any case will result in huge logs and considerable
overhead on the engine runtime.

2. Groups 100 and 101 - Details basic information about the output/input of
each model like series, coeffs, fit, forecast and the averaging for them.
Specifically, group 101 adds finer details such as Coeff Base and Coeff
Promo separately.

3. Group 110 - Details the causals information

4. Group 120 - Details additional information related to functionality of split


schemas for calendar month, to get values of arguments before the relevant
processors also set Debug Pro to level 6.

4. Issues when starting up the engine

General clarifications:
- What is the OS of the server where customer is having the engine: Windows? Linux? Solaris?
Before demantra 7.3.x, engine was supported on Windows only. Starting with demantra
7.3.0, we can deploy the engine on the application server from Linux.
- How customer is starting the engine? From Engine Administrator (if on Windows), from URL
(if on Unix)? Is it starting the engine from workflow?
- Is it the first time when customer is trying to run engine on this environment? Maybe the
setup was not done properly.
- What is not working and what error customer is having.

Windows Engine

Before running the engine on Windows, register the engine on each machine where
engine will run (from Engine Administrator, from RegEngine.bat or
RegEngineAsLauncher.bat)
- When register on Windows 2008 and 7, choosing "Run as Administrator"
- Check DCOM settings if you see the configured identity is incorrect
- May require to run mdac_typ.exe on older Windows NT versions
- WARNING Failed to create engine monitor. HRESULT=0x8007007e The specified
module could not be found (Doc ID 1399333.1)
Issues when starting up engine

8
- Most of those are related with database connection issues
- it can hang while trying to connect can be fixed using RegEngineAsLauncher.bat
11:54:21:662 Working with Oracle RDBMS
11:54:21:662 Database connection string: Provider=MSDAORA;Data Source=PROD User: DM
- it can get an error like
11:54:21:787 ERROR Database Error [db_win.cpp,137]
11:54:21:896 ERROR - Source: ADODB.Connection
11:54:22:005 ERROR - Description: Provider cannot be found. It may not be properly installed.
11:54:22:115 ERROR - Message: Unknown error 0x800A0E7A
11:54:22:224 ERROR - Error Number: 0x800a0e7a - Undefined Error.
- The Oracle Provider for OLEDB requires the Oracle client software to be installed.
- Demantra Engine is a 32-bit application and require Oracle Client 32-bit run
tnsping to verify
- Oracle client installation, does not install OLEDB and ODBC components by default.
When you run the oracle client installer, please choose Custom option and check
the Oracle ODBC Driver check-box when installing it check for sqora32.dll, oci.dll
- Check oracle client version working fine with 10g or 11.2.0.1 (usually issues with
11.2.0.3 on Windows 2008)
- Make sure there is only 1 installation of the oracle client
- Check environment variables like %PATH%, %CommonFiles% and %ORACLE_HOME%
- Review the tnsnames.ora, listner.ora, ensure you are connecting successfully using
SQLPlus to your demantra schema
- Test using a user account with the full Admin privilege usually happens when
running Demantra through Remote Desktop

Unix Engine

- Engine is deployed on the application server (like OAS, WebLogic) install on a


Windows machine and deploy the engineManager.war file on Linux server
- Before demantra 7.3.1.5, we only had a 32-bit engine. For those versions engine can
be deployed on either a 32-bit or 64-bit Linux (Intel CPU only) platform, but in either
scenario, you must use a 32-bit application server (Tomcat, OAS, WebLogic, or
WebSphere).
- Also, those versions are require a 32-bit JVM recommended java 6 build 17
- Configure Environment Variables - run bin/configureVariables.sh
Script will define environment variables like $ENGINE_ROOT, $ORACLE_HOME,
$JAVA_HOME into $HOME/.bash_profile file.'
- Create the Engine Data Source File - run .bin/createDSIniEngineRoot.sh
- run command: chmod R 0777 * from the engine directory
- set up environment variables like $LD_LIBRARY_PATH
- Download then manually copy/move the library libstdc++-libc6.1-2.so.3 to the
/usr/lib or <ENGINE_ROOT>/lib directory

9
from http://rpm.pbone.net/index.php3/stat/2/simple/2
- First AP for issues starting engine on Linux
o stop the application server
o stop the EngineStarter:
ps -ef | grep EngineStarter | grep -v grep | awk '{print $2}' | xargs kill -9
o start the EngineStarter. Make sure that is start from lib folder and the port you
are using to start is the same as the port in Settings.xml file
cd <INSTALL_ROOT>/lib
./EngineStarter 12345 &
Please replace the 12345 with the port from Settings.xml
o check that $ENGINE_ROOT/lib/EngineStarter was started.
ps -ef | grep EngineStarter
o start the application server
o start Engine in Batch Mode as:
http://<Server>:<port>/<ContextName>/EngineManagerStarterServlet?command=start&mode=1&profile_id=1
o Check if the logs are getting created in engine2k folder.
o If not, please check the EngineManagerPreRunLog.txt file .
- If we have logs on engine2k folder, no need to verify EngineManagerPreRunLog.txt
- Parameters issues
Engine Manager Java Wrapper Error
libEngineManager.so can not be found in existing path.
...
HINT : Check ENGINE_ROOT Enviornment variable value
Run echo $ENGINE_ROOT
ldd libEngineManager.so should not have Not found
- Connection issues
DB_OracleManager::DB_OracleManager ==> Create OCCI Enviornment ...
Wait for startup ...
Wait for startup ...
Wait for startup ...

Run OCCI test:


cd $ENGINE_ROOT/lib
./OCCITest <schema name> <password> <db host>:<db port>/<service name or SID>
The test should finish in couple of minutes but if you see that the test is not passing,
then the OCCI connection creation stage is not creating the connection.
Solution: Bounce the servers
If machine UPTIME is too long (more than 248 days) the OCI enters to times(NULL) =
-2138395754 loop.
- Check Demantra Engine on Linux Install Upgrade Troubleshooting Configuration
(Doc ID 1389868.1)

10
Engine from workflow
- There is a standard workflow that calls the engine called : Run Engine
- Set up correctly EnginePlatform parameter: Parameter indicates the platform (OS)
type where the engine is executed. 0 - Windows, 1 Linux
- set up correctly the URL of the application server: AppServerURL
- If you have engine on Linux, please set up correctly EngineBaseURL parameter
- Run @GRANT_HTTP_TO_DEMANTRA.sql to grant ACL privileges for 11g database
- Make sure engine is starting up successfully outside the workflow first
- For engine on Windows:
o Check the OS of the application server where you have deployed demantra
application. The workflows will always look for a path on the same machine
where you have the application server.
o If the OS of the application server is Linux, then you need to install a third-party
SSH type tool, called Cygwin, that allows you to send and receive a command
sent from a non-Windows platform server. Follow Doc ID 468071.1
o If the OS of the application server is Windows and you have different servers for
application server and engine, then you need to use a third-party tool like
"PsExec.exe". If you only map the machine, the engine will run on the same
machine where you have the application server , instead of running on the
engine server
o If the OS of the application server is Windows and you have the application
server and engine on the same machine, you can create a batch file similar as
Start_Engine2K.bat and create a workflow with an executable step that calls
your batch file.
Depending on your setting, this may cause issue when connecting to database.
- make sure you have only 1 oracle client installation, to avoid library mismatch
issues.
- if you have OAS, confirm that ORACLE_HOME and PATH from both opmn.xml
and environment variables are the same and are pointing to the same Oracle Client
installation
- engine is looking directly for 'OraOLEDB*.dll', make sure you have only one on
your server
- OraOLEDB*.dll is dependent on other DLL's and you should make sure that none
of them is incorrectly loaded. You may check with the free "depends.exe" utility
If some .dll cannot be loaded, you may need to set up CommonFiles
o When running the engine from workflow, DCOM settings should be to "The
launching user" , or This User on all engine servers. Set up this by double click
on RegEngineAsLauncher.bat or you can go directly from start >> Run >>
DCOMCNFG >> Expand Component Services >> Computers >> My Computer >>

11
DCOM Config >> Right click Engine2k >> Properties >> Identity tab >> place the
bullet in "Launching user" , or This User

5. Issues/ errors during engine run

Check for the errors in engine manager log and engine log files set up engine to write
the engine manager to a file
Execute select * from forecast_history order by time_sig desc; status =1 means successful
Wrong parameters in init_params_0 , init_params_x or sys_params table
Eg: Wrong date parameters
select pname, pval from sys_params where pname in
('max_sales_date','min_sales_date','min_fore_sales_date','max_fore_sales_date');
select pname, description, value_date, value_float from init_params_0 where pname
in('start_date' ,'lead','last_date_backup', 'last_date , 'HistoryLength') ;
Check forecast tree definition - within the forecast tree, all item levels of the tree must
belong to the same item hierarchy of the same item dimension, and all location levels
must belong to the location hierarchy of the same location dimension
The forecast tree should contain 3 to 6 levels on which the engine can traverse and
forecast. This number does not include any levels below the minimum forecast level
and does not include the HFL.
FillMissingDates() - engine completes successfully but the INSERT_UNITS procedure
had not inserted all the rows in sales_data table so the forecast could not be run
Lots of docs for it: for parameters settings and also patches Doc ID 1355195.1, Doc ID
889513.1
EXECUTE_PROFILES this is not an engine issue. Set RunInsertUnits=3 and run it
outside the engine
If you see errors related with files missing or file permissions, manually delete all cache
for the Engine run under: default cache directory: /demantra/Engine/lib/Cache/
Engine is hanging - could be a huge branch - as discussed on performance issues

12
6. Documents
a. Installation
i. Linux
1. Q/A
a. Does The Demantra 7.3.0.1 Analytical Engine Need A 2nd Application Server ? (Doc ID
1276661.1)
b. Why is an older library libstdc++-libc6.1-2.so.3 advocated when you run the Demantra
Engine on Linux? (Doc ID 1275238.1)
c. Added Security Enhancement for Demantra Engine on Linux Versions 7.3.1.4 and
Earlier (Doc ID 1611623.1)
2. Deployments
a. Demantra Deploy Application Serve. This note describes how to deploy the engine
(Linux) on the following application servers: Oracle Application Server, Web Logic and
Tomcat (Doc ID 1668320.1)
3. Troubleshooting
a. Demantra Engine on Linux Install Upgrade Troubleshooting Configuration - Re-written,
April 2014, 9th Revision (Doc ID 1389868.1)
b. Demantra on Unix Linux Engine Troubleshooting, Common Issues (Doc ID 1669570.1)
4. Enhanced Engine logs
a. How to configure Enhanced Engine logs for Engine Configured Either on Windows or
Linux (Doc ID 1454588.1)
5. Errors
a. libEngineManager.so can not be loaded
i. Issue With Demantra Engine on Linux - engine2k not generated (Doc ID
1684749.1)
ii. Demantra Engine on Linux Install Upgrade Troubleshooting Configuration -
Re-written, April 2014, 9th Revision
b. java.lang.UnsatisfiedLinkError on the application server
i. Demantra Servlet EngineManagerStarterServlet Threw Exception (Doc ID
1524873.1)
c. ReleaseStringUTFChars
i. Demantra Engine 7.3.1.2 On Linux Crashes with ReleaseStringUTFChars called
on something not allocated by GetStringUTFChars (Doc ID 1436490.1)
d.
e.
ii. Windows
1. Troubleshooting
a. ENGINE Setup. TROUBLESHOOTING Most common Errors While Running the
Analytical Engine (Doc ID 1416643.1)
2. Failed to create engine monitor

13
a. WARNING Failed to create engine monitor. HRESULT=0x8007007e The specified
module could not be found (Doc ID 1399333.1)
b. Engine Errorout on Windows 2008 (Doc ID 1293246.1)
c. Engine Error HRESULT=0X800706BE Remote Procedure Call Failed (Doc ID 1557175.1)
3. Provider cannot be found
a. Demantra Engine fails with an 'Provider cannot be found' message (Doc ID 437648.1)
b. Troubleshooting Engine Error: Description: Provider cannot be found. It may not be
properly installed - Error Number: 0x800a0e7a (Doc ID 1491151.1)
c. Engine Failing On 64 Bit Oracle Install Unknown Error 0x800A0E7A (Doc ID 851718.1)
d. Engine Throws 0x800a0e7a Error (Doc ID 1432031.1)
4. ORA-12541: TNS:no listener
a. ORA-12541 TNS No Listener Error When Running Demantra Engine (Doc ID 1368346.1)
5. Engine on machine xxx could not be created. HRESULT=0x80070005
a. Demantra Engine Not Running From Workflow Manager (Doc ID 857490.1)
b. Demantra Error Engine On Machine Was Created But Could Not Be Initialized (Doc ID
784760.1)
6. Catastrophic failure
a. Demantra Engine Run Error 0x8000ffff - Catastrophic failure (Doc ID 1580071.1)

b. Running engine from workflow


i. Running Engine via Workflow (Doc ID 1508816.1)
ii. Windows 2008 Cannot Run Demantra Forecast Engine Via Workflow (Doc ID 1556439.1)
c. Distributed engine
i. Distributed Engine Windows and Linux Deploying Multiple Engines Howto and Troubleshoot (Doc ID 751772.1)
d. Engine fails
i. Search Helper - Doc ID 1486634.2
ii. Trobleshooting
1. ENGINE Setup. TROUBLESHOOTING Most common Errors While Running the Analytical Engine
(Doc ID 1416643.1)
iii. Errors on engine logs
1. FillMissingDates
a. ENGINE Warning FillMissingDates() .. no causal or INSERT_UNITS was Not Run (Doc ID
1355195.1)
b. Demantra Resolving Deadlocks WARNING EngNewSystemProcessor::FillMissingDates()
Detected Missing Future dates rows. (Doc ID 1565571.1)
c. Either INSERT_UNITS Was Not Run At All Or Failed To Run Correctly .FillMissingDates()
detected missing future dates rows (Doc ID 1545861.1)
2. Bulk loaded
a. Engine on Linux : Error executing the bulk loader! (Doc ID 1390054.1)
b. Analytical Engine : Retrying bulk insert for file: sqlldr.exe due to communication Error
(Doc ID 750194.1)
3. Variable: InitParam.HeartBeatCheckEnable not found in dictionary!
a. Warning During Demantra Engine Run On Linux or windows (Doc ID 1534769.1)
4. ORA-00942 on TABLE_INPUTS
a. 12.2.3 Simulation Engine Gives ORA-00942 on TABLE_INPUTS (Doc ID 1670016.1)
5. ORA-12154
a. Demantra Engine on Linux has ORA-12154: TNS:could not resolve the connect
identifier error (Doc ID 1323534.1)
e. Engine results
i. Wrong results

14
1. Understanding Poor Forecast Results, Bad Forecast Results, or Confusing Forecast Results
generated by the Demantra Analytical Engine (Doc ID 744602.1)
2. Baseline Forecast Showing Huge Negative Forecast For One Combination. (Doc ID 464124.1)
3. Engine Forecast Results are Very Different for Two Consecutive (Doc ID 1488029.1)
ii. No forecast
1. No Demantra Forecast Generated - Common Issues (Doc ID 848205.1)
2. Engine Is Not Written Forecast In Sale_data (Doc ID 1533335.1)
3.
iii. Causal factors
1. Oracle Demantra Introduction To Causal Factors FAQ (Doc ID 884602.1)
2. Demantra: Engine Error: Warning The Constant Causal Factor Is Not Chosen in the SECOND
multiplicative set of DMult model (Doc ID 757742.1)
3. Issue With The Impact Of Causal Factors On The Forecast (Doc ID 1139165.1)
4. Demantra UpTime Up_Time FillMethod FillParameter Analytical Engine Behavior (Doc ID
1370244.1)
5. Demantra 12.2.2 Engine Failed With ORA-00904: "TIME_RELATED": Invalid Identifier (Doc ID
1617132.1)
iv. MAPE
1. Mape Metrics For IO Is Not Calculated When Using Intermittent Models (Doc ID 1228227.1)
f. Simulation
i. Simulation Status Remains at Requested and no Results are shown on the Worksheet (Doc ID 468939.1)
ii. Receiving Error In The Demantra Simulation Engine dpweb.spreadsheet: Series null_val is not in the model (Doc
ID 866294.1)
g. Performance
i. How to Analyze Demantra Forecast Engine Performance (Processing Time) Issues / Demantra Engine is Slow
(Doc ID 863025.1)
ii. Improving Demantra Engine Performance of Resetting Previous Forecast For Inactive Combinations (Doc ID
1270690.1)
h. Q/A
i. Can I drop tables in my database that are similar to MDP_3791_10019 and
MDP_3791_10019_RESETFOREVALS (Doc ID 467842.1)

15

You might also like