Symfony 2 meets Oracle (part 3)

Configuration

First of all you will need to configure the database connection. We will assumme you have followed the previous tutorials and have an Oracle XE database.

parameters:
    database_driver: oci8 
    database_host: your_VM_IP
    database_port: '1521'
    database_name: XE
    database_user: your_username
    database_password: your_password
    database_charset: AL32UTF8

Database charset is by default AL32UTF8 in Oracle XE but if you have to move your database to another Oracle version I would recommend to specify it explicitely in the configuration.
You need to make sure you have the following parameter in your app/config/config.yml

doctrine:
    dbal:
        charset:  %database_charset%

Adding a listener

You need then to add a custom listener to handle the session properly.

services:
    oracle.listener:
        class: Doctrine\DBAL\Event\Listeners\OracleSessionInit
        tags:
            - { name: doctrine.event_listener, event: postConnect }

SonataPageBundle and Oracle

Doctrine does not support where conditions on CLOB. You need to update your schema using the following PR https://github.com/sonata-project/SonataPageBundle/pull/104

Doctrine and Oracle

Finally there are a few known issues between Oracle and Doctrine

http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/known-vendor-issues.html#oracle