它是msdb,資源,主或本地?如果我備份運行XE的本地數據庫,我是否也備份了會話?系統表中是否還有任何元數據存儲? 謝謝大家。擴展事件的會話定義存儲在哪裏?
1
A
回答
0
在做了一些挖掘之後,我發現會話的定義存儲在主數據庫中(因爲會話是在服務器級別定義的,因此您可以考慮這些定義)。
備份此數據庫將備份您創建的會話,但這不是恢復它們的最簡單方法。您可能最好導出會話並將其保存爲模板,或將它們腳本化並保存在安全的地方。
2
您可以從各種擴展DMV中檢索它們。例如,下面的查詢將返回一些關於擴展事件的信息。包括一些過濾器已註釋:
-- Extended Event Packages
select
name,
guid,
description
from sys.dm_xe_packages
where (capabilities is null or capabilities & 1 = 0) -- ignore private packages for SQL Server internal use
-- Events
select
p.name as package_name,
o.name as source_name,
o.description
from sys.dm_xe_packages as p
inner join sys.dm_xe_objects as o
on p.guid = o.package_guid
where
(p.capabilities is null or p.capabilities & 1 = 0)
and (o.capabilities is null or o.capabilities & 1 = 0)
and o.object_type = 'event'
--and o.name like 's%'
-- Event targets
select
p.name as package_name,
o.name as source_name,
o.description
from sys.dm_xe_packages as p
inner join sys.dm_xe_objects as o
on p.guid = o.package_guid
where
(p.capabilities is null or p.capabilities & 1 = 0)
and (o.capabilities is null or o.capabilities & 1 = 0)
and o.object_type = 'target'
-- Predicate sources
select
p.name as package_name,
o.name as source_name,
o.description
from sys.dm_xe_packages as p
inner join sys.dm_xe_objects as o
on p.guid = o.package_guid
where
(p.capabilities is null or p.capabilities & 1 = 0)
and (o.capabilities is null or o.capabilities & 1 = 0)
and o.object_type = 'pred_source'
-- Predicate comparators
select
p.name as package_name,
o.name as source_name,
o.description
from sys.dm_xe_packages as p
inner join sys.dm_xe_objects as o
on p.guid = o.package_guid
where
(p.capabilities is null or p.capabilities & 1 = 0)
and (o.capabilities is null or o.capabilities & 1 = 0)
and o.object_type = 'pred_compare'
-- Maps
select
p.name as package_name,
o.name as source_name,
o.description
from sys.dm_xe_packages as p
inner join sys.dm_xe_objects as o
on p.guid = o.package_guid
where
(p.capabilities is null or p.capabilities & 1 = 0)
and (o.capabilities is null or o.capabilities & 1 = 0)
and o.object_type = 'map'
-- Types
select
p.name as package_name,
o.name as source_name,
o.description
from sys.dm_xe_packages as p
inner join sys.dm_xe_objects as o
on p.guid = o.package_guid
where
(p.capabilities is null or p.capabilities & 1 = 0)
and (o.capabilities is null or o.capabilities & 1 = 0)
and o.object_type = 'Type'
-- Event columns
select
o.name as [event],
oc.name as column_name,
oc.column_type as column_type,
oc.column_value as column_value,
oc.description as column_description
from
sys.dm_xe_packages as p
inner join sys.dm_xe_objects as o
on p.guid = o.package_guid
inner join sys.dm_xe_object_columns as oc
on o.name = oc.object_name
and o.package_guid = oc.object_package_guid
where
(p.capabilities is null or p.capabilities & 1 = 0)
and (o.capabilities is null or o.capabilities & 1 = 0)
and (oc.capabilities is null or oc.capabilities & 1 = 0)
and o.object_type = 'event'
--and o.name like '%lock%'
order by event, column_name
-- Configurable Event Columns
-- These elements are optional and usually not present in event output.
-- They can be enabled as needed.
select
o.name as [event],
oc.name as column_name,
oc.column_type as column_type,
oc.column_value as column_value,
oc.description as column_description
from
sys.dm_xe_packages as p
inner join sys.dm_xe_objects as o
on p.guid = o.package_guid
inner join sys.dm_xe_object_columns as oc
on o.name = oc.object_name
and o.package_guid = oc.object_package_guid
where
(p.capabilities is null or p.capabilities & 1 = 0)
and (o.capabilities is null or o.capabilities & 1 = 0)
and (oc.capabilities is null or oc.capabilities & 1 = 0)
and o.object_type = 'event'
--and o.name = 'file_write_completed'
and oc.column_type = 'customizable'
-- Configurable options
select
oc.name as column_name,
oc.column_id,
oc.type_name,
oc.capabilities_desc,
oc.description
from
sys.dm_xe_packages as p
inner join sys.dm_xe_objects as o
on p.guid = o.package_guid
inner join sys.dm_xe_object_columns as oc
on o.name = oc.object_name
and o.package_guid = oc.object_package_guid
where
(p.capabilities is null or p.capabilities & 1 = 0)
and (o.capabilities is null or o.capabilities & 1 = 0)
and (oc.capabilities is null or oc.capabilities & 1 = 0)
and o.object_type = 'target'
--and o.name = 'file_write_completed'
and oc.column_type = 'customizable'
-- Map Values
select
name,
map_key,
map_value
from sys.dm_xe_map_values
where 1 = 1
--and name = 'wait_types'
--and map_value like 'lck%'
相關問題
- 1. 會話存儲在哪裏?
- 2. TortoiseHg擴展名存儲在哪裏?
- 3. Yii的:它在哪裏存儲會話
- 4. 哪裏擴展屬性存儲?
- 5. ZF2:會話存儲在哪裏?
- 6. 在哪裏存儲會話狀態?
- 7. 會話超時在哪裏定義?
- 8. 會話保存在哪裏?
- 9. Linux事件存儲快照在哪裏?
- 10. chrome存儲在哪裏解壓縮擴展本地存儲文件
- 11. 在哪裏存儲擴展相關的信息在vscode
- 12. 在哪裏存儲用於Chrome擴展的HTML片段
- 13. SQL Server中存儲的擴展屬性在哪裏?
- 14. 在哪裏存儲擴展在斯威夫特項目
- 15. 在Dynamics CRM 4.0中爲自定義事件存儲的實際JavaScript在哪裏?
- 16. 如何存儲可擴展的可擴展事件日誌?
- 17. JavaScript對象存儲在哪裏可擴展與否?
- 18. 用戶數據存儲在哪裏VS擴展?
- 19. symfony2自定義存儲庫擴展EntityRepository
- 20. Moq - setup在哪裏擴展?
- 21. 我在哪裏擴展AsyncTask?
- 22. 文件存儲在哪裏?
- 23. 自定義控件的屬性存儲在哪裏?
- 24. 我可以在哪裏存儲自定義控件的圖像?
- 25. Laravel在哪裏存儲memcached會話驅動程序的配置?
- 26. IIS在哪裏存儲用戶創建的會話?
- 27. Django基於cookie的會話數據存儲在哪裏?
- 28. 會話數據在redmine中存儲在哪裏?
- 29. WCF事務狀態存儲在哪裏?
- 30. 擴展會話中間件
謝謝隊友。接受爲正確的答案。 – user2155565 2013-03-25 03:24:57