| 245 | Understanding |
| 246 | ============= |
| 247 | |
| 248 | An Oracle instance allows the existence of only one database. This is somewhat different from what we could be accustomed from working with other RDBMS. For more details see the Oracle documentation. |
| 249 | |
| 250 | When the Django ORM testing code needs to test multi-DB functionality added in version 1.2 it uses the services of the Django Oracle backend and it implements the by creating tablespaces. The overall of things is like this: |
| 251 | |
| 252 | * The ``NAME`` variable values specifies the name of the DB ('xe' in the case of Oracle XE). This can be further controlled by using the ``tnsnames`` infrastructure. |
| 253 | * Both a data tablespace and a temporary data tablespace are created. |
| 254 | * The names of such tablespaces are derived from the value f the ``NAME`` var (or from the ``TEST_NAME`` var that overrides ``NAME`` for these purposes). |
| 255 | * But their names can also be overridden by the ``TEST_TBLSPACE`` and ``TEST_TBLSPACE_TMP`` vars, respectively. |
| 256 | * For these tablespaces, an user is created beforehand, that has full ownership and control over them. |
| 257 | * The username of such user isn't the same as the ``USER`` var, is based on it with a prefix added. Can be overridden with the value of the ``TEST_USER`` var. |
| 258 | * The password assigned to that user is hardcoded, but can be overridden by the value of the ``TEST_PASSWD`` var. |
| 259 | * The tablespaces and the user are removed afterwards. |
| 260 | * Some variables are provided to control parts of this process: |
| 261 | * ``TEST_CREATE`` |
| 262 | * ``TEST_USER_CREATE`` |
| 263 | |
| 264 | In summary, Oracle has the following extra vars when compard with other Django DB backends: ``TEST_TBLSPACE``, ``TEST_TBLSPACE_TMP``, ``TEST_USER``, ``TEST_PASSWD``, `TEST_CREATE`` and ``TEST_USER_CREATE`` |
| 265 | |