Sonarque DB cleaner Issue

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    - Sonarqube Version: 7.3

  • what are you trying to achieve
    - Sonarqube DB Cleanup. (Trying to get rid of old project)

  • what have you tried so far to achieve this
    - We have Sonarqube DB consumed 390 GB. Our settings for DB didn’t clean the DB. So I have deleted the projects in Sonarqube Manually but this didn’t cleanup the Data in the DB. its still 390 GB. So, How do we can cleanup the DB manually? We want to know few things?

  • Where are the references stored in the DB for the manually deleted projects? we want to cleanup all the projects that are deleted manually from the GUI. Please help.

Following are our current Database size.

  • live measures - 15.3 GB
  • Issues - 7.3 GB
  • Files sources -13.5 GB
  • Data File - (290 GB)

Thanks,
Srikanth

Srikanth,

SonarQube will mark data as deleted, but it is up to the database engine to reclaim free space (like a postgres vaccum).

Colin

2 Likes

Hi,

We are using MSSQL 2014 version of DB. Do we have this vaccum option for MSSQL? Can you please suggest?

Thanks,
Srikanth

Hi Colin,

Can you please tell me if there are any options for SQL 2012 vaccum? we have planned for an upgrade this weekend.

Thanks in advance.

Regards,
Srikanth

Hi. Please read this (and consider the risks): https://dba.stackexchange.com/questions/53857/i-need-to-shrink-my-database-i-just-freed-a-lot-of-space/53858#53858

1 Like

Hi Felipe,

Thanks for the response.

When we upgrade Sonarqube few months back it took more than 16hrs to complete successfully and now we want to go for another upgrade. Not sure what took longer time and now the DB Size is almost double the size. Is there any way to speed the upgrade process. Any suggestions are appreciated. Actually we want to keep only latest 3 months of data Please suggest.

( I have used bulk delete option in Sonarqube and cleanedup many projects Manually. But it seems DB Size didn’t reduce)

Following are the tables which are bigger in size.

  • live measures - 15.3 GB
  • Issues - 7.3 GB
  • Files sources -13.5 GB

Thanks,
Srikanth

Hi,

Can you please help with the above?

Thanks,
Srikanth

Hi Srikanth,

As part of our preparation for releasing 7.9, we made sure that the migrations on a large database (some details here) completed in 24 hours or less. As part of that work, we optimized some of the migrations that you’ve probably already gone through (there are trade-offs for being an early adopter :neutral_face:) and probably some that you have yet to face.

I can’t tell you how long your migration will take, but I should be <24h.

Regarding the sizes of your DB tables, there’s little I can add beyond the help you’ve already gotten from Colin and Felipe. I.e. that’s a DBA topic, not a SonarQube administrator topic.

 
HTH,
Ann