将数据库设置为脱机
Microsoft.SQLServer.2014.Database.SetDBOffline (Task)
Element properties:
Member Modules:
Source Code:
<Task ID="Microsoft.SQLServer.2014.Database.SetDBOffline" Target="SQL2014Core!Microsoft.SQLServer.2014.Database" Accessibility="Internal" Enabled="true">
<Category>Maintenance</Category>
<WriteAction ID="WA" TypeID="Microsoft.SQLServer.2014.SetDBState">
<ConnectionString>$Target/Host/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.DBEngine"]/ConnectionString$</ConnectionString>
<Database>$Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.Database"]/DatabaseName$</Database>
<State>OFFLINE</State>
<TimeoutSeconds>300</TimeoutSeconds>
</WriteAction>
</Task>