环境:
OS:Centos 7
DB:18.1.4
1.下载软件包
地址地址:
https://edelivery.oracle.com/osdc/faces/SoftwareDelivery
我这里下载的是V1035435-01.zip
2.解压到相应目录
我这里是解压后迁移到/opt/目录
[root@localhost cc]# unzip V1035435-01.zip
[root@localhost cc]# unzip timesten1814340.server.linux8664.zip
[root@localhost cc]# mv tt18.1.4.34.0 /opt/
3.创建用户
groupadd -g 10000 timesten
useradd -u 55000 -g timesten instanceadmin
passwd instanceadmin
4.检查
[root@localhost tt22.1.1.13.0]# /opt/tt18.1.4.34.0/bin/ttInstallationCheck
This installation has been verified.
5.创建实例目录
[root@localhost tt18.1.4.34.0]# mkdir -p /opt/tt18.1.4.34.0/myinstance
[root@localhost tt18.1.4.34.0]# chown -R instanceadmin:timesten /opt/tt18.1.4.34.0
6.创建实例
[root@localhost tt18.1.4.34.0]# /opt/tt18.1.4.34.0/bin/ttInstanceCreate -name instance1 -location /opt/tt18.1.4.34.0/myinstance ERROR: It is not allowed to install TimesTen as root. Please refer to the installation guide for more information. Aborting installation.
使用普通用户创建
[root@localhost opt]# su - instanceadmin [instanceadmin@localhost ~]$ /opt/tt18.1.4.34.0/bin/ttInstanceCreate -name instance1 -location /opt/tt18.1.4.34.0/myinstance Creating instance in /opt/tt18.1.4.34.0/myinstance/instance1 ... INFO: Mapping files from the installation to /opt/tt18.1.4.34.0/myinstance/instance1/install NOTE: The TimesTen daemon startup/shutdown scripts have not been installed. The startup script is located here : '/opt/tt18.1.4.34.0/myinstance/instance1/startup/tt_instance1' Run the 'setuproot' script : /opt/tt18.1.4.34.0/myinstance/instance1/bin/setuproot -install This will move the TimesTen startup script into its appropriate location. The 18.1 Release Notes are located here : '/opt/tt18.1.4.34.0/README.html'
7.设置环境变量
[instanceadmin@localhost ~]$source /opt/tt18.1.4.34.0/myinstance/instance1/bin/ttenv.sh [instanceadmin@localhost ~]$ which ttVersion /opt/tt18.1.4.34.0/myinstance/instance1/bin/ttVersion [instanceadmin@localhost ~]$ ttVersion TimesTen Release 18.1.4.34.0 (64 bit Linux/x86_64) (instance1:6624) 2023-05-17T14:33:45Z Instance admin: instanceadmin Instance home directory: /opt/tt18.1.4.34.0/myinstance/instance1 Group owner: timesten Daemon home directory: /opt/tt18.1.4.34.0/myinstance/instance1/info PL/SQL enabled. [instanceadmin@localhost ~]$ ttStatus ttStatus: Could not connect to the TimesTen daemon. If the TimesTen daemon is not running, please start it by running "ttDaemonAdmin -start".
8.启动ttDaemonAdmin
[instanceadmin@localhost ~]$ ttDaemonAdmin -start TimesTen Daemon (PID: 11153, port: 6624) startup OK. [instanceadmin@localhost ~]$ ttStatus TimesTen status report as of Thu Jun 1 21:52:38 2023 Daemon pid 2374 port 6624 instance instance1 TimesTen server pid 2381 started on port 6625 ------------------------------------------------------------------------ ------------------------------------------------------------------------ Accessible by group timesten End of report
9.修改配置文件
[instanceadmin@localhost ~]$ cd /opt/tt18.1.4.34.0/myinstance/instance1/conf
vi sys.odbc.ini
下面部分之前是注释掉的,现在将注释去掉,启用
[ODBC Data Sources] sampledb=TimesTen 18.1 Driver sampledbCS=TimesTen 18.1 Client Driver [sampledb] Driver=/opt/tt18.1.4.34.0/myinstance/instance1/install/lib/libtten.so DataStore=/databases/sampledb PermSize=512 TempSize=128 LogBufMB=256 LogFileSize=256 LogDir=/logs DatabaseCharacterSet=AL32UTF8 OracleNetServiceName=ttorcl [sampledbCS] TTC_SERVER=sampledb_CS TTC_SERVER_DSN=sampledb
[instanceadmin@localhost conf]$ more sys.ttconnect.ini # Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. ############################################################### # This is a sample sys.ttconnect.ini file that is used for the # TimesTen Client. It contains entries for each server. ############################################################### [sampledb_CS] Description=TimesTen Server Network_Address=192.168.1.101 TCP_Port=6625
10.创建配置文件中指定的目录
[root@localhost tt18.1.4.34.0]# mkdir /logs
[root@localhost tt18.1.4.34.0]# mkdir -p /databases/sampledb
[root@localhost tt18.1.4.34.0]# chown -R instanceadmin:timesten /logs
[root@localhost tt18.1.4.34.0]# chown -R instanceadmin:timesten /databases
11.本地登录
[instanceadmin@localhost conf]$ cd /opt/tt18.1.4.34.0/myinstance/instance1/bin ./ttisql # 本地访问客户端 Command>connect "dsn=sampledb"; # 连接dsn,若不指定userid的话会默认使用timesten.conf定义的用户admin_user=instanceadmin Command>create user hxl identified by 'oracle'; Command> grant all to hxl; Command> tables; 0 tables found. Command> procedures; 0 procedures found.
退出使用创建的用户登录
./ttisql Command> connect "dsn=sampledb;uid=hxl;pwd=oracle"; 建表: Command> create table tb_test (id number not null primary key,name varchar2(31)); Command> insert into tb_test values (1, 'zhangshan'); Command> insert into tb_test values (2, 'lisi'); Command> commit; Command> select * from tb_test; < 1, zhangshan > < 2, lisi > 2 rows found.
11.远程登录
[instanceadmin@localhost bin]$ cd /opt/tt18.1.4.34.0/myinstance/instance1/bin [instanceadmin@localhost bin]$ ./ttIsqlCS # 远程访问客户端 Command> connect "dsn=sampledbCS;uid=hxl;pwd=oracle"; Connection successful: DSN=sampledbCS;TTC_SERVER=sampledb_CS;TTC_SERVER_DSN=sampledb;UID=hxl;DATASTORE=/databases/sampledb;DATABASECHARACTERSET=AL32UTF8;CONNECTIONCHARACTERSET=US7ASCII;LOGFILESIZE=256;LOGBUFMB=256;LOGDIR=/logs;PERMSIZE=512;TEMPSIZE=128;ORACLENETSERVICENAME=ttorcl; (Default setting AutoCommit=1) Command> select * from HXL.TB_TEST; < 1, zhangshan > < 2, lisi > 2 rows found.
12.日常维护
停止/启动 timesten
su - instanceadmin
ttDaemonAdmin -stop
ttDaemonAdmin -start
查看状态
source /opt/tt18.1.4.34.0/instance_dir/instance1/bin/ttenv.sh
ttstatus
####################windows配置odbc客户端#######################
1.客户端安装相同版本的timesten客户端
下载解压后点击setup.exe进行安装
V1019777-01.zip
2.配置odbc
控制面板-->设置odbc数据源(64位)





这里填写timesten服务器的ip地址

点击Refresh会自动刷新出在服务器上配置的sampledb
3.客户端连接
C:\Users\Administrator>ttIsql Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved. Type ? or "help" for help, type "exit" to quit ttIsql. Command> connect "DSN=timesten_dns"; Connection successful: DSN=timesten_dns;TTC_SERVER=tt_test;TTC_SERVER_DSN=sampledb;UID=hxl;DATASTORE=/databases/sampledb;DATABASECHARACTERSET=AL32UTF8;CONNECTIONCHARACTERSET=US7ASCII;LOGFILESIZE=256;LOGBUFMB=256;LOGDIR=/logs;PERMSIZE=512;TEMPSIZE=128;ORACLENETSERVICENAME=ttorcl; (Default setting AutoCommit=1) Command> tables; HXL.TB_TEST 1 table found. Command> select * from hxl.tb_test; < 1, zhangshan > < 2, lisi > 2 rows found.