2.5

Table Of Contents
vCenter Chargeback Manager Database Management Scripts
vCenter Chargeback Manager provides SQL scripts that can help database administrators to manage the
vCenter Chargeback Manager database.
These SQL scripts can be run from the SQL prompt by any database user having the required permissions.
These scripts are packaged with the application and are located in the following folders:
n
For SQL Server
Installation_Directory
\Database Scripts\main\
version
\mssql\db-management
The script names are of the form
script_name
_mssql.sql.
n
For Oracle
Installation_Directory
\Database Scripts\main\
version
\oracle\db-management
The script names are of the form
script_name
_oracle.sql.
Installtion_Directory refers to the complete path of the folder in which vCenter Chargeback Manager is installed.
version refers to a folder that has version number as the folder name. For example, v1.5.0 or v2.0.
Generic Scripts
vCenter Chargeback Manager provides few generic SQL scripts that let you fetch certain statistical data about
the vCenter Chargeback Manager database.
Prerequisites for Running the Generic SQL Scripts
You must have the SELECT permission on the tables in the vCenter Chargeback Manager database to run
these scripts. Before running the generic scripts on an SQL Server database, you must replace $dbName with the
name of the vCenter Chargeback Manager database in the SQL scripts.
About the Generic SQL Scripts
Table 8-8 lists the generic SQL scripts provided with vCenter Chargeback Manager.
Table 8-8. Generic SQL Scripts
Script Name Description
countActiveConns
This script returns the number of active connections to the database.
countRows
This script returns the number of rows in each of the tables in the database.
dbSize
This script return the space occupied by the tables in the database.
Space Calculation Scripts
The space calculation scripts shipped with vCenter Chargeback Manager enable you to calculate the space that
can be retrieved by purging the old data from the database tables.
Prerequisites for Running the Space Calculation Scripts
You must have the SELECT permission on the tables in the vCenter Chargeback Manager database to run the
space calculation scripts. The v_months_in_history parameter in the Oracle scripts and the
@MONTHS_IN_HISTORY parameter in the SQL Server scripts is set to 6 months by default. You can change this in
the scripts to the desired number of months.
vCenter Chargeback Manager User’s Guide
148 VMware, Inc.