Установка Oracle TimesTen, TimesTen Client

Установка TimesTen Server на примере Ubuntu

  • Добавление пользователя для TimesTen
groupadd timesten
groupadd ttadmin
useradd -G ttadmin -g timesten orattadmin

Сама установка

Скачиваем , меняем права и входим под пользователем под которым будем устанавливать. 

# cd /opt/
# mkdir timesten
# wget V1019656-01.zip
# unzip V1019656-01.zip -d timesten/
# chown orattadmin.ttadmin timesten/ -R
# su - orattadmin
su: warning: cannot change directory to /home/orattadmin: No such file or directory
$ bash
# cd timesten/

Проверяем

# ./tt18.1.4.22.0/bin/ttInstallationCheck
This installation has been verified.

Устанавливаем, если вы увидели тоже самое значит все хорошо и мы установили TimesTen

./tt18.1.4.22.0/bin/ttInstanceCreate
cat: '': No such file or directory

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 ] tt2
Instance name will be 'tt2'.
Is this correct? [ yes ] yes
Where would you like to install the tt2 instance of TimesTen? [ /home/orattadmin ] /opt/timesten
Creating instance in /opt/timesten/tt2 ...
INFO: Mapping files from the installation to /opt/timesten/tt2/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 ] 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 :
        '/opt/timesten/tt2/startup/tt_tt2'

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

The 18.1 Release Notes are located here :
  '/opt/timesten/tt18.1.4.22.0/README.html'

Starting the daemon ...
TimesTen Daemon (PID: 1223805, port: 6624) startup OK.

Начинаем настраивать TimesTen и попробуем подключиться

Создаем нужные директории для DATA and LOG

orattadmin@ubuntu:/opt/timesten$ mkdir instance1_data
orattadmin@ubuntu:/opt/timesten$ mkdir instance1_logs

Произведем настройку БД добавив нужный конфиг

vim tt2/conf/sys.odbc.ini
[database1]
DataStore=/opt/timesten/instance1_data/database1
LogDir=/opt/timesten/instance1_logs
DatabaseCharacterSet=AL32UTF8
PermSize=1280
TempSize=640
LogBufMB=1024

Перезапустим TimesTen

orattadmin@ubuntu:/opt/timesten$ ./tt2/bin/ttDaemonAdmin -stop
orattadmin@ubuntu:/opt/timesten$ ./tt2/bin/ttDaemonAdmin -start

Пробуем подключиться, если видим тоже самое значит все отлично

orattadmin@ubuntu:/opt/timesten$ ./tt2/bin/ttIsql database1

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

connect "DSN=database1";
Connection successful: DSN=database1;UID=orattadmin;DataStore=/opt/timesten/instance1_data/database1;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;LogBufMB=1024;LogDir=/opt/timesten/instance1_logs;PermSize=1280;TempSize=640;
(Default setting AutoCommit=1)
Command> 

Создаем нового пользователя и даем много прав(Только для Тестов)

CREATE USER user1 IDENTIFIED BY password;
GRANT ALL PRIVILEGES TO user1;

Попробуем подключиться с Oracle SQLDeveloper

Скачиваем SQLDeveloper и устанавливаем(Там все просто, картинок не будет)

Скачиваем TimesTen Client Windows и устанавливаем.

Запускаем SQL Developer и добавляем соединение

Создадим Таблицу

Добавим в таблицу данные

Проверка соединения с помощью Java ( SELECT из TABLE1)

TTConnect.javal

import com.timesten.jdbc.TimesTenDataSource;
import com.timesten.jdbc.TimesTenConnection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class TTconnect {
 
  public static void main(String[] args) {
    try {
      // create the TimesTen data source and set the connection URL
      TimesTenDataSource ttds = new TimesTenDataSource();
      ttds.setUrl(«jdbc:timesten:client:ttc_server_dsn=database1;ttc_server=172.16.215.4;tcp_port=6625;UID=user1;PWD=password»);
      ttds.setUser(«user1»);
      ttds.setPassword(«passowrd»);
     
      // connect to the TimesTen database
      TimesTenConnection ttcon = (TimesTenConnection) ttds.getConnection();
     
      // create and execute the statement
      Statement stmt = ttcon.createStatement();
      ResultSet rset = stmt.executeQuery(«select * from table1»);
     
      // process the result set
      while(rset.next()) {
        System.out.println(«Value: » + rset.getInt(1));
        System.out.println(«Name: » + rset.getString(2));
      }
    } catch(SQLException e) {
      e.printStackTrace();
    }
  }
}

