Changes between Version 3 and Version 4 of OracleTestSetup
- Timestamp:
- Nov 11, 2010, 8:15:03 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
OracleTestSetup
v3 v4 33 33 tools (APT, Aptitude, ...) didn't install things like the ``/etc/init.d/oracle-xe`` init 34 34 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). 36 37 37 38 #. Install the prerequisite packages, if you fail to do so the installation won't be successful … … 72 73 (among others) in the ``/etc/default/oracle-xe`` configuration file and we 73 74 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. 75 76 76 77 What we can do is to create a slightly modified ``/etc/init.d/xe`` script … … 83 84 This is the ``oracle-xe-script.diff`` patch file (you can also download it):: 84 85 85 --- oracle-xe 2006-02-24 17:23:15.000000000 -030086 +++ xe 2010-11-03 07:58:43.000000000 -030086 --- xe 2006-02-24 17:23:15.000000000 -0300 87 +++ xe.new 2010-11-03 07:58:43.000000000 -0300 87 88 @@ -596,13 +596,8 @@ 88 89 # See how we were called … … 129 130 ``sudo service xe start``) 130 131 131 #. Make sure the neededOracle environment vars needed by its client libraries132 #. Make sure the Oracle environment vars needed by its client libraries 132 133 are set (Bash shell):: 133 134 … … 135 136 $ source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh 136 137 138 139 #. Decide if you will run the following tasks 140 141 * Access the administrative web app 142 * Run the Django tests 143 144 from 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 145 detailed 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 137 150 #. Access the DB engine administration web app by pointing our Web browser to ``http://localhost:8080/apex`` 138 and using the ``SYSTEM`` user andthe 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``) 142 155 143 156 #. Give the user the needed privileges. … … 146 159 * *Directly Granted System Privileges*: ``CREATE TABLE``, ``CREATE PROCEDURE``, ``CREATE SEQUENCE`` and ``CREATE TARIGGER`` 147 160 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 151 162 .. _places: http://blog.schmehl.info/Debian/oracle-xe 152 163 .. _here: http://oss.oracle.com/debian/dists/unstable/non-free/binary-i386/ … … 157 168 158 169 $ sudo apt-get install python-dev 159 $ ... 170 171 :: 172 173 $ sudo pip install cx_Oracle 174 175 or:: 176 177 $ sudo easy_install cx_Oracle 178 179 etc. 160 180 161 181 Create the Django settings file … … 170 190 'NAME': 'xe', 171 191 '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', 173 196 }, 197 174 198 'other': { 175 199 'ENGINE': 'django.db.backends.oracle', 176 'NAME': 'xe other',177 'USER': 'djangotest 2',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', 182 206 }, 183 207 } 208 209 The 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. 184 210 185 211 Test things … … 214 240 and a 30 GiB hard disk. Platform is GNU/Debian Linux 5.0 aka *Lenny* (stable as of Nov 2010) 215 241 because 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 .242 form. Things should also work with Ubuntu Linux without too much tweaking. 217 243 218 244 Things to review: … … 220 246 * 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. 221 247 * 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 do224 =====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.227 248 }}}