This page last changed on Mar 11, 2007 by david.soul@atlassian.com.

This guide covers deploying Confluence standalone 2.2 or later against an Oracle database, and is also applicable to the WAR version. For older Confluence versions, please follow these instructions.

Database Setup Information

Please consider this information when preparing your Oracle database for Confluence.

Schema Requirements

Confluence must be deployed to a schema in it's own, separate Oracle instance. This avoids a Hibernate bug triggered by the existence of duplicate tablenames in other schemas, outlined here.

Database Incompatibilities

Orcale 9i and later are supported, please upgrade any older versions prior to installing Confluence.

Database driver update may be required
For all versions of Oracle, you must upgrade to the latest 10g drivers. Check the latest compatible version here. We highly recommend to use the thin drivers.

Please check that your version of Oracle does not have any known issues:

Oracle Version Oracle Driver Issue Solution
Any Pre 10g Driver incompatibilities Upgrade to latest 10g drivers if compatible
Pre 9 Any Earlier DBs not compatible Upgrade DB to 9.x or later
9.0.1.0 Any DB not compatible Upgrade DB to 9.0.2.6 or later
10g 10.1.0.3.0 Drivers not compatible with Tomcat 5.5 Upgrade drivers to 10.1.0.4.0 or later

Deploying Against Oracle

Complete the instructions for installing Confluence standalone, then return to this document instead of proceeding to the Confluence Setup Guide.

Database Preparation

Tailor these instructions to your particular database version:

  1. Perform any necessary database or driver upgrades. Download the latest compatible database drivers

  2. Create a seperate instance of Oracle and apply any configuration tasks.

  3. Create a Confluence user configuration and grant access permissions.

Adding a Datasource to Tomcat

  1. Open <INSTALL>/conf/server.xml for editing.

  2. Locate the section Host -> Context
    <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false">
        <Context path="" docBase="../confluence" debug="0" reloadable="true">
             <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
             <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/>
        </Context>
    </Host>
  3. Paste in the Resource section provided, prior to Manager as shown
    <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false">
        <Context path="" docBase="../confluence" debug="0" reloadable="true">
             <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
    
             <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"
             />
    
             <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/>
        </Context>
    </Host>
  4. Change the username and password to match the Oracle login.

  5. Change url to match hostname, port and sid of the Oracle server. Sid stands for the schema name. For example:
    jdbc:oracle:thin:@example.atlassian.com:1521:confluencedb
  6. If required, choose different maxActive and maxIdle values. These set 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.

Configure Confluence Datasource Access

Confleunce must be configured to use this datasource:

  1. Edit the file <INSTALL>/confluence/WEB-INF/web.xml

  2. 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>
  3. Locate the Oracle JDBC database drivers for JDK 1.4, which comes bundled with your database. We recommend using the thin drivers only. Copy ojdbc14.jar to the <INSTALL>/common/lib directory.

Confluence Setup Wizard

Now Confluence is ready to attempt to connect to Oracle:

  1. Startup Confluence using <INSTALL>/bin/startup.bat or <INSTALL>/bin/startup.sh

  2. Insert your licence and select External Database.

  3. Select Datasource Connection using your Oracle version.

  4. Enter java:comp/env/jdbc/confluence for the name of the datasource.

Confluence should now deploy using the Oracle database specified. Please read this comment on Oracle database optimisation.

Generic Oracle Configuration Tips

Websphere and Oracle

If you are planning to run Confluence on a Websphere application server and Oracle database, you should read the information on Known Issues for Websphere.

24-hour time format with Oracle 8i

We have received a report from a user that when an Oracle 8i database is configured to use 24-hour time as the default format, an exception like this may occur:

005-12-06 13:23:20 Loading root WebApplicationContext

2005-12-06 13:24:34 StandardContext[]: Exception sending context initialized event to listener instance
of class com.atlassian.confluence.util.ConfluenceContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userAccessor' defined in class path resource [applicationContext.xml]:
Can't resolve reference to bean 'userAccessorTarget' while setting property 'target';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userAccessorTarget' defined in class path
resource [applicationContext.xml]: Can't resolve reference to bean 'spacePermissionManager' while setting property 'spacePermissionManager';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spacePermissionManager' defined in class path resource [securityContext.xml]:
Can't resolve reference to bean 'spacePermissionManagerTarget' while setting property 'target';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'spacePermissionManagerTarget' defined in class path resource [securityContext.xml]: Initialization of bean failed;
nested exception is org.springframework.jdbc.UncategorizedSQLException: (Hibernate operation): encountered SQLException [Cannot create PoolableConnectionFactory];
nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory

...

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory, cause:


java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1


ORA-12705: invalid or unknown NLS parameter value specified

One symptom of this problem is that Confluence may refuse to start after midday.

The workaround is to go to 'General Configuration' and set the default time format to "HH:mm".

Sorry, but can someone please explain why you need:

<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false">
    <Context path="" docBase="../confluence" debug="0" reloadable="true">
         <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->

         <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"
         />

         <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/>
    </Context>
</Host>

for as well as the change to the web.xml mentioned here...?

I did all of this but there was no connection to the database. I then took it all out and simply entered the details into the install wizard (or whatever it is called)... and presto it installed the demo space i asked for...

Sorry for being a bit of a noob, but am I missing the point ... why does mine work without following all of this?

Thanks 

Posted by supernovachild at Sep 22, 2006 18:36

At one point Oracle would only work via a Data Source, not a direct JDBC connection. This documentation is now out of date.

Posted by tom@atlassian.com at Nov 12, 2006 16:06

Is there anywhere that the database schema of Confluence is documented, like JIRA's here?

Posted by jguthrie at Dec 14, 2006 15:30

Unfortunately, there is no such documentation about the Confluence database schema. However, you may use a database tool to extract an entity relationships diagram from the Confluence database tables. For example, you can use DbVisualizer for that.

Posted by dchui at Dec 14, 2006 17:10

Hi Jeff,

Unfortunately there is no such documentation available. However, you could extract the entity relationships diagram using database tools like DbVis.

Posted by dchui at Dec 14, 2006 17:55
Document generated by Confluence on Mar 22, 2007 20:58