Search This Blog & Web

Sunday, May 28, 2017

Changing and verifying SQL Server Status from Linux (Ubuntu)

Recently we learn how to install SQL Server on Linux and how to use it. As a database administrator we need to check current database status as well as need to enable and disable it on demand. In the following post we will learn how to check current database status and change it using Linux command shell.

Once you install MSSQL Server in Ubuntu, You need to restart Linux machine in order to finish installation. SQL Server engine will automatically start as “Active” after restart. In the following post we will learn how to verify and change its status like Start, Stop, Disable and Enable.
1-      Verify running status for MSSQL Server using following command
“ systemctl status mssql-server”
You can see the status in green color.

2-      We can change MSSQL Server status using following sudo command
“sudo systemctl stop mssql-server”
To verify current database status you will repeat same step as above “ systemctl status mssql-server”.

3-      Using following command We can disable MSSQL Server engine using following sudo command
“sudo systemctl disable mssql-server” and can verify by executing as “ systemctl status mssql-server”.

4-      To enable MSSQL Server engine we can using same sudo command
“sudo systemctl enable mssql-server” and can verify by executing as “ systemctl status mssql-server”

5-      Finally MSSQL Server is up and active.



No comments: