由于运维需求,我们需要接手TimesTen的维护工作,出于习惯,我们测试了TimesTen的安装、缓存功能以及复制功能。
采用TimesTen的版本为18.1.4.11.0,Oracle数据库版本为19.3, 操作系统为OL7.8
安装步骤:
1 创建timesten系统用户,用它来安装TimesTen数据库
useradd -u 1001 -g dba timesten
passwd timesten
[timesten@rac2 log]$ id timesten
uid=1001(timesten) gid=300(dba) groups=300(dba)
2 创建安装文件目录和数据库目录
安装文件位于/mytt/installation
数据库文件位于/mytt/database ,data和log子目录分别存放数据库文件和日志文件
root用户
mkdir -p /mytt/installation
mkdir -p /mytt/database/data
mkdir -p /mytt/database/log
chown timesten.dba /mytt/installation
chown -R timesten.dba /mytt/database
3 解压
timesten用户
unzip /tmp/timesten1814110.server.linux8664.zip -d /mytt/installation/
查看解压文件
[timesten@rac2 tt18.1.4.11.0]$ pwd
/mytt/installation/tt18.1.4.11.0
[timesten@rac2 tt18.1.4.11.0]$ ls -lrt
total 124
-r--r----- 1 timesten dba 105752 May 14 20:35 README.html
dr-xr-x--- 2 timesten dba 4096 May 14 20:35 bin
dr-xr-x--- 2 timesten dba 26 May 14 20:35 kubernetes
dr-xr-x--- 2 timesten dba 4096 May 14 20:35 info
dr-xr-x--- 3 timesten dba 4096 May 14 20:35 include
dr-xr-x--- 4 timesten dba 31 May 14 20:35 grid
dr-xr-x--- 3 timesten dba 18 May 14 20:35 nls
dr-xr-x--- 2 timesten dba 4096 May 14 20:35 oraclescripts
dr-xr-x--- 3 timesten dba 19 May 14 20:35 network
dr-xr-x--- 3 timesten dba 4096 May 14 20:35 lib
dr-xr-x--- 7 timesten dba 68 May 14 20:35 plsql
dr-xr-x--- 2 timesten dba 90 May 14 20:35 support
dr-xr-x--- 2 timesten dba 26 May 14 20:35 startup
dr-xr-x--- 4 timesten dba 40 May 14 20:35 PERL
dr-xr-x--- 3 timesten dba 32 May 14 20:35 ttoracle_home
dr-xr-x--- 3 timesten dba 61 May 14 20:35 3rdparty
4 安装验证
cd /mytt/installation/tt18.1.*/bin
unset TIMESTEN_HOME
$ ./ttInstallationCheck
This installation has been verified.
$ ./ttInstallationCheck -install_dir /mytt/installation/tt18.1.4.11.0/
This installation has been verified.
5 创建classic实例
[timesten@rac2 bin]$ pwd
/mytt/installation/tt18.1.4.11.0/bin
[timesten@rac2 bin]$ ls -lrt *instance*
lrwxrwxrwx 1 timesten dba 17 Jun 16 16:45 ttinstancedestroy -> ttInstanceDestroy
lrwxrwxrwx 1 timesten dba 16 Jun 16 16:45 ttinstancecreate -> ttInstanceCreate
[timesten@rac2 bin]$ ./ttInstanceCreate
NOTE: Each TimesTen instance is identified by a unique name.
The instance name must be a non-null alphanumeric string, not longer
than 255 characters.
Please choose an instance name for this installation? [ tt181 ]
一路回车,只有设置TNS_ADMIN 时输入s。<<<<<<暂时不设置该变量,后续再修改
6 设置环境变量,这里要根据上一步设置的具体值,默认即可,下面可以直接刷
echo 'export TIMESTEN_HOME=~/tt181' >> ~/.bash_profile
echo '. $TIMESTEN_HOME/bin/ttenv.sh' >> ~/.bash_profile
echo '. $TNS_ADMIN=$TIMESTEN_HOME/conf' >> ~/.bash_profile
source ~/.bash_profile
也可以直接编辑文件~/.bash_profile
7 查看实例的配置文件和TimesTen的版本
默认的日志文件记录只输出时间,没有日期。
修改文件timesten.conf:
vi $TIMESTEN_HOME/conf/timesten.conf
添加show_date=1
重启Daemon生效:
ttdaemonadmin -restart
测试日志记录
[timesten@rac2 ~]$ tail -f $TIMESTEN_HOME/diag/ttmesg.log
2021-06-22 14:41:21.627 Info: CAC: 5991: TT08323-5991-73021184-refresh05557: TTDB Autorefresh for interval 5000 will use Select Every 0 Rows
2021-06-22 14:41:21.632 Info: CAC: 5991: TT05958-5991-73021184-refresh05674: TTDB CG Validation duration time: 31 ms
[timesten@rac2 ~]$ cat $TIMESTEN_HOME/conf/timesten.conf
# TimesTen Instance Configuration File
# Created by ttInstanceCreate
# Commented values are default values
hostname=rac2
timesten_release=18.1.4
instance_name=tt181
daemon_port=6624
server_port=6625
admin_user=timesten
admin_uid=1001
group_name=dba
instance_guid=99972FEE-45FE-455B-AB93-0B997BE6ADE2
verbose=1
show_date=1
tns_admin=/home/timesten/tt181/conf
[timesten@rac2 ~]$ ttversion;
TimesTen Release 18.1.4.11.0 (64 bit Linux/x86_64) (tt181:6624) 2021-05-14T10:05:29Z
Instance admin: timesten
Instance home directory: /home/timesten/tt181
Group owner: dba
Daemon home directory: /home/timesten/tt181/info
PL/SQL enabled.
8 设置Daemon开机自启动
cd $TIMESTEN_HOME/bin
./setuproot -install -force
创建TimesTen数据库
1 修改
cd $TIMESTEN_HOME/conf
vi sys.odbc.ini
修改后的内容如下:
[ODBC Data Sources]
#sampledb=TimesTen 18.1 Driver
#sampledbCS=TimesTen 18.1 Client Driver
TTDB=TimesTen 18.1 Driver
[TTDB] <<<<<<创建新DSN
Driver=/home/oracle/tt181/install/lib/libtten.so
DataStore=/mytt/database/data/ttdb
LogDir=/mytt/database/log
PermSize=512
TempSize=64
LogBufMB=256
LogBufParallelism=8
DatabaseCharacterSet=AL32UTF8
ConnectionCharacterSet=AL32UTF8
OracleNetServiceName=prod <<<<<tnsnames.ora中配置的相同,到Oracle数据库
2创建数据库:
基于sys.odbc.ini配置的新DSN创建数据库
$ ttisql ttdb
3设置数据库内存加载策略:
设置加载策略为手动:
ttadmin -rampolicy manual ttdb
设置完后必须用以下命令加载和卸载数据库:
ttadmin -ramload ttdb
ttadmin -ramunload ttdb
建议设置自动加载,随daemon自动启动,如下设置:
ttadmin -rampolicy always ttdb
4 设置与Oracle数据库的连接,配置tnsnames.ora文件
[timesten@rac2 conf]$ pwd
/home/timesten/tt181/conf
[timesten@rac2 conf]$ cat tnsnames.ora
prod =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = prod)
)
)
测试到Oracle连接
[timesten@rac2 conf]$ sqlplus oratt/oracle@prod
SQL*Plus: Release 12.1.0.2.0 Production on Tue Jun 22 15:38:31 2021
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Mon Jun 21 2021 16:32:59 +08:00
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
SQL>
目前tns连接测试成功。
TimesTen18.1安装部署测试-详细步骤
下一篇:MySQL的开发必会的sql语句
分享好友
分享这个小栈给你的朋友们,一起进步吧。
订阅须知
• 所有用户可根据关注领域订阅专区或所有专区
• 付费订阅:虚拟交易,一经交易不退款;若特殊情况,可3日内客服咨询
• 专区发布评论属默认订阅所评论专区(除付费小栈外)