1

I am building a Django app and it has several apps. It is working fine with SQLite database as a backend. When I am trying to migrate the backend to Oracle using "manage.py migrate", I am getting below error

django.db.utils.DatabaseError: ORA-01950: no privileges on tablespace 'XXXXXX'

When I checked my User privileges in the database, it has privileges to create tables, views etc. I tried to execute "manage.py sqlmigrate" and go through the queries that Django is going to execute on the database and found out that they are "create table" and "add constraints queries". Is there a way in Django to find out which query is getting failed or raising that ORA-01950 error?

1 Answer 1

2

When I checked my User privileges in the database, it has privileges to create tables, views etc.

Have you checked that app user has permssion related to quota (unlimited or 1GB .. ) ? In oracle, it is not sufficient to have create table permission to create table, you also need quota on table space.

ALTER USER <user> quota unlimited on <tablespace name>;

or

ALTER USER <user> quota 1G on <tablespace name>;
Sign up to request clarification or add additional context in comments.

3 Comments

I already tried altering the quota, but cannot execute it due to ORA-01031 insufficient privileges. One more thing(forgot to mention in the post) is that I am able to run queries to create tables and views manually
@Kumar-58 Creating an empty table doesn't necessarily use a tablespace. Try inserting a row into a table that you created. If you don't have either a sufficient quota on the tablespace or the UNLIMITED TABLESPACE system privilege them your migration isn't happening.
@WilliamRobertson I tried to insert values into one of the tables created in the database. I got similar error ORA-01950 no privileges on tablespace. I will contact my DBA to provide privileges on the tablespace. Thanks for help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.