The FASTEST way to unload data to CSV

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ธ.ค. 2024

ความคิดเห็น •

  • @TheMrTalliban
    @TheMrTalliban 3 หลายเดือนก่อน

    we use exactly the same pro*c program and it's slow as heck. 1-2 Mb/s.

    • @DatabaseDude
      @DatabaseDude  3 หลายเดือนก่อน +1

      Then you're doing something wrong. Thus from a VM on my 3 year old laptop
      SQL> select bytes/1024/1024/1024 from user_segments where segment_name = 'T';
      BYTES/1024/1024/1024
      --------------------
      1.25488281
      [oracle@db23oel8 demo]$ ./oracle-ascii-unload userid=scott/tiger@db21pdb1 arraysize=1000 sqlstmt="select * from t" > /tmp/demo.out
      Unloading 'select * from t'
      Array size = 1000
      OWNER|OBJECT_NAME|SUBOBJECT_NAME|OBJECT_ID|DATA_OBJECT_ID|OBJECT_TYPE|CREATED|LAST_DDL_TIME|TIMESTAMP|STATUS|TEMPORARY|GENERATED|SECONDARY|NAMESPACE|EDITION_NAME|SHARING|EDITIONABLE|ORACLE_MAINTAINED|APPLICATION|DEFAULT_COLLATION|DUPLICATED|SHARDED|IMPORTED_OBJECT|CREATED_APPID|CREATED_VSNID|MODIFIED_APPID|MODIFIED_VSNID
      7532400 rows extracted
      Elapsed: 00:00:14

  • @ge0rgej0seph
    @ge0rgej0seph 3 ปีที่แล้ว +1

    in sqldeveloper we had a hint /*CSV*/ that was useful

  • @rydmerlin
    @rydmerlin 3 ปีที่แล้ว

    FWIW I use Dbdivs and @export which all uses JDBC.
    Would unload data work if you had your data in a view?
    Does this assume you're doing this on the same machine that's running oracle server?
    How will it format Timestamps/Dates etc?

    • @DatabaseDude
      @DatabaseDude  3 ปีที่แล้ว

      SQLcl UNLOAD only works on tables unfortunately.
      Yes, all on same machine. Networks obviously add their own impact
      Timestamps/dates etc are controlled via NLS