对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.
具体执行命令如下:
-
TEST(ADMIN)=> select TABLENAME, RELVERSION from _v_table where OBJTYPE='TABLE' and RELVERSION<>0;
-
TABLENAME | RELVERSION
-
-------------------------------------+------------
-
X27_REPORT | 3
-
(1 rows)
-
-
TEST(ADMIN)=>
-
TEST(ADMIN)=>
-
TEST(ADMIN)=>
-
TEST(ADMIN)=> groom table X27_REPORT versions;
-
NOTICE: Groom processed 37 pages; purged 141 records; scan size shrunk by 28 pages; table size shrunk by 28 extents.
-
GROOM VERSIONS
-
TEST(ADMIN)=> groom table X27_REPORT records ready;
-
NOTICE: Groom processed 16 pages; purged 0 records; scan size unchanged; table size unchanged.
-
GROOM RECORDS READY
-
TEST(ADMIN)=>
-
TEST(ADMIN)=> select TABLENAME, RELVERSION from _v_table where OBJTYPE='TABLE' and RELVERSION<>0;
阅读(1871) | 评论(0) | 转发(0) |