timesten配置手册_chencl.docx_第1页
timesten配置手册_chencl.docx_第2页
timesten配置手册_chencl.docx_第3页
timesten配置手册_chencl.docx_第4页
timesten配置手册_chencl.docx_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

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

文档简介

从TimesTen 7版本过渡到TimesTen 11g,在Cache Group这一块,操作上要复杂些,下面介绍如何在TimesTen 11g中创建Cache Group。主要参考标准文档Oracle In-Memory Database Cache Users Guide 中的第二章 Getting Started。我的环境是RedHat 4 64bit ,TimesTen 11.2。1.安装Oracle软件为了和TimesTen 11g 中底层的OCI接口以及CRS(Oracle Clusterware)的兼容,建议安装或者以上版本。当然其它版本的Oracle估计也可以,但没有经过完全官方测试,在有些功能上可能会有问题,我就在的版本上碰到无法卸载TimesTen 11g注册资源的问题,但如果只是普通的功能应该没什么问题。实验中我创建了操作系统用户oracle,且其.bash_profile设置如下:export EDITOR=viexport ORACLE_SID=devdb1export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_11gexport NLS_LANG=american_america.zhs16gbkexportPATH=$ORACLE_HOME/bin: /bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:$PATH:$HOME/bin例:PATH=$PATH:$HOME/binexport PATHORACLE_BASE=/rootORACLE_HOME=$ORACLE_BASE/oracleORACLE_SID=orclPATH=$ORACLE_HOME/bin:$PATHexport ORACLE_BASE ORACLE_HOME ORACLE_SID PATH建议先装Oracle,再装TimesTen,这样安装TimesTen的时候可以直接设置TNS_ADMIN的路径,即tnsnames.ora文件所在的路径,位于$ORACLE_HOME/network/admin目录下。如果先装的是TimesTen,后装的Oracle,则要通过ttmodinstall来重新配置TNS_ADMIN路径。我的$ORACLE_HOME/network/admin/tnsnames.ora配置如下:ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.joyhoo) (INSTANCE_NAME = orcl) ) )2.创建timesten用户及/etc/TimesTen目录为了便于管理,不建议用oracle用户或者root用户安装TimesTen,实验中我单独创建了操作系统用户timesten,并使之属于dba以及oinstall组,Primary Group为dba。用root用户创建/etc/TimesTen目录,TimesTen的大小写要一致,并更改所属用户为刚创建的timesten:root#mkdir /etc/TimesTenroot#chown timesten:dba /etc/TimesTen3.安装TimesTen软件可以去/technology/software/products/timesten/index.html下载最新的TimesTen版本.0 (timesten112140.linux86.tar.gz),然后解压安装。在安装的时候要注意的地方: TNS_ADMIN的设置Please enter a value for TNS_ADMIN (s=skip)? /u01/app/oracle/product/11.1.0/db_11g/network/admin Enable PL/SQLWould you like to enable PL/SQL for this instance? yes yes 选择文档以及Demo的安装Do you want to install QuickStart and the TimesTen Documentation? no yes4.设置环境变量修改timesten用户的.bash_profile,增加如下设置:export CLASSPATH=/opt/TimesTen/tt1121/lib/ttjdbc5.jar:$CLASSPATHexport PATH=/opt/TimesTen/tt1121/bin/:$PATHexport ORACLE_HOME=/root/oracleexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/opt/TimesTen/tt1121/lib:$LD_LIBRARY_PATH要注意的是LD_LIBRARY_PATH,因为cache connect要调用oracle下的一些动态链接库,所以一定要设置准确,64位平台上可能名字叫lib64。退出并重新登录,使环境变量起作用。5.初始化配置现在我们跟着文档Oracle In-Memory Database Cache Users Guide 的第二章Getting Started一步步做,这个初始化工作都一样的,做一次就可以了。建议大家先把这一章读一遍,知道里面到底是要做些什么,Oracle里面涉及到如下几个用户: TIMESTEN这个用户名字无法修改指定,是直接通过timesten的安装脚本产生的,这个用户是使用Cache Grid的时候要用的,专门管理Cache Grid的元数据信息。当然你如果直接修改其脚本可以达到修改用户名的目的,但以后使用Cache Grid时肯定会碰到问题。可以认为是TimesTen在Oracle这边的定制用户。 cacheuser这个用户是用于管理Cache Connect,比如drop cache group,create cache group,启动关闭cache agent等日常维护操作。 oratt真正的最终数据所在的schema用户,所以在生产系统中,这个用户是我们经常要用到的,比如对表进行insert、update、delete等时,就要用这个用户了。timestenrac1 oraclescripts$ cd $TT_HOME/oraclescriptstimestenrac1 oraclescripts$ pwd/home/timesten/TimesTen/tt1121/oraclescriptstimestenrac1 oraclescripts$ sqlplus / as sysdba/为管理cache group创建单独的Oracle表空间SQL create tablespace cachetblsp datafile datfttuser.dbf size 100m;/在Oracle中创建TimesTen用户以及配置对应的表空间SQL initCacheGlobalSchema cachetblspPlease enter the tablespace where TIMESTEN user is to be createdThe value chosen for tablespace is cachetblsp注: /opt/TimesTen/tt1121/oraclescripts/* Creation of TIMESTEN schema and TT_CACHE_ADMIN_ROLE starts *1. Creating TIMESTEN schema2. Creating TIMESTEN.TT_GRIDID table3. Creating TIMESTEN.TT_GRIDINFO table4. Creating TT_CACHE_ADMIN_ROLE role5. Granting privileges to TT_CACHE_ADMIN_ROLE* Creation of TIMESTEN schema and TT_CACHE_ADMIN_ROLE done successfully *PL/SQL procedure successfully completed./创建表所属的用户SQL create user oratt identified by oracle default tablespace users;/赋予权限SQL grant create session,resource to oratt;Grant succeeded./创建Cache Group的管理员用户SQL create user cacheuser identified by oracle default tablespace cachetblsp quota unlimited on cachetblsp;User created./赋予相应的权限SQL grantCacheAdminPrivileges cacheuserPlease enter the administrator user idThe value chosen for administrator user id is cacheuser* Initialization for cache admin begins *0. Granting the CREATE SESSION privilege to CACHEUSER1. Granting the TT_CACHE_ADMIN_ROLE to CACHEUSER2. Granting the DBMS_LOCK package privilege to CACHEUSER3. Granting the RESOURCEprivilege to CACHEUSER4. Granting the CREATE ANY PROCEDUREprivilege to CACHEUSER5. Granting the CREATE ANY TRIGGERprivilege to CACHEUSER6. Checking if the cache administrator user has permissions on the defaulttablespace Permission exists7. Granting the CREATE ANY TYPE privilege to CACHEUSER* Initialization for cache admin user done successfully *6.在Oracle中创建表以及初始化数据su timesten/记得要先启动oracle listenersqlplusoratt/oracledevdb1/创建表以及数据并赋予cacheuser用户相关表的访问权限,scott.sql可以在这儿下载SQL scott.sql/为了后面维护上的方便,讲相应的权限预先都赋予给cacheuser用户。在真实的环境中,不必要把所有的权限都给cacheuser用户,它需要什么要的操作的时候就赋予它什么样的权限即可SQLgrant all on bonus to cacheuser;SQLgrant all on salgrade to cacheuser;SQLgrant all on dept to cacheuser;SQLgrant all on emp to cacheuser;7.在TimesTen配置DSN以及相关设置/配置sys.odbc.initt_workshopDriver=/home/timesten/TimesTen/tt1121/lib/libtten.soDataStore=/home/timesten/datastore/tt_workshopDatabaseCharacterSet=ZHS16GBKPermSize=100TempSize=32CkptFrequency=120CkptLogVolume=0PLSQL=1OracleNetServiceName=devdb1/创建缺少的目录mkdir -p /home/timesten/datastore/不带用户登录,即为缺省的安装用户,相当于sys用户timestenrac1 oraclescripts$ ttisql tt_workshopCommand create user cacheuser identified by timesten;Command grant create session,cache_manager,create any table to cacheuser;Command create user oratt identified by timesten;Command grant create session,create any table to oratt;Command exit/用cacheuser用户登录timestenrac1$ttisql dsn=tt_workshop;uid=cacheuser;pwd=timesten;oraclepwd=oracle/设置Cache Group管理用户信息并创建Cache GridCommand call ttcacheuidpwdset(cacheuser,oracle);/TimesTen 11g 所有的cache group必须隶属于一个Cache GridCommand call ttgridcreate(mygrid);Command call ttgridnameset(mygrid);Command exit至此,所有准备工作全部完成。8.创建只读Cache Group/cache group的创建都是通过cacheuser用户来进行的ttisql dsn=tt_workshop;uid=cacheuser;pwd=timesten;oraclepwd=oracleCommand call ttcachestart;Commandcreate readonly cache group ro Autorefreshinterval 5 seconds mode incrementalfromoratt.salgrade( grade number primary key, losal number, hisal number );Command cachegroups;Command load cache group ro commit every 10 rows;Command exit;/通过真正的数据拥有者oratt登录进去检查,如果还是通过cacheuser用户查询oratt.salgrade表的话,会报权限不够的错误,可以赋与cacheuser相关权限也可以查询grant select on oratt.salgrade to cacheuser;ttisql dsn=tt_workshop;uid=oratt;pwd=timesten;oraclepwd=oracleCommandselect * from oratt.salgrade;/在Oracle中针对Oratt.salgrade表插入一条记录并提交SQLinsert into oratt.salgrade values(6,10000,15000);SQLcommit;/在TimesTen中验证刚插入的记录已经同步到TimesTen中Command select * from oratt.salgrade;6 rows found.要注意的是整个timesten只有两种用户cacheuser,oratt。而o

温馨提示

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

评论

0/150

提交评论