I'm setting up a Oracle XE instance on Linux to be able to test Django ORM
changes. This has so far resulted in a couple of small fixes and
a [1]wiki page documenting the process and hopefully any feeback
I get to this email.
Being a total newbie regarding Oracle is th reason I post this question after
a couple of hours trying to get our Django test suite working against
Oracle without errors to no avail.
I know that with this product only a 'XE' database is available and
that the Oracle
backend creates 'tablespaces' for every Django database.
I've reached the point where I can run most tests when
the DATABASES setting only includes the 'default' connection
but obviously I get a bunch of
ConnectionDoesNotExist: The connection other doesn't exist
errors and the following summary:
Ran 2712 tests in 1559.220s
FAILED (failures=28, errors=850, skipped=36, expected failures=1)
When I use a settings file, created after trial and error, containing:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'xe',
'USER': 'djangotest',
'PASSWORD': 'foo',
},
'other': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'xeother',
'USER': 'djangotest2',
'PASSWORD': 'bar',
'TEST_TBLSPACE': 'tblspace_other',
'TEST_TBLSPACE_TMP': 'tblspace_tmp_other',
},
}
the auxiliary test-specific code of the Oracle bckend creates both tablespaces
and their respective users before running them and cleanly deletes all of it
afterwards. But then I get a lot of
DatabaseError: ORA-12520: TNS:listener could not find available
handler for requested type of server
errors and a summary like:
Ran 2746 tests in 2335.718s
FAILED (failures=36, errors=207, skipped=41, expected failures=2)
Has anybody had success with this setup i.e. one where the 'default and 'other'
alias pointing to such an Oracle product/install?. Is it possible at all?
If so, could you please share the relevant Django settings file (not
really, only
the DATABASES setting)?
Thanks,
--
Ramiro Morales
I've been working with Oracle during the sprints after last DjangoCon,
and had the same problem. I've been told by several people that
the second db can't be oracle and should be something else, like sqlite.
Here is my db settings.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.oracle', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'XE', # Or path to database file if using sqlite3.
'USER': 'andrew', # Not used with sqlite3.
'PASSWORD': 'djangocon', # Not used with sqlite3.
'HOST': '192.168.2.33', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '1521', # Set to empty string for default. Not used with sqlite3.
},
'other': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'other_db', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
'TEST_NAME': 'other_db',
}
}
Andrew
> --
> You received this message because you are subscribed to the Google Groups "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
>
On Tue, Nov 9, 2010 at 2:15 AM, Andrew Kurinnyi <pri...@gmail.com> wrote:
> Hi Ramiro
>
> I've been working with Oracle during the sprints after last DjangoCon,
> and had the same problem. I've been told by several people that
> the second db can't be oracle and should be something else, like sqlite.
Thank you very much for your reply. I will test this tonight at home.
Karen had already given me some hints via IRC about havin
to use such a mutiple, heterogeneous DB scheme.
Thanks again for taking the time to share your experiences.
>
> Here is my db settings.
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.oracle', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'XE', # Or path to database file if using sqlite3.
> 'USER': 'andrew', # Not used with sqlite3.
> 'PASSWORD': 'djangocon', # Not used with sqlite3.
> 'HOST': '192.168.2.33', # Set to empty string for localhost. Not used with sqlite3.
> 'PORT': '1521', # Set to empty string for default. Not used with sqlite3.
> },
> 'other': {
> 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'other_db', # Or path to database file if using sqlite3.
> 'USER': '', # Not used with sqlite3.
> 'PASSWORD': '', # Not used with sqlite3.
> 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
> 'PORT': '', # Set to empty string for default. Not used with sqlite3.
> 'TEST_NAME': 'other_db',
> }
> }
>
> Andrew
>
--
Ramiro Morales
Has anybody had success with this setup i.e. one where the 'default and 'other'
alias pointing to such an Oracle product/install?. Is it possible at all?
If so, could you please share the relevant Django settings file (not
really, only
the DATABASES setting)?
Wow. Thanks Ian!. With these settings, plus your [1]patch for #11101
(and plus [2]r14510)
things look definitely better in the Oracle front:
----------------------------------------------------------------------
Ran 2804 tests in 1935.104s
FAILED (failures=4, errors=6, skipped=42, expected failures=2)
Will run the test suite against 1.2.X and update the [3]wiki page tomorrow.
--
Ramiro Morales
1. http://code.djangoproject.com/ticket/11101
2. http://code.djangoproject.com/changeset/14510
3. http://code.djangoproject.com/wiki/OracleTestSetup