Access the H2 embedded database in Jira server

お困りですか?

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

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

目的

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 Java GUI, or through the command line.

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

GUI:

  1. Locate the H2 .jar file (h2-1.4.187.jar for example) in your JIRA installation directory:

    <JIRA_INSTALL>/atlassian-jira/WEB-INF/lib/
  2. From that folder, launch the GUI interface by entering the following command:

    java -jar h2-1.4.187.jar
  3. This will result in a browser opening, and you will be presented with a UI which looks something like this:

  4. Enter the JDBC URL field using the string in found in the <url> tag of  <jira-home>/dbconfig.xml. For example:

    jdbc:h2:file:/path/to/your/<jira-home>/database/h2db
  5. Hit Connect and you will be in a pretty familiar SQL GUI.

Command Line:

  • Locate the H2 .jar file (h2-1.4.187.jar for example) in your JIRA installation directory:

    <JIRA_INSTALL>/atlassian-jira/WEB-INF/lib/
  • From that folder launch the command line interface by entering the following command:

    java -cp h2-1.4.187.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 <jira-home>/dbconfig.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.

    説明 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 Java GUI, or through the command line.
    製品Jira
    プラットフォームServer



最終更新日 2019 年 9 月 25 日

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

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