Oracle データベースセットアップ

このページは、Confluence を設定して Oracle データベースを利用する方法を解説します。セットアップ手順には、Oracle サーバーと Confluence サイトの設定が含まれます。

ステップ 1. 前提条件を確認する

始める前に、以下の内容を確認します:

  • ご使用の Oracle のバージョンがサポートされていることを確認します。サポートするプラットフォームをご覧下さい。使用予定の Oracle のバージョンがサポート対象外の場合は、Confluence のインストール前にサポート対象バージョンにアップグレードしてください。
  • Confluence を評価していて、お使いのデータを新しいデータベースに転送されたい場合は、まず次のガイドを参考にして下さい: 別のデータベースへの移行
  • 別のデータベースから移行してくる場合、まず次のガイドを参考にして下さい:別のデータベースへの移行
  • Note: This database can only be set up by an Oracle database administrator (DBA). Oracle is difficult to set up. If you are not a DBA, and you do not have access to an experienced Oracle DBA, we recommend that you choose an alternative database. For a list of supported databases, see Supported Platforms. If you are evaluating Confluence, we recommend that you start with an alternative database and only consider migrating to Oracle after approval from your DBA. If you request Atlassian's technical support for difficulties with Oracle setup, we will assume you have the high level of skill required for an Oracle setup.

ステップ 2.Oracle サーバーのインストール

既に操作可能な Oracle データベースサーバーを持っていない場合、Oracle ダウンロードページからインストレーションパッケージをダウンロードし、Oracle ドキュメンテーションの指示に従います。

次に、以下の手順に従い、Confluence を Oracle サーバーのスキーマに展開します。

注: データベースは、Confluence と同じ文字エンコーディングを使用するように設定する必要があります。推奨されるエンコーディングは、AL32UTF8(Oracle で同等なエンコーディングは Unicode UTF-8です)です。「データベースの文字エンコードの設定」を参照してください。

ステップ 3.Oracle ユーザーをスキーマ作成権限でセットアップする

このステップでは、Oracle で Confluence ユーザーを作成し、ユーザーがコネクションをセットアップしたり、自身のスキーマにオブジェクトを作成したり、スキーマを設定したりできるように、適切な役割を与えます。

ユーザーを作成し、権限を割り当てる方法:

  1. Access the command line interface to Oracle via the 'sqlplus' command.

    sqlplus user/password <as sysdba|as sysoper>

    You must add the 'as sysdba' or 'as sysoper' option if you are logging in with the user 'sys'. This determines which sys role you are using.
    Once logged in, you can type arbitrary SQL commands.

  2. Create a Confluence user (<user>) in Oracle, and grant the appropriate roles only to the user:

    • connect role is required to set up a connection.
    • resource role is required to allow the user to create objects in its own schema. 
    • Create table, sequence and trigger are required to configure the schema.

      create user <user> identified by <password> default tablespace <tablespace_name> quota unlimited on <tablespace_name>;
      grant connect to <user>;
      grant resource to <user>;
      grant create table to <user>;
      grant create sequence to <user>;
      grant create trigger to <user>;
      


      メモ:

      • 上記に示したものと同一の権限がユーザーに付与されていることが非常に重要です。Confluence はこれらの権限のみを必要とするため、ユーザーに特定の権限を付与し、ロールを割り当てないようにしてください

      • Do not grant the user the select any table permission. That permission can cause problems with other schemas. See the bug report CONF-3613.

      • When you create a user, specify the tablespace for the table objects as shown above.

  3. Add a local all_objects view to the user's schema, to prevent a conflict that can occur when a table exists in another schema with the same name as one of the Confluence tables. This is a workaround for the bug CONF-3613:

    create view <user>.all_objects as
    select *
    from sys.all_objects
    where owner = upper('<user>');

ステップ 4.Confluence のインストール

Confluence のインストールを行っていない場合は、ここでインストールしてください。Confluence インストールガイドをご覧ください。お使いのブラウザで Confluence セットアップウィザードを開く前に、インストレーション後すぐに中断して次のステップに従います。

既に Confluence セットアップウィザードの途中まで進んだ場合、データベースセットアップのステップで止めて、以下のステップに従います。後で、同じ所から再びセットアップウィザードを再開できます。

ステップ5. JDBC URL を決定する

Oracle 用の JDBC Thin ドライバーは、3種類のスタイルの URL を使用します。

  • 新しいスタイル:

    新しいスタイル
     jdbc:oracle:thin:@//[HOST][:PORT]/SERVICE
  • 古いスタイル

    古いスタイル
    jdbc:oracle:thin:@[HOST][:PORT]:SID
  • 「tnsnames」スタイル

    tnsnames
    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)))
    

