Db2dart,/ddel Export the table data under a schema.

Source: Internet
Author: User


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 ("", "", $)
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 was defined with for BIT data, The/ddel parameter genera TES the DEL file which contains the binary data. When you load the data from the DEL file to the table using the load command, ensure this specify the modified by D Elprioritychar option. When you insert data to the table from the DEL file using the IMPORT command, make sure this specify the MODI Fied by Delprioritychar codepage=x option where x is the code page of the data in the input data set.

Db2dart,/ddel Export the table data under a schema.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.