Gallery2:Oracle - Gallery Codex
Personal tools

Gallery2:Oracle

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

  • CHARACTER_ENCODING AL32UTF8
  • NLS_LENGTH_SEMANTICS CHAR ([1])

Client / Environment Settings

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

Database User Requirements

Required Permissions:

  • CREATE, ALTER, DROP TABLE
  • 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.

Notes

[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.