.. _voss_database_commands:

Database Commands
-----------------

.. _19.1.1|EKB-1033:

.. index:: voss;voss cleardown

* **voss cleardown** - the command re-initializes the |VOSS-4-UC| database. It
  is usually run on a fresh installation and care should be taken with its use,
  as it deletes all system data.

  Note that this step may take some time. You can follow the process by
  running **log follow upgrade_db.log** or **log follow voss-deviceapi/app.log**.

.. index:: voss;voss db_collection_stats

* **voss db_collection_stats [collection]...** - Display detailed statistics of
  all the |VOSS-4-UC| databases, or of only a list of collections.

  Refer to the example snippets below.


::

   $ voss db_collection_stats


   +--------------------+-----+--------+---------+-------------+------+----------+
   | Collection         | Cnt | % Size | DB Size | AvgObj Size | Idx  | Idx Size |
   +--------------------+-----+--------+---------+-------------+------+----------+
   | VOSS.DATA_ACCESS.. |   8 |   0.0% |  92.88K |      11.61K |    2 |   15.97K |
   | VOSS.DATA_APIVER.. |   1 |   0.0% | 496.00b |     496.00b |    2 |   15.97K |
   | VOSS.DATA_APPLIC.. |   1 |   0.0% |   1.98K |       1.98K |    2 |   15.97K |
   +--------------------+-----+--------+---------+-------------+------+----------+

   ...

   | VOSS.WORKER_QUEUE  |9508 |   9.4% | 117.76M |      12.68K |    9 |    4.34M |
   +--------------------+-----+--------+---------+-------------+------+----------+
   Total Documents: 144624
   Total Data Size: 1.22G
   Total Index Size: 73.31M

 
.. index:: voss;voss db_index_stats

* **voss db_index_stats** - Display detailed statistics of the |VOSS-4-UC| database indices, including the
  five largest.

  Refer to the example below.


::  

   $ voss db_index_stats
   
   Index Overview
   +----------------------+--------------------------------+--------+------------+
   | Collection           | Index                          | % Size | Index Size |
   +----------------------+--------------------------------+--------+------------+
   | VOSS.CACHE           | _id_                           |   1.9% |      1.38M |
   | VOSS.CACHE           | model_type_1_model.name_1_vers |   5.4% |      3.88M |
   | VOSS.DATA_USER       | _id_                           |   0.0% |      7.98K |
   
   ...
   
   | VOSS.WORKER_QUEUE    | top_level_transaction_pkid_1   |   1.1% |    838.36K |
   +----------------------+--------------------------------+--------+------------+
   
   Top 5 Largest Indexes
   +----------------------+--------------------------------+--------+------------+
   | Collection           | Index                          | % Size | Index Size |
   +----------------------+--------------------------------+--------+------------+
   | VOSS.RESOURCE        | meta.model_type_1__search._i.. |  32.9% |     23.51M |
   | VOSS.TRANSACTION_LOG | _id_                           |   8.3% |      5.94M |
   | VOSS.CACHE           | model_type_1_model.name_1_ve.. |   5.4% |      3.88M |
   | VOSS.TRANSACTION_LOG | _id.t_id_1_time_1              |   5.3% |      3.81M |
   | VOSS.TRANSACTION     | top_level_1                    |   5.2% |      3.75M |
   +----------------------+--------------------------------+--------+------------+
   
   Total Documents: 139857
   Total Data Size: 1.12G
   Total Index Size: 71.47M

 

.. |VOSS-4-UC| replace:: VOSS-4-UC
.. |Unified CM| replace:: Unified CM