Use this guide in conjunction with the more general Database Setup Guide for Any Database. These instructions add some reference notes specific to SQL Server.

  1. Review the known issues for SQL Server.
  2. 使用する文字エンコードを指定します。このためには、アプリケーションサーバーおよび Confluence で使用中の文字エンコードを確認する必要があります。SQL Server を含めた 3 台すべてで互換性のある文字エンコードを使用しなければなりません。例えば、SQL Server のデフォルトの文字エンコードである UCS-2 は、UTF-8 と互換性があります。
  3. Create a new database (as an SQL administrator). If you set your application server and Confluence to use an encoding incompatible with UCS-2, specify that character encoding for the database.
  4. デフォルトのデータベース照合順序を、'SQL_Latin1_General_CP1_CS_AS' (大文字と小文字の区別があります) に設定します。この設定は、次の SQL クエリを発行することによって行われます:

    ALTER DATABASE <database_name> COLLATE SQL_Latin1_General_CP1_CS_AS


    Note: if you receive an error at this point stating 'The database could not be exclusively locked to perform the operation', you may need to prevent other connections by setting the mode to single user for the transaction:

    ALTER DATABASE <database_name> SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
    <your ALTER DATABASE query>
    ALTER DATABASE <database_name> SET MULTI_USER;


  5. データベースの分離レベルを、'Read Committed with Row Versioning' に設定します。この設定は、次の SQL クエリを発行することによって行われます:

    READ_COMMITTED_SNAPSHOT を有効にするか決めてください
    SELECT is_read_committed_snapshot_on FROM
    sys.databases WHERE name= 'YourDatabase' 

    戻り値:
    1 = READ_COMMITTED_SNAPSHOT オプションはオンです。この場合、コミットされたデータのみを読み取る分離レベルにおける読み取り処理はスナップショットスキャンをベースとし、ロックは全く使用しません。

    0 = READ_COMMITTED_SNAPSHOT オプションはオフです (デフォルトの設定)。この場合、コミットされたデータのみを読み取る分離レベルにおける読み取り処理は共有ロックを使用します。

    ALTER DATABASE <database_name>
       SET READ_COMMITTED_SNAPSHOT ON
       WITH ROLLBACK IMMEDIATE;
    
  6. Create a new SQL user account for Confluence (as an SQL administrator). Provide full create, read and write permissions for the database tables. Note that Confluence must be able to create its own schema.
  7. If you are configuring a datasource to connect to your MS SQL server database, install the database drivers.

    The JDBC drivers for this database are bundled with Confluence.
    • If you are using a direct JDBC connection, you do not need to download or install any JDBC drivers.
    • If you are connecting via a datasource, you must download and install the drivers manually. For information about driver versions and download links, see Database JDBC Drivers.
    • If you are not sure which connection you are using, it is probably JDBC. A JNDI resource must be configured manually, as described in each database's docs: PostgreSQLMySQLSQL Server or Oracle

  8. If you are configuring a datasource to connect to your MS SQL server database, place the JAR file in <confluence install>/WEB-INF/lib. You may also find this page helpful: http://jtds.sourceforge.net/faq.html
  9. If you are installing a new version of Confluence: Start Confluence and visit the home URL (e.g. http://localhost:8090) to start the Confluence Setup Wizard. Select a custom installation, and insert the relevant connection information.
    • When prompted for a driver class name in the database setup step enter:

      net.sourceforge.jtds.jdbc.Driver
      
    • When prompted for the jdbc url, the format to use is:

      jdbc:jtds:sqlserver://<server>:<port>/<database>