分享

Linux5.4平台上TimesTen1122安装过程以及部分注意事项

 guolijiegg 2012-03-31

Linux5.4平台上TimesTen1122安装过程以及部分注意事项

上一篇 / 下一篇  2012-02-24 09:13:09 / 个人分类:个人日记

Linux5.4平台Oracle TimesTen 11.2.2安装过程

在安装TimesTen之前,需要先安装好oracle11gR2版本的数据库,并且保证它能完好的运行。

安装TimesTen的过程与安装oracle数据库相比,要简单的多,但是里面有一些概念需要清晰。

下面开始安装TimeTen11.2.2

1、linux5.4中创建一个专门用于安装TT的用户,用户名为tt

[root@gxx~]# groupadd -g tt

[root@gxx~]# useradd -g tt -G sys tt

[root@gxx~]#passwd tt

2、linux5.4中将TimesTen安装包(timesten112220.linux86.tar.gz)解压。

转到tt用户下,将安装包解压在/home/tt目录下

3、解压完之后进入解压之后的文件夹linux86,运行安装程序:

注意:在安装过程当中,他会问你TNS_ADMIN的目录,这个目录指向的就是oracle数据库的$ORACLE_HOME/netword/admin,因为TimesTen要连接到oracle数据库需要使用连接符,也就是tnsnames.ora文件中定义的连接字符串。如果在tt用户的.bash_profile文件中定义了TNS_ADMIN,那么他会显示一定以的TNS_ADMIN的值,如果没有定义,则需要手动输入。

[tt@gxx linux86]$ ./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 ] 

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/tt

  [2] /u01/tt/install

  [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/tt/TimesTen/tt1122/info ] [/u01/tt/TimesTen/tt1122/info]

The directory /[/u01/tt/TimesTen/tt1122/info] does not exist.

Do you want to create it? [ yes ] 

Could not create /[/u01/tt/TimesTen/tt1122/info].

Please check permissions and try again ...

Where would you like to create the daemon home directory? [ /home/tt/TimesTen/tt1122/info ] 

The daemon logs will be located in /home/tt/TimesTen/tt1122/info

Would you like to specify a different location for the daemon logs? [ no ] 

Installing into /home/tt/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 53392.

Do you want to use the default port number for the TimesTen daemon? [ yes ] 

The daemon will run on the default port number (53392).

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 'tt'? [ 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)? [/opt/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin]

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? [ 53393 ] Do you want to install QuickStart and the TimesTen Documentation? [ no ] 

Would you like to install the documentation (without QuickStart)? [ yes ] 

Where would you like to create the doc directory (s=skip)? [ /home/tt/TimesTen/tt1122/doc ] 

The TimesTen documentation has been installed in /home/tt/TimesTen/tt1122/doc.

Installing client components ...

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

Please provide the path to the Oracle Clusterware installation on this machine (s=skip)? [  ] s

TimesTen Replication with Oracle Clusterware will not be installed. You can run

        /home/tt/TimesTen/tt1122/bin/ttmodinstall -crs

to install this feature after this installation.

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

Run the 'setuproot' script :

        cd /home/tt/TimesTen/tt1122/bin

        ./setuproot -install

This will move the TimesTen startup script into its appropriate location.

The startup script is currently located here :

  '/home/tt/TimesTen/tt1122/startup/tt_tt1122'.

The 11.2.2.2 Release Notes are located here :

  '/home/tt/TimesTen/tt1122/README.html'

Starting the daemon ...

TimesTen Daemon startup OK.

End of TimesTen installation.

这样就安装完了TimesTen了。

4、安装完之后,需要配置tt的环境变量。

tt@gxx ~]$ vi .bash_profile

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

export ORACLE_BASE=/opt/oracle/app/oracle

export ORACLE_HOME=/opt/oracle/app/oracle/product/11.2.0/dbhome_1

export ORACLE_SID=orcl

export TIMESTEN=/home/tt/TimesTen/tt1122

export LD_LIBRARY_PATH=$TIMESTEN/lib:$ORACLE_HOME/lib

export PATH=$TIMESTEN/bin:$ORACLE_HOME/bin:$PATH:$HOME/bin

unset USERNAME

这里,假设需要使用的三个用户定义为:TimeTencacheadmintest

TimesTen用户由执行initCacheGlogSchema.sql脚本文件创建。其他两个手动创建。

5、在数据库中执行脚本initCacheGlogSchema.sql

6、创建cacheadmintest用户。

