安装timesten(22.1)
环境:
OS:Centos 7
DB:22.1
1.下载软件包
2.解压到相应目录
我这里是解压到/opt/tt22.1.1.13.0目录
3.创建用户
groupadd -g 10000 timesten
useradd -u 55000 -g timesten instanceadmin
passwd instanceadmin
4.检查
[root@localhost tt22.1.1.13.0]# /opt/tt22.1.1.13.0/bin/ttInstallationCheck
This installation has been verified.
5.创建实例目录
mkdir -p /opt/tt22.1.1.13.0/instance_dir
chown -R instanceadmin:timesten /opt/tt22.1.1.13.0
6.创建实例
[root@localhost tt22.1.1.13.0]# /opt/tt22.1.1.13.0/bin/ttInstanceCreate -name instance1 -location /opt/tt22.1.1.13.0/instance_dir
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]$ /opt/tt22.1.1.13.0/bin/ttInstanceCreate -name instance1 -location /opt/tt22.1.1.13.0/instance_dir
Creating instance in /opt/tt22.1.1.13.0/instance_dir/instance1 ...
NOTE: The TimesTen daemon startup/shutdown scripts have not been installed.
The startup script is located here :
'/opt/tt22.1.1.13.0/instance_dir/instance1/startup/tt_instance1'
Run the 'setuproot' script :
/opt/tt22.1.1.13.0/instance_dir/instance1/bin/setuproot -install
This will move the TimesTen startup script into its appropriate location.
The 22.1 Release Notes are located here :
'/opt/tt22.1.1.13.0/README.html'
Instance created successfully.
7.设置环境变量
[instanceadmin@localhost ~]$source /opt/tt22.1.1.13.0/instance_dir/instance1/bin/ttenv.sh
[instanceadmin@localhost ~]$ which ttVersion
/opt/tt22.1.1.13.0/instance_dir/instance1/bin/ttVersion
[instanceadmin@localhost ~]$ ttVersion
TimesTen Release 22.1.1.13.0 (64 bit Linux/x86_64) (instance1:6624) 2023-05-09T22:59:41Z
Instance admin: instanceadmin
Instance home directory: /opt/tt22.1.1.13.0/instance_dir/instance1
Group owner: timesten
Daemon home directory: /opt/tt22.1.1.13.0/instance_dir/instance1/info
PL/SQL enabled.
[instanceadmin@localhost ~]$ ttStatus
ttStatus: Could not connect to the TimesTen daemon on port 6624.
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 02:31:02 2023
Daemon pid 11153 port 6624 instance instance1
TimesTen server pid 11160 started on port 6625
------------------------------------------------------------------------
------------------------------------------------------------------------
Accessible by group timesten
End of report
9.修改配置文件
cd /opt/tt22.1.1.13.0/instance_dir/instance1/conf
vi sys.odbc.ini
[ODBC Data Sources]
sampledb=TimesTen 22.1 Driver
sampledbCS=TimesTen 22.1 Client Driver
[sampledb]
Driver=/opt/tt22.1.1.13.0/instance_dir/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.创建配置文件中指定的目录
mkdir /logs
mkdir /databases/sampledb
chown -R instanceadmin:timesten /logs
chown -R instanceadmin:timesten /databases
11.本地登录
cd /opt/tt22.1.1.13.0/instance_dir/instance1/bin
./ttisql # 本地访问客户端
connect "dsn=sampledb"; # 连接dsn,若不指定userid的话会默认使用timesten.conf定义的用户admin_user=instanceadmin
create user hxl identified by 'oracle';
grant all to hxl;
tables;
procedures;
建表:
SQL> CREATE TABLE readtab (a NUMBER NOT NULL PRIMARY KEY,b VARCHAR2(31));
SQL> INSERT INTO readtab VALUES (1, 'hello');
SQL> INSERT INTO readtab VALUES (2, 'world');
SQL> COMMIT;
11.远程登录
cd /opt/tt22.1.1.13.0/instance_dir/instance1/bin
./ttIsqlCS # 远程访问客户端
connect "dsn=sampledbCS;uid=hxl;pwd=oracle";
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)
12.日常维护
停止/启动 timesten
su - instanceadmin
ttDaemonAdmin -stop
ttDaemonAdmin -start
查看状态
source /opt/tt22.1.1.13.0/instance_dir/instance1/bin/ttenv.sh
ttstatus