码迷,mamicode.com
首页 > 数据库 > 详细

db2dart,/DDEL导出某个schema下的表数据.

时间:2015-04-27 15:38:55      阅读:501      评论:0      收藏:0      [点我收藏+]

标签:db2dart


db2dart sample /ddel


Table object data formatting start.
Please enter
Table ID or name, tablespace ID, first page, num of pages:
SYSTABLES,0,0,999999

The output data file is TS0T5.DEL.


DBNAME=sample
SCHEMA=E97Q7A
RPTDIR=/tmp/db2dart

sed ‘s/"//g‘ TS0T5.DEL|while read line
do
echo $line|awk -F"," ‘{
objtype=substr($3,1,1)
gsub(" ","",$2)
dbschema=$2
if(objtype=="T" && dbschema=="‘$SCHEMA‘" )
{
tablename=$1
tableid=$7
tbspaceid=$8
printf("%s,%s,0,9999999\ny\n%s\n",tableid,tbspaceid,tablename)
}
}‘>inputfile
if [ -s inputfile ]
then
db2dart $DBNAME /DDEL /RPT $RPTDIR < inputfile
fi
done


The /DDEL parameter supports only the following column data types. If a table contains columns with any other data type, the column is skipped and not included in the delimited ASCII file.

    SMALLINT
    FLOAT
    REAL
    INTEGER
    TIME
    DECIMAL
    CHAR()
    VARCHAR()
    DATE
    TIMESTAMP
    BIGINT

If a column of type CHAR and VARCHAR contains any binary data, or is defined with FOR BIT DATA, the /DDEL parameter generates the DEL file which contains the binary data. When you load data from the DEL file to the table using the LOAD command, ensure that you always specify the modified by delprioritychar option. When you insert data into the table from the DEL file using the IMPORT command, make sure that you always specify the modified by delprioritychar codepage=x option where x is the code page of the data in the input data set.

db2dart,/DDEL导出某个schema下的表数据.

标签:db2dart

原文地址:http://masaly.blog.51cto.com/9302075/1638931

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!