Changes between Version 3 and Version 4 of OracleTestSetup


Ignore:
Timestamp:
Nov 11, 2010, 8:15:03 AM (14 years ago)
Author:
Ramiro Morales
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OracleTestSetup

    v3 v4  
    3333   tools (APT, Aptitude, ...) didn't install things like the ``/etc/init.d/oracle-xe`` init
    3434   script and some files under the ``/usr/lib/oracle`` hierarchy so I went with the older
    35    package plus dpkg and taking care of  dependencies manually.
     35   package plus the los -level `dpkg` package manager and taking care of dependencies manually
     36   (see next step).
    3637
    3738#. Install the prerequisite packages, if you fail to do so the installation won't be successful
     
    7273   (among others) in the ``/etc/default/oracle-xe`` configuration file and we
    7374   would be using the same script as the one executed when the system boots
    74    (``/etc/init.d/oracle-xe``) that always examines these values.
     75   (the SyV ``/etc/init.d/oracle-xe`` script) that always examines these values.
    7576
    7677   What we can do is to create a slightly modified ``/etc/init.d/xe`` script
     
    8384   This is the ``oracle-xe-script.diff`` patch file (you can also download it)::
    8485
    85     --- oracle-xe   2006-02-24 17:23:15.000000000 -0300
    86     +++ xe  2010-11-03 07:58:43.000000000 -0300
     86    --- xe   2006-02-24 17:23:15.000000000 -0300
     87    +++ xe.new  2010-11-03 07:58:43.000000000 -0300
    8788    @@ -596,13 +596,8 @@
    8889     # See how we were called
     
    129130   ``sudo service xe start``)
    130131
    131 #. Make sure the needed Oracle environment vars needed by its client libraries
     132#. Make sure the Oracle environment vars needed by its client libraries
    132133   are set (Bash shell)::
    133134
     
    135136    $ source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
    136137
     138
     139#. Decide if you will run the following tasks
     140
     141   * Access the administrative web app
     142   * Run the Django tests
     143
     144from same system as the DB engine or from another system through the network. If you chose the first option we are done, if you chose the second option for any of the two kinds of access you need to solve the following two issues first (see the `Oracle installation documentation`_ for
     145detailed instructions):
     146
     147   * You will need to install the Oracle client stack.
     148   * By default no access of any type (SQL sessions, admin web app) is allowed through the network to the DB engine, you need to change that by using the administrative web interface or possibly using the `sqlplus` tool.
     149
    137150#. Access the DB engine administration web app by pointing our Web browser to ``http://localhost:8080/apex``
    138    and using the ``SYSTEM`` user and the password you chose above.
    139 
    140 #. Create an user to be used for running the tests. (e.g. ``djangotest``) -- Go to *Home > Administration > Database Users > CREATE*
    141    assign it a password (e.g. ``foo``)
     151   and using the ``SYSTEM`` user plus the password you chose above.
     152
     153#. Create an user to be used to connect to the DB when running the tests. (e.g. ``djangotest``)
     154   -- Go to *Home > Administration > Database Users > CREATE* assign it a password (e.g. ``foo``)
    142155
    143156#. Give the user the needed privileges.
     
    146159   * *Directly Granted System Privileges*: ``CREATE TABLE``, ``CREATE PROCEDURE``, ``CREATE SEQUENCE`` and ``CREATE TARIGGER``
    147160
    148 #. We don't need to install the Oracle client stack because we are going to run the Django tests in the same system.
    149 
    150 .. _Oracle installation documentation: http://www.oracle.com/pls/xe102/to_toc?pathname=install.102%2Fb25144%2Ftoc.htm&remark=portal+%28Getting+Started%29
     161.. _Oracle installation documentation: http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25144/toc.htm
    151162.. _places: http://blog.schmehl.info/Debian/oracle-xe
    152163.. _here: http://oss.oracle.com/debian/dists/unstable/non-free/binary-i386/
     
    157168
    158169    $ sudo apt-get install python-dev
    159     $ ...
     170
     171::
     172
     173    $ sudo pip install cx_Oracle
     174
     175or::
     176
     177    $ sudo easy_install cx_Oracle
     178
     179etc.
    160180
    161181Create the Django settings file
     
    170190            'NAME': 'xe',
    171191            'USER': 'djangotest',
    172             'PASSWORD': 'foo',
     192            'PASSWORD': 'tehsekret',
     193            'TEST_USER': 'django_test_default',
     194            'TEST_TBLSPACE': 'django_test_default',
     195            'TEST_TBLSPACE_TMP': 'django_test_default_temp',
    173196        },
     197
    174198        'other': {
    175199            'ENGINE': 'django.db.backends.oracle',
    176             'NAME': 'xeother',
    177             'USER': 'djangotest2',
    178             'PASSWORD': 'bar',
    179             #'TEST_USER_CREATE': False,
    180             'TEST_TBLSPACE': 'tblspace_other',
    181             'TEST_TBLSPACE_TMP': 'tblspace_tmp_other',
     200            'NAME': 'xe',
     201            'USER': 'djangotest',
     202            'PASSWORD': 'tehsekret',
     203            'TEST_USER': 'django_test_other',
     204            'TEST_TBLSPACE': 'django_test_other',
     205            'TEST_TBLSPACE_TMP': 'django_test_other_temp',
    182206        },
    183207    }
     208
     209The key is that NAME should be the same ('xe') for both entries, since you're really establishing two connections to the same database. The TEST_USER, TEST_TBLSPACE, and TEST_TBLSPACE_TMP entries must be different, however. Thanks Ian Kelly for providing the correct settings file.
    184210
    185211Test things
     
    214240and a 30 GiB hard disk. Platform is GNU/Debian Linux 5.0 aka *Lenny* (stable as of Nov 2010)
    215241because it still is in its support period and as a bonus contains Python 2.4 in pre-packaged
    216 form. Things should also work with Ubuntu Linux.
     242form. Things should also work with Ubuntu Linux without too much tweaking.
    217243
    218244Things to review:
     
    220246* How much does the Oracle installation pollutes the system?. If it result to be confined and easy to undo/cleanup, maybe this setup doesn't need to be done inside a VM.
    221247* System resource (CPU, RAM usage while running the full test suite). Maybe I can reduce the RAM assigned to the VM to 512 MiB and the virtual CPU count from two to one.
    222 
    223 To do
    224 =====
    225 
    226 Finish the multi-db setup by crafting a correct Django settings file (``oracle.py`` above) that allows us to run the entire suite with errors.
    227248}}}
Back to Top