The Reconfiguration and Configuration utilities are used to define the AMPs and PEs that operate together as a Teradata Database. (Configuration is described in an earlier chapter of this manual.)
1.config工具
(1)启动工具
cnsterm 6 start config Started ‘config’ in window 1. cnsterm 1 ctrl + c
(2)添加1个HOST、1个PE和4个AMP
begin config add host hn = 1, ht = cop //hostname和hosttype,后续必须添加对应PE add pe 16381, hn = 1 add amp 0, cn = 3 //cluster number add amp 1 add amps 2- 3, cn = 3 default cluster 4 end config list stop
【list | list pe | list amp | list cluster | list host 】
2.reconfig工具
Reconfiguration 要求没有用户登录,且系统是静止的。以重启数据库为终止。配置过程中,系统不可用。可以使用online和offline两种方式。
(1)登录工具
cnsterm 6 start reconfig Started ‘reconfig’ in window 2. cnsterm 2 ctrl + c
登录工具时,如报如下错误,使用vprocmanager工具将对应AMP状态改为offline
6164 NewReady AMPs which are not in New Configuration need to be DOWN
//登录vprocmanager后使用如下命令: set /v 1 offline
restart
(2)重新配置
reconfig status //执行过程中查看状态 stop //reconfig命令执行之前使用,停止reconfig。
abort //online方式且在重分布阶段时,停止reconfig。不支持offline方式的reconfig。
(3)确定reconfig正在执行
pdestate -a //查看当前状态 PDE state is RUN/STARTED. DBS state is 6: RECONFIG is running
3.vprocmanager工具设定vproc状态
(1)启动工具
cnsterm 6 start vprocmanager Started ‘vprocmanager’ in window 3. cnsterm 3 ctrl + c
(2)status命令
【status | status dbs | status online | status notonline | status pde | status restart | status sysstate | status 0,1,2,3 to 10,8192 to 20000】
(3)设置vproc状态
set /v 0 to 10 offline
set /v 1 online
(4) 重启
RESTART