# Using Oracle for the MDM server

When you select to use Oracle as the database for the MDM server, you must make specific configurations before starting the MDM server.

You can use a single Oracle database with different tablespaces: one tablespace for the master container, one for system objects, and another for the staging container.

The configurations for different Oracle versions are the same. For more information about the supported Oracle versions, see [Compatible databases](https://help.qlik.com/talend/en-US/installation-guide-linux/7.2/compatible-databases "The following tables provide information on the recommended and supported databases you can use with Talend server modules.").

MDM also supports other types of databases. For more information, see [Managing MDM databases](https://help.qlik.com/talend/en-US/installation-guide-linux/7.2/managing-mdm-databases).

## Procedure

1. Using your Oracle development tool (Oracle SQL developer, for example), create a user per container.

   In this example, create three users: mdm\_master, mdm\_staging, and mdm\_system.
2. Create a tablespace for each user.

   For example, create a tablespace MDMMASTER for the user mdm\_master:
   ```
   CREATE TABLESPACE
   MDMMASTER DATAFILE '/home/talend/oracle/oradata/XE/MDMMASTER.DBF'  SIZE 20M
   AUTOEXTEND ON NEXT 5M
   MAXSIZE 100M;
   ```

   Make sure you see the output: "tablespace MDMMASTER created."
3. Grant access right to users on the tablespaces.
   ```
   ALTER USER mdm_master
   QUOTA 100M ON MDMMASTER; 
   ```

   Make sure you see the output: "user mdm\_master altered."
4. Alter the users so that each one uses a different tablespace.

   In this example, mdm\_master uses the tablespace MDMMASTER, and mdm\_staging uses MDMSTAGING.
5. Make sure that each user has the permissions for "System Privileges"..
6. On the MDM server, update the datasource configuration file &lt;$INSTALLDIR&gt;/conf/datasources.xml.

   The template is as follows:
   ```
       <datasource name="Oracle-Default">
           <master>
               <type>RDBMS</type>
               <rdbms-configuration>
                   <dialect>Oracle11g</dialect>
                   <connection-driver-class>oracle.jdbc.driver.OracleDriver</connection-driver-class>
                   <connection-url>jdbc:oracle:thin:@localhost:1521:TMDM_DB</connection-url>
                   <connection-username>mdm_master</connection-username>
                   <connection-password></connection-password>
                   <connection-pool-minsize>5</connection-pool-minsize>
                   <connection-pool-maxsize>50</connection-pool-maxsize>
                   <fulltext-index-directory>/home/talend/Talend-MDMServer/data/indexes/Oracle-Default</fulltext-index-directory>
                   <schema-generation>update</schema-generation>
                   <properties>
                       <property name="hibernate.show_sql">false</property>
                       <property name="hibernate.default_schema">mdm_master</property>
                   </properties>
               </rdbms-configuration>
           </master>
           <staging>
               <type>RDBMS</type>
               <rdbms-configuration>
                   <dialect>Oracle11g</dialect>
                   <connection-driver-class>oracle.jdbc.driver.OracleDriver</connection-driver-class>
                   <connection-url>jdbc:oracle:thin:@localhost:1521:TMDM_DB</connection-url>
                   <connection-username>mdm_staging</connection-username>
                   <connection-password></connection-password>
                   <connection-pool-minsize>5</connection-pool-minsize>
                   <connection-pool-maxsize>50</connection-pool-maxsize>
                   <schema-generation>update</schema-generation>
                   <properties>
                       <property name="hibernate.show_sql">false</property>
                       <property name="hibernate.default_schema">mdm_staging</property>
                   </properties>
               </rdbms-configuration>
           </staging>
           <system>
               <type>RDBMS</type>
               <rdbms-configuration>
                   <dialect>Oracle11g</dialect>
                   <connection-driver-class>oracle.jdbc.driver.OracleDriver</connection-driver-class>
                   <connection-url>jdbc:oracle:thin:@localhost:1521:TMDM_DB</connection-url>
                   <connection-username>mdm_system</connection-username>
                   <connection-password></connection-password>
                   <connection-pool-minsize>5</connection-pool-minsize>
                   <connection-pool-maxsize>50</connection-pool-maxsize>
                   <schema-generation>update</schema-generation>
                   <properties>
                       <property name="hibernate.show_sql">false</property>
                       <property name="hibernate.default_schema">mdm_system</property>
                   </properties>
               </rdbms-configuration>
           </system>
       </datasource>
   ```

   For more information about the file, see [Talend Help Center](https://help.qlik.com/talend/#/search/books?query=mdm+sql+storage).

   Information noteNote: The staging area does not define any full text index directory.
7. Update the configuration file &lt;$INSTALLDIR&gt;/conf/mdm.conf as follows:
   ```
   db.autoPrepare=false
   db.default.datasource=Oracle-Default
   ```
8. Restart the MDM server.