TimesTen Classic 18c 安装与配置过程

2024-02-04 13:18

本文主要是介绍TimesTen Classic 18c 安装与配置过程,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

参考

Complete example for installing and uninstalling TimesTen Classic

概述

TimesTen 18.1.2.1版是首个兼容TimesTen Classic模式的安装包。Release Notes是这么说的:

This release supports Classic TimesTen In-Memory Database, in addition to TimesTen Scaleout.

Oracle Blogs里是这么说的:

One Download, Two Products …

也就是说一个介质中包含了两种类型的安装方式,此版本详细的新特性请见此PPT。

安装文档请参Oracle Docs中的Installation, Migration, and Upgrade Guide。

介质下载

从Oracle网站下载,版本选择Linux
Edelivery上也有,主要搜索关键字为“Oracle TimesTen In-Memory Database”。
此介质的MD5SUM为:7b5fc2f506a89f8560b503cb61774841

准备操作系统

操作系统的支持以Linux为主,详见下图:
在这里插入图片描述
本例中使用Oracle Linux 7。

如果使用VagrantBox,可使用以下的Vagrantfile,如果不是请忽略。

Vagrant.configure("2") do |config|config.vm.provider :virtualbox do |vb|vb.name = "tt18121"vb.memory = 2048vb.cpus = 2endconfig.vm.box = "ol7-latest"config.vm.hostname = "tt18121"config.vm.network "private_network", ip: "192.168.0.11"
end

用户,组设定

假定用户oracle为实例管理员,假定timesten为TimesTen 用户组,命令如下:

sudo groupadd -g 10000 timesten
sudo useradd -u 55000 -g timesten oracle
sudo passwd oracle

查看用户:

$ id oracle
uid=55000(oracle) gid=10000(timesten) groups=10000(timesten)

为方便,本例赋予实例管理员用户sudo,虽然这不是必需的:

sudo usermod -aG wheel oracle

目录设定

规划如下:

  • 安装文件位于/u01/installation (安装文件不是安装介质,指TimesTen术语installation)
  • 数据库文件位于/u01/database,数据和日志文件分布位于其下的data和log目录
    命令如下:
sudo mkdir -p /u01/installation
sudo mkdir -p /u01/database/data
sudo mkdir -p /u01/database/log
sudo chown oracle:timesten /u01/installation
sudo chown -R oracle:timesten /u01/database

创建安装

切换到实例管理员用户,本例为oracle。

su - oracle

创建安装:

unzip -d /u01/installation/ /vagrant/timesten181210.server.linux8664.zip

查看安装目录:

$ cd /u01/installation/
$ ls
tt18.1.2.1.0
$ cd tt18.1.2.1.0/
$ ll
total 96
dr-xr-x---. 3 oracle timesten    51 Feb 18 20:56 3rdparty
dr-xr-x---. 2 oracle timesten  4096 Feb 18 20:56 bin
dr-xr-x---. 4 oracle timesten    31 Feb 18 20:56 grid
dr-xr-x---. 3 oracle timesten  4096 Feb 18 20:56 include
dr-xr-x---. 2 oracle timesten  4096 Feb 18 20:56 info
dr-xr-x---. 3 oracle timesten  4096 Feb 18 20:56 lib
dr-xr-x---. 3 oracle timesten    19 Feb 18 20:56 network
dr-xr-x---. 3 oracle timesten    18 Feb 18 20:56 nls
dr-xr-x---. 2 oracle timesten  4096 Feb 18 20:56 oraclescripts
dr-xr-x---. 4 oracle timesten    40 Feb 18 20:56 PERL
dr-xr-x---. 7 oracle timesten    68 Feb 18 20:56 plsql
-r--r-----. 1 oracle timesten 76902 Feb 18 20:56 README.html
dr-xr-x---. 2 oracle timesten    26 Feb 18 20:56 startup
dr-xr-x---. 2 oracle timesten    90 Feb 18 20:56 support
dr-xr-x---. 3 oracle timesten    32 Feb 18 20:56 ttoracle_home
$ du -sh .
1.3G    .

验证安装:

cd /u01/installation/tt18.1.*/bin
unset TIMESTEN_HOME
./ttInstallationCheck
```exit
注意,需要unset环境变量是为防止ttInstallationCheck命令检查$TIMESTEN_HOME目录。
当然也可以直接指定安装目录,例如:
```bash
$ ./ttInstallationCheck
This installation has been verified.$ ./ttInstallationCheck -install_dir /u01/installation/tt18.1.4.1.0/This installation has been verified.

创建classic实例

一路回车,只有设置TNS_ADMIN 时输入s。

