optdiag syntax

The syntax for optdiag is:

optdiag [binary] [simulate] statistics
    {-i input_file | 
    database[.owner[.[table[.column]]]]
        [-o output_file]} 
    [-U username] [-P password]
    [-I interfaces_file] 
    [-S server]
    [-v] [-h] [-s] [-Tflag_value]
    [-z language] [-J client_charset] 
    [-a display_charset]

You can use optdiag to display statistics for an entire database, for a single table and its indexes and columns, or for a particular column.

To display statistics for all user tables in the pubtune database, placing the output in the pubtune.opt file, use the following command:

optdiag statistics pubtune -Usa -Ppasswd  
-o pubtune.opt

This command displays statistics for the titles table and for any indexes on the table:

optdiag statistics pubtune..titles -Usa -Ppasswd
        -o titles.opt

See Utility Programs Manual for your platform for more information on the optdiag command. The following sections provide information about the output from optdiag.