创建oracle系统dsn,timesten创建dsn

Timesten11g建立datastore

在完成上面的安装任务之后,因为我们需要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

an_tt1122=TimesTen 11.2.2 Driver

anCS_tt1122=TimesTen 11.2.2 Client Driver

然后在 该文件的最后,添加如下内容:

#定义系统一级的DSN 的名字

[an_tt1122]

#定义驱动

Driver=/opt/TimesTen/tt1122/lib/libtten.so

#定义文件存放位置,数据文件和log都是放在info/an目录下,以 an 为前缀开始的

DataStore=/opt/TimesTen/tt1122/info/an

#定义数据库的字符集

DatabaseCharacterSet=ZHS16GBK

#定义是否需要用户授权认证

Authenticate=0

#定义内存大小

PermSize=64

TempSize=32

#定义用户一级的DSN

[anCS_tt1122]

#服务器的地址

TTC_SERVER=192.168.20.230

#服务器data store的系统一级的DSN 名字,对应上面定义的 名字

TTC_SERVER_DSN=an_tt1122

[an_tt1122]

Driver=/opt/TimesTen/tt1122/lib/libtten.so

DataStore=/opt/TimesTen/tt1122/info/an/andata

DatabaseCharacterSet=ZHS16GBK

Authenticate=0

PermSize=64

TempSize=32

OracleId=db2

[anCS_tt1122]

TTC_SERVER=189.168.0.2

TTC_SERVER_DSN=an_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';

cd /opt/TimesTen/tt1122/info

mkdir -p an/logs

[timesten@localhost info]$ ttisql

Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.

Type ? or "help" for help, type "exit" to quit ttIsql.

Command> connect an_tt1122

> ;

Warning 20000: Use of a deprecated feature: Authenticate (ignored)

Connection successful: DSN=an_tt1122;UID=timesten;DataStore=/opt/TimesTen/tt1122/info/an;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=US7ASCII;DRIVER=/opt/TimesTen/tt1122/lib/libtten.so;PermSize=64;TempSize=32;TypeMode=0;

(Default setting AutoCommit=1)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值