$ ./ttInstanceCreateNOTE: Each TimesTen instance is identified by a unique name.The instance name must be a non-null alphanumeric string, not longerthan 255 characters.Please choose an instance name for this installation? [ tt181 ]
Instance name will be 'tt181'.
Is this correct? [ yes ]
Where would you like to install the tt181 instance of TimesTen? [ /home/oracle ]
Creating instance in /home/oracle/tt181 ...
INFO: Mapping files from the installation to /home/oracle/tt181/installNOTE: If you are configuring TimesTen for use with Oracle Clusterware, thedaemon port number must be the same across all TimesTen installationsmanaged within the same Oracle Clusterware cluster.NOTE: All installations that replicate to each other must use the same daemonport number that is set at installation time. The daemon port number canbe verified by running 'ttVersion'.The default port number is 6624.Do you want to use the default port number for the TimesTen daemon? [ yes ]
The daemon will run on the default port number (6624).In order to use the 'TimesTen Application-Tier Database Cache' feature in any databases
created within this installation, you must set a value for the TNS_ADMIN
environment variable. It can be left blank, and a value can be supplied later
using <install_dir>/bin/ttInstanceModify.Please enter a value for TNS_ADMIN (s=skip)? [  ] s
What is the TCP/IP port number that you want the TimesTen Server to listen on? [ 6625 ]Would you like to use TimesTen Replication with Oracle Clusterware? [ no ]NOTE: The TimesTen daemon startup/shutdown scripts have not been installed.The startup script is located here :'/home/oracle/tt181/startup/tt_tt181'Run the 'setuproot' script :/home/oracle/tt181/bin/setuproot -install
This will move the TimesTen startup script into its appropriate location.The 18.1 Release Notes are located here :'/u01/installation/tt18.1.2.1.0/README.html'Starting the daemon ...
TimesTen Daemon (PID: 5640, port: 6624) startup OK.

以上为实例的完全安装,如果只想安装客户端可以运行一下命令:

./ttInstanceCreate -clientonly

环境变量设置

执行以下命令,注意不是粘贴到.bash_profile文件中:

echo 'export TIMESTEN_HOME=~/tt181' >> ~/.bash_profile
echo '. $TIMESTEN_HOME/bin/ttenv.sh' >> ~/.bash_profile
source ~/.bash_profile

然后验证实例状态:

$ ttversion
TimesTen Release 18.1.2.1.0 (64 bit Linux/x86_64) (tt181:6624) 2019-02-18T19:19:18ZInstance admin: oracleInstance home directory: /home/oracle/tt181Group owner: timestenDaemon home directory: /home/oracle/tt181/infoPL/SQL enabled.

查看实例配置文件:

$ cat $TIMESTEN_HOME/conf/timesten.conf
# TimesTen Instance Configuration File
# Created by ttInstanceCreate
# Commented values are default values
hostname=ol7-vagrant
timesten_release=18.1.2
instance_name=tt181
daemon_port=6624
server_port=6625
admin_user=oracle
admin_uid=55000
group_name=timesten
instance_guid=B1E7F2DE-1383-4100-A9E2-6B8E15BED96D
verbose=1

为日志文件记录添加日期

默认的日志文件记录只输出时间,没有日期。
修改文件timesten.conf:

 vi $TIMESTEN_HOME/conf/timesten.conf

添加以下行:

show_date=1

重启Daemon生效:

$ ttdaemonadmin -restart
TimesTen Daemon (PID: 13264, port: 6624) stopped.
TimesTen Daemon (PID: 13425, port: 6624) startup OK.

验证:

tail  $TIMESTEN_HOME/diag/ttmesg.log
...
2019-04-22 14:42:55.432 Info:    : 13425: << Date : Mon Apr 22 14:42:55 2019, daemon port 6624 >>
2019-04-22 14:42:56.432 Info:    : 1342 ...

设置实例开机自动启动

是可选的设置(需要用户有sudo权限,否则记录TIMESTEN_HOME环境变量后,用root执行)。

sudo TIMESTEN_HOME=$TIMESTEN_HOME -s
cd $TIMESTEN_HOME/bin
./setuproot -install -force

输出如下:

[root@ol7-vagrant bin]# ./setuproot -install -force
Copying /home/oracle/tt181/startup/tt_tt181 to /etc/init.dSuccessfully installed the following scripts :
/etc/init.d/tt_tt181
/etc/rc.d/rc0.d/K45tt_tt181
/etc/rc.d/rc1.d/K45tt_tt181
/etc/rc.d/rc2.d/S90tt_tt181
/etc/rc.d/rc3.d/S90tt_tt181
/etc/rc.d/rc5.d/S90tt_tt181
/etc/rc.d/rc6.d/K45tt_tt181

重启机器验证实例已自动启动:

