For SonarQube Microsoft SQL Server Database optimization

We are using SoanrQube 6.7 version along with Microsoft SQL Server 2014
We are trying to optimize the database as currently database size is around 20 GB and transaction log size is > 1TB, we are not experts in Database administration and need inputs here.

Documentation says database will be cleaned upon settings mentioned in the Database Cleaner, will this also reduce the database size ? Is there any other thing we can do to optimize database?

Also we tried to delete few old projects we were not using but even after that and restarting SonarQube database size was same, please let us know how to reduce database size after deleting projects itself instead of snapshots. Since project itself is deleted we cannot perform analysis as mentioned for database cleaner.

Is there anyway to reduce database size after deleting old projects.

Please suggest us best way to use MSSQL databse with SoanrQube.

Second thing is Transaction log size currently it is > 1TB , currently our recovery model is set to Full can changing it to Simple will address this issue ? Any issues if set it to Simple from SoanrQube perspective.

Hi,

Welcome to the community!

You may find this thread helpful:

 
Ann

Hi,

First of all thanks for the update, so Shrinking MSSQL database is the only option to reduce the database
size ?

Also please help for the topic
Second thing is Transaction log size currently it is > 1TB , currently our recovery model is set to Full can changing it to Simple will address this issue ? Any issues if set it to Simple from SoanrQube perspective.

Also please suggest us best way to use MSSQL databse with SoanrQube.

You need to do standard SQL Server database maintenance. There’s nothing about this that’s a Sonarqube issue. The minimum maintenance for a SQL database is:

  1. Run backups - this allows Shrink to recover space in the transaction logs
  2. Shrink the database
  3. Re-index the database - rebuild the indexes to defragment and order/align them

These are all SQL DBA tasks. Do you have a full-time DBA? They should know how to do this.

Google “SQL Server Database Maintenance”. There are any number of writeups on this.