Accessing Bamboo's H2 embedded database

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

目的

While the H2 database is not supported for production environments, sometimes admins will need access for testing purposes. The most likely use case is to get into an instance where you are locked out. You can access H2 through a Database Administration tool, Java GUI, or through the command line.

Bamboo must be shut down before accessing the H2 database. It is also highly recommended to back up your data before making any changes.

DB Visualizer を使用して組み込み H2 データベースに接続する

データベース内で直接変更を行う必要があり、H2 データベースを使用している場合は、次の方法で、DBVisualizer を使用して接続できます。 

DBVisualizer is just one database administration tool. You can use any administration tool that supports embedded H2 databases. The steps will be similar.

  1. Bamboo をシャットダウンします。
  2. <bamboo-home>/database ディレクトリをバックアップします。
  3. Launch DBVisualizer
  4. Add the H2 db driver which is embedded in Bamboo installer:

    1. Go to Tools >> Driver manager

    2. Locate the driver H2 embedded

    3. Add a new driver file path to <Bamboo_Install>/lib/h2-1.4.xxx.jar

    4. Move the driver to the top of the list

  5. 新しいデータベース コネクションを作成するを選択し、プロンプトに従ってコネクションをセットアップします。
    必要な情報は以下のとおりです。
    • データベース ドライバー: H2 embedded 
    • データベース ユーザー ID: sa
    • データベース パスワード: 空白のまま
    • データベース ファイル名: <bamboo-home>/database/h2
      (warning) ファイル拡張子 .h2.db は不要です。
  6. データベースに接続します。 

DBVisualizer の使用についてのヘルプは、「DBVisualizer マニュアル」を参照してください。

Connect to the embedded H2 database using Java GUI

Locate the H2 .jar file (h2-1.4.x.jar) in your Bamboo installation directory:

<BAMBOO_INSTALL>/atlassian-bamboo/WEB-INF/lib/

From that folder, launch the GUI interface by entering the following command:

java -jar h2-1.4.194.jar

This will result in a browser opening, and you will be presented with a UI which looks something like this:

Enter the JDBC URL field using the string found in the "hibernate.connection.url" property in <bamboo-home>/bamboo.cfg.xml For example:

    <property name="hibernate.connection.url">jdbc:h2:${bambooHome}/database/h2</property>

(info) Replace the {bambooHome} variable with the real path to the bamboo-home folder

jdbc:h2:file:/real/path/to/your/<bamboo-home>/database/h2

The default credentials are:

ユーザー名パスワード
saNone (leave blank).

Connect to the embedded H2 database using Command Line

Locate the H2 .jar file (h2-1.4.x.jar) in your Bamboo installation directory:


<BAMBOO_INSTALL>/atlassian-bamboo/WEB-INF/lib/

From that folder launch the command line interface by entering the following command:

java -cp h2-1.4.194.jar org.h2.tools.Shell

You will be prompted to enter the following database URL, JDBC driver, user name, and password:

URLJDBC Driverユーザ名パスワード
The <url> string from <bamboo-home>/bamboo.cfg.xml - see example above.org.h2.DriversaNone (leave blank, sometimes you will have to hit enter twice)

If successful, you should be presented with a sql> prompt, and can run any queries needed.










最終更新日: 2019 年 10 月 25 日

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

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