dmfldr large field data loading

dmfldr supports loading and exporting large field data of DM database. The supported large field data types include TEXT, LONGVARCHAR, IMAGE, LONGVARBINARY, BLOB and CLOB.
01

Large field data export

When dmfldr works in export MODE (MODE is OUT), the data file name corresponding to the large field is generated by LOB_FILE_NAME is specified. If not specified, it defaults to dmfldr Lob, the file storage directory is determined by LOB_DIRECTORY is specified. If it is not specified, it will be stored in the same directory as the exported data file.
Now t_ Export TESTLOB table data to text
(1) Create test tables and insert data
Create t_ In the TESTLOB table, the field ID is a self incrementing column, and the test data is inserted. The table structure reference is as follows:

create table t_testlob (
    id      int identity,
    name    varchar(20),
    info1   blob,  
    info2   clob
);
insert into t_testlob (name, info1, info2)
values('Xue Ming Zhang', 0xabcdef001, 'Wuhan East Lake high tech Zone future science and Technology City');
insert into t_testlob (name, info1, info2)
values('Chen Wuliang', 0xdfdfd234, 'Huashen Avenue, Yuhuatai District, Nanjing City, Jiangsu Province');
insert into t_testlob (name, info1, info2)
values('Ma Liang', 0xfadaaf123, 'Shanghai Zhangjiang High Tech Park, Pudong New Area, Shanghai');
insert into t_testlob (name, info1, info2)
values('Li Mei', 0xab121032def, 'Zhongguancun South st, Haidian District, Beijing');
insert into t_testlob (name, info1, info2)
values('Cheng Yihang', 0xdadde110, 'Tianshun North Street, high tech Zone, Chengdu, Sichuan');
commit;

select * from t_testlob;

LINEID     NAME  TYPE$       NULLABLE
---------- ----- ----------- --------
1          ID    INTEGER     N
2          NAME  VARCHAR(20) Y
3          INFO1 BLOB        Y
4          INFO2 TEXT        Y

(2) Preparation of control documents
Edit the control file / DM8 / backup / dmfldr / TESTLOB CTRL, export the data to / DM8 / backup / dmfldr / TESTLOB Txt file, the contents of the control file are as follows:

LOAD DATA
INFILE '*'
INTO TABLE t_testlob
FIELDS '|'
(
ID,
NAME,
INFO1,
INFO2
)

(3) Execute export command
Use the dmfldr command to export data. The command reference is as follows (note that the user name is case sensitive):

/home/dmdba/dmdbms2/bin/dmfldr userid=SYSDBA/SYSDBA@192.168.17.79:5236 control=\'/dm8/backup/dmfldr/testlob.ctrl\' data=\'/dm8/backup/dmfldr/testlob.txt\' mode=\'out\' lob_directory=\'/dm8/backup/dmfldr\'lob_file_name=\'testlob.lob\'
dmfldr V8
5 rows is load out
Load finish 5 rows, 
time:159.805(ms)

(4) View export results
Generate TESTLOB in / dm8/backup/dmfldr / Txt and TESTLOB Lob two files, execute the directory to generate the export log file. testlob.lob cannot be opened directly, TESTLOB Txt is shown below.

[dmdba@ora79 ~]$ cat /dm8/backup/dmfldr/testlob.txt
1|estlob.lob:0:5|testlob.lob:5:26
2|estlob.lob:31:4|testlob.lob:35:28
3||testlob.lob:63:5|testlob.lob:68:34
4||testlob.lob:102:6|testlob.lob:108:24
5|estlob.lob:132:4|testlob.lob:136:26

02 large field data loading

Scenario 1: DIRECT is TRUE

When the loaded big field data is stored in a separate data file (such as the big field data file exported above), it is necessary to specify the DIRECT=TRUE method to import.

When importing on a non database server, specify the CLIENT_LOB is TRUE, LOB_DIRECTORY specifies the local directory of the client where the large field data file is located; When importing on the database server, specify CLIENT_LOB is FALSE, LOB_DIRECTORY is specified as the server directory where the large field data file is located (you need to transfer the large field file to the DM server first).

The large field data file is specified in the data file and recorded in the data file in the form of "file name: starting offset: length".

Use the following command to export the above exported data file TESTLOB Txt and TESTLOB Lob is imported into t of server 192.168.88.102_ In the TESTLOB table (T_TESTLOB table is created in advance):

dmfldr userid=SYSDBA/dameng123@192.168.88.102:5236 
control=\'/dm8/backup/dmfldr/testlob.ctrl\' 
data=\'/dm8/backup/dmfldr/testlob.txt\' mode=\'in\' 
lob_file_name=\'testlob.lob\' client_lob=true 
lob_directory=\'/dm8/backup/dmfldr\' direct=true set_identity=false

Scenario 2: DIRECT is FALSE
When the large field column data is saved in the data file, you need to specify DIRECT=FALSE to import. BLOB_ The type parameter specifies the content type of the blob column (including HEX_CHAR and HEX, which is HEX_CHAR hexadecimal by default).

Edit the data file testlobdata Txt, refer to the following:

dmfldr userid=SYSDBA/dameng123@192.168.88.102:5236 
control='d:/test/testlob.ctrl' 
data='d:/test/testlobdata.txt' mode='in' 
direct=false blob_type='hex'

Added by phpwannabe25 on Thu, 20 Jan 2022 12:28:51 +0200