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

重新加载卸载的数据

要重新加载卸载操作的结果,您可以使用 COPY 命令。

下面的示例演示了一种简单的情况:使用清单文件卸载 VENUE 表、截断,然后重新加载。

Copy
unload ('select * from venue order by venueid') to 's3://mybucket/tickit/venue/reload_' iam_role 'arn:aws:iam::0123456789012:role/MyRedshiftRole' manifest delimiter '|'; truncate venue; copy venue from 's3://mybucket/tickit/venue/reload_manifest' iam_role 'arn:aws:iam::0123456789012:role/MyRedshiftRole' manifest delimiter '|';

重新加载后,VENUE 表如下所示:

Copy
select * from venue order by venueid limit 5; venueid | venuename | venuecity | venuestate | venueseats ---------+---------------------------+-------------+------------+----------- 1 | Toyota Park | Bridgeview | IL | 0 2 | Columbus Crew Stadium | Columbus | OH | 0 3 | RFK Stadium | Washington | DC | 0 4 | CommunityAmerica Ballpark | Kansas City | KS | 0 5 | Gillette Stadium | Foxborough | MA | 68756 (5 rows)