Code

Opened 3 years ago

Closed 3 years ago

#16478 closed Cleanup/optimization (fixed)

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

Reported by: aaugustin 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 aaugustin)

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 aaugustin 3 years ago.
Screen shot 2011-07-17 at 11.38.28.png (37.1 KB) - added by aaugustin 3 years ago.
16478-docs-only.patch (1.8 KB) - added by aaugustin 3 years ago.

Download all attachments as: .zip

Change History (10)

Changed 3 years ago by aaugustin

comment:1 Changed 3 years ago by aaugustin

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

Changed 3 years ago by aaugustin

comment:2 Changed 3 years ago by aaugustin

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 Changed 3 years ago by aaugustin

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.

Changed 3 years ago by aaugustin

comment:4 Changed 3 years ago by aaugustin

  • Description modified (diff)
  • Summary changed from Don't hardcode the location of Oracle's datafiles for the test tablespaces to Document Oracle-specific database settings, esp. for tests.

comment:5 Changed 3 years ago by bpeschier

  • Triage Stage changed from Unreviewed to Accepted

comment:6 Changed 3 years ago by ramiro

  • Component changed from Testing framework to Documentation
  • Triage Stage changed from Accepted to Ready for checkin

comment:7 Changed 3 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.