Common Queries for Horizon SQL DBs

View Events DB

Count rows in database

SELECT COUNT(EventID) FROM [ViewEvents6].[dbo].[event]

 

Error Events

SELECT * from ViewEvents6.dbo.event where Severity like ‘%Error%’

 

Events including a specific text

SELECT * from ViewEvents6.dbo.event where ModuleAndEventText like ‘%not ready to accept connections%’

 

Events on a specific date

SELECT * from ViewEvents6.dbo.event where CONVERT(varchar(25), Time, 126) like ‘2016-06-08%’

 

Events of a specific EventType

SELECT * from ViewEvents6.dbo.event where EventType like ‘%ADMIN_DESKTOP_MAINTENANCE_MODE_UPDATED%’

 

Find events for specific VM in View

SELECT * from ViewEvents6.dbo.event where ModuleAndEventText like ‘%desktopname%’

 

 

vCenter Events

Find Desktops Created

SELECT * from ViewVirtualCenter.dbo.VPX_EVENT where EVENT_TYPE like ‘vim.event.vmclonedevent’

 

Find events for specific VM in vCenter

select * from ViewVirtualCenter.dbo.VPX_EVENT where VM_NAME likeĀ  ‘%desktopname%’

 

When vMotions/Storage vMotions Occur

SELECT * from ViewVirtualCenter.dbo.VPX_EVENT where EVENT_TYPE like ‘vim.event.vmbeinghotmigratedevent’

 

SELECT * from ViewVirtualCenter.dbo.VPX_EVENT where EVENT_TYPE like ‘vim.event.vmmigratedevent’

 

Advertisements