Opened 13 years ago

Closed 13 years ago

#16478 closed Cleanup/optimization (fixed)

Document Oracle-specific database settings, esp. for tests.

Reported by: Aymeric Augustin Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords: oracle
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Aymeric Augustin)

EDIT: a few days after reporting this ticket, I changed my recommendation. See comments 2 and 3 below. I'm updating the title to reflect this.


Original title: Don't hardcode the location of Oracle's datafiles for the test tablespaces

Use case: I want to move Oracle's datafiles to a RAM disk (tmpfs) to speed up the execution of Django's test suite.

Problem: django.db.backends.oracle.creation currently uses this SQL: CREATE TABLESPACE %(tblspace)s DATAFILE '%(tblspace)s.dbf' ...

It's allright to provide a datafile name, because we can't assume all users of Django are using Oracle-managed files. However, since we provide a relative path, the file will always be created in Oracle's dbs directory. The DB_CREATE_FILE_DEST parameter is ignored when a datafile name is provided.

See http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/clauses004.htm#i1030551 (if you speak Oraclese).

Proposed solution: add an optional setting to control the location of the datafile during the tests. If the setting is not provided, default to TEST_TBLSPACE + '.dbf' for backwards compatibility.

Attachments (3)

16478.diff (4.5 KB ) - added by Aymeric Augustin 13 years ago.
Screen shot 2011-07-17 at 11.38.28.png (37.1 KB ) - added by Aymeric Augustin 13 years ago.
16478-docs-only.patch (1.8 KB ) - added by Aymeric Augustin 13 years ago.

Download all attachments as: .zip

Change History (10)

by Aymeric Augustin, 13 years ago

Attachment: 16478.diff added

comment:1 by Aymeric Augustin, 13 years ago

NB: during the test suite, each tablespace takes 160MB (see attached screenshot). This is a good reason to move it to RAM.

by Aymeric Augustin, 13 years ago

comment:2 by Aymeric Augustin, 13 years ago

Upon further investigation, there are undocumented TEST_CREATE and TEST_USER_CREATE boolean parameters.

The best solution may be to set TEST_CREATE = False and create the tablespace with whatever parameters I want.

comment:3 by Aymeric Augustin, 13 years ago

Here is a new patch that documents the undocumented Oracle-specific settings. I'm now using this, and I'm creating and dropping the user and the tablespaces with a separate SQL script.

by Aymeric Augustin, 13 years ago

Attachment: 16478-docs-only.patch added

comment:4 by Aymeric Augustin, 13 years ago

Description: modified (diff)
Summary: Don't hardcode the location of Oracle's datafiles for the test tablespacesDocument Oracle-specific database settings, esp. for tests.

comment:5 by Bas Peschier, 13 years ago

Triage Stage: UnreviewedAccepted

comment:6 by Ramiro Morales, 13 years ago

Component: Testing frameworkDocumentation
Triage Stage: AcceptedReady for checkin

comment:7 by Malcolm Tredinnick, 13 years ago

Resolution: fixed
Status: newclosed

In [16646]:

Documented some Oracle-specific test settings.

Patch from aaugustin that should help people with specific testing
requirements for Oracle set things up in their preferred way. The
settings have always existed, but now they are documented.

Fixes #16478.

Note: See TracTickets for help on using tickets.
Back to Top