cancel
Showing results for 
Search instead for 
Did you mean: 

update stats for table in dbstatc

Former Member
0 Kudos

Hello all,

I am very new to administrating SAP on Oracle. My question is. There are some tables in dbstatc with ignore flag. I ran the below query to get that...

select COUNT(*) from sapsr3.dbstatc

where ACTIV = 'I';

Now from my understanding the I flag means...do not update stats for that table...

So i first ran below...which runs the full stats and it did not update or touched those table in dbstats with I flag

brconnect -c -u / -f stats -t all -f collect -p 8

so after researching i found we can update those stats with below .... even after running the below, stats still do not show up as update.... how can i update (forcefully if required) to update stats for a particular table....

brconnect -u / -c -f stats -t SAPSR3.table_name -f allsel -p 4

i query dba_tables at DB level to see if that specific table was analyzed or not. I am on 11.2 oracle version...and this is a BW SAP system....

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

New User:

1) Which objects do you have the INACTIVE flag set for:

col dbobj format a20

select dbobj, activ from sapsr3.dbstatc where activ = 'I' order by 1;

2) Check that you have the correct DBSTATC settings per SAP Note 403704.

If you do not, then I would suggest you update the DBSTATC table following SAP Note 403704, but before you do take a copy of the dbstatc table:

sqlplus sapsr3/<pass.

create table dbstatc_old as select * from dbstatc;

3) To check to see if you have stats on a table:

select table_name, partitioned, last_analyzed, num_rows from dba_tables where table_name = 'TBTCO';

TABLE_NAME PAR LAST_ANALYZED NUM_ROWS

-


TBTCO NO 19-MAY-11 163030

If the LAST_ANALYZED shows up with NO values, then there are NO stats on the table.

HOWEVER, be careful for partitioned tables in BW because there are stats at the partition level as well:

select TABLE_NAME, PARTITION_NAME, LAST_ANALYZED, NUM_ROWS from dba_tab_partitions where table_name = '<table>';

4) To collect the statistics on a table

brconnect -c -u / -f stats -t <TABLE> -f allsel,collect -g 4 -p 16

5) If the stats are still not collected with the brconnect command, it may be because the stats are locked at the table level from SAP Note 1020260:

SELECT stattype_locked FROM dba_tab_statistics WHERE table_name = '<TABLE>';

If the value is ALL, then the stats may be locked at the table level and may require to unlock the stats before updating.

Good Luck,

Mike Kennedy

Former Member
0 Kudos

Thanks,

Is there a brconnect specific doc that you guys can point me to?

i found the below (SAP Database Guide: Oracle)..... the full version....and it talks about brconnect just a little bit. I was wondering if there is a brconnect connect that talk about all the details....where if i were to use alsel falg...what it dose....and my brconnect version is 7.2

[original link is broken]