Sonar – Our environment

This is the first post in a series presenting the installation and the use of Sonar to analyse source code quality.

The objective here is to present our environment and as, a pre-requisite, the creation of an Oracle user.

Environment

Windows 7 Profesional SP1, Oracle 11.2, Tomcat 7.0, Java 6. Very close to anything you would find in any customer, except you would probably have a Windows Server.

Tomcat has been installed as a Windows service, so that I just click on a ‘Services’ icon to start/stop/restart it as I want. Installation has been done on port 8888, in order to avoid conflict with applications that install by defaut on 8080 port. I also have an icon to launch the GUI application (Tomcat7w.exe) to configure Tomcat. Notice the 512 Mb Java memory pool.

Oracle

We need an Oracle user so that Sonar will be able to create its own schema. We also want to dedicate a tablespace to this user, for reasons of performance and ease of management. Use your favorite SQL tool. Hereunder the resulting command line instructions.

  • Creation of a tablespace, 500 Mb autoextended.

CREATE SMALLFILE TABLESPACE “SONAR” DATAFILE ‘C:\ORACLE\ORADATA\JPORA11\SONAR.DBS’ SIZE 500M AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO

  • Creation of the Sonar user on the previous tablespace, with DBA privilege.

CREATE USER “SONAR” PROFILE “DEFAULT” IDENTIFIED BY “sonar” DEFAULT TABLESPACE “SONAR” TEMPORARY TABLESPACE “TEMP” ACCOUNT UNLOCK
GRANT “CONNECT” TO “SONAR”
GRANT “DBA” TO “SONAR”

It is not mandatory to create the Sonar user with DBA profile, but as nothing forbids it, why not.

Next post: Install Sonar.

Leave a Reply

Your email address will not be published. Required fields are marked *