Front page   Edit Freeze Diff Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes


Last-modified: Sat, 29 Jan 2011 15:27:49 JST (4322d)
Top > 技術文書 > Oracle > TimesTen > CentOS5.5(64bit)にTimesTen11gをインストール

Oracle TimesTen In-Memory Databaseインストレーション・ガイド リリース11.2.1 を見ながらインストールしていきます。

環境 EditEdit(GUI)

  • VMware Player 2.5.4 for Linux
  • CentOS 5.5 (64bit)
  • Oracle TimesTen 11g

インメモリDBなので、メモリは多めに取りましょう。 ここでは仮想マシンには4GB確保しました。 1GBくらいでも簡単な検証なら大丈夫です。

OSの設定 EditEdit(GUI)

/etc/sysctl.conf でメモリの設定をします。 下記のように追記しました。

# for TimesTen 11g
net.ipv4.tcp_rmem=4096 4194304 4194304
net.ipv4.tcp_wmem=98304 4194304 4194304
net.ipv4.ip_local_port_range="1024 65000"


[root@ora1 ~]# sysctl -p

ユーザの設定 EditEdit(GUI)

ttadmin グループと timesten ユーザを作成します。

[root@ora1 ~]# groupadd ttadmin
[root@ora1 ~]# adduser timesten -g ttadmin
[root@ora1 ~]# id timesten
uid=501(timesten) gid=503(ttadmin) 所属グループ=503(ttadmin)
[root@ora1 ~]# passwd timesten
Changing password for user timesten.
New UNIX password:

インスタンス・レジストリの作成 EditEdit(GUI)

[root@ora1 ~]# mkdir /etc/TimesTen
[root@ora1 ~]# chgrp -R ttadmin /etc/TimesTen
[root@ora1 ~]# chmod 770 /etc/TimesTen/

ソフトウェアの展開とインストール EditEdit(GUI)

timestenユーザにてインストールを進めていきます。 まず tar で展開します。

[timesten@ora1 ~]$ tar xvpfz timesten112161.linux8664.tar.gz
[timesten@ora1 ~]$ を実行します。 いろいろ聞かれますが、ほとんどそのまま Enter で通しました。

[timesten@ora1 ~]$ cd linux8664/
[timesten@ora1 linux8664]$ ./ 

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? [ tt1121 ] 
Instance name will be 'tt1121'.
Is this correct? [ 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/linux8664
  [3] Specify a location
  [q] Quit the installation

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

The daemon logs will be located in /home/timesten/TimesTen/tt1121/info
Would you like to specify a different location for the daemon logs? [ no ] 
Installing into /home/timesten/TimesTen/tt1121 ...
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 53388.

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

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 'ttadmin'? [ yes ] 

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

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

In order to use the 'In-Memory 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)? [  ] s

NOTE: It appears that you are running version 4.1 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? [ 53389 ] 
Do you want to install QuickStart and the TimesTen Documentation? [ no ] yes
Where would you like to install the quickstart and doc directories (s=skip)? [ /home/timesten/TimesTen/tt1121 ] 

The TimesTen Quickstart applications can take up to 64 Mbytes of disk space.
Depending on how your system is configured, you may not want to create the
QuickStart DemoDataStore directory in the default location,

Where would you like to create the DemoDataStore directory? [ /home/timesten/TimesTen/tt1121/info ] 
Creating /home/timesten/TimesTen/tt1121/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/tt1121/bin
        ./setuproot -install
This will move the TimesTen startup script into its appropriate location.

The startup script is currently located here :

The Quickstart home page can be accessed here :

The Release Notes are located here :

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


  • インスタンス名
  • インストールするコンポーネント
  • インストール先
  • ポート番号
  • グループによるアクセス制限
  • PL/SQL を有効にするか
  • In-Memory Database Cache 用の TNS_ADMIN
    • 必要に応じて後で設定してもいいのでここでは skip
  • デモ用データストアを入れるか
  • Oracle Clusterware を使うか

使ってみる EditEdit(GUI)


環境変数の設定は TimesTen/tt1121/bin/ で行います。 あらかじめ ~/.bash_profile で読むようにしてもいいですね。

[timesten@ora1 ~]$ . TimesTen/tt1121/bin/

接続情報は TimesTen/tt1121/info/sys.odbc.ini に書いてあります。 ここでは sampledb_1121 に接続してみました。 表示は改行してあります。

[timesten@ora1 ~]$ ttisql sampledb_1121

Copyright (c) 1996-2010, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.

connect "DSN=sampledb_1121";
Connection successful: DSN=sampledb_1121;UID=timesten;
(Default setting AutoCommit=1)
Command> tables;
0 tables found.


Command> create table sample (id number(10), data varchar2(1000));
Command> insert into sample values (1, 'abcdefg');
1 row inserted.
Command> insert into sample values (2, 'hijklmn');
1 row inserted.
Command> insert into sample values (3, 'opqrstu');
1 row inserted.
Command> insert into sample values (4, 'vwxyz');
1 row inserted.
Command> select * from sample;
< 1, abcdefg >
< 2, hijklmn >
< 3, opqrstu >
< 4, vwxyz >
4 rows found.

set timing on とすると時間も計測できます。

Command> select * from sample where id = 3;
< 3, opqrstu >
1 row found.
Execution time (SQLExecute + Fetch Loop) = 0.000041 seconds.

41マイクロ秒でした。 マイクロ秒単位でのレスポンスが返ってくるのがTimesTenのいいところです。 ちゃんとメモリ上に載れば、たとえ5000万件あってもこれくらいで返ってきます。

起動と終了 EditEdit(GUI)

ttDaemonAdmin で起動と終了を行います。 確認は ttStatus です。

起動 EditEdit(GUI)

[timesten@ora1 ~]$ ttDaemonAdmin -start
TimesTen Daemon startup OK.
[timesten@ora1 ~]$ ttStatus
TimesTen status report as of Sun Aug 22 11:57:14 2010

Daemon pid 7100 port 53388 instance tt1121
TimesTen server pid 7120 started on port 53389
Data store /home/timesten/TimesTen/tt1121/info/DemoDataStore/sampledb_1121
There are no connections to the data store
Replication policy  : Manual
Cache Agent policy  : Manual
PL/SQL enabled.
Accessible by group ttadmin
End of report
[timesten@ora1 ~]$ 

終了 EditEdit(GUI)

[timesten@ora1 ~]$ ttDaemonAdmin -stop
TimesTen Daemon stopped.
[timesten@ora1 ~]$ ttStatus
ttStatus: Could not connect to the TimesTen daemon.
If the TimesTen daemon is not running, please start it
by running "ttDaemonAdmin -start".
[timesten@ora1 ~]$ 

URL B I U SIZE Black Maroon Green Olive Navy Purple Teal Gray Silver Red Lime Yellow Blue Fuchsia Aqua White