Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1925654
  • 博文数量: 389
  • 博客积分: 7877
  • 博客等级: 少将
  • 技术积分: 4521
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-10 14:02
文章分类

全部博文(389)

文章存档

2024年(1)

2022年(1)

2021年(1)

2020年(1)

2019年(1)

2018年(3)

2017年(6)

2016年(4)

2015年(8)

2014年(15)

2013年(31)

2012年(19)

2011年(47)

2010年(33)

2009年(105)

2008年(109)

2007年(4)

分类: 大数据

2013-08-27 14:02:59

对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;


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