If you are a database-savvy developer or even a database administrator, you probably know how important it is to always keep an eye out on your database servers. Some database servers might need more of your attention and upkeep than others, of course, but after all, even if they are facing some sorts of issues, none of them should be neglected – when your database instances are facing issues, one of the things you might want to keep an eye out on is uptime – your database instances might also have the need to be restarted.
As easy as it sounds, the restarting of your database instances might be a pretty tedious task: you might need to shut down all of the running processes, keep an eye out on your database schemas, and also keep an eye out on their uptime – thankfully, we have tools that can help us with that.
dbWatch for SQL Server
dbWatch, for example, is a fully-fledged database management solution letting you keep an eye on all kinds of database instances: from Oracle and Sybase to PostgreSQL. However, what we’re interested in the most is the capabilities dbWatch provides for Microsoft SQL server (MSSQL) to successfully run. If you’re using SQL Server Express, you will be able to make use of dbWatch as well!
Open up dbWatch and import a SQL Server instance (in this example we will use SQL Server 2017) – you will see a bunch of “Folders.”) Those folders house categories of database jobs – database jobs that can help you monitor your database availability, capacity, replication capabilities, maintenance, or performance:
In this case, you might have noticed that we marked a job called “Database Server uptime” – check what it says and you will notice that it depicts the amount of time your SQL Server has been running:
Seeing this shouldn’t be surprising – however, when do you decide when it’s time to restart your SQL Server instances? In that kind of scenario, we would need to take care of a few aspects. We should think about:
- 1. Do we really need to restart our SQL Server instances in the first place? Perhaps we could do without a restart and just change a couple of queries around here and there?
- 2. When we should go about restarting our SQL Server instances (i.e. what kind of time of restart would be most beneficial for both us and not interrupt the work for our clients, employees, etc.?)
- 3. How we should restart our database (SQL Server) instances? Manually? Should we make use of the help of certain tools (e.g. dbWatch, etc.)? How should we use such tools to our advantage?
Answering these three questions shouldn’t be too difficult – however, what might be more difficult is the fact thateven if you restart your database (in this case, SQL Server) instances while aiming to solve some kind of an issue you are facing, you might find that you might have the need to keep an eye on a couple of different things related to your database instances ranging from availability to maintenance at the same time as well. How do you do that?
Well, you should probably use software that is up for the task, such as dbWatch. For example, expand the Performance section of database jobs in dbWatch and you will see a couple of different jobs that will be suitable to improve your database performance – dbWatch in this case can monitor your databases for high activity (which might be useful to decide when to restart your database instances – you should do so at the lowest point of usage to not disrupt anybody using your services):
dbWatch can also provide you with the statistics of the usage of your indexes inside of a certain database instance, etc.:
However, that’s only when performance is related. dbWatch also has other similar MS SQL database jobs (simply expand the categories of Availability, Capacity, and the like), and it can also show you a bunch of really colourful statistics to help you decide what should the next step be for your database instances (simply click Monitor -> Management to observe the following screen):
This output might also be useful when deciding when to restart your SQL Server database instances. You should restart your database instances once they are at the lowest point of usage (for that, you could make use of the logical reads per second and the sessions graphs.) See how everything starts to work together so nicely? If you ever need any support, the dbWatch team is always here for you too – ping them and they will get back to you to help you solve your database issues sooner than you think.
We hope that this blog post has been a little of an eye-opener of what restarting SQL Server and other database instances usually comes down to and we hope that you will consider using our tool to achieve database goals. See you next time!
About the Author:
Lukas Vileikis is an ethical hacker and a frequent conference speaker.
Since 2014, Lukas has found and responsibly disclosed security flaws in some of the most visited websites in Lithuania.
He runs one of the biggest & fastest data breach search engines in the world - BreachDirectory.com, frequently speaks at conferences and blogs in multiple places including his blog over at lukasvileikis.com.