TimesTen高可用性Word格式文档下载.docx
《TimesTen高可用性Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《TimesTen高可用性Word格式文档下载.docx(19页珍藏版)》请在冰豆网上搜索。
后即陆续介绍如何安装,如何配置datastore,如何配置cachegroup连接到oracle,如何配置复制,实现高可用性
timesten系列二:
如何安装timesten
发表人:
wzy25|发表时间:
2008年八月07日,16:
53
imesten支持在linux,unix,windows上面运行,最新的版本是7.0.5,下面我们将以在
oracleenterpriselinux5.0上面为例说明如何安装timesten,真的很简单,比装oracle简单
安装目录/oracle/timesten
操作系统版本oracleenterpriselinux5.032bit
需要把SELINUX关闭
timesteninstance名字为tt70
1.修改内核参数
修改/etc/sysctl.conf文件,加上如下列
kernel.shmmax=2147483648
kernel.sem="
25032000128100"
net.ipv4.tcp_rmem="
409641943044194304"
net.ipv4.tcp_wmem="
9830441943044194304"
net.ipv4.tcp_mem="
net.core.rmem_default=65535
net.core.wmem_default=65535
net.core.rmem_max=4194304
net.core.wmem_max=4194304
net.ipv4.tcp_window_scaling=1
net.ipv4.ip_local_port_range="
102465000"
然后执行sysctl-p,使修改生效
2.为了能够连接到oracle做同步,请安装oracle10.2的客户端
oracle以oracle用户,dba组安装
3.添加用户
useradd-gdba-u505timesten
4.用root用户登陆os
然后执行下面的操作,为timesten保存安装信息用
mkdir/etc/TimesTen
chmod775/etc/TimesTen
chgrptimesten/etc/TimesTen
5.设置用户.bash_profile
exportCLASSPATH=/oracle/timesten/TimesTen/tt70/lib/ttjdbc14.jar:
$CLASSPATH
exportPATH=/oracle/timesten/TimesTen/tt70/bin:
$PATH
exportORACLE_HOME=/oracle/product/10.2.0/db_1
exportLD_LIBRARY_PATH=$ORACLE_HOME/lib:
$ORACLE_HOME/network/lib:
/oracle/timesten/TimesTen/tt70/lib:
$LD_LIBRARY_PATH
注意:
LD_LIBRARY_PATH一定要包含上面的几个目录,否则cache会出问题
下载地址:
...0500.linux86.tar.gz
然后解开timesten安装包
tarxvzftimesten70500.linux86.tar.tar
cdlinux86/
./setup.sh
后面会提示输入路径,名称,端口等,一路回车,就ok了,具体的安装提示,请看下面:
NOTE:
EachTimesTeninstallationisidentifiedbyauniqueinstancename.
Theinstancenamemustbeanon-nullalphanumericstring,notlonger
than255characters.
Pleasechooseaninstancenameforthisinstallation?
[tt70]
Instancenamewillbe'
tt70'
.
Isthiscorrect?
[yes]
Pleaseselectaproduct:
[1]OracleTimesTenIn-MemoryDatabase
[2]OracleIn-MemoryDatabaseCache
Whichproductwouldyouliketoinstall?
[1]
Ofthethreecomponents:
[1]Client/ServerandDataManager
[2]DataManagerOnly
[3]ClientOnly
Whichwouldyouliketoinstall?
Wherewouldyouliketoinstallthett70instanceofTimesTen?
[/home/timesten]/oracle/timesten
Thedirectory/oracle/timestendoesnotexist.
Doyouwanttocreateit?
Wherewouldyouliketocreatethedaemonhomedirectory?
[/oracle/timesten/TimesTen/tt70/info]
Thedirectory/oracle/timesten/TimesTen/tt70/infodoesnotexist.
Installinginto/oracle/timesten/TimesTen/tt70...
Uncompressing...
TheTimesTenDemoapplicationscantakeupto64Mbytesofdiskspace.
Dependingonhowyoursystemisconfigured,youmaynotwanttocreatethe
DemoDataStoredirectoryinthedefaultlocation,
/oracle/timesten/TimesTen/tt70/info/DemoDataStore
WherewouldyouliketocreatetheDemoDataStoredirectory?
Creating/oracle/timesten/TimesTen/tt70/info/DemoDataStore...
Allinstallationsthatreplicatetoeachothermustusethesamedaemon
portnumberthatissetatinstallationtime.Thedaemonportnumbercan
beverifiedbyrunning'
ttVersion'
Thedefaultportnumberis17000.
DoyouwanttousethedefaultportnumberfortheTimesTendaemon?
Thedaemonwillrunonthedefaultportnumber(17000).
Processing/oracle/timesten/TimesTen/tt70/PERL/perl.tar...
Wouldyouliketoenabledatastoreaccesscontrol?
[no]
Thedaemonlogswillbelocatedin/oracle/timesten/TimesTen/tt70/info
Wouldyouliketospecifyadifferentlocationforthedaemonlogs?
Itappearsthatyouarerunningversion4.1oftheg++
compiler.TimesTenshipswithmultiplesetsofclientlibrariesandserver
binaries:
onebuiltwithg++3.2.3,onewithg++3.4.6,andonewith
g++4.1.0.Theinstallerhascreatedlinkstothe4.1.0libraryinthe
<
install_dir>
/libdirectoryandtothe4.1.0serverbinaryinthe
/bindirectory.Ifyouwanttouseadifferentcompiler,
pleasemodifythelinkstopointtothedesiredlibraryandserverbinary.
Installingservercomponents...
WouldyouliketologallserverConnects/Disconnects?
WhatistheTCP/IPportnumberthatyouwanttheTimesTenServertolistenon?
[17002]
Startingthedaemon...
TimesTenDaemonstartupOK.
Installingclientcomponents...
WhatisthenameofthehostrunningtheTimesTenserver?
[rac01]
WhatistheTCP/IPportnumberthattheTimesTenserverislisteningon?
WhatisthenameoftheinstancerunningtheTimesTenserver?
Creatingnew/oracle/timesten/TimesTen/tt70/info/sys.ttconnect.ini
Extracting3rdpartytools...
Wouldyouliketoinstallthedocumentation?
[yes]no
Documentationnotinstalled.
Tomanuallyinstallthedocumentation,runthecommand'
setup.sh-installDoc'
TheTimesTendaemonstartup/shutdownscriptshavenotbeeninstalled.
Runthescript'
/oracle/timesten/TimesTen/tt70/bin/setuproot'
asroot.
ThiswillmovetheTimesTenstartupscriptintoitsappropriatelocation.
Thestartupscriptiscurrentlylocatedhere:
'
/oracle/timesten/TimesTen/tt70/startup/tt_tt70'
EndofTimesTeninstallation.
为了添加随着OS启动而启动timestendaemon的脚本,需要按照提示,用root用户执行下面的脚本:
/oracle/timesten/TimesTen/tt70/bin/setuproot
很简单,就完成了安装了,看看timesten启动之后的进程情况:
ps-ef|greptimesten
timesten22001018:
45?
00:
00:
00/oracle/timesten/TimesTen/tt70/bin/timestend-initfd13
timesten22032200018:
00/oracle/timesten/TimesTen/tt70/bin/timestensubd
timesten22042200018:
timesten22052200018:
timesten22062200018:
timesten22082200018:
00/oracle/timesten/TimesTen/tt70/bin/ttcserver
系统安装完成之后,会有一个缺省的datastore(这个概念和oracle的schema概念差不多),叫TpcbData_tt70
我们现在就连接到这个datastore来看看,看看timesten工作是否正常。
ttIsqlTpcbData_tt70(注释:
ttIsql是一个和oraclesqlplus差不多的命令行交互控制工具)
[timesten@rac01info]$ttIsqlTpcbData_tt70
Copyright(c)1996-2008,Oracle.Allrightsreserved.
Type?
or"
help"
forhelp,type"
exit"
toquitttIsql.
Allcommandsmustendwithasemicoloncharacter.
connect"
DSN=TpcbData_tt70"
;
Connectionsuccessful:
DSN=TpcbData_tt70;
UID=timesten;
DataStore=/oracle/timesten/TimesTen/tt70/info/DemoDataStore/TpcbData;
DatabaseCharacterSet=US7ASCII;
ConnectionCharacterSet=US7ASCII;
WaitForConnect=0;
DRIVER=/oracle/timesten/TimesTen/tt70/lib/libtten.so;
Authenticate=0;
PermSize=16;
TypeMode=0;
(DefaultsettingAutoCommit=1)
Command>
tables;
SYS.CACHE_GROUP
SYS.COLUMNS
SYS.COLUMN_HISTORY
SYS.COL_STATS
SYS.DUAL
SYS.INDEXES
SYS.MONITOR
SYS.OBJ_ACC_RIGHT
SYS.PLAN
SYS.SEQUENCES
SYS.SYNONYMS
SYS.SYS_ACC_RIGHT
SYS.TABLES
SYS.TABLE_HISTORY
SYS.TBL_STATS
SYS.TCOL_STATS
SYS.TINDEXES
SYS.TRANSACTION_LOG_API
SYS.TTABLES
SYS.TTBL_STATS
SYS.USERS
SYS.VIEWS
SYS.XLASUBSCRIPTIONS
TTREP.REPELEMENTS
TTREP.REPLICATIONS
TTREP.REPNETWORK
TTREP.REPPEERS
TTREP.REPSTORES
TTREP.REPSUBSCRIPTIONS
TTREP.REPTABLES
TTREP.TTSTORES
31tablesfound.
在来做一个创建表的测试
createtabletest(idnumber
(2));
insertintotestvalues
(1);
1rowinserted.
commit;
select*fromtest;
1>
1rowfound.
TT的语法和oracle几乎是一样的,特别是dml和ddl,所以,如果有oracle的基础,就很容易了。
ok,TT工作正常,安装顺利结束。
如何启动停止timesten呢?
(以后就简称timesten为TT)
启动TT
ttDaemonAdmin-start
停止TT
ttDaemonAdmin-stop
TT的所有配置文件都放在install_dir/info目录下
TT产生的日志也都在install_dir/info
timesten系列三:
如何安装创建自己的datastore
2008年八月12日,16:
55
在完成上面的安装任务之后,因为我们需要TT存放我们应用的数据,我们就要配置自己的datastore了(理解为oracle里面的schema)。
在做这个任务之前,需要厘清一个概念,DSN=datasourcename,这个是标准的ODBC的用语,用来描述一个可以提供odbc连接的数据库服务器,
在timesten里面,所有的连接都是通过odbc的,就算是jdbc也是通过odbc连接到到TT上的。
在TT里面,有两种DSN
1.系统一级的DSN定义在服务器端,定义该datastore的文件存放位置,以及其他的一些控制参数,比如是否需要log,是否打开checkpoint等等。
2.客户端的DSN,用来描述一个远端服务器上的datastore,客户端程序用来连接到服务器
首先我们在刚才装好的TT服务器上定义个两个DSN,一个系统一级的,一个用户一级的
打开$INSTALL_DIR/info/sys.odbc.ini
在[ODBCDataSources]下面添加如下两行,定义我们这个datastore需要的driver
wzy_tt70=TimesTen7.0Driver
wzyCS_tt70=TimesTen7.0ClientDriver
然后在该文件的最后,添加如下内容:
#定义系统一级的DSN的名字
[wzy_tt70]
#定义驱动
Driver=/oracle/timesten/TimesTen/tt70/lib/libtten.so
#定义文件存放位置,数据文件和log都是放在info/wzy目录下,以wzy为前缀开始的
DataStore=/oracle/timesten/TimesTen/tt70/info/wzy/wzy
#定义数据库的字符集
DatabaseCharacterSet=WE8ISO8859P1
#定义是否需要用户授权认证
Authenticate=0
#定义内存大小
PermSize=64
TempSize=16
#定义用户一级的DSN
[wzyCS_tt70]
#服务器的地址
TTC_SERVER=LocalHost_tt70
#服务器datastore的系统一级的DSN名字,对应上面定义的名字
TTC_SERVER_DSN=wzy_tt70
然后我们创建wzy这个目录
mkdirwzy