欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Timesten安装

程序员文章站 2022-07-05 23:23:01
...

Timesten安装

俩边防火墙一定要关闭

一 安装部分

  1. vi /etc//etc/redhat-release

Red Hat Enterprise Linux Server release 4.0 (Santiago)

  1. vi /etc/sysctl.conf
    kernel.sem = 250 32000 100 128

/sbin/sysctl -w net.ipv4.tcp_rmem=“4096 4194304 4194304”
/sbin/sysctl -w net.ipv4.tcp_wmem=“98304 4194304 4194304”
/sbin/sysctl -w net.ipv4.tcp_mem=“98304 4194304 4194304”
/sbin/sysctl -w net.core.rmem_default=65535
/sbin/sysctl -w net.core.wmem_default=65535
/sbin/sysctl -w net.core.rmem_max=4194304
/sbin/sysctl -w net.core.wmem_max=4194304
/sbin/sysctl -w net.ipv4.tcp_window_scaling=1

  1. install-package

    compat-libstdc++
    unixODBC-devel
    libaio-devel
    or
    libXp-devel

  2. 创建 tt 用户
    [[email protected] ~]# useradd ttadmin -g oinstall -G dba
    [[email protected] ~]# passwd ttadmin

5) 创建tt 目录
root 执行
mkdir /etc/TimesTen
chown ttadmin:oinstall /etc/TimesTen
mkdir /u01/tt
chown ttadmin:oinstall /u01/tt -R

  1. 拷贝 tt 安装文件到 /home/ttadmin 用户下

    [email protected] timesten]# mv timesten112180.linux8664.tar.gz /home/ttadmin

7)授权
[[email protected] timesten]# chown ttadmin:oinstall /home/ttadmin/timesten112180.linux8664.tar.gz

8)解压 包

[[email protected] ~]$ tar -zxvf  timesten112180.linux8664.tar.gz 

9) 进入到解压出的目录

[[email protected] ~]$ cd linux8664/

  1. install tt
    ./setup.sh

  2. Please choose an instance name for this installation? [ tt1121 ]
    敲击回车

    Please choose an instance name for this installation? [ tt1121 ]
    Instance name will be ‘tt1121’.
    Is this correct? [ yes ] yes

12)

[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/ttadmin
[2] /home/ttadmin
[3] Specify a location
[q] Quit the installation

Where would you like to install the tt1121 instance of TimesTen? [ 1 ] /u01/tt
/u01/tt not writable.
Where would you like to create the daemon home directory? [ /u01/tt/TimesTen/tt1121/info ]

The daemon logs will be located in /u01/tt/TimesTen/tt1121/info
Would you like to specify a different location for the daemon logs? [ no ]
Installing into /u01/tt/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 ]
敲击回车

14)
Restrict access to the the TimesTen installation to the group ‘oinstall’? [ yes ]
敲击回车

15) Would you like to enable PL/SQL for this instance? [ yes ]
   敲击回车

  1. Please enter a value for TNS_ADMIN (s=skip)? [ ] /u01/tt/TimesTen/tt1121/network/admin

    输入 /u01/tt/TimesTen/tt1121/network/admin

  2. What is the TCP/IP port number that you want the TimesTen Server to listen on? [ 53389 ]
    敲击回车

  3. 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
    19) 其他的一路回车

  4. 安装成功之后显示如下
    Starting the daemon …
    TimesTen Daemon startup OK.
    End of TimesTen installation.

21)
可以通过命令来确定TimesTen是否已经启动。
[[email protected] ~]# ps -ef|grep timesten
或tt安装用户下
[[email protected] ~]# su - ttadmin
[[email protected] ~]$ ttstatus

如果重启系统后需要手工或自动启动则如下处理
[[email protected] ~]# su - ttadmin
[[email protected] ~]$ ttdaemonadmin -h 可以看到操作参数
[[email protected] ~]$ ttdaemonadmin -start 手工启动
[[email protected] ~]$ ttdaemonadmin -stop 手工停止
22) tt自动启动配置
root下
[[email protected] ~]# cd <$TT_HOME>/bin
[[email protected] ~]# ./setuproot -install
按照提示即可完成自动启动配置

23) 编辑ttadmin .bash_profile

 export  TT_HOME=/u01/tt/TimesTen/tt1121
 export  PATH=$PATH:$HOME/bin:$TT_HOME/bin

 source .bash_profile
  1. 3.6 卸载
    卸载:
    $TT_HOME/bin/ttdaemonadmin -stop
    $TT_HOME/bin/setup.sh -uninstall
    或手工删除
    rm -rf $TT_HOME
    vi /etc/TimesTen/instance_info
    去掉需要删除的实例部分配置即可或直接删除/etc/TimesTen目录

  1. [[email protected] ~]$ cd $TT_HOME/info
    vi sys.odbc.ini

[tt]
Driver=/u01/tt/TimesTen/tt1121/lib/libtten.so
DataStore=/u01/tt/TimesTen/tt1121/info/tt
PermSize=40
TempSize=32
Overwrite=0
PLSQL=1
DatabaseCharacterSet=AL32UTF8
PLSQL_TIMEOUT=0
Connections=30
ConnectionCharacterSet=AL32UTF8
PermSize=800
RecoveryThreads=8
TempSize=200
Preallocate=0
LogFileSize=512
CkptFrequency=600
LogBufMB=50
OraclenetServiceName=orcl
注意这里的网络连接服务名orcl必须在tnsnames.ora定义的

  1. 配置网络

