The LONG RAW data type support of text unload (export) utility

Links: http://www.dbatools.net/mytools/unload_oracle_raw_data.html

    Now you can use ociuldr to move data with LONG RAW type. Just the same as LONG type, the "long=" option define the maximum length ociuldr will read. You may need to set the proper value of this option, the default value is 32KB. Let's start with a sample of how it works. First, create a table with LONG RAW data type.

CREATE TABLE T_RAW (COL1 NUMBER, COL2 LONG RAW);
-- 4c4f4e47205241572031=LONG RAW 1
INSERT INTO T_RAW VALUES (1,'4c4f4e47205241572031');

    Then we unload the data with ociuldr.

ociuldr user=scott/tiger query="select * from t_raw" table=t_raw

    And check what's in the exported file. Don't feel strange that the LONG RAW values are converted to hex code.

1,4c4f4e47205241572031

    The we check the SQL Loader control file generated. The maximum length of these columns is doubled compared to LONG data type.

--
-- Generated by OCIULDR
--
OPTIONS(BINDSIZE=8388608,READSIZE=8388608,ERRORS=-1,ROWS=50000)
LOAD DATA
INFILE 'uldrdata.txt' "STR X'0a'"
INSERT INTO TABLE t_raw
FIELDS TERMINATED BY X'2c' TRAILING NULLCOLS
(
  COL1 CHAR(40),
  COL2 CHAR(65536)
)

    Then you can load these rows into new database easily with sqlldr utility.

Post a comment

« Previous | Main | Next »

Powered by
Movable Type 3.36