Перевести базу данных в аварийное состояние
Microsoft.SQLServer.Windows.Task.Database.SetDBEmergency (Task)
Element properties:
Member Modules:
Source Code:
<Task ID="Microsoft.SQLServer.Windows.Task.Database.SetDBEmergency" Target="SqlDiscW!Microsoft.SQLServer.Windows.Database" Accessibility="Internal" Enabled="true">
<Category>Maintenance</Category>
<WriteAction ID="WA" TypeID="Microsoft.SQLServer.Windows.WriteAction.SetDBState" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Task">
<MachineName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<InstanceName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<MonitoringType>$Target/Host/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<Login>$RunAs[Name="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.SqlCredentials"]/UserName$</Login>
<Password>$RunAs[Name="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.SqlCredentials"]/Password$</Password>
<DatabaseName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</DatabaseName>
<DatabaseState>EMERGENCY</DatabaseState>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<Publisher>SQLMonitoringWindows</Publisher>
<ManagementGroupName>$Target/ManagementGroup/Name$</ManagementGroupName>
</WriteAction>
</Task>