Skip to content

Specmate with Oracle DB

wehrlean edited this page Jan 11, 2021 · 10 revisions

Use Spacmate with Oracle Database

Content

For Windows

  1. Download SQL Developer and Oracle Database (Oracle Database Express Edition (smaller download) or Oracle Database). You have to register.
  2. Install the Oracle Database. You have to set a password.
  3. Connect with SQL Developer to the Oracle DB. Create new connection in SQL Developer.
    • If you are using a pre-configured VM the credentials may differ. See hints on Oracle on MacOs.
    • If you are using the Oracle XE (and maybe Oracle Database, but not tested) the following credentials work:
      1. Username: system
      2. Password: predefined password on installation of the DB
      3. Hostname: localhost
      4. Port: 1521
      5. SID: XE
  4. Now we need to execute some SQL statements on the oracle db.
    1. Create a new schema, which we can use for Specmate. On default, on Oracle XE the user has to have the prefix C##.

      CREATE USER C##specmate IDENTIFIED BY specmate_oracle;

    2. Grant access to the new user

      GRANT CREATE SESSION TO C##specmate;
      GRANT CREATE TABLE TO C##specmate;
      ALTER USER C##specmate quota unlimited on USERS;

  5. Now we can create a new database connection to our newly created schema.
  6. Configure the connection in Specmate. Open specmate-config/config/specmate-config.properties
    1. Comment out the H2 jdbc connection

      #h2.jdbcConnection = jdbc:h2:./database/specmate

    2. Add the oracle connection.

      oracle.jdbcConnection = jdbc:oracle:thin:@localhost:1521/XE
      oracle.username = C##specmate
      oracle.password = specmate_oracle

    3. Change the cdo.repositoryName to the name of the database schema. ATTENTION: This must be the same name as the schema defined in 4.i.

      cdo.repositoryName = C##specmate

  7. Download the oracle driver oracle-driver-ojdbc-12.1.0.2.jar. (Found on google drive).
  8. Create a new folder in the bundle specmate-dbprovider-oracle named jar.
  9. Copy downloaded .jar file into created jar folder
  10. Add .jar file to the buildpath of the specmate-dbprovider-oracle bundle.
  11. In Eclipse, run dev-specmate-all-oracle.bndrun

For MacOs

As Oracle DB is not supported by MacOS, the simplest way is to download a pre-configured Linux VM where Oracle DB is pre-installed. (https://www.oracle.com/database/technologies/databaseappdev-vm.html)
For configuration of the VM see: https://www.databasestar.com/oracle-mac/
However, step 5, 6 and 7 seem to be outdated.

Credentials for pre-configured VM:

  • Username: system
  • Password: oracle
  • Service name: orcl

Due to the other credential on step 6.ii. the oracle.jdbcConnection must be adapted.

Troubleshoot

If you can't connect to the database on a Windows PC, it is possible that the Windows-Listener is not started. To check the status of the listener type use the following command on Powershell (with admin rights):

lsnrctl status

To start it, use

lsnrctl start