7、然后在数据库中执行脚本grantCacheAdminPrivileges.sql,给cacheadmin赋予相应的权限。

SQL>@grantCacheAdminPrivileges.sql "cacheadmin"

注意:第57步很重要,在以前的版本中不用执行这两个命令,但是在新的版本中需要执行这两个脚本,如果不执行这两个脚本二直接创建需要的用户,那么在执行ttGridCreate命令式会出现ORA-12457错误(连接不上oracle数据库)。

8、配置TimesTenDSN

[TT_1122]

Driver=/home/tt/TimesTen/tt1122/lib/libtten.so

DataStore=/home/tt/TimesTen/tt1122/info/TT_1122
DatabaseCharacterSet=ZHS16GBK

PermSize=64

注意:这个DSNtt安装目录的info目录下,也就是sys.odbc.ini文件,这里的DatabaseCharacterSet需要更改为与oracle数据库的编码一致,如果不一致,那么就会连接不上数据库,如果oracle数据库的编码问ZHS16GBK,那么DSN里面就需要设置为ZHS16GBK

9、配置完成之后,在oracle用户下,打开数据库然后在终端进入tt用户,启动TimesTen.

[tt@gxx ~]ttdaemonadmin -start

注意:如果执行命令是提示没有这个命令,但是检查环境变量设置完全正确,那么可以在tt用户的根目录先,试试执行“source .bash_profile”命令,然后就行了(有时候很有用哦)。

10、启动了TimesTen之后,就可以进入TT了。

[tt@gxx ~]ttisql tt_1122

11、进入tt之后,就在内存数据库(TimesTen)中创建两个用户,一个是管理用户,就像是oracle数据库中的sys管理员用户一样,一个是数据操作用户,也就是普通用户,真正操作数据的用户。

Command>Create user cacheadmin identified by password

Command>Grant create session,cache_manager, create any table to cacheadmin;

Command>Create user test identified by password;

Command>Grant create session, create any table to test ;

注意:这里的两个用户需要与oracle数据库中创建的用户的名字一模一样,因为名字一模一样才能从oracle数据库中匹配,然后从oracle数据库中取出数据。TimesTen用户在内存数据库中不用创建,她只存在oracle数据库中,他是oracle数据库专门用来存放内存数据库(TimesTen)的相关管理信息的用户。

12、接下来需要在内存中创建用于存储数据的cache group,但是cache group又是需要存放在一个grid里面的(性特性),所以,现在就要用在内存数据库中创建好了的管理员用户(cacheadmin)登陆,创建一个grid用来存放cache group

[tt@gxx ~]ttisql "dsn=tt_1122;uid=cacheadmin;pwd=password;oraclepwd=oraclepassword"

先要指定做这些操作的这个用户对应的oracle数据库的用户,应为需要在oracle数据库中记录相应的变更:

Command>call ttcacheuidpwdset('cacheadmin','oraclepassword');

这样,内存数据库中的cacheadminoracle数据库中的cacheadmin就建立了连接。

然后创建grid

Command>call ttGridCreate('myGrid');

Command>call ttGridnameSet('myGrid');

这样,就创建了一个名为myGridgrid,并且相应的信息存储到了oracle数据库的cacheadmin用户中,以后每次启动,这个grid都会存在,因为已经永久的保存在了oracle数据库的cacheadmin用户中。

注意:在老版本中(比如7版本),不需要创建grid,而在TimesTen11版本中需要先创建一个grid,然后才能创建cache group,因为cache group需要放在grid中。(我吃了亏才明白,哈哈)

13、创建好了grid,就可以进入真正操作数据的用户了,但是需要先在该用户下创建cache group

[tt@gxx ~]ttisql "dsn=tt_1122;uid=test;pwd=password;oraclepwd=oraclepassword"

进入之后,内存数据库的cache并没有启动,需要启动它才能往里放数据。

Command>call ttcachestart

启动cache之后就可以创建cache group了,创建group时,需要将表的名字和结构设置成语oracle数据库中test用户下的需要加载的表的名字和结构一模一样,这样才能匹配找到相应的表,否则无法加载数据。(这里创建的readonly类型的group)

Command>create readonly cache group cache_t1

              Autorefresh interval 5 seconds mode incremental

              From test.t1(a int nor null primary key , b char(10));

    Command>load cache group cache_t1 commit every 10 rows;

到此,整个配置就已经完成了,oracle数据库中的test用户下的表t1的数据已经加载到了内存数据库(TimesTen)的用户test下的t1表中。


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多