

 Amazon Redshift 將不再支援在 2026 年 6 月 30 日之後使用 Python UDFs。我們將開始分階段強制執行。如需 Python 生命週期結束和遷移選項的詳細資訊，請參閱 2025 年 6 月 30 日發佈的[部落格文章](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# SYS\_UNLOAD\_HISTORY
<a name="SYS_UNLOAD_HISTORY"></a>

使用 SYS\_UNLOAD\_HISTORY 來檢視 UNLOAD 命令的詳細資訊。每一列代表一個 UNLOAD 命令，其中包含某些欄位的累計統計資料。它包含正在執行和已完成的 UNLOAD 命令。

所有使用者都可看見 SYS\_UNLOAD\_HISTORY。超級使用者可以看見所有資料列；一般使用者只能看見自己的資料。如需詳細資訊，請參閱[系統資料表和檢視中資料的可見性](cm_chap_system-tables.md#c_visibility-of-data)。

## 資料表欄
<a name="SYS_UNLOAD_HISTORY-table-columns"></a>


| 欄名稱  | 資料類型  | 說明  | 
| --- | --- | --- | 
| user\_id | integer | 提交卸載之使用者的識別碼。 | 
| query\_id | bigint | UNLOAD 命令的查詢識別碼。 | 
| transaction\_id | bigint | 交易識別碼。 | 
| session\_id | integer | 執行卸載之程序的處理程序識別碼。 | 
| database\_name | text | 發出操作時，要將使用者連接至其中的資料庫名稱。 | 
| status | text | UNLOAD 命令的狀態。有效值包括：running、completed、aborted 與 unknown。 | 
| start\_time | timestamp | 開始卸載的時間。 | 
| end\_time | timestamp | 卸載完成的時間。 | 
| duration | bigint | UNLOAD 命令花費的時間 (微秒)。 | 
| file\_format | text | 輸出檔案的檔案格式。 | 
| compression\_type | text | 壓縮類型。 | 
| unloaded\_location | text | 已卸載檔案的 Amazon S3 位置。 | 
| unloaded\_rows | bigint  | 列的數。 | 
| unloaded\_files\_count | bigint | 輸出檔案的檔案計數。 | 
| unloaded\_files\_size | bigint | 輸出檔案的檔案大小。 | 
| error\_message | text | UNLOAD 命令的錯誤訊息。 | 

## 範例查詢
<a name="SYS_UNLOAD_HISTORY-sample-queries"></a>

下列查詢顯示卸載查詢詳細資訊，包括卸載命令的格式、列和檔案計數。

```
SELECT query_id,
       file_format,
       start_time,
       duration,
       unloaded_rows,
       unloaded_files_count
FROM sys_unload_history
ORDER BY query_id,
file_format limit 100;
```

輸出範例。

```
 query_id | file_format |         start_time         | duration | unloaded_rows | unloaded_files_count
----------+-------------+----------------------------+----------+---------------+----------------------
   527067 | Text        | 2022-02-09 05:18:35.844452 |  5932478 |            10 |                    1
```