# Hbase
# 命令
# 登陆hbase
hbase shell
# 查看所有表
list
1
2
3
4
5
2
3
4
5
# 删除表
- 删除需要先禁用表
- 禁用表后再删除表
# 此操作在hbase shell中执行
disable 'table_name'
drop 'table_name'
# 批量操作(删除haha开头的表)
echo -e "disable_all 'haha.*'\ny" | hbase shell -n
echo -e "drop_all 'haha.*'\ny" | hbase shell -n
1
2
3
4
5
6
7
2
3
4
5
6
7
# 清空表(待测试)
使用 truncate 命令即可,此命令相当于完成禁用表、删除表,并按原结构重新建立表操作:
truncate 'table_name'
# 批量操作(删除haha开头的表)
echo -e "truncate_all 'haha.*'\ny" | hbase shell -n
1
2
3
4
2
3
4