没有合适的资源?快使用搜索试试~ 我知道了~
Timesten运维笔记[借鉴].pdf
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 90 浏览量
2021-10-12
00:57:11
上传
评论
收藏 74KB PDF 举报
温馨提示
试读
20页
Timesten运维笔记[借鉴].pdf
资源推荐
资源详情
资源评论
********************************************************
-——********************************************************
tt 现用版本:
tt 版本: 11.2.1.9.7 HP平台: 11.2.1.9.10 suse 平台: 11.2.1.9.8
tt 出现问题,紧急收集信息:
ttcapture;
ttschema;
call ttconfigrations;
------********************************************************
********************************************************
注: ttisql 登录 tt 库后输入命令时先使用 vertical 1; 可以显示列名
1. 常用命令
1. 启停、加载、卸载、启动复制代理、重建、日常检查命令
1》启停
ttdaemonadmin -start -stop
--1. 启动 tt:ttadmin -start -force 好像不对
2》. 加载内存库到内存、卸载内存库
>ttadmin -rampolicy manual accounta1 ## 设置内存加载方式为手动加载
>ttAdmin -noautoreload accounta1 ## 设置不要自动重新加载
ttadmin -ramload accounta1 ## 加载
ttadmin -ramunload accounta1 ## 卸载
ramunload 前先后动执行一个 checkpoint ,不然会很长时间
3》连接数据库
3.1 直连: ttisql accounta1
3.2 cs 方 式 : cbe 路 由 库 : 133.96.64.63 , 用 户 cbea 连 接 : alias roucbe='ttisqlcs
"dsn=rouacs;uid=roudata;pwd=roudata"'
ttisqlcs "dsn=userinfoa1cs;uid=ckhung;pwd=ckhung"
ttisqlcs "dsn=userinfoa2cs;uid=ckhung;pwd=ckhung"
3.3 高级形式:
ttisqlcs -v 1 - e “ dssize m;quit; ” “ dsn=abmmdb;uid=omc;pwd=omc “(采用 -e模式执行,可以顺序执
行多条命令, -v 1 表示不打印其它连接信息)
ttisqlcs – f <filename> “ dsn=abmmdb;uid=omc;pwd=omc “ (采用 -f 模式执行,适合批量执行 sql
语句,将 sql放在文件中,直接执行即可)
ttisql -showcurrenttime accounta2 会显示命令执行的时间
3.4 退出 exit; quit;ctrl + d
3》. 启停复制代理
Command> CALL ttRepStart ;启动复制代理
Command> CALL ttRepstop ;停止复制代理
3》启停复制子进程
ttadmin -repstop accounta2 ;ttadmin -repstart accounta2
4》. 重建
重建前需启动主节点的复制代理。重建后需重新设置 加载策略才能加载: ttadmin -rampolicy manual dsn;
ttadmin -noautoreload dsn; 还可以有 verbersity -2 参数表示设置日志级别为详细的。
B:ttRepAdmin -duplicate -from accountb2 -host kdbdsb4 -uid ckhung -pwd ckhung -verbosity 2 -ramLoad
-dsn accountb2
ttRepAdmin -duplicate -from acct31602 -host kdtt31602s -uid ckhung -pwd ckhung -verbosity 2 -ramLoad
-dsn acct31602
C:ttRepAdmin -duplicate -from accountc3 -host kdbdsc3 -uid ckhung -pwd ckhung -verbosity 2 -ramLoad
-dsn accountc3
ttRepAdmin -duplicate -from accountc3 -host kdbdsc1 -uid ckhung -pwd ckhung -verbosity 2 -ramLoad -dsn
accountc3
ttRepAdmin -duplicate -from accountc4 -host kdbdsc2 -uid ckhung -pwd ckhung -verbosity 2 -ramLoad -dsn
accountc4 # 重建容灾
D:ttRepAdmin -duplicate -from accountd1 -host kdbdsd1 -uid ckhung -pwd ckhung -verbosity 2 -ramLoad
"dsn=accountd1"
或者: ttRepAdmin -duplicate -from accounta2 -host kdbdsa2 -uid repadmin -pwd repadmin -ramload
-localhost kdbdsa1 -dsn accounta2
A2: ttRepAdmin -duplicate -from accounta2 -host kdbdsa2 -uid ckhung -pwd ckhung -verbosity 2 -ramLoad
-dsn accounta2
5》. 日常检查命令
$>ttstatus ## 查看 tt 库的主进程、 server 进程、端口、连接、子进程、复制进程、加载状态等信息
登录dsn后vertical 1; 就会显示数据项的名称和值,
call ttrepstateget ## 查看主备状态
ttRepAdmin –bookmark DSN ## 主备是否同步
call ttbookmark ## 主备是否同步 2
vertical 1; # 列出字段名
ttadma2@kdbdsa2:/timesten/ttadma2# ttrepadmin -receiver -list accounta2 # 查看详细的 receiver
信息:积压日志数,网速等
Peer name Host name Port State Proto
---------------- ------------------------ ------ ------- -----
ACCOUNTA2 KDBDSA1 Auto Start 29
Last Msg Sent Last Msg Recv Latency TPS RecordsPS Logs
------------- ------------- ------- ------- --------- ----
00:00:00 00:00:02 4852.19 2211 11240 41
ttrepadmin –showstatus roua # 查看复制代理是否启动。
命令输出如下:
Replication Agent Status as of: 2014-04-17 21:50:39
DSN : roua
Process ID : 1217 (Started)
Replication Agent Policy : manual
Host : KYCBE3
RepListener Port : 56890 (AUTO)
Last write LSN : 24239.726493880
Last LSN forced to disk : 24239.726476800
Replication hold LSN : 24239.712540160
Replication Peers:
Name : ROUA
Host : KYCBE4
Port : 15770 (AUTO) (Connected)
Replication State : STARTED
Communication Protocol : 29
call ttlogholds ## 大事务
Command> dssize; 或者
dssize m
-- 内存信息 ,使用情况
Command> call ttckpthistory; --checkpoint 历史记录
ipcs -map|grep timesten ## 查看共享内存段 (ttstatus 可以查看共享内存 key )
查看版本 call ttversion; 或者 ttadma1@kdbdsa1:/timesten/ttadma1# ttversion -m
检查对象定义: ttschema accountd1
call ttblockinfo; # 内存碎块
Command>indexes [table_name];
该命令用于查看某个表相关的索引信息
Command>timing [0|1];
该命令用于打开计时开关,打开该开关后可以确认查询某个 sql的耗时时间
Command>autocommit [0|1]
该命令用于设置自动提交为开或关,使用 ttisql 登陆的时候,默认自动提交为开
Command>dssize [k|m]
该命令用户查看内存库大小
Command>describe [object_name];
该命令用于查看某个表相关信息
Command>call ttrepstateget();
该命令用于查询当前内存库的主备状态
Command>call ttckpthistory();
该命令用于查看内存库 check point 的历史信息
Command>call ttbookmark();
该命令用户查看内存库复制信息
Command>call ttlogholds();
该命令用于查看当前内存库是否有长事务
Command>call ttblockinfo;
该命令用于查看连续内存块信息
Command>call ttsqlcmdcacheinfo(sqlid);
该命令用于查询事务 id对应的 sql语句
Command>call ttsqlcmdqueryplan(); 查询 sql语句的执行计划;
Command>call ttrepstart;
Command>call ttrepstop;
Command>monitor;
还可以通过以下命令查看执行计划:
Command> autocommit 0;
Command> showplan
Command> sql语句(例如: select * from app_users a join users_age b
on a.id=b.id where a.id<5 ) ; 执行后即可显示执行计划。
6》 检查点 checkpoint
1)手动执行 checkpoing :Command> call ttckpt;
2)检查 checkpoint 历史 :Command> call ttckpthistory;
3) 改变系统 checkpoint 时间间隔
Command> call ttckptconfig();
< 600, 0, 50 >
1 row found.
Command> call ttckptconfig(300,0,50);
< 300, 0, 50 >
1 row found.
Command> call ttckptconfig();
< 300, 0, 50 >
1 row found.
call ttckptconfig(300,x,50) 只对当前 load入内存中 TT 库生效 .
如需永久改变 checkpoint 间隔,则要编辑 $TT_HOME/info/sys.odbc.ini 中CkptFrequency=600
为CkptFrequency=300 ,该配置在下次重启 TT 库后生效。
7》 ttmesg.log 日志信息及设置
该文件由 $TT_HOME/info/ttendaemon.options 中的 -userlog来指定,默认值为
$TT_HOME/info/tterror.log ,该配置文件中可以通过 -maxuserlogfiles 指定 userlog文件个数, 通过
-maxuserlogsize指定单个文件大小。
8》查看主备节点复制关系、复制节点
登录 dsn 后repschemes;
10》 查看配置信息
call ttconfiguration;
11》查看复制信息
call ttbookmark
select * from ttrep.ttstores;
select * from ttrep.reppeers;
11》 查看配置
此配置信息为当前生效的配置信息,当 tt 重启时读的是配置文件的信息。
Command> call ttconfiguration;
剩余19页未读,继续阅读
资源评论
czq131452007
- 粉丝: 2
- 资源: 12万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功