

 Amazon Redshift 將不再支援從修補程式 198 開始建立新的 Python UDFs。現有 Python UDF 將繼續正常運作至 2026 年 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\_LOAD\_DETAIL
<a name="SYS_LOAD_DETAIL"></a>

傳回資訊以追蹤資料載入或對其進行故障診斷。

此檢視會在每一個資料檔案載入至資料庫資料表時記錄其進度。

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

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


| 欄名稱  | 資料類型  | 說明  | 
| --- | --- | --- | 
| user\_id | integer | 產生項目的使用者之 ID。 | 
| query\_id | integer | 查詢 ID。 | 
| file\_name | character(256) | 要載入的檔案名稱。 | 
| bytes\_scanned | integer | 從 Amazon S3 中的檔案掃描的位元組數。 | 
| lines\_scanned  | integer  | 從載入檔案掃描的行數。此數目可能不符合實際載入的資料列數目。例如，根據 COPY 命令中的 MAXERROR 選項，載入可能掃描但容忍一些錯誤記錄。 | 
| record\_time | timestamp  | 上次更新此項目的時間。 | 
| splits\_scanned | 此檔案的分割數目。 | 此檔案的分割數目。 | 
| start\_time | timestamp | 此檔案處理開始的時間。 | 
| end\_time | timestamp | 此檔案處理完成的時間。 | 
| file\_etag | character(256) | Amazon S3 中檔案的 ETag。 | 
| file\_last\_modified | timestamp | Amazon S3 中檔案的上次修改時間戳記。 | 

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

下列範例傳回上次 COPY 操作的詳細資訊。

```
select query_id, trim(file_name) as file, record_time
from sys_load_detail
where query_id = pg_last_copy_id();

 query_id |               file               |          record_time        
----------+----------------------------------+----------------------------
 28554    | s3://dw-tickit/category_pipe.txt | 2013-11-01 17:14:52.648486 
(1 row)
```

下列查詢包含 TICKIT 資料庫中全新載入之資料表的項目：

```
select query_id, trim(file_name), record_time
from sys_load_detail
where file_name like '%tickit%' order by query_id;

 query_id |           btrim          |          record_time          
----------+--------------------------+----------------------------
 22475    | tickit/allusers_pipe.txt | 2013-02-08 20:58:23.274186 
 22478    | tickit/venue_pipe.txt    | 2013-02-08 20:58:25.070604  
 22480    | tickit/category_pipe.txt | 2013-02-08 20:58:27.333472 
 22482    | tickit/date2008_pipe.txt | 2013-02-08 20:58:28.608305  
 22485    | tickit/allevents_pipe.txt| 2013-02-08 20:58:29.99489    
 22487    | tickit/listings_pipe.txt | 2013-02-08 20:58:37.632939 
 22593    | tickit/allusers_pipe.txt | 2013-02-08 21:04:08.400491  
 22596    | tickit/venue_pipe.txt    | 2013-02-08 21:04:10.056055  
 22598    | tickit/category_pipe.txt | 2013-02-08 21:04:11.465049  
 22600    | tickit/date2008_pipe.txt | 2013-02-08 21:04:12.461502  
 22603    | tickit/allevents_pipe.txt| 2013-02-08 21:04:14.785124  
 22605    | tickit/listings_pipe.txt | 2013-02-08 21:04:20.170594  

(12 rows)
```

事實上，記錄寫入至此系統檢視的日誌檔案，並不表示已成功遞交載入，做為其包含交易的一部分。若要驗證載入遞交，請查詢 STL\_UTILITYTEXT 檢視，並尋找與 COPY 交易相對應的 COMMIT 記錄。例如，此查詢會針對 STL\_UTILITYTEXT 根據子查詢聯結 SYS\_LOAD\_DETAIL 和 STL\_QUERY：

```
select l.query_id,rtrim(l.file_name),q.transaction_id
from sys_load_detail l, sys_query_text q
where l.query_id=q.query_id
and exists
(select xid from stl_utilitytext where xid=q.transaction_id and rtrim("text")='COMMIT');

 query_id |           rtrim           |  transaction_id
----------+---------------------------+-----------------
 22600    | tickit/date2008_pipe.txt  | 68311
 22480    | tickit/category_pipe.txt  | 68066
  7508    | allusers_pipe.txt         | 23365
  7552    | category_pipe.txt         | 23415
  7576    | allevents_pipe.txt        | 23429
  7516    | venue_pipe.txt            | 23390
  7604    | listings_pipe.txt         | 23445
 22596    | tickit/venue_pipe.txt     | 68309
 22605    | tickit/listings_pipe.txt  | 68316
 22593    | tickit/allusers_pipe.txt  | 68305
 22485    | tickit/allevents_pipe.txt | 68071
  7561    | allevents_pipe.txt        | 23429
  7541    | category_pipe.txt         | 23415
  7558    | date2008_pipe.txt         | 23428
 22478    | tickit/venue_pipe.txt     | 68065
   526    | date2008_pipe.txt         |  2572
  7466    | allusers_pipe.txt         | 23365
 22482    | tickit/date2008_pipe.txt  | 68067
 22598    | tickit/category_pipe.txt  | 68310
 22603    | tickit/allevents_pipe.txt | 68315
 22475    | tickit/allusers_pipe.txt  | 68061
   547    | date2008_pipe.txt         |  2572
 22487    | tickit/listings_pipe.txt  | 68072
  7531    | venue_pipe.txt            | 23390
  7583    | listings_pipe.txt         | 23445
(25 rows)
```