Rebuilding databases monthly

To reduce fragmentation of the databases, rebuild the database monthly by packing and unpacking it.

This topic contains steps for Windows and UNIX

Windows

Procedure

  1. Shut down database sessions and protect the database.
    1. Broadcast a shutdown message to the database users.

      > ccm message /database database_path "shutdown message"

    2. Perform the shutdown.

      > ccmdb shutdown database_path

    3. Show the database usage to ensure that everyone is out of the database.

      > ccm monitor database_path

  2. Back up the database. First check the database, and then pack it.
    > ccmdb check database_path
    > ccmdb pack database_path /to destination_dir
  3. Delete the database.

    > ccmdb delete database_path

  4. Unpack the database, using the pack file you created in step 2.

    > ccmdb unpack packfile /to database_path

UNIX

Procedure

  1. Set user to ccm_root.
    $ su - ccm_root
    Password: *****
  2. Shut down database sessions and protect the database.
    1. Broadcast a shutdown message to the database users.

      ccm message -database database_pathshutdown message

    2. Perform the shutdown.

      $ ccmdb shutdown database_path

    3. Show the database usage to ensure that everyone is out of the database.

      $ ccm monitor database_path

  3. Back up the database. First check the database, and then pack it.

    $ ccmdb check database_path

    $ ccmdb pack database_path -to destination_dir

  4. Delete the database.

    $ ccmdb delete database_path

  5. Unpack the database, using the pack file you created in step 3.

    $ ccmdb unpack packfile -to database_path


Feedback