0

I'm using Oracle Database 10g xe universal Rel.10.2.0.1.0 against cx_Oracle-5.0.4-10g-unicode-py26-1.x86_64 on a django project on Ubuntu 10.04

My db is generated by Oracle 10gr2 enterprise edition (on Windows XP, import done in US7ASCII character set and AL16UTF16 NCHAR character set, import server uses AL32UTF8 character set, export client uses EL8MSWIN1253 character set)

When I try django-admin.py inspectdb I get the following error:

......."indexes = connection.introspection.get_indexes(cursor, table_name) File "/usr/lib/pymodules/python2.6/django/db/backends/oracle/introspection.py", line 116, in get_indexes for row in cursor.fetchall(): File "/usr/lib/pymodules/python2.6/django/db/backends/oracle/base.py", line 483, in fetchall for r in self.cursor.fetchall()]) cx_Oracle.DatabaseError: OCI-22061: invalid format text [T".

I am aware of "inspectdb works with PostgreSQL, MySQL and SQLite" but as I understand from other posts it also works with Oracle somehow.

Does anyone know why I get this error or how I could fix it?

VC1
  • 1,660
  • 4
  • 25
  • 42
marlen
  • 473
  • 6
  • 20

2 Answers2

0

can you try it with updating cx_Oracle 5.1.1 package, then try this:

python manage.py inspectdb --database dbname
urcm
  • 2,274
  • 1
  • 19
  • 45
0

You can download cx_Oracle-5.1.2 and fix the issue using below command.

$ wget -c http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.1.2-11g-py27-1.x86_64.rpm

Command to install rpm

$ sudo yum install cx_Oracle-5.0.4-11g-unicode-py27-1.x86_64.rpm

Also download Oracle instantclient http://download.oracle.com/otn/linux/instantclient/11101/basic-11.1.0.6.0-linux-x86_64.zip and http://download.oracle.com/otn/linux/instantclient/11101/sdk-11.1.0.6.0-linux-x86_64.zip

Extract the above downloaded zip file. copy the include folder from sdk-11.1.0.6.0-linux-x86_64 and paste in basic-11.1.0.6.0-linux-x86_64 Set the below path in .bashrc file

export $LD_LIBRARY_PATH = $LD_LIBRARY_PATH:/oracle_lib/oracle_instantclient_11_1

export $ORACLE_HOME = /oracle_lib/oracle_instantclient_11_1

$ ls /oracle_lib/oracle_instantclient_11_1

You should find the include folder with list of files

Then execute .bashrc file using $ source ~/.bashrc

I have tested it.

Prashant Sahoo
  • 979
  • 16
  • 19