DCM4CHEE will work with PostgreSQL 8.x. You may download the database software from http://www.postgresql.org/
To use PostgreSQL 9.x - it is necessary to upgrade your Postgres driver in <DCM4CHEE_HOME>/server/default/lib to the 9.0 version:
Setup PostgreSQL following instructions for your operating system.
Set permissions on Postgres database. The following setting will trust only connections from the localhost, which is reasonable for a development machine, but may need to be changed for production.
Initiate the archive database instance: pacsdb using create DDL script dcm4chee-psql-2.13.6/sql/create.psql
- Install PostgreSQL using the installation wizard contained in the distribution.
- Accept the default Service User name of postgres, and install as a Windows Service.
- Name the database superuser postgres, with a password of your choice.
- When going through the Wizard, at the Initialize database cluster page, only select Accept connections on all addresses, not just localhost if this database server will be serving information over the network or if you intend on remotely accessing the database. If dcm4chee is installed and running on the same computer as the database, this checkbox should not be selected (i.e., the database will only accept connections from localhost).
- After installation, start the PostgreSQL service.
- Open pgAdmin (Start -> Programs -> PostgreSQL 8.2 -> pgAdmin III), and log in as the postgres user.
- Create a database called pacsdb (right click on Databases, and select New Database). Ensure the owner is the postgres user. Be sure to specify UTF8 encoding for the database.
- Ensure that the pacsdb database is selected/highlighted; select Tools, and then Query Tool from the top level menu within pgAdmin.
- Within the pgAdmin Query Tool, Click on File -> Open. Open the file /sql/create.psql within the dcm4chee installation directory. Highlight all of the SQL statements, and click on the Execute Query button ( ). This should execute without any errors.
- In your dcm4chee installation, use a text editor to edit server/default/deploy/pacs-postgres-ds.xml, and server/default/deploy/arr-psql-ds.xml. These files control the dcm4chee connections to the database. pacs-postgres-ds.xml is for the main archive application, and arr-psql-ds.xml is for the Audit Record Repository (ARR). Note that if you opted to install the ARR on a separate machine or as a separate process, this file will not be in your dcm4chee installation directory. Ensure the connection information, including the user name and password, are correct.
- It is now ready for dcm4chee to use it!
Sometimes it is desirable to set up a specific user in postgres to handle the database interaction. This may be a situation where the database is shared by multiple applications, or you do not want to use the DB super user account within dcm4chee. In this case, you will need to create a new user in postgres. When creating the database ensure that the desired user is selected as the database owner (see step 7 above), and make the necessary changes in the datasource config files (see step 10 above).
Postgres will by default store all of the dcm4chee data in a subdirectory the postgres installation directory. This is the default tablespace. As you can imagine there are many scenarios where this is not desirable; you may have a specific mount point or file system that you want to store the database on. The two main use cases for this are:
- You want to separate the database file system from the DICOM image file system for performance reasons. I.e. to eliminate disk IO contention between image file reads/writes, database file reads/writes, and/or application log file writes.
- You have a separate disk or disk array that has a backup strategy in place, and/or is managed in an HA or fault tolerant manner.
In this case, before you create the database (in step 7 above), create a tablespace.
- Create a directory on the desired file system to hold the dcm4chee data files.
File System Permissions
Ensure that the postgres Service User has full control of the created directory, with regards to Windows (or other operating system) Security/Permissions for the folder.
- Right click on Tablespaces
- Select New Tablespace for the database.
- The tablespace location should be the directory you just created, and the owner should be postgres (or other user if you're using a non-default user id for dcm4chee database access). Name the tablespace dcm4chee.
- Specify this tablespace when you create the dcm4chee database (see step 7 above).
Your mileage may vary on this, as every installation is different. I have had success with these parameters in some installations. Again, keep in mind that tuning is very specific to the usage of the archive.
The following table lists some modifications that may be made to the default Postgres settings.