Thursday, May 3, 2012

Install Sonar Using Oracle as the Database

This short tutorial shows how to setup Sonar with an Oracle 10g database. These instructions and screenshots are

Step 1: Configure Sonar. Open up C:\Program Files\sonar-3.0\conf\sonar.properties

comment out:

sonar.jdbc.url: jdbc:derby://localhost:1527/sonar;create=true

remove comment:

sonar.jdbc.url: jdbc:oracle:thin:@localhost/XE
sonar.jdbc.driverClassName: oracle.jdbc.OracleDriver
sonar.jdbc.validationQuery: select 1 from dual


Step 2: Create database user. Open up SQL*Plus and run the following commands at the prompt:

connect username/password
CREATE USER sonar IDENTIFIED BY sonar;
GRANT UNLIMITED TABLESPACE, CONNECT, RESOURCE, CREATE SESSION, CREATE TABLE, CREATE VIEW, CREATE SYNONYM, CREATE SEQUENCE, CREATE PROCEDURE, CREATE TRIGGER TO sonar;
EXIT

Step 3: Get the oracle jdbc driver. Download ojdbc6.jar from Oracle's download site and place it in C:\Program Files\sonar-3.0\extensions\jdbc-driver\oracle.


Step 4: Restart Sonar.

Step 5: Verify it's running. Open up a browser and go to: http://localhost:9000/. You should see the following...


Viewing the Sonar System Info should reveal that Sonar is indeed running with Oracle:


Piece of Cake!!!

Relevant Links

SQL*Plus on Wikipedia

2 comments:

Anonymous said...

I have the same issue... :(

Anonymous said...

Hi, I doubt you ever gonna read my comment, but your post helped me to install sonar. So thank you very much : - )