1
votes

I'm trying to start using flyway v2.3 on an existing Oracle 11g schema that does not contain the schema_history table

In my flyway.properties i've set the flyway.user to the schema owner and i've set the flyway.schemas property to the same value

When running init from the command line I expected flyway to only create the schema_history table but it fails with this message:

$ ./flyway.cmd init
Flyway (Command-line Tool) v.2.3

Creating schema "myschema" ...
ERROR: Unable to create schema "myschema"
ERROR: Caused by: java.sql.SQLSyntaxErrorException: ORA-01031: insufficient privileges

Why is flyway attempting to create the schema? I only want it to create the schema_history table in the schema I configured

3

3 Answers

2
votes

The command is correct. Please note that flyway.schemas is case-sensitive and automatically filled with the default schema of the user if left empty.

I suspect the value you put in flyway.schemas is in the wrong case. Just leave it empty and you should be ok.

0
votes

So you have to be sure you want to work on schema which belongs to user name with which you login. If you want to work in different schema you have to specify inside flyway.properties.

0
votes

I've just had the same problem in Flyway Maven plugin 3.1.

I turned out that I have created my user with lowercase name

CREATE USER myuser ...

And I gave Flyway

flyway.user=myuser

But while connecting my user's name was cast to uppercase, so Flyway reported that user of name MYUSER did not exist.

Solution: Create and use Oracle DB user with uppercase name.