#21775 closed New feature (fixed)
No facility to specify the datafile of a django test Oracle tablespace
Reported by: | jarshwah | Owned by: | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | oracle |
Cc: | Shai Berger, alvaro@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There is no way to customise the name of the datafile for the Oracle test database. This is required for RAC installations which use shared storage. I propose a new option to the DATABASES dict:
'TEST_TBLSPACE_DATAFILE': '', 'TEST_TBLSPACE_TMP_DATAFILE': '',
Without these options, it is impossible to test against RAC, so I'm classifying it as a bug rather than a new feature.
And the existing code that creates the tablespaces:
# django/db/backends/oracle/creation.py def _execute_test_db_creation(self, cursor, parameters, verbosity): if verbosity >= 2: print("_create_test_db(): dbname = %s" % parameters['dbname']) statements = [ """CREATE TABLESPACE %(tblspace)s DATAFILE '%(tblspace)s.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE 200M """, """CREATE TEMPORARY TABLESPACE %(tblspace_temp)s TEMPFILE '%(tblspace_temp)s.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE 100M """, ] self._execute_statements(cursor, statements, parameters, verbosity)
Since not many people have access to an Oracle RAC installation, I'll throw together a patch in the near future.
Change History (9)
comment:1 by , 11 years ago
Cc: | added |
---|---|
Keywords: | oracle added |
Needs documentation: | set |
Triage Stage: | Unreviewed → Accepted |
Type: | Bug → New feature |
comment:2 by , 11 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
I'd like to try to create a patch for this.
Could you please elaborate more on how to you imagine this patch to look like?
Thanks!
comment:3 by , 11 years ago
Alvaro, there is a discussion happening at the moment on the django developers mailing list:
https://groups.google.com/forum/#!topic/django-developers/2aJuLbMRARU
The discussion is currently centred on cleaning up how test database settings should be structured. It'd be worth reading that, and either waiting on an outcome, or writing the patch as you think it should work and submitting for review.
Regards,
comment:4 by , 11 years ago
Easy pickings: | unset |
---|
comment:6 by , 10 years ago
https://github.com/django/django/pull/3118
This patch allows specifying the DATAFILE and MAXSIZE of each tablespace (the primary and the tmp). The default maxsize has been increased from 200M to 500M to better support GIS on Oracle. This default may need to be increased to correctly support GIS as it was just a guess - Shai to confirm.
I've also changed the tablespace creation to be test_USER rather than test_NAME - which should make more sense for an Oracle deployment. NAME will be "xe" (or some other like-value) for every single django app running on the same database, which could lead to clobbering if running two different django applications on the same server. NAME will at least be linked to the actual django application under test, rather than the server.
comment:7 by , 10 years ago
Has patch: | set |
---|---|
Version: | 1.6 → master |
comment:8 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
You should be able to test even against RAC by creating (or even just using) your own tablespace, and setting
TEST_CREATE = False
. Of course, it is much better to allow the use of test-only tablespaces and give the user more control over where they are created; but that is an enhancement.I have just run into a related problem myself -- the 200M size limit on the test tablespace does not allow testing the GIS oracle backend; so, I'd like to "hijack" this ticket into one which allows complete control over the creation of the test tablespaces.
While at it, I don't like much the current set of Oracle-specific-test-only parameters in the general database settings dictionary. I'd like to collect them into a
TESTING
entry, or maybe into theOPTIONS
entry; I'll take that to the developers list.