web stats
Connecting to Mirth's embedded database - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2009, 10:28 AM
geraldb geraldb is offline
Mirth Employee
 
Join Date: Aug 2006
Location: Irvine, CA
Posts: 314
geraldb is an unknown quantity at this point
Default 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
Reply With Quote
  #2  
Old 10-06-2014, 12:34 PM
appsbyaaron's Avatar
appsbyaaron appsbyaaron is offline
Mirth Guru
 
Join Date: Nov 2011
Location: Florida, USA
Posts: 377
appsbyaaron is on a distinguished road
Default

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 at 12:40 PM.
Reply With Quote
  #3  
Old 10-06-2014, 12:39 PM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

Quote:
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.
Reply With Quote
  #4  
Old 10-06-2014, 12:52 PM
appsbyaaron's Avatar
appsbyaaron appsbyaaron is offline
Mirth Guru
 
Join Date: Nov 2011
Location: Florida, USA
Posts: 377
appsbyaaron is on a distinguished road
Default

Thanks Nick.

I do get frustrated with the outdated/lack-of information concerning MIRTH. When was the Wiki last updated?
Reply With Quote
  #5  
Old 10-06-2014, 12:59 PM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

Quote:
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.
Reply With Quote
  #6  
Old 10-30-2018, 02:02 PM
stormcel stormcel is offline
OBX.3 Kenobi
 
Join Date: Mar 2010
Location: Phoenix
Posts: 150
stormcel is on a distinguished road
Default

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.
Reply With Quote
  #7  
Old 10-30-2018, 05:58 PM
stormcel stormcel is offline
OBX.3 Kenobi
 
Join Date: Mar 2010
Location: Phoenix
Posts: 150
stormcel is on a distinguished road
Default

Tony on the SLACK channel helped me with this one!
thanks
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:15 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation