美文网首页
TimesTen 11.2.2安装

TimesTen 11.2.2安装

作者: 轻飘飘D | 来源:发表于2020-02-03 16:09 被阅读0次

1.主机名检查

[root@XAG816 ~]# hostname
XAG816.COM

[root@XAG816 ~]# ping -qc3 $(hostname)
PING XAG816 (192.168.40.8) 56(84) bytes of data.

--- XAG816 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.023/0.036/0.045/0.012 ms
  1. 添加组、用户及注册表目录
[root@XAG816 ~]# groupadd oinstall

[root@XAG816 ~]# useradd -g oinstall -d /home/timesten timesten

[root@XAG816 ~]# passwd timesten

[root@XAG816 ~]# mkdir /etc/TimesTen

[root@XAG816 ~]# chmod 775 /etc/TimesTen

[root@XAG816 ~]# chgrp oinstall /etc/TimesTen
  1. configure Shared Memory for TimesTen & Modify the memlock settings
[root@XAG816 ~]# 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  #同上

4.配置 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。
  1. Configure HugePages
[timesten@XAG816 root]$ id
uid=1001(timesten) gid=1001(oinstall) groups=1001(oinstall)
#In this case, the GID is 1001
# 查询 HugePages size

[timesten@XAG816 root]$ 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 = 1001
  1. 参数sysctl.conf
[root@XAG816 ~]# 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 = 1001
[root@XAG816 ~]# sysctl -p

[root@XAG816 ~]# cat /proc/meminfo|grep HugePages
AnonHugePages:    761856 kB
HugePages_Total:    3072
HugePages_Free:     3072
HugePages_Rsvd:        0
HugePages_Surp:        0

待定配置

4.复制
1).配置网络参数
针对复制,TCP发送和接收buffers应该增加到4MB,在/etc/sysctl.conf文件加入以下行:
net.ipv4.tcp_rmem=4096 4194304 4194304
net.ipv4.tcp_wmem=98304 4194304 4194304
net.core.rmem_default=65535
net.core.wmem_default=65535
net.core.rmem_max=4194304
net.core.wmem_max=4194304
net.ipv4.tcp_window_scaling=1

5.IMDB Cache
1).配置网络参数
针对IMDB Cache,TCP发送和接收buffers应该增加得更大,修改/etc/sysctl.conf文件添加以下行:
net.ipv4.tcp_rmem=4096 4194304 4194304
net.ipv4.tcp_wmem=98304 4194304 4194304
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=4194304
net.ipv4.tcp_window_scaling=1
net.ipv4.ip_local_port_range=1024 65000

7.下载并解压

[timesten@XAG816 setup]$ pwd
/home/timesten/setup
[timesten@XAG816 setup]$ ls
p30652212_1122_Linux-x86-64.zip

[timesten@XAG816 setup]$ unzip p30652212_1122_Linux-x86-64.zip

[timesten@XAG816 setup]$ ls
linux8664  p30652212_1122_Linux-x86-64.zip  README.html
  1. 运行安装脚本
[timesten@XAG816 setup]$ cd linux8664/
[timesten@XAG816 linux8664]$ ls
3rdparty  doc  install.pl  LINUX8664  README.html  setup.sh  uninst.sh

[timesten@XAG816 linux8664]$ ./setup.sh 

NOTE: Each TimesTen installation is identified by a unique instance name.
      The instance name must be a non-null alphanumeric string, not longer
      than 255 characters.

Please choose an instance name for this installation? [ tt1122 ] 
Instance name will be 'tt1122'.
Is this correct? [ yes ] yes

Of the three components:

  [1] Client/Server and Data Manager
  [2] Data Manager Only
  [3] Client Only

Which would you like to install? [ 1 ] 

Of the following options :

  [1] /home/timesten
  [2] /home/timesten/setup
  [3] Specify a location
  [q] Quit the installation

Where would you like to install the tt1122 instance of TimesTen? [ 1 ] 
Where would you like to create the daemon home directory? [ /home/timesten/TimesTen/tt1122/info ] 

The daemon logs will be located in /home/timesten/TimesTen/tt1122/info
Would you like to specify a different location for the daemon logs? [ no ] 
Installing into /home/timesten/TimesTen/tt1122 ...
Uncompressing ...

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 53396.

Do you want to use the default port number for the TimesTen daemon? [ yes ] yes
The daemon will run on the default port number (53396).

NOTE: For security, we recommend that you restrict access to the
      TimesTen installation to members of a single OS group. Only members of
      that OS group will be allowed to perform direct mode connections to
      TimesTen, and only members of that OS group will be allowed to perform
      operations that access TimesTen data stores, TimesTen files and shared
      memory. The OS group defaults to the primary group of the instance
      administrator. You can default to this group, choose another OS group
      or you can make this instance world-accessible. If you choose to make
      this instance world-accessible, all database files and shared memory
      are readable and writable by all users.

Restrict access to the the TimesTen installation to the group 'oinstall'? [ yes ] yes

NOTE: Enabling PL/SQL will increase the size of some TimesTen libraries.

