Previous Topic: Cleaning Up Your DatabaseNext Topic: Backing Up Your Database


Updating Database Statistics

SQL Server provides the ability to update statistics in a database. Update statistics will cause SQL Server to evaluate the current state of the database and store statistics about how many rows are stored in each table. This helps SQL Server determine which indexes to use when retrieving data from the tables.

Updating statistics frequently (you may choose to update statistics at the same time as your database backups), can help improve performance in the CSE. You should not take down the database or CSE software to run statistics for SQL Server. You may want to update statistics daily.

Follow these steps:

  1. Start up the SQL Server Management Studio from the SQL Server program group. Unless the system administrator ID/password has been changed, use sa as the login ID and a password to start the Management Studio.
  2. From the DB drop down list box, select <DBCSE> (or your encyclopedia database name).
  3. Select File Open, to open the file estats.sql in %IEFCSGEN%\..\cse_msqls.

    If you do not have estats.sql, then type in the following commands manually:

    update statistics DASC
    update statistics DCKOHIST
    update statistics DCKOID
    update statistics DENCY
    update statistics DGRPUS
    update statistics DMAX
    update statistics DMDL
    update statistics DMDLUS
    update statistics DNAME
    update statistics DOBJ
    update statistics DSUBDF
    update statistics DSUBEX
    update statistics DSUBID
    update statistics DSUBUS
    update statistics DTXT
    update statistics DUSR
    update statistics SASC
    update statistics SDIV
    update statistics SOBJ
    update statistics SPRP
    update statistics STRG
    update statistics DXCPID

  4. Select the Execute Query (F5) icon.

    This executes all the previous commands against your <DBCSE> database. Output can be viewed in the Results window. The update statistics commands have completed successfully when the following message is displayed on the Results window:

    This command did not return data, and it did not return any rows.

  5. You may save the data to a file for use the next time.

Follow these steps:

  1. Start up the SQL Server Management Studio from the SQL Server program group. Unless the system administrator ID/password has been changed; use sa as the login ID and a password to start the Management Studio.
  2. From the DB drop down list box, select <DBDIR> (or your Coordination server database name).
  3. Select File Open to open the file called dstats.sql. If you do not have dstats.sql, then type in the following commands manually:

    update statistics DIRLOGON
    update statistics DIRUSER
    update statistics DIRENCY
    update statistics DIRXCPID

  4. Select the Execute Query (F5) icon.

    This executes all the previous commands against your <DBDIR> database. Output can be viewed in the Results window. The update statistics commands have completed successfully when the following message is displayed on the Results window:

    This command did not return data, and it did not return any rows.

  5. You may save the data in a file for use the next time.