Amazon Redshift
数据库开发人员指南 (API Version 2012-12-01)
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。点 击 Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

验证数据是否已正确加载

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

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

Copy
select query, trim(filename) as filename, curtime, status from stl_load_commits where filename like '%tickit%' order by query; query | btrim | 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)