Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORA-01950 on schema baseline/init in Oracle 12.1 #1093

Closed
sebtacke opened this issue Sep 11, 2015 · 1 comment
Closed

ORA-01950 on schema baseline/init in Oracle 12.1 #1093

sebtacke opened this issue Sep 11, 2015 · 1 comment
Labels
Milestone

Comments

@sebtacke
Copy link

@sebtacke sebtacke commented Sep 11, 2015

The RESOURCE role in Oracle 12.1 doesn't include the unlimited quota for all tablespaces anymore. See: http://docs.oracle.com/database/121/DBSEG/release_changes.htm#BABEBGDI

This results in an ORA-01950 error on baseline, because the newly create user now has a quota of 0 for the default tablespace. When the first row is written to the metadata (schema_version) table, the quota is checked for the schema owner (created user). The user has a quota of 0 on the tablespace so nobody is allowed to write data into that schema.
As the user is created in the baseline operation you cannot grant a quota beforehand and as the metadata is written before anything else is executed you cannot grant a quota in an SQL script.

The easiest way to fix this would be to add the UNLIMITED TABLESPACE grant to the doCreate() method in https://github.com/flyway/flyway/blob/master/flyway-core/src/main/java/org/flywaydb/core/internal/dbsupport/oracle/OracleSchema.java.

In my opinion it would make sense to add an optional placeholder/configuration for the default tablespace of the user and limiting the quota grant to the specified tablespace when the placeholder is present, though. You could change the tablespace for the user in a script, but everything that is written up to that point has already been written to the default tablespace. And in production environments you usually want dedicated tablespaces for your applications. (If you agree with this, I would open a separate issue for the placeholder, as they are separate concerns. One is a feature request for Oracle 12 support, the other one is a feature request for better production environment support.)

axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Oct 27, 2015
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Oct 27, 2015

Thanks Sebastian! I implemented the fix you suggested. For the tablespace, please +1 #865

@axelfontaine axelfontaine added this to the Flyway 4.0 milestone Oct 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.