[свернуть]

Устанавливаем TimesTen Client in Linux

Добавляем пользователя для TimesTen (Смотри сверху)

mkdir –p /opt/TimesTen
chown -R orattadmin:timesten /opt/TimesTen/
su orattadmin

Скачиваем V1019656-01

unzip V1019656-01.zip

Проверяем

/opt/TimesTen/tt18.1.4.22.0$ ./bin/ttInstallationCheck
This installation has been verified.

Устанавливаем

/opt/TimesTen/tt18.1.4.22.0$ ./bin/ttInstanceCreate -clientonly
cat: '': No such file or directory

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 ] t1
Instance name will be 't1'.
Is this correct? [ yes ] yes
Where would you like to install the t1 instance of TimesTen? [ /home/orattadmin ] /opt/TimesTen/client
The directory /opt/TimesTen/client does not exist.
Do you want to create it? [ yes ] yes
Creating instance in /opt/TimesTen/client/t1 ...
INFO: Mapping files from the installation to /opt/TimesTen/client/t1/install

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
The 18.1 Release Notes are located here :
  '/opt/TimesTen/tt18.1.4.22.0/README.html'

Использованные материалы 

Дополнительные материалы

./oracle/client/client/bin/ttIsqlCS -connStr «ttc_server=172.16.215.19;uid=user1;pwd=password;ttc_server_dsn=database1;tcp_port=6625»

select * from database1.andrei;

[database1]
TTC_Server=172.16.215.19
TTC_Server_DSN=database1
TCP_Port=6625

https://www.oracledistilled.com/timesten/installing-the-oracle-timesten-in-memory-database-11g-11-2-1-6-1-client-on-windows/

  • https://oracledistilled.com/timesten/timesten-installation-linux/
  • https://programmersought.com/article/38281157997/
  • https://www.oracledistilled.com/timesten/creating-an-odbc-dsn-for-an-oracle-timesten-database-in-windows/
  • https://www.oracledistilled.com/linux/create-an-odbc-client-dsn-for-an-oracle-timesten-database-on-linux/
  • https://www.oracledistilled.com/timesten/installing-the-oracle-timesten-in-memory-database-11g-11-2-1-6-1-client-on-windows/
  • https://www.oracledistilled.com/java/connect-to-an-oracle-timesten-in-memory-database-using-java-and-jdbc/
  • https://docs.oracle.com/database/sql-developer-17.3/TTSDV/connect.htm#TTSDV114
  • https://docs.oracle.com/database/sql-developer-17.3/TTSDV/connect.htm#TTSDV112

[свернуть]
Дополнительные настройки

2. Set resource limits

# vi /etc/sysctl.conf

kernel.shmmax = 51539607552 —RAM of 90%

kernel.shmall=14680064        -SHMMAX/(4*1024)

# sysctl -p

3. Configure Hugepage

# cat /proc/meminfo | grep Hugepagesize

Hugepagesize:       2048 kB

$ id

uid=55000(instanceadmin) gid=10000(g10000)groups=10000(g10000)

# vi /etc/sysctl.conf

vm.nr_hugepages=24576

vm.hugetlb_shm_group=10000

# sysctl -p

Restart the server

# cat /proc/meminfo|grep Huge

# vi /etc/security/limits.conf

instanceadmin soft memlock 50331648 — to set SHMMAX

instanceadmin  hard   memlock  50331648

4. Configuration semaphores

Signal should be greater than the maximum number of connections to the database. Database connection consists of:

Users connected: established by user applications
System Connection: established internally by TimesTen (set at 48 connections)
Other: Other required connections (set at 107 connections)

Each connection is assigned a semaphore, it can be calculated by the amount of signals required for the following:

Total semaphores = N + 155 (N is the number of user connections)

Thus sysctl.conf in the kernel.sem SEMMSL should be set to N + 155

Is assumed here that the number of user connections 3845, 4000 of the SEMMSL

# vi /etc/sysctl.conf

kernel.sem = 4000 400000 2000 2560

# sysctl -p

[свернуть]

Добавить комментарий 0