Announcement

Collapse
No announcement yet.

Connecting to Mirth's embedded database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connecting to Mirth's embedded database

    By default Mirth comes bundled with Apache Derby as its database for storing channel and message data. While this is useful for getting started quickly and evaluating Mirth, we strongly recommend switching to PostgreSQL or another external database in a production setting.

    For various reasons, it is sometimes useful to connect to the embedded database to perform cleanup if the tables are too large or to export data. Below are instructions for how to connect to Mirth's embedded Derby database.

    Step 1: Download SQuirreL SQL and start it up.

    Step 2: Under the Drivers panel, edit the "Apache Derby Embedded" driver and under "Extra Class Path" add derby.jar (located in the %MIRTH_HOME%/lib/ folder).

    Step 3: Under the Aliases panel, create a new alias using the "Apache Derby Embedded" driver and set the URL to "jdbc:derby:C:\Program Files\Mirth\mirthdb;create=true" without the quotes, and replacing that path with the path to your mirthdb folder. The user name and password are blank.

    You should now be able to connect to the database. Make sure that the Mirth server is stopped before trying to access the database. To clear out all messages in the database and compress the table, run the following commands:

    Code:
    DELETE FROM MESSAGE;
    {call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'MESSAGE', 0)};
    Gerald Bortis | Chief Information Officer | Mirth Corporation

  • #2
    I have followed this as best as I cold but I do not have any tables. Running the DELETE FROM MESSAGE; Gives me:

    Error: Table/View 'MESSAGE' does not exist.
    SQLState: 42X05
    ErrorCode: 30000


    Also I only can find derby in C:\Program Files\Mirth Connect\server-lib\database\derby-10.10.1.1.jar
    Last edited by appsbyaaron; 10-06-2014, 12:40 PM.

    Comment


    • #3
      Originally posted by appsbyaaron View Post
      I have followed this as best as I cold but I do not have any tables. Running the DELETE FROM MESSAGE; Gives me:

      Error: Table/View 'MESSAGE' does not exist.
      SQLState: 42X05
      ErrorCode: 30000
      What version are you on? The thread you're replying to was created over 5 and a half years ago, so much has changed. In 3.x there's no single "message" table anymore; instead each channel has its own set of normalized d_m* tables.

      Note that we do not recommend deleting anything manually via SQL. Instead, log into the Administrator, select all channels on the dashboard, and choose the "Remove All Messages" option.
      Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

      Nicholas Rupley
      Work: 949-237-6069
      Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


      - How do I foo?
      - You just bar.

      Comment


      • #4
        Thanks Nick.

        I do get frustrated with the outdated/lack-of information concerning MIRTH. When was the Wiki last updated?

        Comment


        • #5
          Originally posted by appsbyaaron View Post
          Thanks Nick.

          I do get frustrated with the outdated/lack-of information concerning MIRTH. When was the Wiki last updated?
          Well, we are planning on doing a major update to it with the 3.1 GA release (which will be very soon, maybe even next week). So look forward to that...
          Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

          Nicholas Rupley
          Work: 949-237-6069
          Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


          - How do I foo?
          - You just bar.

          Comment


          • #6
            So, if these old instructions do not work, that leaves me the following questions?
            Will deleting messages shrink the Derby DB?
            Pruning doesn't seem to be reclaiming disk space.
            Can you please walk me through how to reclaim the disk space without killing the entire install?
            thank you so much.

            Comment


            • #7
              Tony on the SLACK channel helped me with this one!
              thanks

              Comment

              Working...
              X