Data movement in the DB2 databaseIt is a frequently used technology in office work. I hope that you will be able to master the data mobile technology of DB2 databases through the study in this article.
The so-called data movement in db2 includes:
1. import data)
2. export data export)
3. load data)
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, 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 initialize ate new york
15 new england 50 eastern boston
20 mid atlantic 10 eastern washington
38 south atlantic 30 eastern atlantic
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, "initialize ate", "new york"
15, "new england", 50, "eastern", "boston"
20, "mid atlantic", 10, "eastern", "washington"
38, "south atlantic", 30, "eastern", "atlantic"
42, "great lakes", 100, "midwest", "chicago"
51, "plains", 140, "midwest", "dallas"
66, "pacific", 270, "western", "san francisco"
84, "mountain", 290, "western", "denver"