This guide covers deploying Confluence standalone or WAR distribution with an Oracle database.

This database can only be set up by an Oracle database administrator (DBA)

If you are not a DBA, you should not attempt to set up this database.

Oracle has a history of being extremely difficult to set up. If you do not have access to an experienced Oracle DBA in your organisation, you are recommended to select any free, scalable and easy-to-install alternative rather than proceeding with Oracle. Users evaluating Confluence are recommended to start with an alternative database and only consider migrating to Oracle after approval from their DBA. Atlassian's technical support for Oracle setup difficulties will also reflect the high minimum skill requirements for attempting an Oracle setup.

Database Setup Information

This setup guide must be used in conjunction with the list of Database Troubleshooting for Oracle. Please review that page before continuing.

Schema Requirements

Confluence can be deployed to a schema in any Oracle instance.

Database Compatibility

Please refer to Supported Platforms for information about supported database versions. If your version of Oracle is not supported, please upgrade to a supported version before installing Confluence.

Check your database drivers, to see if you need an update.

  • For Oracle 11.1, use the 10.2.0.4 or 11.1.0.7.0 driver (Java 6 ojdbc6.jar).
  • For Oracle 11.2, use the 11.2.0.1.0 driver (Java 6 ojdbc6.jar).

Tip: search for the jar filename on the download site.

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

Oracle Version

Oracle Driver

課題

ソリューション

すべて

Pre 10g

Driver incompatibilities

Upgrade to latest 10g drivers if compatible

You may be also interested in the relevant JIRA documentation to check the compatibility of your Oracle server and driver.

Deploying Confluence with 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. See the Oracle JDBC driver FAQ.
  2. Create a Confluence user and grant the following permissions to the user:
    grant connect to <user>;
    grant resource to <user>;
    

Do not grant the database user the select any table permission, or it can cause problems with other schemas. See CONF-3613 for a report.

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 pathname="" />
        </Context>
    </Host>
    
  3. Paste in the Resource section provided, before 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.OracleDriver"
             url="jdbc:oracle:thin:@hostname:port:sid"
             username="<username>"
             password="<password>"
             connectionProperties="SetBigStringTryClob=true"
             maxActive="25"
             maxIdle="5"
             maxWait="10000"
             />
    
             <Manager pathname="" />
        </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. Note that sid stands for the Schema ID. For example:
    jdbc:oracle:thin:@example.atlassian.com:1521:confluencedb
    
    For connecting to an Oracle RAC cluster, you'll need to edit the connection string using Oracle's connection syntax like this:
    jdbc:oracle:thin:@(DESCRIPTION=
                        (SDU=32768)
                        (enable=broken)
                        (LOAD_BALANCE=yes)
                        (FAILOVER=yes)
                        (ADDRESS=
                          (PROTOCOL=TCP)
                          (HOST=dbserver1.example.com)
                          (PORT=1525))
                        (ADDRESS=
                          (PROTOCOL=TCP)
                          (HOST=dbserver2.example.com)
                          (PORT=1525))
                        (CONNECT_DATA=
                          (SERVICE_NAME=CONFDB)))
    
    This example has been broken up over multiple lines for clarity, but it should be compacted into a single line.
  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.

Configuring Confluence Datasource Access

次のデータソースを使用するように Confluence を設定します。

  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. Download the Oracle JDBC database drivers for your JDK version via the Database JDBC drivers page. We recommend using the thin drivers only. Copy the JAR file into <confluence install>/WEB-INF/lib. This directory path is potentially <INSTALL>/lib if Confluence is running off Apache Tomcat version 6 or above.

Running the 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.

Oracle Configuration Tips

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

関連トピック

Oracle データベースのトラブルシューティング