Timesten11g建立datastore

Timesten11g建立datastore[@more@]

在完成上面的安装任务之后,因为我们需要TT存放我们应用的数据,我们就要配置自己的data store了(理解为oracle里面的schema)。
在做这个任务之前,需要厘清一个概念,DSN=data source name ,这个是标准的ODBC的用语,用来描述一个可以提供odbc连接的数据库服务器,
在timesten里面,所有的连接都是通过odbc的,就算是jdbc也是通过odbc连接到到TT上的。

在TT里面,有两种DSN
1.系统一级的DSN定义在服务器端,定义该data store的文件存放位置,以及其他的一些控制参数,比如是否需要log,是否打开checkpoint等等。
2.客户端的DSN,用来描述一个远端服务器上的data store,客户端程序用来连接到服务器

首先我们在刚才装好的TT服务器上定义个两个DSN,一个系统一级的,一个用户一级的

打开 $INSTALL_DIR/info/sys.odbc.ini
在[ODBC Data Sources] 下面添加如下两行 ,定义我们这个data store需要的driver
ljg_tt1122=TimesTen 11.2.2 Driver
ljgCS_tt1122=TimesTen 11.2.2 Client Driver
然后在 该文件的最后,添加如下内容:
#定义系统一级的DSN 的名字
[ljg_tt1122]
#定义驱动
Driver=/home/timesten/TimesTen/tt1122/lib/libtten.so
#定义文件存放位置,数据文件和log都是放在info/ljg目录下,以 ljg 为前缀开始的
DataStore=/home/timesten/TimesTen/tt1122/info/ljg
#定义数据库的字符集
DatabaseCharacterSet=WE8MSWIN1252
#定义是否需要用户授权认证
Authenticate=0
#定义内存大小
PermSize=64
TempSize=32
#定义用户一级的DSN
[ljgCS_tt1122]
#服务器的地址
TTC_SERVER=rhel132
#服务器data store的系统一级的DSN 名字,对应上面定义的 名字
TTC_SERVER_DSN=ljg_tt1122

The relevant attributes' values are:
Driver = the TimesTen Direct Linked ODBC Driver
DataStore = the location and the name of the database files
LogDir = the directory for the transaction logs
PermSize = the size of the permanent region of the database. In the above example, this is configured for 40MB
TempSize = the size of the temporary region of the database. In the above example, this is configured for 32MB
DatabaseCharacterSet = the character set used by the database
OracleNetServiceName = the TNS service name to the Oracle database. This attribute is required for In-Memory Database Cache only.

DatabaseCharacterSet必须与数据库的字符集一致,通过下面的命令查询服务器的字符集:
select value from nls_database_parameters where parameter='NLS_CHARACTERSET';

然后创建ljg/logs目录
[timesten@rhel132 info]$ mkdir -p ljg/logs

[timesten@rhel132 ~]$ ttisql
Command> connect ljg_tt1122;

Connection successful: DSN=ljg_tt1122;UID=timesten;DataStore=/home/timesten/TimesTen/tt1122/info/ljg;DatabaseCharacterSet=WE8MSWIN1252;ConnectionCharacterSet=US7ASCII;DRIVER=/home/timesten/TimesTen/tt1122/lib/libtten.so;LogDir=/home/timesten/TimesTen/tt1122/info/ljg/logs;PermSize=64;TempSize=32;TypeMode=0;OracleNetServiceName=orcl131;
(Default setting AutoCommit=1)
Command>

到目前为止,一个data store已经创建成功了。

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

转载于:http://blog.itpub.net/271283/viewspace-1057739/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值