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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s