This page last changed on Jul 26, 2009 by ggaskell.
This document is out of date
This documentation applies to Confluence 2.1.x or older. If you have Confluence 2.2.x or newer, please refer to Database Setup for Oracle}
Please note, we strongly recommend you install Confluence on a schema in a brand new database on your Oracle server. If this cannot be accommodated, be aware that Confluence may not install or operate properly. For more details on this limitation please see the issue filed here.

This installation assumes you are using the standalone distribution of Confluence and Oracle 9i. We have not tested against older versions of Oracle, but have been told that it should work against Oracle 8i provided you use the latest 9i drivers.

Note that some users have found that 9.0.1.0 does not work, while 9.0.2.6 does.

If you are using 10g you should use the 10.1.0.4.0 drivers – the 10.1.0.3.0 drivers don't work when using a Tomcat 5.5 datasource, as the connection returned is a T4CConnection instead of the OracleConnection which Spring is expecting.

1. Adding a datasource to Tomcat

Versions before 5.5
  • Edit the conf/server.xml file in your Tomcat installation
  • Find the following lines:
    <Context path="" docBase="../confluence" debug="0" reloadable="true">
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="atlassian-confluence."
    suffix=".log" timestamp="true"/>
    
  • Directly after the <Logger.../> line, (before the next </Context> line), insert the following:
    <Resource name="jdbc/Confluence" auth="Container" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/Confluence">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>20</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>10</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>10000</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>yourusername</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>yourpassword</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:oracle:thin:@hostname:port:oracle-sid</value>
    </parameter>
    </ResourceParams>
    
    • You may want to choose different maxActive and maxIdle values: these are how many total database connections will be allowed at one time, and how many will be kept open even when there is no database activity
    • Replace the username and password parameters with the correct values for your database
    • In the url parameter, replace the word 'oracle-sid' with the name of the database your confluence data will be stored in. Obviously also change the hostname and port.
Versions 5.5 and later

In Tomcat 5.5 the configuration format has changed. The data source resource should be defined like this:

<Resource
name="jdbc/Confluence"
auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@<hostname>:<port>:<sid>"
username="<username>"
password="<password>"
connectionProperties="SetBigStringTryClob=true"
maxActive="25"
maxIdle="5"
maxWait="10000"
/>

2. Configure the Confluence to be aware of this datasource

  • Edit confluence/WEB-INF/web.xml in your confluence installation
  • Go to the end of the file and just before </web-app>, insert the following:
    <resource-ref>
    <description>Connection Pool</description>
    <res-ref-name>jdbc/confluence</res-ref-name>
    <res-type>javax.sql.Datasource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    
  • Copy the ojdbc14.jar to the common/lib directory (this jar is the oracle jdbc thin driver for JDK 1.4. It comes bundled with your Oracle 9i database). We recommend using the thin drivers only.

3. Confluence setup wizard

  • Startup confluence using bin/startup.bat or startup.sh
  • Run through the setup process and when asked to choose a database type: choose Datasource Connection
  • Enter in java:comp/env/jdbc/confluence for the name of the datasource and select the oracle 9 dialect.
  • Complete the setup and that's it!
Document generated by Confluence on Dec 10, 2009 18:45