1.主机名检查
[oracle@xag182 ~]$ hostname
xag182
[oracle@xag182 ~]# cat /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
HOSTNAME=xag182
[oracle@xag182 ~]$ ping -qc3 $(hostname)
PING xag182 (192.168.40.182) 56(84) bytes of data.
--- xag182 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.031/0.076/0.152/0.054 ms
- 添加组、用户及注册表目录
groupadd oinstall
useradd -g oinstall -d /home/timesten timesten
passwd timesten
mkdir -p /u01/setup2
mkdir -p /u01/timesten/data
mkdir -p /u01/timesten/log
mkdir -p /u01/timesten/tt181/network/admin
chown -R timesten:oinstall /u01/setup2/
chmod -R 775 /u01/setup2/
chown -R timesten:oinstall /u01/timesten/
chmod -R 775 /u01/timesten/
- configure Shared Memory for TimesTen & Modify the memlock settings
[root@xag182 u01]# getconf PAGE_SIZE
4096
#shmmax =物理内存 8G*1024*1024*1024*(0.7~0.8) 大于 PermSize+TempSize+LogBufMB+1+(0.042 * Connections)
#shmall =2097152= 物理内存 8G*1024*1024*1024/4096 小于或等于物理RAM的总量
kernel.shmmax = 6442450944 # 1024 * 1024 * 1024 * 6 =6442450944
kernel.shmall = 2097152 # 1024 * 1024 * 1024 * 7/4096= 1835008
cat /etc/security/limits.conf
...
timesten soft memlock 6291456 # =kernel.shmmax /1024
timesten hard memlock 6291456 #同上
- 配置 kernel.sem
SEMMSL :Maximum number of semaphores per set
每个信号对象集的最大信号对象数[20K connections + some extras];
SEMMNS :Maximum number of semaphores system-wide
系统范围内最大信号对象数;
SEMOPM :Maximum number of operations per set
每个信号对象支持的最大操作数;
SEMMNI :Maximum number of semaphore identifiers
系统范围内最大信号对象集数。
其中 SEMMNS的值等于 SEMMSL*SEMMNI。
kernel.sem = 4000 10240000 2000 2560
要支持最多3,845个连接,请将semmsl值设置为4,000(155 + 3,845)。
semmns将中的第二个值更改kernel.sem为10240000。
- Configure HugePages
[timesten@xag182 u01]$ id
uid=1002(timesten) gid=1000(oinstall) groups=1000(oinstall)
#In this case, the GID is 1000
# 查询 HugePages size
[timesten@xag182 u01]$ cat /proc/meminfo | grep Hugepagesize
Hugepagesize: 2048 kB
The number of HugePages = shmmax [in MB] / page size [in MB].
eg, for a small DEV machine with 8 GB RAM:
shmmax = 6 GB = 6,144 MB
6,144 / 2 = 3,072 pages
Add the following to the /etc/systcl.conf file:
vm.nr_hugepages=3072
vm.hugetlb_shm_group = 1000
- 参数sysctl.conf
[root@xag182 u01]# cat /etc/sysctl.conf (新加如下配置项)
#TimesTen相关配置
kernel.shmmax = 6442450944
kernel.shmall = 2097152
kernel.sem = 4000 10240000 2000 2560
vm.nr_hugepages=3072
vm.hugetlb_shm_group = 1000
[root@xag182 u01]# sysctl -p
[root@xag182 u01]# cat /proc/meminfo|grep HugePages
AnonHugePages: 761856 kB
HugePages_Total: 3072
HugePages_Free: 3072
HugePages_Rsvd: 0
HugePages_Surp: 0
7.下载并解压
[timesten@xag182 setup2]$ pwd
/u01/setup2
[timesten@xag182 setup2]$ ll
total 408744
-rw-r--r-- 1 timesten oinstall 418551934 Feb 19 20:48 timesten181320.server.linux8664.zip
[timesten@xag182 setup2]$ unzip timesten181320.server.linux8664.zip
[timesten@xag182 setup2]$ ls
timesten181320.server.linux8664.zip tt18.1.3.2.0
[timesten@xag182 setup2]$ cd tt18.1.3.2.0/
[timesten@xag182 tt18.1.3.2.0]$ ls
3rdparty bin grid include info lib network nls oraclescripts PERL plsql README.html startup support ttoracle_home
[timesten@xag182 tt18.1.3.2.0]$ cd bin
#验证安装:
[timesten@xag182 bin]$ ./ttInstallationCheck
This installation has been verified.
创建classic实例
[timesten@xag182 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 ]
Instance name will be 'tt181'.
Is this correct? [ yes ]
Where would you like to install the tt181 instance of TimesTen? [ /home/timesten ] /u01/timesten
Creating instance in /u01/timesten/tt181 ...
INFO: Mapping files from the installation to /u01/timesten/tt181/install
NOTE: If you are configuring TimesTen for use with Oracle Clusterware, the
daemon port number must be the same across all TimesTen installations
managed within the same Oracle Clusterware cluster.
NOTE: All installations that replicate to each other must use the same daemon
port number that is set at installation time. The daemon port number can
be 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)? [ ] /u01/timesten/tt181/network/admin
TNS_ADMIN will be set to /u01/timesten/tt181/network/admin
You can change TNS_ADMIN later by running <install_dir>/bin/ttInstanceModify.
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 :
'/u01/timesten/tt181/startup/tt_tt181'
Run the 'setuproot' script :
/u01/timesten/tt181/bin/setuproot -install
This will move the TimesTen startup script into its appropriate location.
The 18.1 Release Notes are located here :
'/u01/setup2/tt18.1.3.2.0/README.html'
Starting the daemon ...
TimesTen Daemon (PID: 109314, port: 6624) startup OK.
- 环境变量设置
[timesten@XAG816 ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
#TIMESTEN_HOME=/u01/timesten/tt181; export TIMESTEN_HOME
#PATH=$PATH:$TIMESTEN_HOME/bin;export PATH
. /u01/timesten/tt181/bin/ttenv.sh
[timesten@xag182 ~]$ source .bash_profile
- 验证
[timesten@xag182 ~]$ ttversion
TimesTen Release 18.1.3.2.0 (64 bit Linux/x86_64) (tt181:6624) 2020-01-15T20:57:22Z
Instance admin: timesten
Instance home directory: /u01/timesten/tt181
Group owner: oinstall
Daemon home directory: /u01/timesten/tt181/info
PL/SQL enabled.
[timesten@xag182 ~]$ cat $TIMESTEN_HOME/conf/timesten.conf
# TimesTen Instance Configuration File
# Created by ttInstanceCreate
# Commented values are default values
hostname=xag182
timesten_release=18.1.3
instance_name=tt181
daemon_port=6624
server_port=6625
tns_admin=/u01/timesten/tt181/network/admin
admin_user=timesten
admin_uid=1002
group_name=oinstall
instance_guid=C57F4A26-4EA1-4322-A469-4B6B01484D2A
verbose=1
- 为日志文件记录添加日期
vim $TIMESTEN_HOME/conf/timesten.conf
#添加以下行
show_date=1
#重启Daemon生效
[timesten@xag182 ~]$ ttdaemonadmin -restart
TimesTen Daemon (PID: 109314, port: 6624) stopped.
TimesTen Daemon (PID: 110106, port: 6624) startup OK.
#查看日志
[timesten@xag182 ~]$ tail $TIMESTEN_HOME/diag/ttmesg.log
2019-02-19 21:20:43.138 Info: : 110106: daemon got #7.7, hello: pid=110110 type=subdaemon payload=%0cM%00%00 protocolID=TimesTen 18.1.3.2.0.tt181 ident=@B%0f%00 isSbSocket=y tid=110118
2019-02-19 21:20:43.138 Info: : 110106: Got hello from pid 110110, type subdaemon (/u01/setup2/tt18.1.3.2.0/bin/timestensubd -verbose -id 1000000 -facility user -showdate )
2019-02-19 21:20:43.138 Info: : 110106: mark process up: index 1000000, port 19724, pid 110110
2019-02-19 21:20:43.138 Info: : 110106: marking subdaemon #1000000 (pid 110110) idle
2019-02-19 21:20:43.156 Info: : 110106: daemon done with request #7.7
2019-02-19 21:20:43.157 Info: : 110110: subd: connectToDaemon(sub) port 19724 id 1000000
2019-02-19 21:20:52.923 Info: : 110106: << Date : Tue Feb 19 21:20:52 2019, TimeStampInSecondsSince1970 1550582452 daemon port 6624 >>
12.设置实例开机自动启动 (root用户下运行)
[root@xag182 timesten]# cd /u01/timesten/tt181/bin
[root@xag182 bin]# pwd
/u01/timesten/tt181/bin
[root@xag182 bin]# ./setuproot -install -force
Copying /u01/timesten/tt181/startup/tt_tt181 to /etc/init.d/tt_tt181
Successfully 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
- 重启机器验证实例已自动启动:
[timesten@xag182 ~]$ ttstatus
TimesTen status report as of Mon Feb 17 01:33:21 2020
Daemon pid 1178 port 6624 instance tt181
TimesTen server pid 1196 started on port 6625
------------------------------------------------------------------------
------------------------------------------------------------------------
Accessible by group oinstall
End of report
[timesten@xag182 conf]$ ps -ef | grep timestend
timesten 1178 1 0 01:33 ? 00:00:01 /u01/timesten/tt181/install/bin/timestend -initfd 13 -minsubs 2 -boot
timesten 2345 1510 0 01:48 pts/1 00:00:00 grep --color=auto timestend
- 创建数据库
[timesten@xag182 ~]$ cd $TIMESTEN_HOME/conf
[timesten@xag182 conf]$ vim sys.odbc.ini (在对应节点下加如下内容)
--------------------------------------------------------------
[ODBC Data Sources]
TTDB=TimesTen 18.1 Driver
[TTDB]
Driver=/u01/timesten/tt181/install/lib/libtten.so
DataStore=/u01/timesten/data/ttdb
LogDir=/u01/timesten/log
PermSize=512
TempSize=64
LogBufMB=256
LogBufParallelism=8
DatabaseCharacterSet=AL32UTF8
ConnectionCharacterSet=AL32UTF8
----------------------------------------------------------------------
15 . 连接数据库
[timesten@xag182 conf]$ ttisql ttdb
Copyright (c) 1996, 2020, 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=timesten;DataStore=/u01/timesten/data/ttdb;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;DRIVER=/u01/timesten/tt181/install/lib/libtten.so;LogBufMB=256;LogBufParallelism=8;LogDir=/u01/timesten/log;PermSize=512;TempSize=64;
(Default setting AutoCommit=1)
Command>
Command> dssize
The following values are in MB:
PERM_ALLOCATED_SIZE: 512
PERM_IN_USE_SIZE: 13.979
PERM_IN_USE_HIGH_WATER: 14.071
TEMP_ALLOCATED_SIZE: 64
TEMP_IN_USE_SIZE: 17.915
TEMP_IN_USE_HIGH_WATER: 23.949
Command> exit
Disconnecting...
Done.
[timesten@xag182 conf]$ ttadmin -query ttdb
RAM Residence Policy : inUse
Replication Agent Policy : manual
Replication Manually Started : False
Cache Agent Policy : manual
Cache Agent Manually Started : False
Database State : Open
网友评论