$ ttstatus
TimesTen status report as of Mon Apr 22 04:14:00 2019Daemon pid 3072 port 6624 instance tt181
TimesTen server pid 3079 started on port 6625
------------------------------------------------------------------------
------------------------------------------------------------------------
Accessible by group timesten
End of report
$ ps -ef|grep -i timesten
oracle    3072     1  0 04:12 ?        00:00:00 /home/oracle/tt181/install/bin/timestend -initfd 13 -minsubs 2 -boot
oracle    3076  3072  0 04:12 ?        00:00:00 /u01/installation/tt18.1.2.1.0/bin/timestensubd -verbose -id 1000000 -facility user
oracle    3077  3072  0 04:12 ?        00:00:00 /u01/installation/tt18.1.2.1.0/bin/timestensubd -verbose -id 1000001 -facility user
oracle    3079  3072  0 04:12 ?        00:00:00 /u01/installation/tt18.1.2.1.0/bin/ttcserver -verbose -id 1000002 -p 6625 -facility user -group timesten
oracle    5171  5135  0 04:14 pts/0    00:00:00 grep --color=auto -i timesten

创建数据库

进入配置文件目录,编辑DSN配置文件sys.odbc.ini:

cd $TIMESTEN_HOME/conf
vi sys.odbc.ini

创建新DSN,本例为TTDB。在[ODBC Data Sources]一节中添加一行:

[ODBC Data Sources]
...
TTDB=TimesTen 18.1 Driver
...

创建一新的小节[TTDB]如下,其中内存大小的单位为M:

[ODBC Data Sources]
TTDB=TimesTen 18.1 Driver[TTDB]
Driver=/home/oracle/tt181/install/lib/libtten.so
DataStore=/u01/database/data/ttdb
LogDir=/u01/database/log
PermSize=512
TempSize=64
LogBufMB=256
LogBufParallelism=8
DatabaseCharacterSet=ZHS16GBK
ConnectionCharacterSet=ZHS16GBK
OracleNetServiceName=orcl

注意第一节[ODBC Data Sources]中的声明也很重要,否则SQL Developer看不到此条目。

以上假设:

  • 字符集为ZHS16GBK,请与Oracle数据库字符集一致
  • Oracle数据库的TNS接口名为orcl
  • Permsize和TempSize为内存数据库的大小
    根据实际情况更改你的配置。

创建数据库:

$ ttisql ttdbCopyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.connect "DSN=ttdb";
Connection successful: DSN=TTDB;UID=oracle;DataStore=/u01/database/data/ttdb;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=ZHS16GBK;DRIVER=/home/oracle/tt181/install/lib/libtten.so;LogBufMB=256;LogBufParallelism=8;LogDir=/u01/database/log;PermSize=512;TempSize=64;OracleNetServiceName=orcl;
(Default setting AutoCommit=1)
Command> dssize
The following values are in MB:PERM_ALLOCATED_SIZE:      512PERM_IN_USE_SIZE:         14.041PERM_IN_USE_HIGH_WATER:   14.071TEMP_ALLOCATED_SIZE:      64TEMP_IN_USE_SIZE:         17.853TEMP_IN_USE_HIGH_WATER:   23.949Command> exit
Disconnecting...
Done.

设置数据库内存加载策略:

此为可选步骤。
设置加载策略为手动:

ttadmin -rampolicy manual ttdb

设置完后,以后必须用以下命令加载和卸载数据库:

ttadmin -ramload ttdb
ttadmin -ramunload ttdb

如果希望随daemon自动启动,可以如下设置:

ttadmin -rampolicy always ttdb

设置与Oracle数据库的连接

假设有一Oracle数据库,网络可达。
首先拷贝样例tnsnames.ora文件:

cp /u01/installation/tt18.1.*/network/admin/samples/tnsnames.ora $TIMESTEN_HOME/conf
chmod u+w $TIMESTEN_HOME/conf/tnsnames.ora

编辑此文件,添加Oracle数据库接口描述,也可以直接从Oracle数据库上拷贝此文件。以下为示例

$ cat tnsnames.ora
...orclpdb =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = odbserver)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orclpdb)))

需要使用ttinstancemodify来修改TNS_ADMIN,使sqlplus可以找到tnsnames.ora文件。本例设置为$TIMESTEN_HOME/conf

$ ttinstancemodifyInstance Info
-------------Name:           tt181
Version:        18.1.4.1.0
Location:       /home/oracle/tt181
Installation:   /u01/installation/tt18.1.4.1.0
Daemon Port:    6624
Server Port:    6625Would you like to change the installation that this instance points to? [ no ]The daemon for instance 'tt181' is currently configured to use port 6624.
Would you like to change this port? [ no ]
The server for instance 'tt181' is currently configured to use port 6625.
Would you like to change this port? [ no ]
TNS_ADMIN for the instance 'tt181' is currently not set.
Would you like to change TNS_ADMIN for this instance? [ no ] yes
Please enter a value for TNS_ADMIN (q=quit)? [  ] /home/oracle/tt181/confDo you want to restart the daemon using the new configuration? [ yes ]
Restarting the daemon ...
TimesTen Daemon (PID: 6392, port: 6624) stopped.
TimesTen Daemon (PID: 15305, port: 6624) startup OK.
The instance 'tt181' is now configured with :
TNS_ADMIN=/home/oracle/tt181/confWould you like to configure TimesTen Replication with Oracle Clusterware? [ no ]

