1、TimesTen学习笔记4(timesten 中个各种命令)TimesTen学习4(timesten 中个各种命令)1.ttAdmin(命令)功能:指定内存加载策略指定replication agent策略启动或停顿cache agent如:timestenrh44server $ ttadmin -query tt_eservice;RAM Residence Policy : inUseReplication Agent Policy : manualReplication Manually Started : FalseCache Agent Policy : manualCache A
2、gent Manually Started : Falsetimestenrh44server $ ttadmin -rampolicy always tt_eservice;RAM Residence Policy : alwaysReplication Agent Policy : manualReplication Manually Started : FalseCache Agent Policy : manualCache Agent Manually Started : Falsetimestenrh44server $ ttadmin -cachePolicy always tt
3、_eservice;2.ttDaemonAdmin(命令)功能:启动/停顿TimesTen main daemon, Server and Webserver.语法:ttDaemonAdmin -force -start | -stop | -restartttDaemonAdmin -startserverttDaemonAdmin -force -stopserverttDaemonAdmin -startwebserver | -stopwebserver3.ttBackup(命令)功能:备份data store。例如:timestenrh44server $ ttbackup -typ
4、e filefullenable -dir /home/timesten/ -fname logzhou tt_eservice;Backup started .Backup complete恢复ttRestore -dir /home/timesten/ -fname logzhou restoredDSN;备到带库ttBackup -type streamFull tt_eservice | dd bs=64k of=/dev/rmt04.ttBulkCp(命令)功能:在内存表和文件之间转换数据。两种方式:bull; In copy-in mode, rows are copied int
5、o an existing TimesTen table from one or more ASCII files (or stdin).bull; In copy-out mode, an entire TimesTen table is copied to a single ASCII output file (or stdout).例如:timestenrh44server $ ttBulkCp -o dsn=tt_eservice tracelog tracelog.dump1/1 row copied5.ttBlockinfo (存储过程)功能:显示perm内存中block的利用信息
6、和碎片信息。用法:CALL ttBlockInfo;6.ttBookmark(存储过程)功能: 显示日志文件信息。用法: Call ttBookmark;7.ttCachePolicySet (存储过程)功能:指定cache agent的策略。用法:call ttCachePolicySet(always);功能: 同意临时停顿把更新推向oracle db用法: Call ttCachePropagateFlagSet(0); 该标志在每次事务提交或回滚段后都被重置,因而假设需要关闭的话,要将autocommit设为0.假设设为1的话,那么update会推向oracle。9.ttCacheSt
7、art/ttCacheStop功能:启动/关闭cache agent用法: Call ttCacheStart();10.ttCkpt功能:手动做non-blocking checkpoint用法:CALL ttCkpt();CALL ttCkpt(1,10);功能:手动做一个blocking checkpoint用法: Call ttCkptBlocking();Call ttCkptBlocking(1,10);功能: 设置后台checkpoint的频率,速率用法: Call ttCkptConfig (ckptFrequency, ckptLogVolume, ckptRate)功能:
8、整合perm和temp内存的碎片,类似于oracle里面的coalescs。用法:CALL ttCompact;功能: 查询参数设定。用法: Call ttConfiguration();功能: 查看data store的状态。用法:call ttdatastorestatus(/home/timesten/TimesTen/eservice/info/TT_eservice);tLockLevel功能:设置lock level.用法:Call ttLockLevel (lockLevel);lockLevel取值为Row和DS功能: 查看log buffer里面的内容用法: ttLogBuf
9、Print (verbose, maxLen)CALL ttLogBufPrint(1,0);CALL ttLogBufPrint(2,0);功能:去除表格上面的统计信息。用法:ttOptClearStats (tblName, invalidate)invalidate取0 (no) or 1 (yes). 0表示即便清掉了统计信息后,也不会阻碍现有的command。功能: 搜集表格上面的统计信息。用法:ttOptEstimateStats (tblName, invalidate, sampleStr)其中sampleStr取值为n ROWS或p PERCENT,功能:将active状态的
10、data store改为active standby状态用法:CALL ttRepDeactivate();功能:启动/关闭replication agent.22.ttRepStateGet()功能: 获取data store的状态用法:CALL ttRepStateGet();lt; STANDBY 功能: 将active standby状态的data store改为Active状态,即master。用法:CALL ttRepStateSet(ACTIVE);24.ttSize功能: 预估表格的大小用法:ttSize(tblName, nRows, frac)其中nRows表示预估表格会有
11、多少条记录。frac表示预估表中varbinary或varchar类型字段的碎片,该参数可选。如:Command call ttsize(tracelog,10000000,null);lt; 3041157861.00000 25.ttDestory(命令)功能:删除一个data store,包括checkpoint文件,logfile。用它能够平安完好地删除data store.语法:ttDestroy -wait -timeout secs -force -connStr connection_string | DSN | dspath26.ttmodinstall(命令)功能:修正端口
12、或者enable/disable access control.语法:ttmodinstall -port portNumberttmodinstall -enableAccessControlttmodinstall -changeOracleSettings27.ttuser(命令)功能:输入一个密码,产生加密密码。语法:ttuser -pwdcrypt28.ttStatus(命令)功能:显示data store的状态29.ttSchema(命令)功能:打印出对象的ddl语句语法:ttSchema -l -c -list all | tables | views | sequences |cachegroups | repschemas ,. -st | -systemTables -u TT_instance -connStr connection_string | DSN owner.name.30.ttRepAdmin(命令)功能:显示replicatioin的定义,监控replication的状态