Stash is now known as Bitbucket Server.
See the

Unknown macro: {spacejump}

of this page, or visit the Bitbucket Server documentation home page.

メタデータの末尾にスキップ
メタデータの先頭に移動

This page describes how to connect Stash to a Oracle database. 

The overall process for using a Oracle database with Stash is:

  • Install Oracle where it is accessible to Stash.
  • Create a database and user on the Oracle server for Stash to use.
  • Install Stash on Windows, or on Linux or Mac.
  • 次のいずれかを実行します。
    • at Stash install time, run the Setup Wizard to connect Stash to the Oracle database, or
    • at a later time, migrate Stash to the Oracle database.

It is assumed here that you already have Oracle installed and running. For information about installing Oracle and creating Oracle databases, see the Oracle documentation pages. For the versions of Oracle supported by Stash see Supported platforms.

前提条件

バックアップ

If you are migrating your data from the internal Stash database, back up the Stash home directory.

If you are migrating your Stash data from a different external database, back up that database by following the instructions provided by the database vendor before proceeding with these instructions.

See Data recovery and backups.

Create the Oracle schema for Stash

Before you can use Stash with Oracle, you must set up Oracle as follows:

  • Ensure that you have a database instance available for Stash (either create a new one or use an existing one)
    The character set of the database must be set to either AL32UTF8 or UTF8, to support storage of Unicode data as per the Oracle documentation.
    Note that it is important to the proper operation of Stash that the database store its data in a case-sensitive manner. By changing the values of the NLS_COMP and/or NLS_SORT variables, it is possible to cause Oracle to perform its searches in a case-insensitive manner. We therefore strongly recommend that those variables be left at their default values.
  • Create a user that Stash will connect as (e.g.  stash ). 
    (tick) Remember the database user name; it will be used to configure Stash's connection to the database in subsequent steps.
    (info) When you create a user in Oracle, a schema is automatically created.

    It is strongly recommended that you create a new database user for use by Stash rather than sharing one that is used by other applications or people.
  • Grant the Stash user connect and resource roles only. The connect role is required to set up a connection, while resource role is required to allow the user to create objects in its own schema.
  • Create a local all_objects view to the user's schema, so that there is no possibility that a table with the same name as one of the Stash tables in another schema will cause any conflicts.

Oracle でユーザーを作成するコマンドの形式は次のとおりです。

CREATE USER <user> 
	IDENTIFIED BY <password>;
GRANT CONNECT, RESOURCE to <user>;
CREATE VIEW <user>.all_objects AS
  SELECT *
  FROM sys.all_objects
  WHERE owner = upper('<user>');

Here is a simple example, using SQL*Plus, of how one might create a user called stash  with password jdHyd6Sn21  in tablespace users , and grant the user a minimal set of privileges. When you run the command on your machine, remember to replace the user name, password and tablespace names with your own values.

CREATE USER stash
  IDENTIFIED BY jdHyd6Sn21;
 
GRANT CONNECT, RESOURCE to stash;
CREATE VIEW stash.all_objects AS
  SELECT *
  FROM sys.all_objects
  WHERE owner = upper('stash');

This creates an empty Oracle schema with the name stash, and a user that can log in from the host that Stash is running on and who has full access to the newly created schema. In particular, the user is allowed to create sessions and tables.

Note that Stash will generally require about 25–30 connections to the database.

Connect Stash to the Oracle database

You can now connect Stash to the Oracle database, either:

  • インストール時にセットアップ ウィザードを実行する場合
  • when you wish to migrate to Oracle, either from the embedded Stash database or from another external database.

インストール時にセットアップ ウィザードを実行する場合

  1. "Database" 手順で [External] を選択します。
  2. [Database Type] で [Oracle] を選択します。
  3. フォームに入力します。詳細は、以下の表を参照してください。
  4. Click Next, and follow the instructions in the Stash Setup Wizard.

Oracle に移行する場合

  1. In the Stash administration area, click Database (under 'Settings').
  2. [データベースの移行] をクリックします。
  3. [Database Type] で [Oracle] を選択します。
  4. フォームに入力します。詳細は、以下の表を参照してください。
  5. [移行の開始] をクリックします。
ホスト名

The host name or IP address of the computer running the Oracle server.

ポートThe TCP port with which Stash can connect to the database server. The default value is the default port that Oracle runs against. You can change that if you know the port that your Oracle instance is using.
データベース名The system identifier of the Oracle instance that Stash should connect to. This should be the fully qualified service name for your Oracle database.
Database usernameThe username that Stash should use to access the database.
データベース パスワードThe password that Stash should use to access the database.

JDBC ドライバのインストール

This section is only relevant to some distributions of Stash, for example if you are running Stash via the Atlassian Plugin SDK, or have built Stash from source.

If the Oracle JDBC driver is not bundled with Stash, you will need to download and install the driver yourself.

  1. Download the appropriate JDBC driver from the Oracle download site.
  2. Copy the downloaded jar file to your <Stash home directory>/lib directory (for Stash 2.1 or later).
  3. Stop, then restart, Stash on Windows, or on  Linux and Mac.
  • ラベルなし