Cannot see projects after connecting to Oracle database

Dear All,

I have SonarQube 6.2 installed with no extra database connected.

Now, I have a Oracle PDB and I connected SonarQube with it . It got connected without any errors.

Connecting user “sonar” has been created in following way,

CREATE USER "sonar" IDENTIFIED BY "password"
DEFAULT TABLESPACE "USERS"
TEMPORARY TABLESPACE "TEMP"
PROFILE "APPLICATION"

grant CREATE TABLE,
CREATE VIEW,
CREATE SYNONYM,
CREATE TRIGGER,
CREATE SESSION,
CREATE PROCEDURE,
CREATE SEQUENCE,
CONNECT,
RESOURCE
to sonar;

alter user sonar quota unlimited on users;

Now when I check on dashboard it shows there are 20 projects present but when I click on projects => all it does not show any project.

What should be missing here. I checked sonar.log and web.log for errors but could not find any.

Please suggest.

Hi,

First, I need to point out that 7.2 (7.3 imminent) is current version of SonarQube, and 6.7.5 is the current LTS. You’re going to have a hard time getting support on versions earlier than that.

That said,

  1. there are other log files in the logs directory. As a general practice, you should always check each of them when you have a problem of unknown origin
  2. it sounds like maybe you spun up your instance on H2 for a test and then pointed it at your Oracle DB. I applaud your switch to a production database, but your Elasticsearch indices are likely out of sync - they still think you’re on H2. The easiest thing to do is
    • shut down your server
    • delete $SONARQUBE_HOME/data/es
    • restart the server

Ann

Thank you for your reply.

After deleting $SONARQUBE_HOME/data/es , there are no projects visible now and it shows ‘0’ projects instead of ‘20’ earlier.

How can I get back all those project which were present before deletion or connection of database.

Also all user database is gone, I need to start from scratch.

Do I need to copy data from h2.db to oracle PDB ?

Hi,

You cannot do so. H2 database is for evaluation purpose only, and (as per massive warning displayed when it’s used) there is no way to migrate data out of it.

All in all if you initially populated data in the embedded H2 database, and now wish to migrate to an actual database, then yes you need to start from the ground up.