Hello all
dbt core newbie here!
The problem I’m having
I am using dbt core in a PoC on top of Oracle.
When I run dbt snapshot command, first run will create the history table. Second run dbt will attempt to create the table again and will fail with ORA-00955: name is already used by an existing object
The context of why I’m trying to do this
hackathon/PoC on using dbt
What I’ve already tried
I tried using check and timestamp strategies. Tried different users. Tried to run al the queries from dbt log directly on the database, they all can run without issues.
Some example code or error messages
my snapshot file
{% snapshot workorder_history %}
{{
config(
target_schema='BI_HACKATHON',
strategy='timestamp',
updated_at='LASTCHANGEDAT',
unique_key='MAINTENANCEORDER',
)
}}
SELECT MAINTENANCEORDER, FUNCTIONALLOCATION, MAINTENANCEORDERDESC, CONTROLLINGAREA, COMPANYCODE, RESPONSIBLECOSTCENTER, PROFITCENTER, CONTROLLINGOBJECTCLASS, BASICSCHEDULINGTYPE, ORDISNOTSCHEDLDAUTOMATICALLY, MAINTORDPERSONRESPONSIBLE, MAINTENANCEORDERINTERNALID, TASKLISTGROUP, TASKLISTTYPE, TASKLISTGROUPCOUNTER, MAINTENANCEPLANT, CREATEDBYUSER, ORDERHASLONGTEXT, ADDITIONALDEVICEDATA, WBSELEMENTINTERNALID, PROJECTINTERNALID, ORDERPROCESSINGGROUP, SUPERIORPROJECTNETWORK, MAINWORKCENTER, MAINWORKCENTERPLANT, CURRENCY, DFSMAINTORDEROBJECTNMBR, DFSMAINTSUPERORDINATEEQUIPNMBR, EQUIPMENT, ERRDESC, USERSTATUS, USERSTATUSTEXT, SORTFIELD, MAINTPRIORITYTYPE, MAINTPRIORITY, MAINTENANCEPROCESSINGPHASE, MAINTOBJECTLOCACCTASSGMTNMBR, MAINTENANCENOTIFICATION, ASSEMBLY, SERIALNUMBER, MAINTENANCEPLANNINGPLANT, MAINTENANCEPLANNERGROUP, MAINTENANCEREVISION, MAINTENANCEPLAN, MAINTENANCEITEM, MAINTENANCEACTIVITYTYPE, WORKCENTERINTERNALID, WORKCENTERTYPECODE, MAINTENANCEORDERPLANNINGCODE, OPERATIONSYSTEMCONDITION, REFERENCEELEMENT, PERSONNELNUMBER, MAINTORDERROUTINGNUMBER, BUSINESSAREA, MAINTENANCEORDERTYPE, MAINTENANCEORDERCATEGORY, SCHEDULEDBASICSTARTDATE, SCHEDULEDBASICENDDATE, CREATIONDATE, LASTCHANGEDATETIME, LATESTACCEPTABLECOMPLETIONDATE, MAINTORDBASICSTARTDATE, MAINTORDBASICENDDATE, MAINTENANCEITEMOBJECTLIST, MAINTENANCEORDEROBJECTLIST, CONFIRMEDENDDATE, ACTUALSTARTDATE, MAINTORDERREFERENCEDATE, SCHEDULEDBASICSTARTTIME, SCHEDULEDBASICENDTIME, CREATIONTIME, MAINTORDBASICSTARTTIME, MAINTORDBASICENDTIME, MAINTORDERREFERENCETIME, ISCLAIMSTATUSACTIVE, ISWORKORDERACTIVE, LASTCHANGEDAT, LASTCHANGEDBY, LASTCHANGEDDATE, STATUSLASTCHANGEDATE, USERSTATUSSHORTNAME
FROM {{ source('BID30_CUR', 'T30_012_WORKORDER') }}
{% endsnapshot %}
error I get:
10:43:24 Concurrency: 1 threads (target=‘dev’)
10:43:24
10:43:24 1 of 1 START snapshot BI_HACKATHON.workorder_history … [RUN]
10:43:24 oracle adapter: Oracle error: ORA-00955: name is already used by an existing object
10:43:24 1 of 1 ERROR snapshotting BI_HACKATHON.workorder_history … [ERROR in 0.17s]
10:43:24
10:43:24 Finished running 1 snapshot in 0 hours 0 minutes and 0.55 seconds (0.55s).
10:43:24
10:43:24 Completed with 1 error and 0 warnings:
10:43:24
10:43:24 Database Error in snapshot workorder_history (snapshots/workorder_history.sql)
10:43:24 ORA-00955: name is already used by an existing object
10:43:24 compiled Code at target/run/dwh_oracle/snapshots/workorder_history.sql