Hi experts,
I would like to share with you a strange behavior I've noticed on a test system.
OS Win 2008R2 SP1
Oracle 11.2.0.3 PATCH 15
SAP ECC 6 Ehp (NW 731)
Brtools 7.20 (31)
I've noticed some wrong execution plans after client copy.
I did run an other copy this weekend and checked closely what was going on and it's not matching at all what I've read/learned.
Even if table monitoring is active the DBA_TAB_MODIFICATIONS has not been updated after the client copy (copy of production client on test system).
show parameter statistics
NAME TYPE VALUE
optimizer_use_pending_statistics boolean FALSE
statistics_level string TYPICAL
timed_os_statistics integer 0
timed_statistics boolean TRUE
select monitoring, count(1) from dba_tables where owner = 'SAPSR3' group by monitoring;
MON COUNT(1)
YES 85195
Before copy:
select sum(INSERTS), sum(UPDATES), sum(DELETES) from sys.dba_tab_modifications where TABLE_OWNER ='SAPSR3';
COUNT(1) SUM(INSERTS) SUM(UPDATES) SUM(DELETES)
18030 71041559 5727108 63098779
After copy:
select sum(INSERTS), sum(UPDATES), sum(DELETES) from sys.dba_tab_modifications where TABLE_OWNER ='SAPSR3';
COUNT(1) SUM(INSERTS) SUM(UPDATES) SUM(DELETES)
18030 71041559 5727108 63098779
I did check last time stat has been update on one of our largest table:
select 'dba_tables', to_char(LAST_ANALYZED, 'Dy DD-Mon-YYYY HH24:MI:SS') from dba_tables tbls where table_name ='FAGLFLEXA'
union
select 'dba_tab_statistics', to_char(LAST_ANALYZED, 'Dy DD-Mon-YYYY HH24:MI:SS') from dba_tab_statistics where table_name ='FAGLFLEXA';
'DBA_TABLES' TO_CHAR(LAST_ANALYZED,'DYDD-MON-YYYY
dba_tab_statistics Mon 02-Sep-2013 01:37:07
dba_tables Mon 02-Sep-2013 01:37:07
I checked the table number of rows
select num_rows from dba_tables where table_name ='FAGLFLEXA';
NUM_ROWS
109225667
select count(1) from sapsr3.FAGLFLEXA;
COUNT(1)
134074127
According to the stat internal rules B*Tools should update stats...
106047 - DB21: Customizing the DBSTATC
http://help.sap.com/saphelp_nw73ehp1/helpdata/en/46/CE3317A5171827E10000000A1553F6/content.htm
#old rows + # inserted rows >= # old rows * (100 + threshold) / 100
109225667+134074127 >= 109225667 * (100+50)/100
243299794 >= 163838501
But it is not ...
brconnect -u / -c -f stats -t FAGLFLEXA
BR0280I BRCONNECT time stamp: 2013-09-15 21.52.30
BR0879I Statistics checked for 1 table
BR0878I Number of tables selected to collect statistics after check: 0
BR0880I Statistics collected for 0/0 tables/indexes
The fact is that after the client copy some reports doing heavy DB access are performing very poorly and some unoptimized access path are selected.
There is always a possibility to force statistics updates for all tables...
brconnect -u / -c -f stats -t all -m +I -s P10 -f allsel,collect,method -p 12
... but I would like to understand what's wrong with my understanding and/or my analysis...
Thanks for your help !