TimesTen学习笔记4(timesten中个各种命令)TimesTen学习4(timesten中个各种命令)1.ttAdmin(命令)功能:指定内存加载策略指定replicationagent策略启动或停顿cacheagent如:[timesten@rh44server~]$ttadmin-querytt_eservice;RAMResidencePolicy:inUseReplicationAgentPolicy:manualReplicationManuallyStarted:FalseCacheAgentPolicy:manualCacheAgentManuallyStarted:False[timesten@rh44server~]$ttadmin-rampolicyalwaystt_eservice;RAMResidencePolicy:alwaysReplicationAgentPolicy:manualReplicationManuallyStarted:FalseCacheAgentPolicy:manualCacheAgentManuallyStarted:False[timesten@rh44server~]$ttadmin-cachePolicyalwaystt_eservice;2.ttDaemonAdmin(命令)功能:启动/停顿TimesTenmaindaemon,ServerandWebserver.语法:ttDaemonAdmin[-force]{-start|-stop|-restart}ttDaemonAdmin-startserverttDaemonAdmin[-force]-stopserverttDaemonAdmin[-startwebserver|-stopwebserver]3.ttBackup(命令)功能:备份datastore。例如:[timesten@rh44server~]$ttbackup-typefilefullenable-dir/home/timesten/-fnamelogzhoutt_eservice;Backupstarted...Backupcomplete恢复ttRestore-dir/home/timesten/-fnamelogzhourestoredDSN;备到带库ttBackup-typestreamFulltt_eservice|ddbs=64kof=/dev/rmt04.ttBulkCp(命令)功能:在内存表和文件之间转换数据。两种方式:bull;Incopy-inmode,rowsarecopiedintoanexistingTimesTentablefromoneormoreASCIIfiles(orstdin).bull;Incopy-outmode,anentireTimesTentableiscopiedtoasingleASCIIoutputfile(orstdout).例如:[timesten@rh44server~]$ttBulkCp-odsn=tt_eservicetracelogtracelog.dump1/1rowcopied5.ttBlockinfo(存储过程)功能:显示perm内存中block的利用信息和碎片信息。用法:CALLttBlockInfo;6.ttBookmark(存储过程)功能:显示日志文件信息。用法:CallttBookmark;7.ttCachePolicySet(存储过程)功能:指定cacheagent的策略。用法:callttCachePolicySet(always);功能:同意临时停顿把更新推向oracledb用法:CallttCachePropagateFlagSet(0);该标志在每次事务提交或回滚段后都被重置,因而假设需要关闭的话,要将autocommit设为0.假设设为1的话,那么update会推向oracle。9.ttCacheStart/ttCacheStop功能:启动/关闭cacheagent用法:CallttCacheStart();10.ttCkpt功能:手动做non-blockingcheckpoint用法:CALLttCkpt();CALLttCkpt(1,10);功能:手动做一个blockingcheckpoint用法:CallttCkptBlocking();CallttCkptBlocking(1,10);功能:设置后台checkpoint的频率,速率用法:CallttCkptConfig(ckptFrequency,ckptLogVolume,ckptRate)功能:整合perm和temp内存的碎片,类似于oracle里面的coalescs。用法:CALLttCompact;功能:查询参数设定。用法:CallttConfiguration();功能:查看datastore的状态。用法:callttdatastorestatus(/home/timesten/TimesTen/eservice/info/TT_eservice);tLockLevel功能:设置locklevel.用法:CallttLockLevel(lockLevel);lockLevel取值为Row和DS功能:查看logbuffer里面的内容用法:ttLogBufPrint(verbose,maxLen)CALLttLogBufPrint(1,0);CALLttLogBufPrint(2,0);功能:去除表格上面的统计信息。用法:ttOptClearStats(tblName,invalidate)invalidate取0(no)or1(yes).0表示即便清掉了统计信息后,也不会阻碍现有的command。功能:搜集表格上面的统计信息。用法:ttOptEstimateStats(tblName,invalidate,sampleStr)其中sampleStr取值为nROWS或pPERCENT,功能:将active状态的datastore改为activestandby状态用法:CALLttRepDeactivate();功能:启动/关闭replicationagent.22.ttRepStateGet()功能:获取datastore的状态用法:CALLttRepStateGet();lt;STANDBY功能:将activestandby状态的datastore改为Active状态,即master。用法:CALLttRepStateSet(ACTIVE);24.ttSize功能:预估表格的大小用法:ttSize(tblName,nRows,frac)其中nRows表示预估表格会有多少条记录。frac表示预估表中varbinary或varchar类型字段的碎片,该参数可选。如:Commandcallttsize(tracelog,10000000,null);lt;3041157861.0000025.ttDestory(命令)功能:删除一个datastore,包括checkpoint文件,logfile。用它能够平安完好地删除datastore.语法:ttDestroy[[-wait][-timeoutsecs]][-force]{-connStrconnection_string|DSN|dspath}26.ttmodinstall(命令)功能:修正端口或者enable/disableaccesscontrol.语法:ttmodinstall-portportNumberttmodinstall-enableAccessControlttmodinstall-changeOracleSettings27.ttuser(命令)功能:输入一个密码,产生加密密码。语法:ttuser-pwdcrypt28.ttStatus(命令)功能:显示datastore的状态29.ttSchema(命令)功能:打印出对象的ddl语句语法:ttSchema[-l][-c][-list{all|tables|views|sequences|cachegroups|repschemas}[,...]][-st|-systemTables][-uTT_instance][-connStrconnection_string|DSN][[owner.]name][...]30.ttRepAdmin(命令)功能:显示replicatioin的定义,监控replication的状态