awsliferay

Use Oracle Database with Liferay

Liferay natively allows the use of OracleDB as main data source. If you ever wanted to use this database server for your Liferay installation, follow the steps below.

Step 1: Install JDBC drivers

If you haven’t installed the JDBC driver corresponding to the database server you want to connect, please follow the instructions on how to install the OracleDB driver.

Step 2: Change Liferay DB configuration

Edit the /opt/bitnami/tomcat/webapps/liferay/WEB-INF/classes/portal-ext.properties file and set the following options:

    jdbc.default.driverClassName=oracle.jdbc.driver.OracleDriver
    jdbc.default.url=jdbc:oracle:thin:@DB_HOST:1521:DB_NAME
    jdbc.default.username=DB_USERNAME
    jdbc.default.password=DB_PASSWORD

Don’t forget to substitute all the database parameter placeholders with the corresponding values.

Step 3: Test the connection

Restart the Tomcat server for the changes to take effect:

    $ sudo /opt/bitnami/ctlscript.sh restart tomcat

If everything was configured correctly, you should be able to log in to Liferay.

Step 4 (Optional): Disable the original database

To permanently disable the database included in the stack, so that it is never started and does not waste any resource, execute the commands below:

    $ sudo /opt/bitnami/ctlscript.sh stop mariadb
    $ sudo mv /etc/monit/conf.d/mariadb.conf /etc/monit/conf.d/mariadb.conf.disabled
    $ sudo gonit reload
Last modification February 9, 2023