Gallery2:Oracle - Gallery Codex
Personal tools


From Gallery Codex

Oracle Database Server For Gallery 2

Gallery 2 supports Oracle Database Server 9i and 10g. To guarantee correct functioning of Gallery 2, it is imperative to configure the database correctly. See the below requirements.

Database Server Settings


Client / Environment Settings

  • NLS_LANG=AMERICAN_AMERICA.UTF8 (Choose the territory / language of your choice, but keep .UTF8!)
  • ORA_NLS10=/home/oracle/product/ (example value, must be defined)

Database User Requirements

Required Permissions:

  • CREATE SEQUENCE (DROP SEQUENCE if you want to use the "erase" method of the installer to reinstall G2 without manual steps)
  • SELECT, INSERT, UPDATE, DELETE on all tables created by this user
  • (CREATE, DROP INDEX - is indirectly granted through CREATE, ALTER, DROP TABLE)
  • ANALYZE ANY (to analyze all tables created by this user)
  • Unlimited tablespace quota (without page level caching, the database will remain reasonably small (< 100 MB) even for pretty large image collections. But with page level caching, the CacheMap table alone can take over a GB of space.)

Note: Only SELECT, INSERT, UPDATE, and DELETE is required during the normal operation of Gallery 2. Other permissions are required during installation and upgrade of the core and other modules. Since users can install / upgrade / uninstall modules at any time in "Site Admin : Plugins", you cannot just use another database user during normal operations (unless you change the code).

Optional Components

Install OracleCreateBitOr.sql (location: modules/core/classes/GalleryStorage/) and uncomment the following line in OracleStorage.class

 /* return array(null, 'BIT_OR(' . $args[0] . ')'); */

This may boost performance a bit.

Oracle Express Edition

Instructions for setting up Oracle XE can be found here.


[1] If not the whole database is set to NLS_LENGTH_SEMANTICS, you need to set it in OracleStorage.class function _setConnectionSettings() before you run the Gallery 2 installer.