Note
This view is available starting with V4.6.2.1.
Overview
Displays the historical information of completed AI batch tasks for the current tenant. It is commonly used to track the results, token consumption, and task duration of index creation tasks in batch file mode.
About 10 minutes after a task is completed or fails, it is archived from the Current Tasks view to this History view. In the History view, internal numerical status is converted into strings, and the progress percentage is calculated based on the number of processed requests and the total number of requests.
Compared with the task view, this view additionally provides statistics on token usage (TOKEN_USAGE) and runtime information for batch tasks (PROVIDER_TIMELINE).
Columns
Column |
Type |
Is NULL |
Description |
|---|---|---|---|
| TASK_ID | varchar(256) | NO | Unique identifier of the AI batch task. |
| DDL_TASK_ID | bigint(20) | YES | Associated DDL task ID. Corresponding to the index creation in the batch file. CREATE VECTOR INDEX The DDL task that was triggered. |
| MODEL_NAME | varchar(256) | NO | The name of the AI model used. Corresponding to DBMS_AI_SERVICE The name of the model registered in the model registry. |
| COMMAND_TYPE | varchar(256) | NO | AI call type, for example, EMBED. |
| STATUS | varchar(256) | NO | Final task status. Valid values: INVALID, PENDING, RUNNING, FINISHED, FAILED, CANCELLED, UNKNOWN. |
| REQUESTS_HANDLED | bigint(20) | NO | Number of requests processed. |
| TOTAL_REQUESTS | bigint(20) | NO | Total Requests. |
| PROGRESS_PERCENT | decimal | YES | Task progress percentage, calculated based on the number of rows processed REQUESTS_HANDLED / TOTAL_REQUESTS Calculate. |
| TASK_CREATE_TIME | timestamp | NO | Task creation time. |
| TASK_UPDATE_TIME | timestamp | NO | The last time the task status was updated. |
| BATCH_ID | varchar(256) | YES | The batch task ID on the AI service provider side. |
| REMOTE_FILE_IDS | varchar(2048) | YES | File ID on the AI service provider side, in JSON format. Example in OpenAI style: {"input_file_id":"file-in-xxx","output_file_id":"file-out-xxx","error_file_id":"file-err-xxx"}; Anthropic style example: {"output_file_id":"msgbatch_yyy_result"}. |
| ERROR_DETAIL | varchar(4096) | YES | Error messages of OceanBase AI Database and the model. In the format of JSON string. Example: {"ob_error_code":0,"model_http_code":429,"message":"Rate limit exceeded for requests"}. |
| TOKEN_USAGE | varchar(1024) | YES | The actual number of tokens consumed by the batch task on the AI service provider side, in a JSON string. Example: {"completion_tokens":0,"prompt_tokens":6,"total_tokens":6}. |
| PROVIDER_TIMELINE | varchar(1024) | YES | The duration of the batch task, represented as a JSON string. This can include timestamps (in Unix seconds) for various stages on the service provider's side or fields such as wait time. For example: {"model_wait_time_us":61193090}. |
Sample query
Query the history of terminated tasks in the current tenant:
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_AI_BATCH_TASK_HISTORY;
Return example:
+----------------------------------------------+-------------+-------------------+--------------+-----------+------------------+----------------+------------------+----------------------------+----------------------------+------------------------+----------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+------------------------------------------------------------+---------------------------------+
| TASK_ID | DDL_TASK_ID | MODEL_NAME | COMMAND_TYPE | STATUS | REQUESTS_HANDLED | TOTAL_REQUESTS | PROGRESS_PERCENT | TASK_CREATE_TIME | TASK_UPDATE_TIME | BATCH_ID | REMOTE_FILE_IDS | ERROR_DETAIL | TOKEN_USAGE | PROVIDER_TIMELINE |
+----------------------------------------------+-------------+-------------------+--------------+-----------+------------------+----------------+------------------+----------------------------+----------------------------+------------------------+----------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+------------------------------------------------------------+---------------------------------+
| ai_1002_1780641797310516_1543562579 | 106 | ob_embed_endpoint | EMBED | FINISHED | 1 | 1 | 100.00 | 2026-06-05 14:43:17.310525 | 2026-06-05 14:44:20.458616 | batch_38268a491ed64a90 | {"input_file_id": "file-batch-292094790baf42d8", "output_file_id": "file-batch_output-5488cbb816f347e6"} | {"message": "", "ob_error_code": 0, "model_http_code": 0} | {"completion_tokens":0,"prompt_tokens":6,"total_tokens":6} | {"model_wait_time_us":61193090} |
+----------------------------------------------+-------------+-------------------+--------------+-----------+------------------+----------------+------------------+----------------------------+----------------------------+------------------------+----------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------+------------------------------------------------------------+---------------------------------+
1 row in set