oracle - Benefits of External Tables vs. UTL_FILE -
oracle - Benefits of External Tables vs. UTL_FILE -
i writing application in pl/sql takes .csv flat-file, reads it, info processing on it, , decides of several tables update, insert into, or delete.
i have alternative of using utl_file.get_line functionality process single record @ time, parsing various regex tools, storing info temporarily in variables, , doing work (making decisions, updating tables, etc.)
i have option, of creating external table, , stepping through using cursor on said external table (using each loop performance) should still able of same things data(making decisions, updating tables, etc.)
i have looked around, , couple of forums suggest external tables preferred solution this, scale better, faster, , more reliable. have not, however, heard why. oracles documentation on utl_file and/or external tables not talk why 1 might faster other, i'm curious if has more info or references not create 1 perform improve on other.
the performance difference quite simple: utl_file pl/sql package, while external tables utilize sql*loader code written in c.
if have plenty data, can load external tables in parallel minimal effort f.i. alter table my_external_table parallel 4;
external tables can used in mass mode (insert my_table select ... my_external_table bring together my_lookup_table using (lookup_column)).
external tables can set transactionally safe mode (reject limit 0), above insert either works or rolls back.
do need more reasons?
oracle plsql
Comments
Post a Comment