1.0

Table Of Contents
vCenter Chargeback User’s Guide
82 VMware, Inc.
2Enterthefollowinginformation:
Existingpassword
Newpassword
Confirmationofthenewpassword
3RestartthevCenterChargebackserviceandthedatacollectorservices.
Database Management Scripts
vCenterChargebackprovidesSQLscriptsthatcanhelpdatabaseadministratorstomanagethevCenter
Chargebackdatabase.TheseSQLscriptscanberunbyadatabaseuserwiththerequiredpermissionsfromthe
SQLprompt.Thesescriptsareavailableatthefollowinglocation:
ForSQLServer
<Installation_Directory>/vCenter-CB-Scripts/v0.0.0-v1.0.0/mssql/db-management
Thescriptnamesareoftheform<script_name>_mssql.sql.
ForOracle
<Installation_Directory>/vCenter-CB-Scripts/v0.0.0-v1.0.0/oracle/db-management
Thescriptnamesareoftheform<script_name>_oracle.sql.
Thesescriptscanbeclassifiedasfollows:
“GenericScripts”onpage 82
“SpaceCalculationScripts”onpage 82
“DataPurgingandRestoringScripts”onpage 83
Generic Scripts
vCenterChargebackprovidesthreegenericscripts.YoumusthavetheSELECTpermissiononthetablesinthe
vCenterChargebackdatabasetorunthesescripts.BeforerunningthegenericscriptsonanSQLServer
database,youmustreplace$dbNamewiththenameofthevCenterChargebackdatabaseintheSQLscripts.
The
genericscriptsprovidedareasfollows:
countActiveConns:Thisscriptreturnsthenumberofactiveconnectionstothedatabase.
countRows:Thisscriptreturnsthenumberofrowsineachofthetablesinthedatabase.
dbSize:Thisscriptreturnthespaceoccupiedbythetablesinthedatabase.
Space Calculation Scripts
Thesescriptsenableyoutocalculatethespacethatcanberetrievedbypurgingtheolddatafromthedatabase
tablesintoCSVfiles.YoumusthavetheSELECTpermissiononthetablesinthevCenterChargebackdatabase
torunthesescripts.Thev_months_in_historyparameterforOraclescriptsandthe
@MONTHS_IN_HISTORY
parameterforSQLServerscriptsissetto6monthsbydefault.Youcanchangethisinthescriptstothedesired
numberofmonths.Thespacecalculationscriptsprovidedare:
spaceCostData:Thisscriptreturnstheamountofspacethatcanberetrievedbypurgingthecostdata
thatisolderthanthespecifiednumberofmonths.
spaceHierarchyData:Thisscriptreturnstheamountofspacethatcanberetrievedbypurgingthe
hierarchydatathatisolderthanthespecifiednumberofmonths.
spaceReportData:Thisscriptreturnstheamountofspacethatcanberetrievedbypurgingthereport
datathatisolderthanthespecifiednumberofmonths.