Entering content frameSyntax documentation sapdba -checkopt Locate the document in its SAP Library structure

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.

Recommendation

We strongly recommend you to use the BRCONNECT equivalent function -f stats instead of this SAPDBA command. The reason is that we will in future no longer develop the SAPDBA functions, whereas BRCONNECT functions will always be fully up-to-date.

This is phase I of the update statistics functionality. Phase II is sapdba -analyze.

Note

This command and sapdba -analyze are equivalent to the newer integrated approach using sapdba -statistics. We recommend you to use the new approach.

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

Note

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:

Leaving content frame