embulk / embulk-output-jdbc

MySQL, PostgreSQL, Redshift and generic JDBC output plugins for Embulk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Oracle][General questions] Can i load data oracle on NOLOGGING ?

morihaya opened this issue · comments

Hi there.
I was very happy to replaced the sqlloader with digdag and embulk.
However, one problem is that the amount of output from Archive Log has increased significantly.
Is it possible to load data as NOLOGGING mode with embulk-output-oracle plugin?

My embulk yml.liquied is here.

out:
  type: oracle
  driver_path: {{ env.oracle_driver }}
  url: jdbc:oracle:thin:@//{{ env.oracle_dest_host }}/{{ env.oracle_dest_sid }}
  user: {{ env.oracle_dest_user }}
  password: {{ env.oracle_dest_pass }}
  schema: {{ env.oracle_dest_schema }}
  table: {{ env.table }}
  mode: truncate_insert
  insert_method: direct

@morihaya
Hi,
The following pages say that Oracle will load in NOLOGGING mode by executing ALTER TABLE target_table NOLOGGING.

http://www.dba-oracle.com/t_nologging_append.htm (English)
https://www.shift-the-oracle.com/alter-table/table-property/table-logging-attribute.html (Japanese)

By the before_load option of embulk-output-jdbc, you can execute SQL before loading.
And you can use after_load option to restore the logging attribute for the table.

@ hito4t
Thank you for your reply. I tried your suggestion, but the redo log did not decrease.
However, I tried DROP INDEX XXXX before loading, but got good results.
I think I create a redo log of data load when the index exists, and I can solve that problem by dropping the index before loading.