Restoring metering database from backup taken by VCS

When VCS detects that the metering database has been corrupted or has been accidently deleted outside VCS, it creates a backup of the database. The data available in memory is backed up and a message is logged, and administrative intervention is required to restore the database and reinstate metering and forecast.

The following log message will appear in the engine log:

The backup of metering database from in-memory data is created and saved in <path for metering database backup>. Administrative intervention required to use the backup database.

To restore the database for metering and forecast functionality

  1. Stop the HostMonitor agent using the following command:
    # /opt/VRTSvcs/bin/haagent -stop HostMonitor -force -sys system name
  2. Delete the database if it exists.
    # rm /var/VRTSvcs/stats/.vcs_host_stats.data \
    /var/VRTSvcs/stats/.vcs_host_stats.index
  3. Restore metering database from the backup.
    # cp /var/VRTSvcs/stats/.vcs_host_stats_bkup.data \
    /var/VRTSvcs/stats/.vcs_host_stats.data
    # cp /var/VRTSvcs/stats/.vcs_host_stats_bkup.index \
    /var/VRTSvcs/stats/.vcs_host_stats.index
  4. Setup the database.
    # /opt/VRTSvcs/bin/vcsstatlog --setprop \
    /var/VRTSvcs/stats/.vcs_host_stats rate 120
    # /opt/VRTSvcs/bin/vcsstatlog --setprop \
    /var/VRTSvcs/stats/.vcs_host_stats compressto \
    /var/VRTSvcs/stats/.vcs_host_stats_daily
    # /opt/VRTSvcs/bin/vcsstatlog --setprop \
    /var/VRTSvcs/stats/.vcs_host_stats compressmode avg
    # /opt/VRTSvcs/bin/vcsstatlog --setprop \
    /var/VRTSvcs/stats/.vcs_host_stats compressfreq 24h
  5. Start the HostMonitor agent.
    # /opt/VRTSvcs/bin/haagent -start HostMonitor -sys system name