Would you like to enable PL/SQL for this instance? [ yes ] yes

In order to use the 'Oracle 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/ttModInstall.

Please enter a value for TNS_ADMIN (s=skip)? [  ] /home/timesten/TimesTen/tt1122/network/admin

TNS_ADMIN will be set to /home/timesten/TimesTen/tt1122/network/admin
You can change TNS_ADMIN later by running <install_dir>/bin/ttmodinstall.

NOTE: It appears that you are running version 4 or higher of the g++
      compiler. TimesTen ships with multiple sets of client libraries and server
      binaries : one built for compatibility with g++ 3.4.6 and one with
      g++ 4.1.0. The installer has created links to the 4.1.0 library in the
      <install_dir>/lib directory and to the 4.1.0 server binary in the
      <install_dir>/bin directory. If you want to use a different compiler,
      please modify the links to point to the desired library and server binary.

Installing server components ...
What is the TCP/IP port number that you want the TimesTen Server to listen on? [ 53397 ] 
Do you want to install the Quick Start Sample Programs and the TimesTen Documentation? [ no ] yes
Where would you like to install the Quick Start and doc directories (s=skip)? [ /home/timesten/TimesTen/tt1122 ] 
The TimesTen documentation has been installed in /home/timesten/TimesTen/tt1122.

The TimesTen Quick Start applications can take up to 64 Mbytes of disk space.
Depending on how your system is configured, you may not want to create the
Quick Start DemoDataStore directory in the default location,
/home/timesten/TimesTen/tt1122/info/DemoDataStore

Where would you like to create the DemoDataStore directory? [ /home/timesten/TimesTen/tt1122/info ] 
Creating /home/timesten/TimesTen/tt1122/info/DemoDataStore ...

Installing client components ...

Would you like to use TimesTen Replication with Oracle Clusterware? [ no ] 

NOTE: The TimesTen daemon startup/shutdown scripts have not been installed.

Run the 'setuproot' script :
    cd /home/timesten/TimesTen/tt1122/bin
    ./setuproot -install
This will move the TimesTen startup script into its appropriate location.

The startup script is currently located here :
  '/home/timesten/TimesTen/tt1122/startup/tt_tt1122'.

The Quickstart home page can be accessed here :
  '/home/timesten/TimesTen/tt1122/quickstart/index.html'

The 11.2.2.8 Release Notes are located here :
  '/home/timesten/TimesTen/tt1122/README.html'

Starting the daemon ...
TimesTen Daemon startup OK.
End of TimesTen installation.
[timesten@XAG816 linux8664]$ 

  1. 查看安装日志
[timesten@XAG816 bin]$ cat /home/timesten/TimesTen/tt1122/info/.install_log 
Please choose an instance name for this installation:tt1122
Is this correct1:y
Which would you like to install:1
Where would you like to install the tt1122 instance of TimesTen:/home/timesten
Where would you like to create the daemon home directory:/home/timesten/TimesTen/tt1122/info
Would you like to specify a different location for the daemon logs:n
Do you want to use the default port number for the TimesTen daemon:y
Restrict access to the the TimesTen installation to the group 'oinstall':y
Would you like to enable PL/SQL for this instance:y
Please enter a value for TNS_ADMIN (s=skip):/home/timesten/TimesTen/tt1122/network/admin
What is the TCP/IP port number that you want the TimesTen Server to listen on:53397
Do you want to install the Quick Start Sample Programs and the TimesTen Documentation:y
Where would you like to install the Quick Start and doc directories (s=skip):/home/timesten/TimesTen/tt1122
Where would you like to create the DemoDataStore directory:/home/timesten/TimesTen/tt1122/info
Would you like to use TimesTen Replication with Oracle Clusterware:n
  1. 配置环境变量
