TimesTen安装及测试文档.doc_第1页
TimesTen安装及测试文档.doc_第2页
TimesTen安装及测试文档.doc_第3页
TimesTen安装及测试文档.doc_第4页
TimesTen安装及测试文档.doc_第5页
已阅读5页,还剩31页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Author:Bliss,2008.4TimesTen安装及测试文档目录1.Linux上安装TimesTen31.1.准备工作31.2.安装31.2.1.Oracle TimesTen In-Memory Database31.2.2.Oracle In-Memory Database Cache51.3.配置DSN71.4.设置环境变量81.5.启动服务81.6.停止服务82.卸载82.1.Linux上卸载82.2.Windows下卸载93.测试93.1.用户管理(测试未通过)93.2.建表测试93.3.内存表数据同步93.3.1.安装Oracle客户端93.3.2.配置DSN103.3.3.创建一个cache group103.3.4.Load Cache Group113.3.5.删除Cache Group113.3.6.stop cache group agent113.4.客户端连接114.TimesTen介绍144.1.产品组成144.1.1.Oracle TimesTen In-Memory Database144.1.2.Oracle In-Memory Database Cache144.1.3.Replication TimesTen to TimesTen144.2.TimesTen 为什么快144.3.TimesTen系统变量154.3.1.CLASSPATH154.3.2.LIB、LIBPATH、LD_LIBRARY_PATH、SHLIB_PATH154.3.3.ODBCINI164.3.4.ORACLE_HOME164.3.5.PATH164.3.6.SYSODBCINI164.3.7.SYSTTCONNECTINI164.3.8.TMP/TMPDIR174.4.TimesTen 连接属性174.5.ttisql用法194.5.1.运行模式194.5.2.使用技巧204.6.常用命令214.6.1.ttAdmin214.6.2.ttDaemonAdmin224.6.3.ttBackup224.6.4.ttBulkCp224.6.5.ttRepStart/ttRepStop224.6.6.ttDestory234.6.7.ttmodinstall234.6.8.ttuser234.6.9.ttStatus234.6.10.ttSchema244.6.11.ttRepAdmin244.6.12.ttVersion244.7.常用内置存储过程254.7.1.ttBlockinfo254.7.2.ttBookmark254.7.3.ttCachePolicySet254.7.4.ttCachePropagateFlagSet254.7.5.ttCacheStart/ttCacheStop254.7.6.ttCkpt254.7.7.ttCkptBlocking254.7.8.ttCkptConfig264.7.9.ttCompact264.7.10.ttConfiguration264.7.11.ttDataStoreStatus264.7.12.ttLockLevel264.7.13.ttLogBufPrint264.7.14.ttOptClearStats264.7.15.ttOptEstimateStats264.7.16.ttRepDeactivate274.7.17.ttRepStateGet()274.7.18.ttRepStateSet274.7.19.ttSize275.TimesTen 应用访问接口275.1.基本介绍275.2.直接连接方式285.3.C/S连接方式285.4.驱动管理器方式296.一些错误总结296.1.836: Cannot create data store shared-memory segment, error 22296.2.7001: User authentication failed306.3.5203: Could not find library /u01/app/oracle/product/10.2.0/db_1/lib/libclntsh.so306.4.8296: TimesTen and Oracle database character sets do not match.316.5.5213: Bad Oracle login error in OCISessionBegin():invalid username/password317.备份和恢复327.1.备份327.2.恢复328.Timesten内存数据库的架构331. Linux上安装TimesTen1.1. 准备工作timestenbakserver timesten$ mkdir /timestentimestenbakserver timesten$ groupadd -g 600 timestentimestenbakserver timesten$ useradd -g 600 -u 600 timestentimestenbakserver timesten$ passwd timestentimestenbakserver timesten$ chown -R timesten:timesten /timestentimestenbakserver timesten$ chown -R timesten:timesten /etc/TimesTen/timesten其中/timesten目录为软件和数据库的安装目录1.2. 安装1.2.1. Oracle TimesTen In-Memory Databasetimestenbakserver linux86$ ./setup.shNOTE: 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? tt70 Instance name will be tt70.Is this correct? yes Please select a product : 注意,仅仅这个地方选择不同 1 Oracle TimesTen In-Memory Database 2 Oracle In-Memory Database CacheWhich product would you like to install? 1 Of the three components: 1 Client/Server and Data Manager 2 Data Manager Only 3 Client OnlyWhich would you like to install? 1 Where would you like to install the tt70 instance of TimesTen? /home/timesten /timestenWhere would you like to create the daemon home directory? /timesten/TimesTen/tt70/info /timesten/TimesTen/tt70/infoThe directory /timesten/TimesTen/tt70/info does not exist.Do you want to create it? yes Installing into /timesten/TimesTen/tt70 .Uncompressing .The TimesTen Demo applications can take up to 64 Mbytes of disk space.Depending on how your system is configured, you may not want to create theDemoDataStore directory in the default location,/timesten/TimesTen/tt70/info/DemoDataStoreWhere would you like to create the DemoDataStore directory? /timesten/TimesTen/tt70/info Creating /timesten/TimesTen/tt70/info/DemoDataStore .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 17000.Do you want to use the default port number for the TimesTen daemon? yes The daemon will run on the default port number (17000).Processing /timesten/TimesTen/tt70/PERL/perl.tar .Would you like to enable datastore access control? no The daemon logs will be located in /timesten/TimesTen/tt70/infoWould you like to specify a different location for the daemon logs? no NOTE: It appears that you are running version 3.2 or 3.3 of the g+ compiler. TimesTen ships with multiple sets of client libraries and server binaries : one built with g+ 3.2.3, one with g+ 3.4.6, and one with g+ 4.1.0. The installer has created links to the 3.2.3 library in the /lib directory and to the 3.2.3 server binary in the /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 .Would you like to log all server Connects/Disconnects? yes What is the TCP/IP port number that you want the TimesTen Server to listen on? 17002 Starting the daemon .TimesTen Daemon startup OK.Installing client components .What is the name of the host running the TimesTen server? bakserver What is the TCP/IP port number that the TimesTen server is listening on? 17002 What is the name of the instance running the TimesTen server? tt70 Creating new /timesten/TimesTen/tt70/info/sys.ttconnect.iniExtracting 3rd party tools .Would you like to install the documentation? yes Where would you like to create the doc directory (s=skip)? /timesten/TimesTen/tt70/doc The directory /timesten/TimesTen/tt70/doc does not exist.Do you want to create it? yes NOTE: The TimesTen daemon startup/shutdown scripts have not been installed.Run the script /timesten/TimesTen/tt70/bin/setuproot as root.This will move the TimesTen startup script into its appropriate location.The startup script is currently located here : /timesten/TimesTen/tt70/startup/tt_tt70.End of TimesTen installation.timestenbakserver linux86$1.2.2. Oracle In-Memory Database Cachetimestenbakserver linux86$ ./setup.shNOTE: 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? tt70 Instance name will be tt70.Is this correct? yes Please select a product : 1 Oracle TimesTen In-Memory Database 2 Oracle In-Memory Database CacheWhich product would you like to install? 1 2 注意,仅仅这个地方选择不同Of the three components: 1 Client/Server and Data Manager 2 Data Manager Only 3 Client OnlyWhich would you like to install? 1 1Where would you like to install the tt70 instance of TimesTen? /home/timesten /timestenWhere would you like to create the daemon home directory? /timesten/TimesTen/tt70/info /timesten/TimesTen/tt70/infoThe directory /timesten/TimesTen/tt70/info does not exist.Do you want to create it? yes Installing into /timesten/TimesTen/tt70 .Uncompressing .The TimesTen Demo applications can take up to 64 Mbytes of disk space.Depending on how your system is configured, you may not want to create theDemoDataStore directory in the default location,/timesten/TimesTen/tt70/info/DemoDataStoreWhere would you like to create the DemoDataStore directory? /timesten/TimesTen/tt70/info Creating /timesten/TimesTen/tt70/info/DemoDataStore .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 17000.Do you want to use the default port number for the TimesTen daemon? yes The daemon will run on the default port number (17000).Processing /timesten/TimesTen/tt70/PERL/perl.tar .Would you like to enable datastore access control? no The daemon logs will be located in /timesten/TimesTen/tt70/infoWould you like to specify a different location for the daemon logs? no The following variables have been set in the file :/timesten/TimesTen/tt70/bin/ttThunkORACLE_HOME=/timesten/oracle/10g/oracle/10g/productLD_LIBRARY_PATH=/timesten/TimesTen/tt70/lib:/timesten/oracle/10g/oracle/10g/product/lib32:/timesten/oracle/10g/oracle/10g/product/network/lib32:/timesten/oracle/10g/oracle/10g/product/lib:/timesten/oracle/10g/oracle/10g/product/network/libWould you like to enable the Cache Connect to Oracle Administrator? yes What TCP/IP port number would you like Cache Connect to Oracle Administrator to listen on? 17004 NOTE: To access the TimesTen Cache Connect to Oracle Administrator go to the url: http:/localhost:17004/cache-注意,这个地方用ctrl+C就可以进入下一步了NOTE: It appears that you are running version 3.2 or 3.3 of the g+ compiler. TimesTen ships with multiple sets of client libraries and server binaries : one built with g+ 3.2.3, one with g+ 3.4.6, and one with g+ 4.1.0. The installer has created links to the 3.2.3 library in the /lib directory and to the 3.2.3 server binary in the /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 .Would you like to log all server Connects/Disconnects? yes What is the TCP/IP port number that you want the TimesTen Server to listen on? 17002 Starting the daemon .TimesTen Daemon startup OK.Installing client components .What is the name of the host running the TimesTen server? bakserver What is the TCP/IP port number that the TimesTen server is listening on? 17002 What is the name of the instance running the TimesTen server? tt70 Creating new /timesten/TimesTen/tt70/info/sys.ttconnect.iniExtracting 3rd party tools .Would you like to install the documentation? yes Where would you like to create the doc directory (s=skip)? /timesten/TimesTen/tt70/doc The directory /timesten/TimesTen/tt70/doc does not exist.Do you want to create it? yes NOTE: The TimesTen daemon startup/shutdown scripts have not been installed.Run the script /timesten/TimesTen/tt70/bin/setuproot as root.This will move the TimesTen startup script into its appropriate location.The startup script is currently located here : /timesten/TimesTen/tt70/startup/tt_tt70.End of TimesTen installation.timestenbakserver linux86$1.3. 配置DSNtimestenbakserver info$ vi sys.odbc.iniTT_tt70Driver=/timesten/TimesTen/tt70/lib/libtten.soDataStore=/timesten/TimesTen/tt70/info/TT_tt70DatabaseCharacterSet=US7ASCIIPermSize=500TempSize=100Authenticate=01.4. 设置环境变量export PATH=/timesten/TimesTen/tt70/bin:$PATHexport LD_LIBRARY_PATH=/timesten/TimesTen/tt70/lib:$PATH1.5. 启动服务timestenbakserver performance$ ttdaemonadmin startTimesTen Daemon stopped.1.6. 停止服务timestenbakserver tt70$ ttdaemonadmin -stopTimesTen Daemon startup OK.2. 卸载2.1. Linux上卸载1、 停止服务2、在非timesten目录运行卸载命令timestenbakserver timesten$ ttdaemonadmin -stopTimesTen Daemon stopped.timestenbakserver timesten$ /timesten/TimesTen/tt70/bin/setup.sh -uninstall * WARNING * The uninstallation has been executed by a non-root user. If the TimesTen daemon startup scripts were installed, you must run /bin/setuproot -uninstall to remove them. If you proceed with this uninstallation, you will have to remove the startup scripts manually. Would you like to proceed with the uninstallation? yes Are you sure you want to completely remove the instance tt70 (TimesTen7.0.5) and all of its components? yes NOTE: /timesten/TimesTen/tt70/info contains information related to the data stores that have been created with this release. If you remove /timesten/TimesTen/tt70/info you will no longer be able to access your data stores, nor would you be able to restore nor migrate your data. Would you also like to remove all files in /timesten/TimesTen/tt70/info? no yes /timesten/TimesTen/tt70 RemovedTimesTen uninstall completed.timestenbakserver timesten$2.2. Windows下卸载直接在添加删除程序组件卸载软件。3. 测试3.1. 用户管理(测试未通过)timestenbakserver performance$ ttisql TT_tt70Command create user bliss identified by bliss;3.2. 建表测试timestenbakserver performance$ ttisql TT_tt70Command tables;Command select user from dual;Command create table zrp(id number);Command desc zrp;3.3. 内存表数据同步3.3.1. 安装Oracle客户端安装客户端,配置TNS连接。3.3.2. 配置DSNtimestenbakserver info$ vi sys.odbc.iniODBC Data Sourcestt_study=TimesTen 7.0 Drivertt_studyDriver=/timesten/TimesTen/tt70/lib/libtten.soDataStore=/timesten/TimesTen/tt70/info/tt_studyDatabaseCharacterSet=ZHS16GBKPermSize=20TempSize=20OracleID=db151OraclePWD=rdUID=rdPWD=rd其中db151为Oracle客户端配置的tns名。3.3.3. 创建一个cache grouptimestenbakserver info$ ttisql tt_studyCommand call ttCacheUidPwdSet(rd,rd);Command call ttCacheStart();Command create readonly cache group tt_cache autorefresh interval 2 seconds from yyr_blacklist(PHONENO Varchar2(32) primary key,ACTIONTYPE NUMBER);Command cachegroups;Cache Group RD.TT_CACHE: Cache Group Type: Read Only Autorefresh: Yes Autorefresh Mode: Incremental Autorefresh State: Paused 这个是默认值,此时是不同步的 Autorefresh Interval: 2 Seconds Root Table: RD.YYR_BLACKLIST Table Type: Read Only1 cache group found.Command select * from yyr_blacklist;0 rows found.Command3.3.4. Load Cache GroupCommand load cache group tt_cache commit every 2 rows; 设置为同步3 cache instances affected.Command cachegroups;Cache Group RD.TT_CACHE: Cache Group Type: Read Only Autorefresh: Yes Autorefresh Mode: Incremental Autorefresh State: On 变化了 Autorefresh Interval: 2 Seconds Root Table: RD.YYR_BLACKLIST Table Type: Read Only1 cache group found. Command select * from yyr_blacklist;4 rows found.Command3.3.5. 删除Cache GroupCommanddrop cache group tt_cache; Command3.3.6. stop cache group agentCommand call ttcachestop();Command注意,如果要destroy掉data store的话,必须要做这步。3.4. 客户端连接1、服务器端设置Authenticate参数timestenbakserver info$ vi sys.odbc.iniTpcbData_tt70Driver=/timesten/TimesTen/tt70/lib/libtten.soDataStore=/timesten/TimesTen/tt70/info/DemoDataStore/TpcbDataDatabaseCharacterSet=US7ASCIIPermSize=16WaitForConnect=0Authenticate=0DatabaseCharacterSet:data store字符集ConnectionCharacterSet:连接端字符集Authenticate=0:这样windows客户端就不需要输密码了Connections=150:最大连接数2、Windows客户端配置ODBC配置用户DSN,如下图:3、测试链接4. TimesTen介绍4.1. 产品组成4.1.1. Oracle TimesTen In-Memory DatabaseOracle TimesTen In-Memory Database 是一个内存优化的关系数据库,它为应用程序提供了当今实时企业和行业(例如电信、资本市场和国防)所需的即时响应性和非常高的吞吐量。Oracle TimesTen In-Memory Database 作为高速缓存或嵌入式数据库被部署在应用程序层中,它利用标准的 SQL 接口对完全位于物理内存中的数据存储区进行操作。注:只支持内存数据库,使用ttdestroy删除data store后,数据库中用户所创建的对象全部被清除。4.1.2. Oracle In-Memory Database Cache注:支持内存数据库和同步内存表。(Cache Connect to Oracle 是 Oracle TimesTen In- Memory Database 的一个选项,它为位于应用程序层中的 Oracle 数据创建实时、可更新的高速缓存。它免除了后端系统的计算负担,并支持反应灵敏且可伸缩的实时应用程序。Cache Connect to Oracle 能够将 Oracle 数据的子集加载到 TimesTen 中,能够双向传播更新,能够使对非高速缓存数据的 SQL 请求的透传自动化,并能够在故障之后自动重新同步数据。Cache Connect to Oracle 与 Replication TimesTen to TimesTen 选项完全兼容。)4.1.3. Replication TimesTen to TimesTenReplication TimesTen to TimesTen 是 Oracle TimesTen In-Memory Database 的一个选项,它支持服务器间的实时数据复制,以获得高可用性和负载共享。数据复制配置可以是双机热备份 (active-standby) 或负载均衡 (active-active),可以使用异步或同步传输,可以包含冲突检测和冲突解决以及在故障服务器恢复后自动重新同步。数据复制与 Cache Connect to Oracle 选项完全兼容。4.2. TimesTen 为什么快TimesTen的名字,就是 Ten Times,意思就是比传统的数据库要快一个数量级,为什么同是数据库,TimesTen要快这么多?如果把传统的数据库中的数据全部先load到内存中是否能达到相同的效果?下面我们对它们做一个比较分析。 第一,传统的数据库和应用程序是两个不同的应用系统,它们之间的通讯是通过IPC连接来实现的。而TimesTen则是直接把数据库的内存映射到应用程序的地址空间中,简单来说,这时候TimesTen访问数据库中的数据,就象访问应用程序自己的数组、字符串变量一样,只不过TimesTen有一套完善的机制来实现数据的一致性和完整性。这种直接嵌入到应用程序的运行地址空间机制比IPC要高效很多。 第二,传统的数据库都是 Disk-based 的,即预先假定数据主要是放在磁盘中的,所以它的所有优化、查询算法都是以磁盘存储为主的。举个简单的例子,比如说要查找一行记录,传统的数据库要先查找索引,通过索引查找该记录所在的页面,然后通过查找该页是已经在内存中,还是要从磁盘的数据文件中读取出来。而TimesTen是预先就把所有的数据Load到内存中,它知道所有的数据一定在内存里面,不会再通过其它的调用去决定数据在哪儿,这其中就少走了很多的弯路,基本没有磁盘的IO,而且都在内存中,效率也就高了很多。所以即使传统的数据库把数据都预先Load的内存中,也是达不到TimesTen的效果的。因为传统数据库的索引机制、优化算法、复杂的数据结构、数据的获取机制等等因素限制了它的性能。 第三,由于TimesTen启动的时候预先将所有的数据 Load 到内存中,所以它没有页进页出,而且也不需要类似与Oracle中的SGA缓冲区的管理。 总之,TimesTen只用 1/10 的CPU指令完成了传统数据库同样的任务,从而使得性能和吞吐量提升了一个数量级。下图说明了其中的不同之处:4.3. TimesTen系统变量下列为TimesTen安装之后,可能需要设置的系统变量: 4.3.1. CLASSPATH如用到JDK,则需要设置该变量指向相应的Jar文件。目前支持的JDK有 JDK1.4、JDK5.0、BEA Weblogic Jrockit 5.04.3.2. LIB、LIBPATH、LD_LIBRARY_PATH、SHLIB_PATH指向TimesTen所用到的共享库,即 $INSTALL_DIR/LIB 目录;如用到Cache Group,还需包含 $ORACLE_HOME/LIB 或 $ORACLE_HOME/LIB (32位平台)。且不同的平台该变量的名字各有差异:SOLARIS LD_LIBRARY_PATHAIX LIBPATHHP-UX 32Bit SHLIB_PATHHP-UX 64Bit LD_LIBRARY_PATH ( $INSTALL_DIR/LIB) SHLIB_PATH ( $ORACL

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论