可信任組態

Microsoft.SQLServer.Windows.Monitor.Database.TrustWorthyConfiguration (UnitMonitor)

監視資料庫的 [可信任] 設定。注意: 根據預設會停用此監視器。必要時請使用覆寫加以啟用。

Knowledge Base article:

摘要

此監視器會檢查此資料庫的 [可信任] 設定。因為此監視器是整體標準需求的一部分,所以若設定不符合指定的標準,就會產生警示。

組態

TRUSTWORTHY 設定是用來指出 SQL Server 執行個體是否信任資料庫及其中的內容。當 [可信任] 設定為 ON 時,使用模擬內容的資料庫模組 (例如使用者定義函式或預存程序) 可以存取資料庫外部的資源。

為了將安全性風險降至最低,TRUSTWORTHY 應為 OFF。當其設為 OFF 時,"EXECUTE AS USER" 的範圍為資料庫本身,而且只能使用標示為 SAFE 的 CLR 組件。請只在您確定應用程式需要該設定時,才設為 ON。

TRUSTWORTHY {ON | OFF}

原因

如果選項不符合必要的設定,便會引發警告警示。依預設,當此設定設為 "ON" 時,監視器會設定為發出警示。

解決方式

請按照下列方式解決此問題:

若此監視器與此資料庫無關:

外部資源

如需這項設定的詳細資訊,請參閱: ALTER DATABASE SET 選項 (Transact-SQL)

可覆寫的參數

名稱

描述

預設值

警示優先順序

定義警示優先順序。

標準

警示嚴重性

定義警示嚴重性。

警告

已啟用

啟用或停用該工作流程。

預期值

資料庫組態設定需要的值。若要檢視一組適用的值,請參閱此監視的知識庫之<組態>一節。

關閉

產生警示

定義工作流程是否要產生警示。

間隔 (秒)

每次重複執行工作流程之間的時間間隔 (秒)。

43200

同步處理時間

同步處理時間使用 24 小時制。可予省略。

 

逾時 (秒)

指定流程被關閉及標示為失敗之前,允許執行的時間。

300

資料庫連線的逾時 (秒)

若工作流程無法在指定的期限之內存取資料庫,將會失敗並登錄一則事件。

15

Element properties:

TargetMicrosoft.SQLServer.Windows.Database
Parent MonitorMicrosoft.SQLServer.Windows.Rollup.Database.ExternalAccessConfiguration
CategoryConfigurationHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.Windows.MonitorType.Database.DBConfigurationStatus
RemotableTrue
AccessibilityPublic
Alert Message
Windows 上的 MSSQL: 可信任組態錯誤
電腦 "{2}" 上 SQL 執行個體 "{1}" 中資料庫 "{0}" 的 [可信任] 設定未依照最佳做法設定。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Windows.Monitor.Database.TrustWorthyConfiguration" Accessibility="Public" Enabled="false" Target="SqlDiscW!Microsoft.SQLServer.Windows.Database" ParentMonitorID="Microsoft.SQLServer.Windows.Rollup.Database.ExternalAccessConfiguration" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Windows.MonitorType.Database.DBConfigurationStatus" ConfirmDelivery="false">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Windows.Monitor.Database.TrustWorthyConfiguration.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ConfigurationValueOK" MonitorTypeStateID="ConfigurationValueOK" HealthState="Success"/>
<OperationalState ID="ConfigurationValueNotOK" MonitorTypeStateID="ConfigurationValueNotOK" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<NetbiosComputerName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<DatabaseName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</DatabaseName>
<ConfigName>TrustWorthy</ConfigName>
<ExpectedValue>OFF</ExpectedValue>
<ConnectionString>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<MonitoringType>$Target/Host/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<IntervalSeconds>43200</IntervalSeconds>
<SyncTime/>
</Configuration>
</UnitMonitor>