The following article describes how to correctly parse the DB2 data movement method and import and load data using commands related to the DB2 database in actual operations, save the data in a certain format file to the detailed description in the table in the database.
Database, parsing database, Parsing
The so-called data movement in DB2 includes:
1. import Data)
2. Data export (export)
3. load)
Both import and load use db2 commands to save data in files of a certain format to tables in the database.
Export refers to saving the data in the table of the db2 database to a file of a certain format.
The role of data movement:
To transfer data between different database management systems, DB2 data movement is usually the most practical method, because any database management system supports common file formats, this universal interface makes it easy to transfer data between different systems.
Among the three commands, export is the simplest. Because data is transferred from a table to a file, there is usually no error or illegal data.
Before explaining commands, first introduce the file format.
1. asc -- a non-bounded ascii file, which is an ascii plain stream. The rows in the data stream are separated by line delimiters, and each column in the row is defined by the start and end positions. For example:
- 10 head office 160 corporate new york
- 15 new england 50 eastern boston
- 20 mid atlantic 10 eastern washington
- 38 south atlantic 30 eastern atlanta
- 42 great lakes 100 midwest chicago
- 51 plains 140 midwest dallas
- 66 pacific 270 western san francisco
- 84 mountain 290 western denver
2. del -- specifies an ascii file, which is also an ascii transfer stream. The rows in the data stream are separated by line delimiters, and the column values in the rows are separated by column delimiters. File Type modifiers can be used to modify the default values of these delimiters. For example:
- 10,"head office",160,"corporate","new york"
- 15,"new england",50,"eastern","boston"
- 20,"mid atlantic",10,"eastern","washington"
- 38,"south atlantic",30,"eastern","atlanta"
- 42,"great lakes",100,"midwest","chicago"
- 51,"plains",140,"midwest","dallas"
- 66,"pacific",270,"western","san francisco"
- 84,"mountain",290,"western","denver"
The above content is an introduction to the analysis of the DB2 data movement method. I hope you will have some gains.