Accessing JIRA's H2 embedded database
자주는 아니지만 가끔씩 H2에 접속을 해야 하는 긴급 상황이 발생합니다. 예를 들어 관리자 계정과 비밀번호 분실 및 속성 타입 강제 변경 등의 상황입니다. 이때 H2에 접속하는 방법은 다음과 같습니다.
아래의 과정을 실행하기 전 반드시 jira service가 중지 되어 있어야 합니다.
GUI:
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 GUI interface by entering the following command:
java -jar h2-1.4.187.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 in found in the <url> tag of <jira-home>/dbconfig.xml. For example:
jdbc:h2:file:/path/to/your/<jira-home>/database/h2db
Hit Connect and you will be in a pretty familiar SQL GUI.
<위의 경로는 반드시 dbconfig.xml안에 있는 경로를 입력해야 함>
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:
URL | JDBC Driver | Username | Password |
The <url> string from <jira-home>/dbconfig.xml - see example above. | org.h2.Driver | sa | None (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.