Use
You can use this SAPDBA command with the Oracle database to determine whether new statistics are needed. It enters a
TODO flag in the control table DBSTATC. Using SAPDBA internal rules, methods are entered in DBSTATC for creating or updating obsolete or non-existent statistics.We strongly recommend you to use the
This is phase I of the update statistics functionality. Phase II is
sapdba -analyze.This command and
For a comparison of the old and new approaches, see
Update Statistics for the Cost-Based Optimizer with SAPDBA.For more information on the new approach, see
Updating Statistics using Integrated Approach with SAPDBA.Syntax
You normally enter the following command:
sapdba -checkopt PSAP%
The
sapdba -checkopt PSAP% command uses the primary index to determine the size of all tables. This command only enters tables into DBSTATC that already have statistics.Here is the detailed command syntax:
sapdba
-u system/<password>
-checkopt <tablespace> | <tablespace list> | <table> | <keyword> |
[ -T <hours> ]
force
SAPDBA Command Options
Command option |
Meaning |
-u |
Database system and password |
-checkopt |
Database objects and key words for the operation |
-T |
Restricts the operation to <hours> hours |
-force |
Resets the TODO flags in the control table DBSTATC regardless of the current situation |
If you enter
DBSTATC_TAB for <keyword>, all tables entered in the control table DBSTATC are used.SAPDBA chooses the correct analysis method and option and enters these into the control table DBSTATC if the customer flag is not set. If the table is small, the optimizer starts with the method C. If the table grows, it switches to the method E.
The logs for this command are stored in the directory sapcheck/<timestamp>.opt.
See also: