optimizedb Examples
1. Generate full statistics for all tables in the sales database, assuming you have db_admin privilege:
optimizedb –all sales
2. Generate full statistics for all columns in all your tables in the sales database:
optimizedb –zns sales
The –zns flags speeds the building of the histogram.
3. Generate statistics for key or indexed columns in the employee and dept tables and for the dno column in the dept table:
optimizedb -zk empdata -remployee -rdept -adno
Perform the same operation as the previous example, but from a file:
optimizedb -zf flagfile
where flagfile contains:
-zk
empdata
-remployee
-rdept
-adno
4. Generates statistics for all key or indexed columns in employee, dept, and salhist. Process the eno column in employee, whether or not eno is a key or indexed column. Generate statistics with only minimum and maximum values from the columns. Print status information as each column is processed.
optimizedb
-zk
-zv
-zx
empdata
-remployee
-aeno
-rdept
-rsalhist;
5. Allow up to 100 unique values from each column in the employee table before merging adjacent values into the same histogram cell:
optimizedb
-zu100
empdata
-remployee;
Last modified date: 11/09/2022