[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

TT_HOME=/home/timesten/TimesTen/tt1122; export TT_HOME
. $TT_HOME/bin/ttenv.sh
  1. 设置TimesTen开关机自动启动停止
[root@XAG816 ~]# cd /home/timesten/TimesTen/tt1122/bin
[root@XAG816 bin]# pwd
/home/timesten/TimesTen/tt1122/bin

[root@XAG816 bin]# ./setuproot -install
Would you like to install the TimesTen daemon startup scripts into /etc/init.d? [ yes ] yes
  1. 验证安装
[timesten@XAG816 ~]$ echo $TT_HOME
/home/timesten/TimesTen/tt1122

[timesten@XAG816 ~]$ ttstatus
TimesTen status report as of Mon Feb  3 15:32:15 2020

Daemon pid 6388 port 53396 instance tt1122
TimesTen server pid 6397 started on port 53397
------------------------------------------------------------------------
Accessible by group oinstall
End of report

[timesten@XAG816 ~]$ ttversion
TimesTen Release 11.2.2.8.47 (64 bit Linux/x86_64) (tt1122:53396) 2019-12-11T17:08:44Z
  Instance admin: timesten
  Instance home directory: /home/timesten/TimesTen/tt1122
  Group owner: oinstall
  Daemon home directory: /home/timesten/TimesTen/tt1122/info
  PL/SQL enabled.
  1. 最后查看注册表中的文件信息
[timesten@XAG816 ~]$ cat /etc/TimesTen/instance_info 
#SUM 28094     1
[ tt1122 ]
Product=TimesTen11.2.2.8
InstallDir=/home/timesten/TimesTen/tt1122
InstanceAdministrator=timesten
DaemonHome=/home/timesten/TimesTen/tt1122/info
BitLevel=64
Component=Client/Server and DataManager
TT_PORT=53396

二.创建第一个TimesTen数据库
1.查看示例数据库 sampledb_1122 的定义

[timesten@XAG816 info]$ sed -n '/\[sampledb_1122\]/,/^$/p' sys.odbc.ini 
[sampledb_1122]
Driver=/home/timesten/TimesTen/tt1122/lib/libtten.so
DataStore=/home/timesten/TimesTen/tt1122/info/DemoDataStore/sampledb_1122
PermSize=40
TempSize=32
PLSQL=1
DatabaseCharacterSet=US7ASCII

2 使用ttIsql 连接数据库(初次连接会自动创建数据库)

[timesten@XAG816 ~]$ ttisql sampledb_1122

Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.

connect "DSN=sampledb_1122";
Connection successful: DSN=sampledb_1122;UID=timesten;DataStore=/home/timesten/TimesTen/tt1122/info/DemoDataStore/sampledb_1122;
DatabaseCharacterSet=US7ASCII;ConnectionCharacterSet=US7ASCII;DRIVER=/home/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=40;
TempSize=32;TypeMode=0;
(Default setting AutoCommit=1)

Command> call ttversion;
< 11, 2, 2, 8, 47 >
1 row found.

Command> select sysdate from dual;
< 2020-02-03 15:45:31 >
1 row found.
Command> exit
Disconnecting...
Done.

三. 创建用户及加载数据

[timesten@XAG816 ~]$ cd $TT_HOME/quickstart/sample_scripts/hrschema
[timesten@XAG816 hrschema]$ pwd
/home/timesten/TimesTen/tt1122/quickstart/sample_scripts/hrschema
[timesten@XAG816 hrschema]$ ls
hr_cre_tt.sql  hr_idx_tt.sql  hr_popul_tt.sql  README.TXT

[timesten@XAG816 hrschema]$ ttisql -v1 sampledb_1122

Command> create user ttuser identified by timesten;

Command> grant create session,create table,create view,create sequence to ttuser;

Command> disconnect;

Command> connect "DSN = sampledb_1122;uid = ttuser;pwd = timesten";
Command> run hr_cre_tt.sql
Command> run hr_idx_tt.sql
Command> run hr_popul_tt.sql
Command> tables
  TTUSER.COUNTRIES
  TTUSER.DEPARTMENTS
  TTUSER.EMPLOYEES
  TTUSER.JOBS
  TTUSER.JOB_HISTORY
  TTUSER.LOCATIONS
  TTUSER.REGIONS

Command> select count(*) from countries;
< 25 >
Command> exit


#连接数据库
[timesten@XAG816 hrschema]$ ttisql "DSN = sampledb_1122;uid = ttuser;pwd = timesten";

Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.

connect "DSN=sampledb_1122;uid=ttuser;pwd=********";
Connection successful: DSN=sampledb_1122;UID=ttuser;DataStore=/home/timesten/TimesTen/tt1122/info/DemoDataStore/sampledb_1122;DatabaseCharacterSet=US7ASCII;ConnectionCharacterSet=US7ASCII;DRIVER=/home/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=40;TempSize=32;TypeMode=0;
(Default setting AutoCommit=1)

Command> tables
  TTUSER.COUNTRIES
  TTUSER.DEPARTMENTS
  TTUSER.EMPLOYEES
  TTUSER.JOBS
  TTUSER.JOB_HISTORY
  TTUSER.LOCATIONS
  TTUSER.REGIONS
7 tables found.

Command> select * from countries;
< AR, Argentina, 2 >
< AU, Australia, 3 >
< BE, Belgium, 1 >
< BR, Brazil, 2 >
< CA, Canada, 2 >
< CH, Switzerland, 1 >
< CN, China, 3 >
< DE, Germany, 1 >
< DK, Denmark, 1 >
< EG, Egypt, 4 >
< FR, France, 1 >
< HK, HongKong, 3 >
< IL, Israel, 4 >
< IN, India, 3 >
< IT, Italy, 1 >
< JP, Japan, 3 >
< KW, Kuwait, 4 >
< MX, Mexico, 2 >
< NG, Nigeria, 4 >
< NL, Netherlands, 1 >
< SG, Singapore, 3 >
< UK, United Kingdom, 1 >
< US, United States of America, 2 >
< ZM, Zambia, 4 >
< ZW, Zimbabwe, 4 >
25 rows found.

shmmax 参考值如下:

image.png

相关文章

网友评论

      本文标题:TimesTen 11.2.2安装

      本文链接:https://www.haomeiwen.com/subject/phlhxhtx.html