TNS_ADMIN实际上重新登陆后才能生效,如果需要马上生效:

export TNS_ADMIN=$TIMESTEN_HOME/conf

使用以下的命令测试Oracle数据库联通性:

sqlplus username/password@orcl
sqlplus sys/password@orcl as sysdba

下一步

如果想快速测试缓存组,可参见Timesten Classic 18.1 建立缓存组

这篇关于TimesTen Classic 18c 安装与配置过程的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/677628

相关文章

mybatis映射器配置小结

《mybatis映射器配置小结》本文详解MyBatis映射器配置,重点讲解字段映射的三种解决方案(别名、自动驼峰映射、resultMap),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定... 目录select中字段的映射问题使用SQL语句中的别名功能使用mapUnderscoreToCame

Linux下MySQL数据库定时备份脚本与Crontab配置教学

《Linux下MySQL数据库定时备份脚本与Crontab配置教学》在生产环境中,数据库是核心资产之一,定期备份数据库可以有效防止意外数据丢失,本文将分享一份MySQL定时备份脚本,并讲解如何通过cr... 目录备份脚本详解脚本功能说明授权与可执行权限使用 Crontab 定时执行编辑 Crontab添加定

oracle 11g导入\导出(expdp impdp)之导入过程

《oracle11g导入导出(expdpimpdp)之导入过程》导出需使用SEC.DMP格式,无分号;建立expdir目录(E:/exp)并确保存在;导入在cmd下执行,需sys用户权限;若需修... 目录准备文件导入(impdp)1、建立directory2、导入语句 3、更改密码总结上一个环节,我们讲了

Java使用jar命令配置服务器端口的完整指南

《Java使用jar命令配置服务器端口的完整指南》本文将详细介绍如何使用java-jar命令启动应用,并重点讲解如何配置服务器端口,同时提供一个实用的Web工具来简化这一过程,希望对大家有所帮助... 目录1. Java Jar文件简介1.1 什么是Jar文件1.2 创建可执行Jar文件2. 使用java

SpringBoot 多环境开发实战(从配置、管理与控制)

《SpringBoot多环境开发实战(从配置、管理与控制)》本文详解SpringBoot多环境配置,涵盖单文件YAML、多文件模式、MavenProfile分组及激活策略,通过优先级控制灵活切换环境... 目录一、多环境开发基础(单文件 YAML 版)(一)配置原理与优势(二)实操示例二、多环境开发多文件版

Vite 打包目录结构自定义配置小结

《Vite打包目录结构自定义配置小结》在Vite工程开发中,默认打包后的dist目录资源常集中在asset目录下,不利于资源管理,本文基于Rollup配置原理,本文就来介绍一下通过Vite配置自定义... 目录一、实现原理二、具体配置步骤1. 基础配置文件2. 配置说明(1)js 资源分离(2)非 JS 资

MySQL8 密码强度评估与配置详解

《MySQL8密码强度评估与配置详解》MySQL8默认启用密码强度插件,实施MEDIUM策略(长度8、含数字/字母/特殊字符),支持动态调整与配置文件设置,推荐使用STRONG策略并定期更新密码以提... 目录一、mysql 8 密码强度评估机制1.核心插件:validate_password2.密码策略级

ShardingProxy读写分离之原理、配置与实践过程

《ShardingProxy读写分离之原理、配置与实践过程》ShardingProxy是ApacheShardingSphere的数据库中间件,通过三层架构实现读写分离,解决高并发场景下数据库性能瓶... 目录一、ShardingProxy技术定位与读写分离核心价值1.1 技术定位1.2 读写分离核心价值二

MyBatis-plus处理存储json数据过程

《MyBatis-plus处理存储json数据过程》文章介绍MyBatis-Plus3.4.21处理对象与集合的差异:对象可用内置Handler配合autoResultMap,集合需自定义处理器继承F... 目录1、如果是对象2、如果需要转换的是List集合总结对象和集合分两种情况处理,目前我用的MP的版本

QT Creator配置Kit的实现示例

《QTCreator配置Kit的实现示例》本文主要介绍了使用Qt5.12.12与VS2022时,因MSVC编译器版本不匹配及WindowsSDK缺失导致配置错误的问题解决,感兴趣的可以了解一下... 目录0、背景:qt5.12.12+vs2022一、症状:二、原因:(可以跳过,直奔后面的解决方法)三、解决方