Choosing right separators when unload (export) rows to text file

Links: http://www.dbatools.net/experience/choose_right_separators.html

    I am moving some data by ociuldr with the following field and record option.

ociuldr ... field=0x07 record=0x06 ...

    I think it will work well, but actually not, there are rows rejected when loading with sqlldr. The database use UTF8 character set and contains some Asia language data. The I change the separator option with following.

Unix: ociuldr ... field=\<#\> record=\<$\> ...
Windows: ociuldr ... field="<#>" record="<$>" ...

    This time it works very well, no rows are rejected, and the source and target tables are matched.

SQL> SELECT COUNT(*) FROM CR_8875106_UTNS19;

  COUNT(*)
----------
    100000

SQL> SELECT * FROM CR_8875106_SRC
  2  minus
  3  select * from CR_8875106_DEST;

no rows selected

SQL> SELECT * FROM CR_8875106_DEST
  2  minus
  3  SELECT * FROM CR_8875106_SRC;

no rows selected

    The only reason is the database character set, we should specify separators with the same character set as the database. Some invisible chars do not work well under UTF8 character set.

Post a comment

« Previous | Main | Next »

Powered by
Movable Type 3.36