验证是否正确加载了数据 - Amazon Redshift

验证是否正确加载了数据

在完成加载操作后,请查询 STL_LOAD_COMMITS 系统表以验证所需文件是否已加载。在同一事务中运行 COPY 命令和加载验证,以便在加载出现问题时可以回滚整个事务。

以下查询将返回用于加载 TICKIT 数据库中的表的条目:

SELECT query, trim(filename) AS filename, curtime, status FROM stl_load_commits WHERE filename like '%tickit%' order by query; query | filename | curtime | status -------+---------------------------+----------------------------+-------- 22475 | tickit/allusers_pipe.txt | 2013-02-08 20:58:23.274186 | 1 22478 | tickit/venue_pipe.txt | 2013-02-08 20:58:25.070604 | 1 22480 | tickit/category_pipe.txt | 2013-02-08 20:58:27.333472 | 1 22482 | tickit/date2008_pipe.txt | 2013-02-08 20:58:28.608305 | 1 22485 | tickit/allevents_pipe.txt | 2013-02-08 20:58:29.99489 | 1 22487 | tickit/listings_pipe.txt | 2013-02-08 20:58:37.632939 | 1 22489 | tickit/sales_tab.txt | 2013-02-08 20:58:37.632939 | 1 (6 rows)