メモ:

  • The tnsnames style is required for connecting to an Oracle RAC cluster. For easy reading, we have split the example above over multiple lines, but you should compact it into a single line. These values may need more analysis than documented here, so you should seek the assistance of an experienced DBA.
  • 新しいスタイルの URL を使用する場合、SERVICE は SID かサービス名のいずれかです。
  • 古いスタイルの URL を使用する場合、SERVICE には SID のみが使用可能です。

ホスト、ポート、サービス名、および/または SID を決定するには、Oracle を実行しているユーザーで以下のコマンドを実行します(デフォルトでは、「oracle」ユーザー)。

 lsnrctl status

 

参考として、サンプル出力を以下に示します。

SNRCTL for Linux: Version 11.2.0.2.0 - Beta on 29-JUN-2012 15:20:59
Copyright (c) 1991, 2010, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Beta
Start Date                06-JUN-2012 08:36:34
Uptime                    23 days 6 hr. 44 min. 25 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/<HOSTNAME>/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOSTNAME>)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOSTNAME>)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XE" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
The command completed successfully

 

メモ:

  • The host and port are determined by the line containing PROTOCOL=tcpwithout Presentation=HTTP.
  • Under Services Summary, each service which has an instance with READY status is a connectable service. The name following Service is a service name for connecting to the database name following Instance on the next line.
  • The SID is the name of the database instance, as defined by the $ORACLE_SID variable when you have sourced the Oracle environment to your shell.

For example, assuming that you are running Confluence on the same server as the Oracle database, with the above lsnrctl status output, you would use one of the following URLs:

jdbc:oracle:thin:@//localhost:1521/XE
jdbc:oracle:thin:@localhost:1521:XE

 

この URL は、直接の JDBC 接続や Tomcat データソースで使用したりすることができます。

Oracle JDBC URL の詳細については、Oracle JDBC FAQ を参照してください。

ステップ 6.Oracle データベースドライバーのダウンロードおよびインストール

Oracle への接続方法として JDBC 直接接続またはデータソース接続のどちらを使用するかを、利用環境に合わせて決めておいてください。不明であれば、JDBC への直接接続を選択します。

JDBC への直接接続をセットアップするには:

MySQL に対する Oracle の直接接続をセットアップする予定であれば、Oracle JDBC ドライバーをお使いの Confluence インストレーションにコピーする必要があります。

  1. 最新の互換データベース ドライバをダウンロードします。適切なデータベースドライバーへのリンクは、このページから利用できます: データベース JDBC ドライバ
  2. Copy the driver JAR file to the <Confluence installation>/confluence/WEB-INF/lib folder in your new Confluence installation.

データソース接続をセットアップするには:

Oracle へのデータソース接続をセットアップする場合、「Apache Tomcat での Oracle データソースの設定」において解説されたステップに従います。

ステップ 7.Confluence セットアップウィザードにおけるデータベース接続のセットアップ

Confluence を起動して、お使いのブラウザの Confluence セットアップウィザードに行きます。ステップに従い、新しい設定をセットアップします:

  1. Confluence セットアップガイドにおける最初のステップに従います。
  2. 評価用インストールもしくは本番環境用インストールの選択を求められたときは、本番環境を選択します。
  3. 組み込みデータベースまたは外部データベースを選択するようにプロンプトが出されたら、ドロップダウンリストから Oracle xx を選択して、外部データベースを選択します(xx はご使用の Oracle のバージョン)。
  4. 先ほど Oracle データベースドライバーをセットアップした際の選択と合うように、JDBC 直接接続もしくはデータソース接続を選択します。
    • For the JDBC connection: Enter the database URL to match the JDBC URL you determined in the previous section. Enter the user name (for example, confluenceuser) and password you chose when adding the Confluence database to Oracle.
    • For a datasource connection: Set the JNDI name to java:comp/env/jdbc/confluence.
  5. Confluence が Oracle にスキーマを作成するため、しばらくお待ち下さい。

おめでとうございます!Confluence は、そのデータ保管に Oracle データベースを利用するようになりました。

トラブルシューティング

  • Confluence がクラスファイルを欠いていると訴えた場合は、JDBC ドライバーを誤ったフォルダに配置した可能性があります。
  • If none of the above describes your issue, please create a support ticket at http://support.atlassian.com and be sure to include your logs (found in <CONFLUENCE-INSTALLATION>/logs and <CONFLUENCE-HOME>/logs).
最終更新日 2017 年 5 月 15 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.