Hbase表重命名 表改名

PS:现在我有个表 :test11_new  ,我要给他改名

 

开始:

 

1、先disable掉表
hbase(main):023:0> disable 'test11_new' 0 row(s) in 1.2290 seconds
2、创建一个快照
hbase(main):024:0> snapshot 'test11_new', 'test11_newSnapshot' 0 row(s) in 0.3500 seconds
3、克隆这个快照 赋给新的表名
hbase(main):025:0> clone_snapshot 'test11_newSnapshot', 'test111' 0 row(s) in 0.7280 seconds
4、删除之前创建的快照
hbase(main):026:0> delete_snapshot 'test11_newSnapshot' 0 row(s) in 0.0290 seconds
5、再删除掉之前的表
hbase(main):027:0> drop 'test11_new' 0 row(s) in 0.3800 seconds

 

新的表名如上  再scan一下

hbase(main):029:0> scan 'test111'
ROW                                                                  COLUMN+CELL                                                                                                                                                                                              
 row1                                                                column=info:lie1, timestamp=1470305378723, value=zhi1                                                                                                                                                    
 row1                                                                column=info:lie2, timestamp=1470305399560, value=zhi2                                                                                                                                                    
 row1                                                                column=info:lie3, timestamp=1470305437650, value=zhi33                                                                                                                                                   
1 row(s) in 0.0170 seconds

 

ok,到此结束!

posted on 2016-08-17 18:06  山高似水深  阅读(29083)  评论(1编辑  收藏  举报

购买方式 点击下面图标购买