Skip to content
Luca Dell'Oca Principal Cloud Architect @Veeam
Virtual To The Core Virtual To The Core

Virtualization blog, the italian way.

  • Media
  • About me
Virtual To The Core
Virtual To The Core

Virtualization blog, the italian way.

Deframmentare il database di vCenter

Luca Dell'Oca, March 30, 2010December 4, 2016

Avete mai ipotizzato, tra i vari motivi di lentezza che affliggono vCenter, una eccessiva deframmentazione degli indici del suo database SQL? Beh, fatelo, perchè su sistemi particolarmente carichi, pieni di record storici, la deframmentazione del database potrebbe portare a recuperi prestazionali non da poco.

Innanzitutto, dovrete arrestare il servizio vCenter.

  1. Su un SQL 2005, aprire il Management Studio come amministratore (anche un sql express).
  2. tasto destro sul database di vCenter e scegliete “new query”
  3. Use <database>
    go
    dbcc showcontig (VPX_HIST_STAT1)
    dbcc showcontig (VPX_HIST_STAT2)
    dbcc showcontig (VPX_HIST_STAT3)
    dbcc showcontig (VPX_HIST_STAT4)
    go
  4. premete su “Execute”

I valori importanti per noi saranno:

– Scan Density [Best Count:Actual Count]…….: 33.75% [xxxxx:xxxxx]
– Logical Scan Fragmentation ………………: 41.12%

Nel primo, più il valore si avvicina a 100 meglio è, per il secondo valore è il contrario. Per eseguire la deframmentazione utilizzeremo la seguente query, esattamente come abbiamo fatto con quella precedente:

dbcc indexdefrag ('<database>', 'VPX_HIST_STAT1', 'PK_VPX_HIST_STAT1')
dbcc indexdefrag ('<database>', 'VPX_HIST_STAT2', 'PK_VPX_HIST_STAT2')
dbcc indexdefrag ('<database>', 'VPX_HIST_STAT3', 'PK_VPX_HIST_STAT3')
dbcc indexdefrag ('<database>', 'VPX_HIST_STAT4', 'PK_VPX_HIST_STAT4')
go

Il risultato potrà essere qualcosa di simile a questo:

DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Pages Scanned Pages Moved Pages Removed
173941        63527       110406

che ci indicherà la deframmentazione avvenuta dato che moltissime pagine sono state mosse.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to email a link to a friend (Opens in new window) Email
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
Tecnologia defragsqlvCenter

Post navigation

Previous post
Next post

Search

Sponsors

Latest Posts

  • Migrate WSL (Windows Subsystem for Linux) to a new computer
  • Pass keystrokes to a pfSense virtual machine to install it automatically
  • Automatically deploy pfSense with Terraform and Ansible
  • My Automated Lab project: #6 Create a S3 Bucket with Terraform
  • My Automated Lab project: #5 Deploy a Linux vSphere VM with Terraform and custom disks
©2025 Virtual To The Core | WordPress Theme by SuperbThemes
We use cookies to ensure that we give you the best experience on our website, and to collect anonymous data regarding navigations stats using 3rd party plugins; they all adhere to the EU Privacy Laws. If you continue to use this site we will assume that you are ok with it.OkNoPrivacy Policy