Documentation for JIRA 5.0. Documentation for other versions of JIRA is available too.

この説明は、JIRA の Microsoft SQL Server 2008 データベースへの接続手順に関するものです。

(warning) 注意:

  • SQL Server Express is not one of our recommended databases; however, it is possible to set up JIRA to work with this database. This external blog post contains instructions on installing JIRA on SQL Server Express 2005 that may be helpful, if you want to try this.
  • Due to numerous reported performance issues with SQL Server 2000, it is recommended that you use SQL Server 2005 instead. The following instructions apply only to SQL Server 2005, not to SQL Server 2000, which is no longer supported.

(info) If you are setting up a completely new JIRA installation, the JIRA Setup Wizard will configure a SQL Server 2005 database connection for you.

1. Before You Begin

1.1 Are You Migrating JIRA to Another Server?

他のサーバーへの JIRA の移行 を実行する場合は、XML backup としてデータをエクスポートしてください。その後、 Switching databases で説明されているように、元のデータベースから新しいデータベースへデータを移行できます。

1.2 Shut Down JIRA

On this page:

2. Create and Configure the SQL Server Database

  1. Create a database for JIRA to store issues in (e.g. jiradb). (tick) Remember your database name, as it will be used to configure JIRA's connection to this database in subsequent steps.
    (info) Please Note:
    • 照合順序の設定が、大文字と小文字を区別する case-sensitive に設定されていなければいけません。例えば、'SQL_Latin1_General_CP437_CI_AI' は、case-sensitive の照合順序タイプなどがあります。お客様の SQL Server において、照合順序の設定変更を行っておらずデフォルトのままになっている場合は、設定を確認してください。
    • SQL Server は Unicode エンコード形式で文字を格納します。これで、文字エンコード問題を十分回避できます。
  2. Create a database user which JIRA will connect as (e.g. jiradbuser). (tick) Remember your database user name, as it will be used to configure JIRA's connection to this database in subsequent steps.
    (info) This database user should not be the database owner, but should be in the db_owner role. (See SQL Server Startup Errors for details.)
  3. Create an empty 'schema' in the database (e.g. jiraschema) for the JIRA tables. (tick) Remember this database schema name, as it will be used to configure JIRA's connection to this database in subsequent steps.
    (info) A 'schema' in SQL Server 2005 is a distinct namespace used to contain objects and is different from a traditional database schema. You are not required to create any of JIRA's tables, fields or relationships (JIRA will create these objects in your empty schema when it starts for the first time). You can read more on SQL Server 2005 schemas in the relevant Microsoft documentation.
  4. Ensure that the database user has permission to connect to the database, and create and populate tables in the newly-created schema.
    (info) If you are having difficulties setting up your JIRA database for SQL Server, additional information is available in the Setting Up a SQL Server 2005 database for JIRA document.
  5. Ensure that TCP/IP is enabled on SQL Server and listening on the correct port (which is 1433 for a default SQL Server installation). (tick) Remember this port number, as it will be used to configure JIRA's connection to this database in subsequent steps.
    (info) Read the Microsoft documentation for information on how to enable a network protocol (TCP/IP) and how to configure SQL server to listen on a specific port.
  6. Ensure that SQL Server is operating in the appropriate authentication mode. By default, SQL Server operates in 'Windows Authentication Mode'. However, if your user is not associated with a trusted SQL connection, i.e. 'Microsoft SQL Server, Error: 18452' is received during JIRA startup, you will need to change the authentication mode to 'Mixed Authentication Mode'. Read the Microsoft documentation on authentication modes and changing the authentication mode to 'Mixed Authentication Mode'
  7. SET NOCOUNT オプションのチェックを外します。(Microsoft SQL Server に関する JIRA の資料の中に、SET NOCOUNT にチェックを入れた場合のエラーに関する詳細情報があります) SET NOCOUNT のチェックを外すには:
    • Open SQL Server Management Studio and navigate to Tools -> Options -> Query Execution -> SQL Server -> Advanced. The following screenshot displays the configuration panel for this setting in MSSQL Server 2005. Ensure that the SET NOCOUNT option is not selected:

3. Copy the SQL Server JDBC Driver to Your Application Server (JIRA WAR Only)

