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.
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).
Install OracleCreateBitOr.sql (location: modules/core/classes/GalleryStorage/) and uncomment the following line in OracleStorage.class
/* return array(null, 'BIT_OR(' . $args . ')'); */
This may boost performance a bit.
Instructions for setting up Oracle XE can be found here.
 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.