2.0

Table Of Contents
Running the Guest OS Licensing Script in Oracle
You must have the SELECT permission on the tables in the vCenter Chargeback Manager database to run the
guest OS licensing script.
On running the script, two database objects are created.
n
The CB_VIEW_VC_STAT_INVENTORY database view.
n
The CB_FN_VC_STAT_PAYG function.
The CB_VIEW_VC_STAT_INVENTORY view contains the average usage details of different resources for all the virtual
machines that are part of any hierarchy created in vCenter Chargeback Manager. The CB_FN_VC_STAT_PAYG
function returns the average usage details of different resources for all the virtual machines in the Pay As You
Go model for a given hierarchy ($hierarchy_name) and for the specified time period ($start_time : $end_time).
Table 8-5 lists the details of the columns in the CB_VIEW_VC_STAT_INVENTORY database view. The
CB_VIEW_VC_STAT_PAYG function returns values similar to the output of a SELECT query on the
CB_VIEW_VC_STAT_INVENTORY database view. However, in this case the data for only a given hierarchy and for
a specific duration is returned.
For example,
SELECT * from TABLE(CB_FN_VC_STAT_PAYG('Test Hierarchy',to_timestamp('20110114 00:00:00',
'YYYYMMDD HH24:MI:SS'), to_timestamp('20110714 23:59:59', 'YYYYMMDD HH24:MI:SS')));
NOTE The CB_FN_VC_STAT_PAYG function is created based on the assumption that all the virtual machines in
vCenter Chargeback Manager under the Pay as You Go model for any hierarchy organization is present under
Pay as You Go > Any_OrgVDC > vApps Folder > vApps.
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.
vCenter Chargeback Manager User’s Guide
134 VMware, Inc.