---
title: "TimesTen Training(2)--Command"
author: "zljpp"
date: "2012-07-13T17:07:18Z"
tags: []
categories: ["编程语言"]
slug: "timesten-training-2-command"
draft: false
lastmod: "2012-07-13T17:07:18Z"
id: 1591834
url: "https://zljpp.iteye.com/blog/1591834"
---

TimesTen一些管理命令:

      **1.ttdaemonadmin** 启停服务

> C:\\Documents and Settings\\ChenLi&gt;ttdaemonadmin -stop  
> TimesTen Data Manager 11.2.1 服务正在停止...  
> TimesTen Data Manager 11.2.1 服务已成功停止。
> 
> C:\\Documents and Settings\\ChenLi&gt;ttdaemonadmin -start  
> TimesTen Data Manager 11.2.1 服务正在启动 .  
> TimesTen Data Manager 11.2.1 服务已经启动成功。

      **2.ttisql datastoreName** 登录dataStore

> C:\\Documents and Settings\\ChenLi&gt;ttisql test
> 
> Copyright (c) 1996-2009, Oracle.  All rights reserved.  
> Type ? or "help" for help, type "exit" to quit ttIsql.
> 
> connect "DSN=test";  
> Connection successful: DSN=test;UID=ChenLi;DataStore=F:\\Timesten\\DataSore\\TEST\\;
> 
> ……
> 
> --内部用户登录：
> 
> C:\\Documents and Settings\\ChenLi&gt;ttisql "dsn=test;uid=tt;pwd=tt"
> 
> Copyright (c) 1996-2009, Oracle.  All rights reserved.  
> Type ? or "help" for help, type "exit" to quit ttIsql.
> 
> connect "dsn=test;uid=tt;pwd=tt";  
> Connection successful: DSN=test;UID=tt;DataStore=F:\\Timesten\\DataSore\\TEST\\;
> 
> ……

      **3.ttStatus** 查看timesten服务/进程状态

> C:\\Documents and Settings\\ChenLi&gt;ttstatus  
> TimesTen status report as of Tue Sep 22 22:16:14 2009
> 
> Daemon pid 2616 port 53384 instance tt1121\_32  
> TimesTen server pid 1748 started on port 53385  
> ------------------------------------------------------------------------  
> Data store f:\\timesten\\datasore\\TEST  
> There are 11 connections to the data store  
> Shared Memory KEY Global\\TEST.SHM.19 HANDLE 0x224  
> Type            PID     Context     Connection Name              ConnID  
> Process         3112    0x00de48e8  test                              1  
> Subdaemon       916     0x006cc398  Manager                        2032  
> Subdaemon       916     0x007212c8  Rollback                       2033  
> Subdaemon       916     0x0110cf48  Flusher                        2034  
> Subdaemon       916     0x011820e8  Monitor                        2035  
> Subdaemon       916     0x011d7018  Deadlock Detector              2036  
> Subdaemon       916     0x0122bf48  Checkpoint                     2037  
> Subdaemon       916     0x1b910078  Aging                          2038  
> Subdaemon       916     0x1b964fa8  Log Marker                     2039  
> Subdaemon       916     0x1b9b9ed8  AsyncMV                        2040  
> Subdaemon       916     0x1ba0ee08  HistGC                         2041  
> RAM residence policy: When In Use and 30 Seconds Longer  
> Replication policy  : Manual  
> Cache Agent policy  : Manual  
> ------------------------------------------------------------------------  
> Accessible by group BUILTIN\\Administrators  
> End of report

      **4.ttAdmin** 指定内存加载策略，具体查看帮助 ttadmin --help

> -ramPolicy:  
>   always     The data store should remain in system RAM all the time.  
>   manual     The data store is loaded in system RAM manually by the user  
>              (via the -ramLoad option).  
>   inUse      The data store is loaded in system RAM when in use (i.e., when  
>              applications are connected).  This is the default.  The -ramGrace  
>              option may be used to modify the behavior of this policy.

      **5.ttBulkCp -i/-o** 数据导入、导出。只导出数据，字段数据可指定分隔符。

> ttBulkCp -o –s "|" ttcore departments dept.dat

      **6.ttbackup** 备份datastore,功能类似rman，支持全量、增量、stream备份

> --全备
> 
> ttBackup -type \[fileFullEnable | fileIncrOrFull] -dir *BackupDirectory* ttcore
> 
> --增量
> 
> ttBackup -type \[fileIncremental |fileIncrOrFull ] -dir *BackupDirectory* ttcore

      **7.ttRestore** 恢复ttbackup 备份的数据;不覆盖已存在的数据

> ttRestore -dir BackupDirectory ttcore

      **8.ttDestroy** 删除datastore，可用ttRestore恢复已备份的datastore

> **ttDestroy ttcore**

      9.**ttSchema** 查看表、索引、试图、等对象的DDL语句

> ttSchema –list tables,views ttcore inven%

      10.**ttMigrate** 迁移工具。用于升级、重建、回退datastore.

> ttMigrate -c ttcore *BinaryDataFile*

--To be continue--