Changes between Version 11 and Version 12 of OracleTestSetup


Ignore:
Timestamp:
Nov 16, 2010, 4:58:25 AM (14 years ago)
Author:
Ramiro Morales
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OracleTestSetup

    v11 v12  
    243243    Destroying test database tables...
    244244
    245 Understanding
    246 =============
     245Understanding the database test setup
     246=====================================
    247247
    248248An 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.
    249249
    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.
     250When the Django ORM testing code needs to test multi-DB functionality added in version 1.2, the Django Oracle backend implements that by creating tablespaces. The overall scheme of things is like this:
     251
     252For every DB alias defined in ``DATABASES``:
     253
     254* The ``'NAME'`` variable value specifies the name of the DB we ask the Oracle engine for ('xe' in the case of XE). This can be further controlled by using the ``tnsnames`` infrastructure.
    253255* 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.
     256* The names of such tablespaces are derived from the value of the ``NAME`` var (the data tablespace gets a name prefixed by ``'test_'`` and the temporary tablespace one prefixed by ``'test_'`` and suffixed by ``'_tmp'``.
     257* But their names can also be overridden by the ``'TEST_TBLSPACE'`` and ``'TEST_TBLSPACE_TMP'`` vars, respectively.
     258* For these tablespaces, a temporary user is created beforehand that has full ownership and control over them.
     259* The username of such user isn't the same as the ``'USER'`` var, is derived from it with a prefix added. It can be overridden with the value of the ``'TEST_USER'`` var.
     260* The password assigned to that user is hardcoded, but can be overridden by the value of the ``'TEST_PASSWD'`` var.
     261* The tablespaces and the user are removed when test execution finishes.
    260262* 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``
     263
     264  * ``'TEST_CREATE'`` -- Skips creation and deletion of the tablespaces
     265  * ``'TEST_USER_CREATE'`` -- Skip creation and deletion of the temporary user
     266
     267In summary, Oracle has the following extra ``DATABASES`` vars when compared with other Django DB backends: ``'TEST_TBLSPACE'``, ``'TEST_TBLSPACE_TMP'``, ``'TEST_USER'``, ``'TEST_PASSWD'``, ``'TEST_CREATE'`` and ``'TEST_USER_CREATE'``.
    265268
    266269Notes
    267270=====
    268271
    269 In my particular case I've implemented this setup by using a KVM virtual machine
     272In my particular case I implemented this setup by using a KVM virtual machine
    270273(host system is a workstation running Debian unstable *Sid*). The VM got:
    271274
Back to Top