当安装TimesTen的时候,安装用户即是TimesTen的DBA,这一点和Oracle是类似的。这个用户也叫外部用户,因为它是操作系统的用户。安装的时候如果选择 access control  为 enable ,那么就能在登录TimesTen之后,创建TimesTen的用户了,这时候创建的用户称为内部用户。

    在TimesTen的配置文件 sys.odbc.ini 中,有一些缺省的DSN定义,大部分都是为 Demo 服务的。但有一个比较特别,就是第一个,它的名字一般是前缀 TT_ ,然后加上你安装时候的确定的 Instance 名字,比如我们选择的Instance名字为 tt705,那么它的全名就是 TT_tt705。这个DSN是比较特别的一个,看起来好像和其它没什么区别,也能访问。但在以前的一些版本中有些操作是不能在这个DSN上做的。所以个人觉得创建自己的DSN的时候,最好不要碰这个DSN,还是以这个为模板,另创建一个的好。

 
    当创建TimesTen的内部用户的时候,创建的用户都是 Instance 级的。比如,我们创建了一个DSN 叫 tt_test。这时候我们登录到 TT_tt705,创建一个用户叫 tt,并赋予相关权限后,那么用这个 tt 用户就可以登录到该Instance下的所有DSN了,包括 tt_test。至少到TimesTen 7.0.5为止还是这样的。

[tt705@west-mountain info]$ ttisql "dsn=tt_test;uid=tt"
Copyright (c) 1996-2008, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.
 
connect "dsn=tt_test;uid=tt";
 7001: User authentication failed
The command failed.
Done.
[tt705@west-mountain info]$ ttisql tt_tt705
Copyright (c) 1996-2008, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.
 
connect "DSN=tt_tt705";
Connection successful: DSN=TT_tt705;UID=tt705;DataStore=……
(Default setting AutoCommit=1)
Command> create user tt identified by ‘tt’;
Command> grant all to tt;
Command> exit
Disconnecting…
Done.
[tt705@west-mountain info]$ ttisql "dsn=tt_test;uid=tt;pwd=tt"
Copyright (c) 1996-2008, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.
 
connect "dsn=tt_test;uid=tt";
Connection successful: DSN=tt_test;UID=tt;DataStore=……
(Default setting AutoCommit=1)
Command> call ttusers;
< TT705                         , 1, FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF >
< SYS                           , 0, 00000000000000000000000000000000 >
< TTREP                         , 0, 00000000000000000000000000000000 >
< PUBLIC                        , 0, 03000000000000000000000000000000 >
< TT                            , 0, FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF >
< TEST                          , 0, FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF >
6 rows found.
Command> exit
Disconnecting…
Done.
 
 
 

一个回复 “TimesTen中的用户级别”

  1. TimesTen » Blog Archive » TimesTen 初学者学习路线图 说:

    [...] 用户级别 [...]

留言