11.1.7 Storing data in a base table (data import)
To store data in a base table, use the adbimport command to perform data import. For details about the adbimport command, see adbimport (Import Data) in the manual HADB Command Reference.
Note that the data import method to be used differs depending on the option specified in the adbimport command. The following describes the data import methods that you can use when executing the adbimport command:
-
Data import in creation mode
Data import in creation mode is a data import method that deletes all the existing data in a base table, and then stores new data in the base table. If the target table is a multi-chunk table, this method deletes all the existing chunks, creates a new chunk, and then imports data into the chunk. Therefore, use data import in creation mode when you want to replace all the data in a base table with new data.
To perform data import in creation mode, for the target base table, execute the adbimport command with the -d specified.
- Note
-
If you execute the command for a newly defined table, the command executes data import in creation mode regardless of whether the -d option is specified.
-
Background import
This is a data import method that can be used for multi-chunk tables. Background import creates a new chunk, and then imports data into the chunk. While data is being imported, you can retrieve data from the existing chunks. Therefore, use background import if you want to perform data import and retrieval at the same time.
To perform background import, for the target multi-chunk table, execute the adbimport command by specifying the -b option. For details about how to perform background import, see 11.4.2 Storing data in a multi-chunk table (background import).
-
Data import in addition mode
Data import in addition mode is a method that adds data to a base table without deleting the data existing in the base table. If the target table is a multi-chunk table, this method adds new data to the current chunk without deleting the data in the existing chunks. At this time, if there are segments containing free pages, data is first added to those segments. However, if the target table is a column store table, data is always stored in a new segment even when there are segments that contain free pages. Note that while data import in addition mode is being performed, you cannot retrieve data from the target table.
To perform data import in addition mode, for the target base table, execute the adbimport command without specifying the -d or -b option.
- Note
-
When importing a small amount of data, using addition mode provides more efficient data storage than background import. Therefore, if a need for importing a small amount of data arises during, for example, after-hours table maintenance, consider using addition mode for the import.
For details about the -d and -b options, see Explanation of the specification format and options in Specification format for the adbimport command under adbimport (Import Data) in the manual HADB Command Reference.