(warning) Skip this step if you installed a 'Recommended' distribution of JIRA, which (unlike JIRA WAR) includes the SQL Server JDBC driver.

  1. Download the SQL Server JDBC driver (v1.2.4) from JTDS.
    (warning) Microsoft have their own JDBC driver but we strongly recommend avoiding it after receiving many reports of intermittent disconnections (JRA-5760 and JRA-6872), workflow problems (JRA-8443) and Chinese character problems (JRA-5054).
  2. Add the SQL Server JDBC driver jar (jtds-1.2.4.jar) to the <Tomcat install>/lib/ directory.

4. SQL Server 2005 データベースへ接続するための JIRA サーバーの設定

There are two ways to configure your JIRA server to connect to your SQL Server 2005 database:

(info) 注意:

4.1 Connecting JIRA to SQL Server 2005 Using the JIRA Configuration Tool

(warning) The JIRA Configuration Tool is not available with JIRA WAR distributions.

To start the JIRA Configuration Tool:

(info) Please Note: You may need to set the JAVA_HOME environment variable to run the JIRA Configuration Tool. See Installing Java for details.

To connect JIRA to SQL Server 2005 using the JIRA Configuration Tool:

  1. Click the 'Database' tab.
  2. From the 'Database type' drop-down choose 'SQL Server'.
    (info) The JIRA Configuration Tool will display your current database configuration settings if any are already set.
  3. Fill in the connection details for your SQL Server 2005 database.
    • 'Hostname' — The name or IP address of the machine that the SQL Server 2005 server is installed on.
    • 'Port' — The TCP/IP port that the SQL Server 2005 server is listening on. You can leave this blank to use the default port.
    • 'Database' — The name of your SQL Server 2005 database (into which JIRA will save its data).
    • 'Username' — The user that JIRA uses to connect to the SQL Server 2005 server.
    • 'Password' — The user's password to authenticate with the SQL Server 2005 server.
    • 'Schema' — The name of the schema that your SQL Server 2005 database uses.
      (info) You might need to change this from the default 'dbo'.
  4. JIRA keeps a pool of database connections open to the database server. You can set the maximum size of this pool in the 'Pool Size' text field.
  5. After typing in your settings, click the 'Test Connection' button to test the connection settings. The tool will attempt to connect to the database, and give a message with the results.
  6. Click 'Save' to save your settings when you are done.
    (info) Please Note:
    • The JIRA Configuration Tool will save your database configuration to a dbconfig.xml file in your JIRA Home Directory.
    • JIRA must be restarted for your new settings to take effect.

Congratulations — you have finished! Proceed to 'Next Steps' below.

4.2 Connecting JIRA to SQL Server 2005 Manually

  1. Edit the dbconfig.xml file at the root of your JIRA Home Directory.
    (info)If this file does not exist, create the file, copy and paste the example XML code below into this file and edit the pasted XML as required.

    注意:

    Ensure that the <database-type/> element's content specifies your type of database, as shown below.
    Also ensure that the <schema-name/> element's content matches the name of the SQL Server's schema specified when creating your JIRA database (above).

    (warning) When editing your dbconfig.xml file, escape any '&' characters by adding 'amp;' to the end of each one.

    <?xml version="1.0" encoding="UTF-8"?>
    
    <jira-database-config>
      <name>defaultDS</name>
      <delegator-name>default</delegator-name>
      <database-type>mssql</database-type>
      <schema-name>jiraschema</schema-name>
      <jdbc-datasource>
        <url>jdbc:jtds:sqlserver://dbserver:1433/jiradb</url>
        <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
        <username>jiradbuser</username>
        <password>[enter db password]</password>
        <pool-size>15</pool-size>
      </jdbc-datasource>
    </jira-database-config>
    
  2. Save your edited dbconfig.xml file (at the root of your JIRA Home Directory).
    (info) JIRA must be restarted for your new settings to take effect.

5. 次のステップ

ここまでで、SQL Server データベースに接続するための JIRA の設定が完了したはずです。これで、起動できます!

  • JIRA の『推奨』ディストリビューションを使用している場合は、起動後、エラーがないかどうかログを観察します。
  • JIRA WAR ディストリビューションを使用している場合は、アプリケーションサーバーでウェブアプリケーションを再構築・再展開します。

インストールに際して

JIRA and MS SQL Server 2005 をご覧ください。