One of the challenges of using the free express editions of SQL Server is the lack of the SQL Agent.
This means that creating a functioning maintenance plan is a bit more of a challenge then on a regular SQL Server instance. Luckily for us Ola Hallengren created his maintenance plan in such a way that it can easily be altered to make it usable for SQL express editions.
Ok let’s get started.
First things first, start with downloading Ola’s excellent maintenance scripts from his website, this ensures that you have the latest and greatest version. In this post I won’t explain all the parameters as Ola has an excellent wiki for all his
Personally I try to limit the creation of custom objects into the system databases, so I prefer creating a smaller database to contain all my DBA related objects. In this documentation we’ll use the name DBA_Express for this database.
Minor changes to Ola’s script
Changing the database from master to DBA_Express
Changing default behavior
It seems illogical to create the jobs as the agent is not running on a SQL Express, but I have a very good reasons to do so. It indeed doesn’t create any jobs on a SQL Express, but it doesn’t throw any errors neither so we can use this script on any SQL Edition
Luckily for us Ola’s scripts are designed to run command line, so we’ll us the example scripts provided in his documentation to create 5 bat files. For this purpose, I have created the folder [D:\MSSQL\Maintenanceplan] where we can store these files. For Logging we create the [D:\MSSQL\Maintenanceplan\Log] folder
Backups
First things first, as a DBA backups is our main concern, so I’ll start with that. Please note that I’m against storing the backups on the same drive as the database files, but in this case I have no other choice. This directory will be backed up by using robocopy backups from that drive to a safe location.
Full Backups
Diff Backups
Log Backups
As an express edition doesn’t support backup compression and these servers tend to be rather thin provisioned it can be useful to compress the backup folder by using NTFS compression. As SQL Express database are limited to 10GB, and are seldom that big you could do this to save space. Don’t forget to turn it off once you go to a higher edition of SQL though, because you’ll hit the limit of NTFS compression quite fast on higher edition of SQL Server.
Index Rebuilds
Secondary let’s script our index and statistics maintenance, as this is an express edition I won’t bother splitting it up between indexes and statistics. Also we don’t bother including the online options as they are only supported in Enterprise editions.
Database Integrity
And then last but certainly not least, our database integrity checks. Again we are taking a special approach for express editions as we are not making any differentiation between system and user databases unlike on normal instances.
Adding the scripts to the windows scheduler
Start the windows task scheduler
Select Create Basic Task
Give your task a self-explaining name
Select your frequency
Select a moment
Select an Action
Point the action to the cmd files we created earlier on
Don’t forget to select to open the properties window before you select Finish
Make sure that your job will run with an account with the appropriate rights on both windows and SQL Server.
Make sure you test your newly created job, and then proceed to create the other schedules.
Special Remarks for the Log backups
As you cannot create a schedule that runs several times a day, you’ll have to create multiple log backup schedules that run daily.
© 2023 Kohera
Crafted by
© 2022 Kohera
Crafted by
Cookie | Duration | Description |
---|---|---|
ARRAffinity | session | ARRAffinity cookie is set by Azure app service, and allows the service to choose the right instance established by a user to deliver subsequent requests made by that user. |
ARRAffinitySameSite | session | This cookie is set by Windows Azure cloud, and is used for load balancing to make sure the visitor page requests are routed to the same server in any browsing session. |
cookielawinfo-checkbox-advertisement | 1 year | Set by the GDPR Cookie Consent plugin, this cookie records the user consent for the cookies in the "Advertisement" category. |
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
CookieLawInfoConsent | 1 year | CookieYes sets this cookie to record the default button state of the corresponding category and the status of CCPA. It works only in coordination with the primary cookie. |
elementor | never | The website's WordPress theme uses this cookie. It allows the website owner to implement or change the website's content in real-time. |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
Cookie | Duration | Description |
---|---|---|
__cf_bm | 30 minutes | Cloudflare set the cookie to support Cloudflare Bot Management. |
pll_language | 1 year | Polylang sets this cookie to remember the language the user selects when returning to the website and get the language information when unavailable in another way. |
Cookie | Duration | Description |
---|---|---|
_ga | 1 year 1 month 4 days | Google Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors. |
_ga_* | 1 year 1 month 4 days | Google Analytics sets this cookie to store and count page views. |
_gat_gtag_UA_* | 1 minute | Google Analytics sets this cookie to store a unique user ID. |
_gid | 1 day | Google Analytics sets this cookie to store information on how visitors use a website while also creating an analytics report of the website's performance. Some of the collected data includes the number of visitors, their source, and the pages they visit anonymously. |
ai_session | 30 minutes | This is a unique anonymous session identifier cookie set by Microsoft Application Insights software to gather statistical usage and telemetry data for apps built on the Azure cloud platform. |
CONSENT | 2 years | YouTube sets this cookie via embedded YouTube videos and registers anonymous statistical data. |
vuid | 1 year 1 month 4 days | Vimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. |
Cookie | Duration | Description |
---|---|---|
ai_user | 1 year | Microsoft Azure sets this cookie as a unique user identifier cookie, enabling counting of the number of users accessing the application over time. |
VISITOR_INFO1_LIVE | 5 months 27 days | YouTube sets this cookie to measure bandwidth, determining whether the user gets the new or old player interface. |
YSC | session | Youtube sets this cookie to track the views of embedded videos on Youtube pages. |
yt-remote-connected-devices | never | YouTube sets this cookie to store the user's video preferences using embedded YouTube videos. |
yt-remote-device-id | never | YouTube sets this cookie to store the user's video preferences using embedded YouTube videos. |
yt.innertube::nextId | never | YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen. |
yt.innertube::requests | never | YouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen. |
Cookie | Duration | Description |
---|---|---|
WFESessionId | session | No description available. |