Changes between Version 15 and Version 16 of OracleTestSetup
- Timestamp:
- Jul 17, 2011, 6:48:33 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
OracleTestSetup
v15 v16 5 5 ============================== 6 6 7 **This document is work in progress** 8 9 This document attempts to ease the task of running the Django (or your own app's) test 7 This document attempts to ease the task of running Django's (or your own app's) test 10 8 suite against Oracle by: 11 9 … … 14 12 as efficiently as possible. 15 13 16 Contributions from seasoned Oracle users are welcome! .14 Contributions from seasoned Oracle users are welcome! 17 15 18 16 Chosen components are: 19 17 20 * Oracle XE (10g)21 * GNU/Debian Linux x86 . Things should also work with Ubuntu Linux without too much tweaking.18 * Oracle XE 10g. This is a free version of Oracle targeted at developers. 19 * GNU/Debian Linux x86 — not amd64, because there's no 64bit free version of Oracle (XE). Things should also work with Ubuntu Linux without too much tweaking. 22 20 23 21 The system isn't going to be dedicated exclusively to run Oracle so we will … … 36 34 37 35 Contrarily to what is suggested in some places_ I've found the newer **oracle-xe-universal_10.2.0.1-1.1_i386.deb** package 38 you can get here_ (as of Nov 2010) and install able by usinghigh level Debian/Ubuntu package management36 you can get here_ (as of Nov 2010) and install with high level Debian/Ubuntu package management 39 37 tools (APT, Aptitude, ...) didn't install things like the ``/etc/init.d/oracle-xe`` init 40 script and some files under the ``/usr/lib/oracle`` hierarchy so I went with the older38 script and some files under the ``/usr/lib/oracle`` hierarchy. So I went with the older 41 39 package plus the low-level `dpkg` package manager and took care of dependencies manually 42 40 (see next step). 43 41 44 #. Install the prerequisite packages , if you fail to do so the installation won't be successful45 but won't abort either::42 #. Install the prerequisite packages. If you don't do this, the Oracle package will attempt 43 to install anyway, will fail, and you will end up with a half-installed package:: 46 44 47 45 $ sudo apt-get install bc libaio1 … … 79 77 (among others) in the ``/etc/default/oracle-xe`` configuration file and we 80 78 would be using the same script as the one executed when the system boots 81 (the SyV``/etc/init.d/oracle-xe`` script) that always examines these values.79 (the ``/etc/init.d/oracle-xe`` script) that always examines these values. 82 80 83 81 What we can do is to create a slightly modified ``/etc/init.d/xe`` script 84 that ignores that flag and allows us to control the Oracle process at will:: 82 that ignores that flag and allows us to control the Oracle process at will. 83 Download [[attachment:oracle-xe-script.diff]] then:: 85 84 86 85 $ cd /etc/init.d 87 86 $ sudo cp -a oracle-xe xe 88 87 $ sudo patch < /home/myuser/oracle-xe-script.diff 89 90 This is the ``oracle-xe-script.diff`` patch file::91 92 --- xe 2006-02-24 17:23:15.000000000 -030093 +++ xe.new 2010-11-03 07:58:43.000000000 -030094 @@ -596,13 +596,8 @@95 # See how we were called96 case "$1" in97 start)98 - if test -f "$CONFIGURATION"99 + if test ! -f "$CONFIGURATION"100 then101 - if test "$ORACLE_DBENABLED" != "true"102 - then103 - exit 0104 - fi105 - else106 echo "Oracle Database 10g Express Edition is not configured. You must run107 '/etc/init.d/oracle-xe configure' as the root user to configure the database."108 exit 0109 @@ -613,13 +608,8 @@110 configure111 ;;112 stop)113 - if test -f "$CONFIGURATION"114 + if test ! -f "$CONFIGURATION"115 then116 - if test "$ORACLE_DBENABLED" != "true"117 - then118 - exit 0119 - fi120 - else121 echo "Oracle Database 10g Express Edition is not configured. You must run122 '/etc/init.d/oracle-xe configure' as the root user to configure the database."123 exit 0124 88 125 89 Now we can start/stop Oracle manually using it:: … … 245 209 Destroying test database tables... 246 210 211 If you encounter the following error many times:: 212 213 DatabaseError: ORA-12520: TNS:listener could not find available handler for requested type of server 214 215 you may need to increase the value of the `processes` parameter. 216 By default, it's 40; I've increased it to 100 and this has fixed this error — but I can't guarantee it's the "correct" solution. 217 To change the value: 218 219 * start a SQL shell with ``sqlplus`` 220 * run ``ALTER SYSTEM SET processes = 100 scope=spfile;`` 221 * exit the SQL shell 222 * restart the server: ``/etc/init.d/xe restart``. 223 224 247 225 Understanding the database test setup 248 226 =====================================