Перевести базу данных в автономный режим
Microsoft.SQLServer.Windows.Task.Database.SetDBOffline (Task)
Element properties:
Member Modules:
Source Code:
<Task ID="Microsoft.SQLServer.Windows.Task.Database.SetDBOffline" 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>
<NetbiosComputerName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<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>
<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>OFFLINE</DatabaseState>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<Publisher>SQLMonitoringWindows</Publisher>
<ManagementGroupName>$Target/ManagementGroup/Name$</ManagementGroupName>
</WriteAction>
</Task>