Jira アプリケーションの Oracle への接続
ここでは、JIRA を Oracle データベースに接続する方法を解説します。
はじめる前に
- ご使用の Oracle のバージョンがサポートされていることを確認します。サポート対象プラットフォームを参照してください。
- 以下の既知の問題を確認してください。
- Download the Oracle JDBC 12.2.0.1 driver from the Oracle website. You'll need to later copy it to the Jira installation directory.
- Jira を他のサーバーに移行する場合は、データのエクスポートを XML バックアップ形式で作成します。その後、「データベースの切り替え」で説明されているように、元のデータベースから新しいデータベースにデータを移行できます。
- セットアップ ウィザードを実行中の場合を除き、開始する前に Jira をシャットダウンします。
1. Oracle の設定
- Ensure that you have a database instance available for Jira (either create a new one or use an existing one).
Within that database instance, create a user which Jira will connect as (e.g.
jiradbuser
).
Remember this database user name, as it will be used to configure Jira's connection to this database in subsequent steps.create user <user> identified by <user_pass> default tablespace <tablespace_name> quota unlimited on <tablespace_name>;
注意:
Oracle でユーザーを作成すると、Oracle は自動的に「スキーマ」を作成します。
ユーザーの作成時に、表オブジェクト用の表領域を指定する必要があります。
ユーザーが次の権限を持つことを確認します。
grant connect to <user>; grant create table to <user>; grant create sequence to <user>; grant create trigger to <user>;
It is very important that the user is granted the exact privileges indicated above. Jira requires only these privileges — if either less or more than these privileges are applied, some Jira functions may not work properly.
Simply put, for Jira functions to work as expected, we advise that you grant specific privileges to the user, and not assign a role to the user.
For example, if you grant the
RESOURCE
role to a user, and theRESOURCE
role grants theSELECT ANY TABLE
privilege, then Jira functions may not work as expected.したがって、上記に示した権限をそのままユーザーに付与することをお勧めします。
- Ensure your database is configured to use the same character encoding as Jira. The recommended encoding is AL32UTF8 (the Oracle equivalent of Unicode UTF-8).
2. Oracle JDBC ドライバのダウンロード
Jira requires the Oracle JDBC 12.2.0.1 driver. Download it from the Oracle website, and copy to your installation directory.
- Oracle JDBC ドライバをダウンロードします。
- Copy the downloaded ojdbc8.jar file to the
lib/
directory in the Jira installation directory.
3. Oracle データベースに接続するための Jira Server の設定
Oracle データベースに接続するために JIRA サーバーを設定する方法は2つあります。
- Using the Jira setup wizard — Use this method if you have just installed Jira, and are setting it up for the first time. Your settings will be saved to the
dbconfig.xml
file in your JIRA home directory. - Using the Jira configuration tool — Use this method if you have an existing JIRA instance. Your settings will be saved to the
dbconfig.xml
file in your Jira home directory.
各設定手法の手順説明
Jira セットアップ ウィザード
ブラウザから初めて Jira にアクセスすると、Jira セットアップ ウィザード が表示されます。
- 最初の画面 の “Configure Language and Database” で、 “Database Connection” に My own database を選択します。
- データベース タイプを Oracle に設定します。
- 下記の データベース接続関連フィールド を参照し、フィールド入力を行います。
- 接続をテストし、保存します。
Jira 設定ツール
- Jira 設定ツールを次のように実行します。
- Windows: コマンド プロンプトを開いて、Jira インストール ディレクトリの
bin
サブディレクトリにあるconfig.bat
を実行します。 - Linux/Unix: Open a console and execute
config.sh
in thebin
sub-directory of the Jira installation directory.This may fail with the error as described in our Unable to Start Jira applications Config Tool due to No X11 DISPLAY variable was set error KB article. Please refer to it for the workaround.
- Windows: コマンド プロンプトを開いて、Jira インストール ディレクトリの
- [Database] タブを選択し、”Database type” に ”Oracle” を設定します。
- 下記の データベース接続関連フィールド を参照し、フィールド入力を行います。
- 接続をテストし、保存します。Jira と Oracle を手動で設定したときに指定したすべてのカスタム設定 (例:
<connection-properties>SetBigStringTryClob=true</connection-properties>
の追加) は削除されます。削除された設定は手動で回復させる必要があります。 - Jira を再起動します。
データベース接続フィールド
セットアップウィザード / 設定ツール | dbconfig.xml | 説明 |
---|---|---|
ホスト名 |
| Oracle サーバーがインストールされたサーバー マシンのマシン名または IP アドレスです。 |
ポート |
| Oracle サーバーがリッスンする TCP/IP ポートです。Oracle に設定されたデフォルト ポート番号は “1521” です。 |
SID |
| Oracle の「システム識別子」です。多くの Oracle サーバーに対するこのデフォルト値は、”ORCL” です。Oracle Express Edition を使用している場合は、”XE” です。 |
ユーザ名 |
| The user that Jira uses to connect to the Oracle server. You should have created this in Step 1 above. |
パスワード | <password> タグに配置されます (下記の例の太字部分):<password> jiradbuser</password> | Oracle サーバーが認証に使用するユーザーのパスワードです。 |
dbconfig.xml ファイルのサンプル
上記の dbconfig.xml
ファイルに含まれる、pool
で始まる <jdbc-datasource/>
の子要素の詳細については、「データベース接続のチューニング」を参照してください。
<?xml version="1.0" encoding="UTF-8"?>
<jira-database-config>
<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type>oracle10g</database-type>
<jdbc-datasource>
<url>jdbc:oracle:thin:@dbserver:1521/ORCL</url>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<username>jiradbuser</username>
<password>password</password>
<pool-min-size>20</pool-min-size>
<pool-max-size>20</pool-max-size>
<pool-max-wait>30000</pool-max-wait>
<pool-max-idle>20</pool-max-idle>
<pool-remove-abandoned>true</pool-remove-abandoned>
<pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
<validation-query>select 1 from dual</validation-query>
<min-evictable-idle-time-millis>60000</min-evictable-idle-time-millis>
<time-between-eviction-runs-millis>300000</time-between-eviction-runs-millis>
<pool-test-while-idle>true</pool-test-while-idle>
<pool-test-on-borrow>false</pool-test-on-borrow>
</jdbc-datasource>
</jira-database-config>
4. Jira を起動する
これで、Oracle データベースに接続するための Jira の設定が完了しました。次のステップでは、Jira を起動します。
Congratulations, you now have Jira connected to your Oracle database.
既知の問題
- If you start experiencing problems when dealing with custom workflows or working with issues that have long descriptions, comments or custom field values, try adding the element
<connection-properties>SetBigStringTryClob=true</connection-properties>
as a child of the</jdbc-datasource>
element in yourdbconfig.xml
file. This connection property may solve these problems. You'll need to restart Jira afterwards.