cd $TT_HOME/network/admin
vi tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.140.61)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rac)
)
)

2) 检测 tt store 是否安装成功

[[email protected] info]$ ttisql tt

 connect "DSN=tt";
 Connection successful: DSN=tt;UID=ttadmin;DataStore=/u01/tt/TimesTen/tt1121/info/tt;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;LogFileSize=512;DRIVER=/u01/tt/TimesTen/tt1121/lib/libtten.so;PermSize=40;TempSize=32;Connections=30;CkptFrequency=600;RecoveryThreads=8;TypeMode=0;PLSQL_TIMEOUT=0;OracleNetServiceName=orcl;LogBufMB=50;
 (Default setting AutoCommit=1)
 如上表示成功 

oracle
3) 权限问题
3.1 注意是在安装tt 那边的oracle 用户 拷贝文件
[[email protected] ~]$ cd /u01/tt/TimesTen/tt1121/oraclescripts
scp grantCacheAdminPrivileges.sql initCacheGlobalSchema.sql 172.16.140.61:/home/oracle
3.2
在oracle 数据库那边 执行
create tablespace ttdb datafile ‘ORACLEBASE/oradata/ORACLE_BASE/oradata/ORACLE_SID/ttdb01.dbf’ size 150M autoextend on;
SQL> @/home/oracle/initCacheGlobalSchema.sql “ttdb”

Please enter the tablespace where TIMESTEN user is to be created
The value chosen for tablespace is ttdb

******* Creation of TIMESTEN schema and TT_CACHE_ADMIN_ROLE starts *******

  1. Creating TIMESTEN schema
  2. Creating TIMESTEN.TT_GRIDID table
  3. Creating TIMESTEN.TT_GRIDINFO table
  4. Creating TT_CACHE_ADMIN_ROLE role
  5. Granting privileges to TT_CACHE_ADMIN_ROLE
    ** Creation of TIMESTEN schema and TT_CACHE_ADMIN_ROLE done successfully **

PL/SQL procedure successfully completed.

3.3     SQL>  create user ttm identified by oracle default tablespace ttdb;
        SQL>  @/home/oracle/grantCacheAdminPrivileges.sql "ttm"

The value chosen for administrator user id is ttm

***************** Initialization for cache admin begins ******************
0. Granting the CREATE SESSION privilege to TTM

  1. Granting the TT_CACHE_ADMIN_ROLE to TTM
  2. Granting the DBMS_LOCK package privilege to TTM
  3. Granting the RESOURCE privilege to TTM
  4. Granting the CREATE PROCEDURE privilege to TTM
  5. Granting the CREATE ANY TRIGGER privilege to TTM
  6. Granting the DBMS_LOB package privilege to TTM
  7. Granting the SELECT on SYS.ALL_OBJECTS privilege to TTM
  8. Granting the SELECT on SYS.ALL_SYNONYMS privilege to TTM
  9. Checking if the cache administrator user has permissions on the default
    tablespace
    No existing permission.
  10. Altering the cache administrator to grant unlimited tablespace on TTDB
  11. Granting the CREATE ANY TYPE privilege to TTM
    ********* Initialization for cache admin user done successfully *******

3.4 oracle 授权给ttm 用户可以管理
grant all on scott.emp to ttm;
grant all on scott.dept to ttm;
grant all on scott.salgrade to ttm;
grant all on scott.bonus to ttm;
grant dba to ttm;

TT
3.5 tt 端
[[email protected] /]# su - ttadmin
[[email protected] ~]$ ttisql tt

Command> create user ttm identified by uplooking;
Command> grant create session,cache_manager,create any table,drop any table to ttm;
Command> create user scott identified by tiger;
Command> grant create session,create any table to scott;
Command> exit

3.6
[[email protected] ~]$ ttisql “dsn=tt;uid=ttm;pwd=uplooking;oraclepwd=oracle”

Command> call ttcacheuidpwdset(‘ttm’,‘oracle’);
Command> call ttgridcreate(‘testgrid’);
Command> call ttgridnameset(‘testgrid’);

oracle
3.7 oracle 端
[[email protected] ~]$ sqlplus scott/tiger
SQL> alter table salgrade modify(grade primary key not null);

TT
3.8 tt 端
[[email protected] ~]$ ttisql “dsn=tt;uid=ttm;pwd=uplooking;oraclepwd=oracle”
Command>call ttcachestart;
ttcachestart实现数据库数据到内存从而达到高速缓存的目的
Command>drop cache group t1;
Command>create readonly cache group t1
autorefresh interval 5 seconds mode incremental
from
scott.salgrade(
grade number primary key,
losal number,
hisal number );

3.9 Command> load cache group t1 commit every 10 rows;

1.10 ttisql “dsn=tt;uid=scott;pwd=tiger;oraclepwd=tiger”
Command> tables;

select * from salegrade;
相关标签: 内存数据库