Document Type | Technical Information
Category | Migration
Applicable Product Version | Tibero 6, 7
Document Number | TMITI025
Overview
This article guides you on compressed export and import using compress.
Method
Compressed Export Using compress
-- export.sh -- su - tibero << EOF # Delete previously received Exp.dmp.Z files and exp.log cd /data1/DMP rm test*.dmp.Z rm exp.log # Export using mknod and pipe cd /data1/DMP mknod testdb_01 p compress < /data1/DMP/testdb_01 > /data1/DMP/testdb_01.dmp.Z & tbexport username=tibero password=tmax ip=192.168.126.128 port=8629 sid=tibero file=aaa.dmp user=tibero OVERWRITE=y log=exp.log rm /data1/DMP/testdb* EOF Cur_time=`date` echo ---------------------------------------- echo Export completed $Cur_time echo ----------------------------------------
Compressed Import Using compress
-- import.sh -- su - tibero << EOF # Import using mknod and pipe cd /data1/DMP mknod testdb_i_01 p uncompress < /data1/DMP/testdb_01.dmp.Z > /data1/DMP/testdb_i_01 & tbimport username=tibero password=tmax ip=192.168.126.128 port=8629 sid=tibero file=testdb_i_01 fromuser=tibero touser=tibero log=imp.log ignore=y rm /data1/DMP/testdb_i* EOF Cur_time=`date` echo ---------------------------------------- echo Import completed $Cur_time echo ----------------------------------------
tbExport internally works by creating DDL information and thread-specific DML data files in a temporary directory during export, then after all extraction processes are complete, it merges these files into a single final dump file.
Therefore, the method of delivering data in real-time through a pipe while compressing in the background is not supported.
It is recommended to use the COMPRESS option of tbExport to perform compression internally instead of using external compress.
Example
tbexport username=tibero password=tmax ip=localhost port=20629 sid=UC file=testdb_01.dmp user=tibero OVERWRITE=y log=exp.log compress=y tbexport username=tibero password=tmax ip=localhost port=20629 sid=UC file=testdb_02.dmp user=tibero OVERWRITE=y log=exp.log compress=n $ ls -al | grep dmp -rw-r--r--. 1 tibero dba 457 Oct 20 10:42 testdb_01.dmp -rw-r--r--. 1 tibero dba 20480 Oct 20 10:43 testdb_02.dmp