1.0.1

Table Of Contents
VMware, Inc. 89
Chapter 8 System Health, Utilities, and Troubleshooting
spaceTablesData:Thisscriptreturnstheamountofspacethatcanberetrievedbypurgingthecost,
hierarchy,andreportdatathatisolderthanthespecifiednumberofmonths.
spaceStatsData:Thisscriptreturnstheamountofspacethatcanberetrievedbypurgingthe
performancestatisticsdata(fromtheCB_VC_PERFORMANCE_STATtable)thatisolderthanthespecified
dateandhasthespecifiedsampleinterval.Thedateandintervalvauescanbesetthroughthe
v_purge_beforeandv_req_intervalparametersin
theOraclescriptsandthe$PURGE_BEFOREand
@REQ_INTERVALparametersintheSQLServerscripts.
Data Purging and Restoring Scripts
Thepurgingscriptsenableyoutoremovedataolderthanthespecifiednumberofmonthsfromthedatabase
tablesandsavetheminCSVfiles.TorunthesescriptsyoumusthavetheSELECT,INSERT,andDELETE
permissionsonthedatabasetables.ForrunningthescriptsinanOracledatabase,
youmustalsohavethe
SELECTpermissionontheexternaltables(EXT_CB_%),whicharecreatedbythe
makeExternalTables_oracle.sqlscript.ForrunningthescriptsinanSQLServerdatabase,youmustalso
havetheCREATE TABLEandDROP TABLEpermissionsinthedatabase.
BeforeyourunthepurgingscriptsinSQLServer,you
mustperformthefollowingtasks:
1 CreateafolderwheretheCSVfilescanbesaved.
2CopytheSchema.iniandmakeCSVfiles.batfilesintothecreatedfolder.
Thesefilesareavailableatthefollowinglocation:
<Installation_Directory>/vCenter-CB-Scripts/v0.0.0-v1.0.0/mssql/db-management
3RunthemakeCSVfiles.batfilefromthecommandprompt.
EnsurethatyouhavepermissiontoexecuteBATfiles.ThisscriptcreatesemptyCSVfiles,oneforeachof
thevCenterChargebackdatabasetablesfromwhichdatacanbepurged.
4Setthevalueforthe@datasrcparameterinthemakeArchServer_mssql.sqlscript.
Thevaluefor
thisparametermustbethecompletepathofthefolderthatiscreatedfortheCSVfiles.
5LogintotheSQLServerManagementStudioconsole,andrunthemakeArchServer_mssql.sqlscript.
Thescriptcreatesalinkedserver.
BeforeyourunthepurgingscriptsinOracle,youmustperformthefollowingtasks:
1Loginto
theSQLDeveloperconsoleandrunthecsvproc_oracle.sqlscript.
Thisfileisavailableatthefollowinglocation:
<Installation_Directory>/vCenter-CB-Scripts/v0.0.0-v1.0.0/oracle/db-management
TheprocedureforpurgingdatafromthevCenterChargebackdatabasetablesintotheCSVfilesiscreated.
2SettheEXT_TABLE_DIR_STRparameterinthefollowingfilestothecompetepathofthefolderinwhich
theCSVfilesshouldbesav ed:
makeExternalTables_oracle.sql
purgeCostData_oracle.sql
purgeHierarchyData_oracle.sql
purgeReportData_oracle.sql
purgeTables_oracle.sql
3RunthemakeExternalTables_oracle.sqlscript.
TheexternaltablesarecreatedandlinkedtothecorrespondingCSVfiles.TheCSVarecreatedwhenthe
purgescriptsarerunforthefirsttime.
N
OTEThedatapurgingscriptsaresupportedonlyon32bitdatabaseinstances.