SQL Server creates a scheduled maintenance plan (backup database)

1. Shrink the log to 1MB before backup

    1. Connect to the database-Management-Maintenance Plan-New Maintenance Plan

       Find the Execute T-SQL statement task in the lower left corner and drag it to the right. Click Edit to add the SQL statement that changes the database to simple mode. After the addition is completed, set the execution plan task.

Set execution time for scheduled tasks

2. Shrink the database log to 1MB

   Click on the top to add a subplan. You can add multiple subplans. In the lower left corner, drag the execution T-SQL statement to the right. Click Edit to add the contracted statement to it.

 Set execution time for scheduled tasks

 3. Add automatic backup database scheduled tasks

 Set execution time for scheduled tasks 

Guess you like

Origin blog.csdn.net/weixin_45467975/article/details/131415909