dbt-oracle icon indicating copy to clipboard operation
dbt-oracle copied to clipboard

ORA-00955: name is already used by an existing object

Open JeremyDel opened this issue 1 year ago • 6 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

I have some experience with dbt but None with dbt-oracle and I'm getting a bit frustrated..

When trying to create a dummy model from a simple table, when running dbt run for the first time my model is created but when I run dbt run for the second time I get the following error: ORA-00955: name is already used by an existing object

I don't think this is the desired behaviour of dbt, it should recreate the table no ?

I attempted to do the same with an incremental table and the compilled code isn't not outputting any merge statement as it should do and I get the same error as above.

Expected Behavior

No response

Steps To Reproduce

No response

Relevant log output using --debug flag enabled

No response

Environment

- OS: Windows
- Python: 3.10.11
- dbt-core: 1.7.15
- dbt-oracle: 1.7.5

What Oracle database version are you using dbt with?

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Additional Context

No response

JeremyDel avatar Jun 05 '24 16:06 JeremyDel

@JeremyDel

It would good to check database name if it is lowercase or uppercase. I am suspecting there is some mismatch in the metadata.

select SYS_CONTEXT('userenv', 'DB_NAME') from dual;

Also, have you defined any quoting configuration in dbt-project.yml file?

aosingh avatar Jun 05 '24 17:06 aosingh

The database name is lowercase ! I did try all the quoting possibilities in my dbt-project.yml but it doesn't work quoting: database: true identifier: false schema: false

JeremyDel avatar Jun 05 '24 17:06 JeremyDel

Also, is this on-prem or Autonomous database ?

aosingh avatar Jun 05 '24 17:06 aosingh

This is onprem.

I could recreate the error on another simple oracle database on which I can use the system user and when adding the database parameter in profiles.yml I was getting the error. By removing the database it worked as it should. I cannot remove the database parameter when using another user:

Runtime Error Credentials in profile "consilium", target "dev" invalid: 'database' is a required property

JeremyDel avatar Jun 05 '24 18:06 JeremyDel

Could you try after enabling quoting only for database ?

quoting:
  database: true

aosingh avatar Jun 05 '24 18:06 aosingh

Yes that worked !

Thank you so much for your fast answers !

JeremyDel avatar Jun 05 '24 18:06 JeremyDel

Closing this

aosingh avatar Oct 22 '24 16:10 aosingh