Announcement

Collapse
No announcement yet.

Prune shrinks mirthtb?

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

  • Prune shrinks mirthtb?

    Hey guys,

    We have a PC here just for tests where we have a Mirth Connect installed on it. We receive many messages everyday (which is used for testing) and now our mirthbd is getting really big (I am aware about the Derby limitations). We define a pruner strategy (prune metadata and content older than 1 day) and our question is: After running the pruner, my mirthdb will shrink?

  • #2
    Pruning does DELETE statements which inherently doesn't reclaim disk space. But if you regularly prune then it shouldn't matter, and in general your database shouldn't be perpetually growing, unless your message throughput is also growing.

    Some databases like PostgreSQL have auto-vacuuming features, but for Derby you'll have to compress tables manually. Here's an example: http://www.mirthcorp.com/community/w...edded+database
    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


    • #3
      Thanks Narupley for your help.

      I am trying follow the instructions to access Deby from command line:

      wget http://ftp.unicamp.br/pub/apache//db...1.1-bin.tar.gz

      tar xvf db-derby-10.11.1.1-bin.tar.gz

      cd db-derby-10.11.1.1-bin

      ./bin/ij

      ij> connect 'jdbc:derby:/opt/mirthconnect/appdata/mirthdb'

      >

      Then I stopped all my channels to execute the query:
      DELETE FROM MESSAGE;
      {call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'MESSAGE', 0)};

      But I got this error:

      ERROR XJ040: Failed to start database '/opt/mirthconnect/appdata/mirthdb' with class loader [email protected], see the next exception for details.
      ERROR XSDB6: Another instance of Derby may have already booted the database /opt/mirthconnect/appdata/mirthdb.

      Is it mean I am still connect at mirthdb? What I am missing?

      Thanks.

      Comment


      • #4
        Another disadvantage of using the embedded Derby database is that only one application can access it at a time. So you need to shut down Mirth Connect if you want to connect to it from the command line.
        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


        • #5
          VACUUM mirthdb

          Hello Narupley,

          Thanks for your help.

          I accessed mirthdb (Derby) and now I am try to delete messages. I am trying this:
          DELETE FROM D_MM7;
          {call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'D_MM7', 0)};

          (I am following this instructions? http://www.mirthcorp.com/community/w...edded+database)

          But, I get this error:
          DELETE on table 'D_MM7' caused a violation of foreign key constraint 'D_MC7_FKEY' for key (1,0). The statement has been rolled back.

          What is wrong?

          Thanks!

          Comment


          • #6
            Unfortunately that wiki page was written for version 2.x and hasn't yet been updated. In 3.x since Derby doesn't handle cascading automatically, you'll have to delete from D_MA#, then D_MCM#, then D_MC#, then D_MM#, and finally D_M#.

            Or, don't do the delete manually. Instead, just let Mirth Connect do the pruning, and then do the compress statement afterwards.
            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


            • #7
              Hello, how can I create a compress statement after pruning? I am using Mirth Connect Server 3.3.0.7801 Built on September 14, 2015.

              Thank you

              Comment

              Working...
              X