Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Performance
An Oracle White Paper
October 2012
Oracle Demantra Worksheet Performance
Introduction ....................................................................................................... 3
Worksheet Design Considerations ................................................................. 3
Worksheet Caching ........................................................................................... 4
Appserver Properties Parameters.................................................................... 8
Client Server Attributes .................................................................................... 9
Database Parameters ....................................................................................... 10
Database Health .............................................................................................. 11
Introduction
Worksheets are the primary user interface for the Oracle Demantra tools. Users
use worksheets to view and edit all relevant data for planning purposes, generate
reports and conduct ad-hoc forecasting. Worksheets can be custom designed for
each implementation and individual users based on business requirements and
needs. This flexibility in the design of the worksheet allows the users to create
worksheets that may have a performance impact on the worksheets or system
overall. This white paper lists out some key points that need to be considered
before designing the worksheets to help address potential performance issues. In
addition this white paper lists some of the parameters that can be modified to
improve the performance of the worksheet
Worksheet Caching
Caching enables the system to aggregate and store the subset of data that
is part of the worksheet in a separate table and hence the retrieval is much
faster compared to regular worksheets.
In Demantra 7.3 and onwards, this can be accomplished with the standard
workflow step to call another workflow, with stored procedure step(s) to
manage parallelism. In versions before 7.3, it may be necessary to leverage
the custom step:
v_num_running number;
BEGIN
v_num_running := MAX_CACHE_WFS;
WHILE (v_num_running >= MAX_CACHE_WFS) LOOP
-- get count of wfs in Worksheet Caching group that are
running
select count(*)
into v_num_running
from wf_process_log
where status not in(0,-1,-2)
and schema_id in
(select schema_id from wf_groups_schemas gs,
wf_schema_groups sg
where gs.group_id = sg.group_id
and sg.name = CACHE_WF_GROUP_NAME);
dbms_lock.sleep(dbms_random.value(WAIT_BETWEEN_RETRIES,WAIT_BET
WEEN_RETRIES+60));
END IF;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
null; -- TBD: log exception
END CACHE_WF_WAIT;
/
show errors procedure CACHE_WF_WAIT
exit;
In versions prior to 7.3, the Appserver.properties file has many parameters that can
be leveraged by the administrator to control the behavior of the Demantra system.
In versions after 7.3, these parameters are maintained in the APS_PARAMS table.
The following list of parameters has an impact on the performance of worksheets.
Appserver properties can be located in the appserver machine where the
application is deployed in the following folder (.../ {application name}/ WEB-
INF\classes\com\demantra\applicationServer\services\AppServer.properties)
threadpool.query_run.per_user: This parameter determines the number
of concurrent threads to use for querying data from tables for each user.
Number of concurrent users determines this setting. Experiment, by
increasing it in chunks of 4 to determine an optimal value. Caution should
be exercised in increasing this number; too big a number could result in a
lot of threads waiting for the database to respond if the database doesn’t
have a lot of open connections.
threadpool.query_run.size: This is the total number of threads allocated
for the query run. This should be adjusted based on the number of
concurrent users and the threadpool.query_run.per_user. (Product of
number of concurrent users and threadpool.query_run.per_user). For
example if the threadpool.query_run.per_user is set to 4 and expected
number of concurrent users is 10, this parameter should be set to 40.
Database Health
It is important to maintain the database health so that performance will not
deteriorate.
For more comprehensive and detailed documentation of DB parameters and set
up please refer to the Oracle_Demantra_DB_Best_Practices document (MOS Doc
Id 1499638.1).
This new document is more comprehensive and more up to date with the latest
DB tuning and maintenance options.
Gather DB statistics on the main data tables (such as mdp_matrix,
sales_data, promotion_data) and indexes; after sufficient testing with good
results, statistics can be locked on the tables for the DB optimizer to use.
Rebuild tables by PK: Larger tables in the Demantra schema (like
sales_data, promotion_data, mdp_matrix) should be rebuilt by copying
data to a new table in the order of the column sequence in the Primary
Key. Rebuild should occur when either of these conditions is true:
Out of Order Sequence ratio is > 20%
Chained row count > 10%
Chained Row count: SQL below can be used to determine the %
fragmentation of tables in the Demantra schema. Please note: you should
have run analyze schema before running this sql to get an accurate result.
select table_name, chain_cnt, num_rows,
(chain_cnt/num_rows)*100 percent
from user_tables
where chain_cnt >0 and num_rows > 0
order by chain_cnt desc;
Chained Row count and Out of Order Sequence ratio should be run every
3 months and after any major data load that would increase data volume
by 20%. Make sure you have sufficient disk space to copy data from the
original data tables to the new copy of the tables. If your table is
partitioned you could break the copy by partitions to save on disk space.
It is also recommended (at least once after the data model is finalized and
all the series are created) to re-org the columns on the data tables by
moving empty columns to the end of the table (to minimize table
chaining).
To determine potential savings from a reorder, do the following:
o Determine the avg_row_len, num_rows per table, for example:
select table_name,avg_row_len,num_rows from
sys.dba_tables where table_name ='SALES_DATA' and
owner='&your_owner'
o Use the result of ‘num_rows’ above to compute the maximum
upper limit of the savings.
o Calculate the avg_savings_per_row. Let’s say, for example, the
num_rows was 1072963:
select (sum(num_nulls) / 1072963) as
avg_saving_per_row
from dba_tab_columns
where table_name = 'SALES_DATA'
and owner = '&your_owner';
o Now compare the avg_row_len with the avg_saving_per_row to
see your maximum savings. Your real savings will be less than
this but you will be able to get a reading on the possibile
performance improvement.
To rebuild a table create a procedure similar to this:
o Create a new table NOLOGGING.
V_COUNT := V_COUNT + 1;
IF (V_COUNT = 10000) THEN
v_log_count := v_log_count + 1;
insert into my_sales_log values(v_log_count, SYSDATE);
COMMIT;
V_COUNT := 0;
END IF;
END LOOP;
COMMIT;
END;
Partitioning:
o If the data table (sales_data) is big (over 50M rows) it is
recommended to consider partitioning of the table.
o The most intuitive partitioning option is by date range. Based on
the business flows and requirements, other partitioning strategies
such as a combination of range and hash sub partitioning can
also be evaluated.
o It is also important to distribute the data on the storage system
(either in different physical partitions or via ASM).
Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
Worldwide Inquiries:
Phone: +1.650.506.7000
Fax: +1.650.506.7200
oracle.com