Step by Step TimesTen --- ttIsql

 

ttIsqlTimesTen的一个交互工具,相当于oraclesqlplus.

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.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/81/viewspace-205093/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/81/viewspace-205093/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值