ITPUB??ì3
ITPUB论坛 » 内存数据库 » Step by Step TimesTen --- ttIsql

标题: [原创] Step by Step TimesTen --- ttIsql
离线 feng_xin
guoguo mama


精华贴数 7
个人空间 675
技术积分 2063 (751)
社区积分 3361 (392)
注册日期 2001-9-24
论坛徽章:13
现任管理团队成员ITPUB元老玉石琵琶铁扇公主授权会员生肖徽章2007版:羊
生肖徽章2007版:蛇生肖徽章2007版:鼠生肖徽章2007版:鼠生肖徽章2007版:鸡ITPUB新首页上线纪念徽章 

发表于 2008-3-12 17:53 
Step by Step TimesTen --- ttIsql

ttIsql是TimesTen的一个交互工具,相当于oracle的sqlplus.
ttIsql有两种模式,一种是命令行交互,一种是批处理模式。

a. 命令行模式

1, 连接DataStore
$ ttisql -connStr fxdsn


Copyright (c) 1996-2007, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.

connect "fxdsn";
Connection successful: DSN=fxdsn;UID=times;DataStore=/ora/TimesTen/datastore/fxdsn;DatabaseCharacterSet=US7ASCII;ConnectionCharacterSet=US7ASCII;PermSize=8;TempSize=8;TypeMode=0;
(Default setting AutoCommit=1)
Command>

2,察看数据库中有哪些表

Command> select TBLNAME,TBLOWNER from sys.tables;

< TABLES                         , SYS                             >
< COLUMNS                        , SYS                             >
< INDEXES                        , SYS                             >
< TBL_STATS                      , SYS                             >
< COL_STATS                      , SYS                             >
< PLAN                           , SYS                             >
< MONITOR                        , SYS                             >
< CACHE_GROUP                    , SYS                             >
< TRANSACTION_LOG_API            , SYS                             >
< VIEWS                          , SYS                             >
< SEQUENCES                      , SYS                             >
< TTABLES                        , SYS                             >
< TINDEXES                       , SYS                             >
< TTBL_STATS                     , SYS                             >
< TCOL_STATS                     , SYS                             >
< DUAL                           , SYS                             >
< TABLE_HISTORY                  , SYS                             >
< COLUMN_HISTORY                 , SYS                             >
< SYNONYMS                       , SYS                             >
< SYS_ACC_RIGHT                  , SYS                             >
< OBJ_ACC_RIGHT                  , SYS                             >
< USERS                          , SYS                             >
< REPELEMENTS                    , TTREP                           >
< REPLICATIONS                   , TTREP                           >
< REPPEERS                       , TTREP                           >
< REPSTORES                      , TTREP                           >
< REPSUBSCRIPTIONS               , TTREP                           >
< REPTABLES                      , TTREP                           >
< TTSTORES                       , TTREP                           >
< REPNETWORK                     , TTREP                           >
< XLASUBSCRIPTIONS               , SYS                             >
< TEST                           , TIMES                           >

32 rows found.

3,查看表结构
Command> desc test;


Table TIMES.TEST:
  Columns:
    A                               NUMBER (38)

1 table found.
(primary key columns are indicated with *)

4, 执行SQL语句
Command> select * from test;
0 rows found.
Command> insert into test values(1);
1 row inserted.
Command>  insert into test values(2);
1 row inserted.
Command> select * from test;
< 1 >
< 2 >
2 rows found.

5,运行一个SQL文件
Command> run test.sql

insert into test values(3);
1 row inserted.

insert into test values(4);
1 row inserted.


b. 批处理模式

$ ttisql -f test.sql fxdsn


Copyright (c) 1996-2007, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.

connect "DSN=fxdsn";
Connection successful: DSN=fxdsn;UID=times;DataStore=/ora/TimesTen/datastore/fxdsn;DatabaseCharacterSet=US7ASCII;ConnectionCharacterSet=US7ASCII;PermSize=8;TempSize=8;TypeMode=0;
(Default setting AutoCommit=1)

run "test.sql";

insert into test values(3);
1 row inserted.

insert into test values(4);
1 row inserted.

exit;
Disconnecting...
Done.


__________________

信心并不止是相信,而是看不见证据,仍然相信。

此之谓:大信!


¤ ╱◥█◣^^  ╭⌒╮     
  ︱田︱田︱ぃ╭ ╭ ⌒╮   
⿶⿶⿶⿶⿶ い⿶⿶⿶⿶⿶⿶⿶ 
╪╪╪╪╪╪╪╪╪╪╪
⿶⿶⿶⿶
只看该作者    顶部
离线 liyongdong
版主


精华贴数 5
个人空间 0
技术积分 4649 (282)
社区积分 126 (2950)
注册日期 2001-11-25
论坛徽章:23
现任管理团队成员ITPUB元老会员2006贡献徽章授权会员2008年新春纪念徽章生肖徽章2007版:鸡
生肖徽章2007版:龙ITPUB新首页上线纪念徽章生肖徽章:虎生肖徽章:猪生肖徽章:狗生肖徽章:鸡

发表于 2008-3-13 10:48 
不错。


__________________
人与人之间最大的信任是精诚相见人生没有停靠站,自我本身永远是一个出发点。无论何时何地,只要创造就有收获,只有不息的奋进,才能证明生命的存在。
只看该作者    顶部
离线 zhangzongjun
俊哥儿张


来自 大连
精华贴数 2
个人空间 480
技术积分 4535 (288)
社区积分 35 (5714)
注册日期 2006-8-9
论坛徽章:22
会员2007贡献徽章授权会员2008北京奥运纪念徽章:曲棍球2008北京奥运纪念徽章:水球2008北京奥运纪念徽章:羽毛球2008北京奥运纪念徽章:田径
2008北京奥运纪念徽章:皮划艇激流回旋2008北京奥运纪念徽章:射击生肖徽章2007版:兔生肖徽章2007版:鼠生肖徽章2007版:猴生肖徽章2007版:牛

发表于 2008-8-6 20:42 
学习中~~


__________________
*********************************************
  俊哥儿张   David Zhang
*********************************************
--> $昨夜西风凋碧树,独上高楼,望尽天涯路$
  $衣带渐宽终不悔,为伊消得人憔悴$
  $梦里寻他千百度,蓦然回首,那人却不在灯火阑珊处$
*********************************************
  我有一个梦,
  我想我飞起时,那天也让开路,
  我入海时,水也分成两边,
  众仙诸神,见我也称兄弟,
  无忧无虑,天下再无可拘我之物,
  再无可管我之人,再无我到不了之处,
  再无我做不成之事,再无……
*********************************************
只看该作者    顶部
 
    

相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问