oracle / dbt-oracle

dbt (data build tool) adapter for Oracle Autonomous Database
https://docs.getdbt.com/docs/core/connect-data-platform/oracle-setup
Apache License 2.0
46 stars 17 forks source link

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

Open JeremyDel opened 4 months ago

JeremyDel commented 4 months ago

Is there an existing issue for this?

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

aosingh commented 4 months ago

@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?

JeremyDel commented 4 months ago

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

aosingh commented 4 months ago

Also, is this on-prem or Autonomous database ?

JeremyDel commented 4 months ago

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

aosingh commented 4 months ago

Could you try after enabling quoting only for database ?

quoting:
  database: true
JeremyDel commented 4 months ago

Yes that worked !

Thank you so much for your fast answers !