11.4.4 Temporarily excluding data to be imported to a multi-chunk table from retrieval (creating a chunk in wait status)
If you want to keep data stored using background import from being retrieved, and then make it retrievable at a specific time, specify the -b and --status wait options for the adbimport command.
A chunk in wait status is created and data is stored in it. During this process, the current chunk is not changed. Furthermore, the chunk creation date and time in the system table STATUS_CHUNKS and the date and time when the current chunk was swapped are not set.
- Important
-
-
A chunk in wait status cannot be manipulated using a data manipulation SQL statement. You cannot execute the SELECT or UPDATE statement on data that is in a chunk in wait status. However, you can use the PURGE CHUNK or TRUNCATE TABLE statement to delete a chunk in wait status. If you want to manipulate a chunk in wait status by using a data manipulation SQL statement, change the status of the chunk to normal status.
-
If you want to change a chunk in wait status into a chunk in normal status (a chunk that can be manipulated by a data manipulation SQL statement), execute the adbchgchunkstatus command. For details, see 11.4.12 Changing the chunk status.
-
At any time during operation, a chunk created in wait status by using the adbimport command can be made subject to (or not subject to) retrieval, by using the adbchgchunkstatus command with that chunk. For details, see 11.4.24 Operation taking background import and chunks into consideration (Example 2: Using chunks in wait status).
-
- Note
-
For details about the system table STATUS_CHUNKS, see C.5 Content of STATUS_CHUNKS.
An execution example is described below in which background import is performed by specifying the -b and --status wait options for the adbimport command.
For details about the specification format of the adbimport command, see adbimport (Import Data) in the manual HADB Command Reference.
- ■ Execution example using background import to create a chunk in wait status
-
An HADB user (ADBUSER01) uses background import to store non-retrievable data in a shop table (SHOPSLIST).
adbimport -u ADBUSER01 -p '#HelloHADB_01' -k "'" -s , -g 10 -w /home/adbmanager/tmp -z /home/adbmanager/imp_file/imp_opt_file.txt -b --status wait -m '2014/06/01-2014/06/30' SHOPSLIST /home/adbmanager/imp_file/imp_data_path.txt
When background import is performed to create a chunk in wait status, HADB creates a new chunk in wait status and stores data in that chunk. The following figure shows the use of background import to create a chunk in wait status.
- Explanation
-
When a chunk in wait status is created by executing the adbimport command with the background-import facility applied, data is stored in the newly created chunk in wait status (chunk 3). During this process, chunk 2 remains as the current chunk.
While data is being stored in chunk 3, you can retrieve the data stored in chunk 1 and chunk 2. Note that since chunk 3 is a chunk in wait status, it cannot be manipulated using a data manipulation SQL statement.
- Important
-
Every time background import is performed with the -b and --status wait options specified, a new chunk in wait status is created. Consequently, if you repeat background importing, the number of chunks in wait status increases as a result. When the number of chunks in wait status increases, execution of the adbidxrebuild command might take longer. This is because the index rebuilding process targets both chunks in normal status and chunks in wait status. If there are a large number of chunks in wait status, consider reducing their number by merging chunks. To merge chunks in wait status, see 11.4.9 Merging chunks (to reduce the number of chunks).