Chinaunix首页 | 论坛 | 博客
  • 博客访问: 27111
  • 博文数量: 4
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2014-02-08 21:07
文章分类
文章存档

2015年(1)

2014年(3)

我的朋友

分类: 大数据

2015-11-24 11:15:25

对netezza数据库的groom脚本执行遇到下面的错误:
ERROR:  GROOM VERSIONS must be run on T_DDW_F00_OP_TEST_DAY before any other GROOM operation


什么是groom verions?

链接:
When you use alter table to add or drop columns, what actually happens is that NPS creates a new version of the table and creates a view which performs a UNION ALL between the old and new tables (making it appear as a single table).  The GROOM VERSIONS command combines all of the versions back  into a single table.  GROOM VERSIONS should be used reasonably soon after using alter table as there is a performance cost for using the UNION ALL view instead of having all of the data exist in a single table.  As you have already observed,  you cannot use the normal GROOM command on a table until the versions have been combined back into a single table.

具体执行命令如下:

点击(此处)折叠或打开

  1. TEST(ADMIN)=> select TABLENAME, RELVERSION from _v_table where OBJTYPE='TABLE' and RELVERSION<>0;
  2.               TABLENAME | RELVERSION
  3. -------------------------------------+------------
  4.  X27_REPORT | 3
  5. (1 rows)

  6. TEST(ADMIN)=>
  7. TEST(ADMIN)=>
  8. TEST(ADMIN)=>
  9. TEST(ADMIN)=> groom table X27_REPORT versions;
  10. NOTICE: Groom processed 37 pages; purged 141 records; scan size shrunk by 28 pages; table size shrunk by 28 extents.
  11. GROOM VERSIONS
  12. TEST(ADMIN)=> groom table X27_REPORT records ready;
  13. NOTICE: Groom processed 16 pages; purged 0 records; scan size unchanged; table size unchanged.
  14. GROOM RECORDS READY
  15. TEST(ADMIN)=>
  16. TEST(ADMIN)=> select TABLENAME, RELVERSION from _v_table where OBJTYPE='TABLE' and RELVERSION<>0;


阅读(1871) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~