一.Timesten安装
一,安裝timesten IMDB并測試
1. 創建數據庫相關用戶和組
groupadd timestenuseradd -g timesten -G dba timestenpasswd timesten
2. 創建相關目錄
mkdir /etc/TimesTenchmod 775 /etc/TimesTenchown timesten:timesten /etc/TimesTenmkdir /u01/app/timesTenchmod 775 /u01/app/timesTenchown timesten:timesten /u01/TimesTen
3. 切換到timesten用戶,設置環境變量
[root@oracle ~]# su - timesten[timesten@oracle ~]$?vi?.bash_profile?export?ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome_1export?TIMESTEN=/opt/timesten/TimesTen/tt1122#?.bash_profile#?Get?the?aliases?and?functionsif?[?-f?~/.bashrc?];?then????????.?~/.bashrcfi#?User?specific?environment?and?startup?programsPATH=$PATH:$HOME/binexport?PATHPATH=$PATH:$HOME/binexport?ORACLE_BASE=/u01/app/oracle11gexport?ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_SID=db11export TIMESTEN=/u01/app/timesten/TimesTen/tt1122export LD_LIBRARY_PATH=$TIMESTEN/lib:$ORACLE_HOME/libexport PATH=$TIMESTEN/bin:$ORACLE_HOME/bin:$PATH:$HOME/binexport TNS_ADMIN=$ORACLE_HOME/network/adminunset USERNAMEexport PATH
4. 上傳軟件,并修改軟件的用戶和屬組,切換到timesten用戶
[root@oracle timesten]# su - timesten[timesten@oracle ~]$?gzip?-d?timesten112280.linux8664.gz?[timesten@oracle?~]$ ls -ltotal 344792-rw-r--r-- 1 timesten timesten 353064960 May 28 2015 timesten112280.linux8664[timesten@oracle ~]$?ls?-ltotal?344792-rw-r--r--?1?timesten?timesten?353064960?May?28??2015?timesten112280.linux8664[timesten@oracle?~]$ tar -xvf timesten112280.linux8664linux8664/linux8664/uninst.shlinux8664/install.pllinux8664/README.htmllinux8664/LINUX8664/linux8664/LINUX8664/ttpatchinstlinux8664/LINUX8664/unziplinux8664/LINUX8664/common.tar.bz2linux8664/LINUX8664/ttclient.tar.bz2linux8664/LINUX8664/perllinux8664/LINUX8664/manifestlinux8664/LINUX8664/timesten.tar.bz2linux8664/LINUX8664/bzip2linux8664/LINUX8664/ttserver.tar.bz2linux8664/3rdparty/linux8664/3rdparty/ant-1.6.2-bin.tar.bz2linux8664/3rdparty/jms-1_1-fr-apidocs.tar.bz2linux8664/doc/linux8664/doc/doc.ziplinux8664/setup.sh[timesten@oracle ~]$ lltotal 344796drwxrwxr-x 5 timesten timesten 4096 Jan 20 18:12 linux8664-rw-r--r-- 1 timesten timesten 353064960 May 28 2015 timesten112280.linux8664
5. 開始安裝軟件
[timesten@oracle ~]$?cd?linux8664/[timesten@oracle?linux8664]$ lltotal 420drwxr-xr-x 2 timesten timesten 4096 Jan 20 18:12 3rdpartydrwxrwxr-x 2 timesten timesten 4096 Jan 20 18:12 doc-rwxr-xr-x 1 timesten timesten 256471 Jan 20 18:10 install.pldrwxr-xr-x 2 timesten timesten 4096 Jan 20 18:12 LINUX8664-rwxr--r-- 1 timesten timesten 114161 Jan 20 18:10 README.html-rwxr-xr-x 1 timesten timesten 5759 Jan 20 18:10 setup.sh-rwxr-xr-x 1 timesten timesten 34886 Jan 20 18:10 uninst.sh[timesten@oracle linux8664]$ ./setup.shNOTE: Each TimesTen installation is identified by a unique instance name.The instance name must be a non-null alphanumeric string, not longerthan 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 OnlyWhich would you like to install? [ 1 ]Of the following options :[1] /home/timesten[2] /home/timesten[3] Specify a location[q] Quit the installationWhere would you like to install the tt1122 instance of TimesTen? [ 1 ] 3Please specify a directory to install TimesTen? [ /home/timesten ] /u01/app/timestenThe directory /u01/app/timesten does not exist.Do you want to create it? [ yes ]Where would you like to create the daemon home directory? [ /u01/app/timesten/TimesTen/tt1122/info ]The daemon logs will be located in /u01/app/timesten/TimesTen/tt1122/infoWould you like to specify a different location for the daemon logs? [ no ]Installing into /u01/app/timesten/TimesTen/tt1122 ...Uncompressing ...NOTE: If you are configuring TimesTen for use with Oracle Clusterware, thedaemon port number must be the same across all TimesTen installationsmanaged within the same Oracle Clusterware cluster.NOTE: All installations that replicate to each other must use the same daemonport number that is set at installation time. The daemon port number canbe verified by running 'ttVersion'.The default port number is 53396.Do you want to use the default port number for the TimesTen daemon? [ yes ]The daemon will run on the default port number (53396).NOTE: For security, we recommend that you restrict access to theTimesTen installation to members of a single OS group. Only members ofthat OS group will be allowed to perform direct mode connections toTimesTen, and only members of that OS group will be allowed to performoperations that access TimesTen data stores, TimesTen files and sharedmemory. The OS group defaults to the primary group of the instanceadministrator. You can default to this group, choose another OS groupor you can make this instance world-accessible. If you choose to makethis instance world-accessible, all database files and shared memoryare readable and writable by all users.Restrict access to the the TimesTen installation to the group 'timesten'? [ yes ]NOTE: Enabling PL/SQL will increase the size of some TimesTen libraries.Would you like to enable PL/SQL for this instance? [ yes ]TNS_ADMIN exists in your environment and is set to :/u01/app/oracle11g/product/11.2.0/dbhome_1/network/adminWould you like to use this TNS_ADMIN setting for the Oracle TimesTen Application-Tier Database Cache? [ yes ]TNS_ADMIN will be set to /u01/app/oracle11g/product/11.2.0/dbhome_1/network/adminYou can change TNS_ADMIN later by running <install_dir>/bin/ttmodinstall.NOTE: It appears that you are running version 4 or higher of the g++compiler. TimesTen ships with multiple sets of client libraries and serverbinaries : one built for compatibility with g++ 3.4.6 and one withg++ 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? [ 53397 ]Do you want to install the Quick Start Sample Programs and the TimesTen Documentation? [ no ]Would you like to install the documentation (without the Quick Start Sample Programs)? [ yes ]Where would you like to create the doc directory? [ /u01/app/timesten/TimesTen/tt1122/doc ]The TimesTen documentation has been installed in /u01/app/timesten/TimesTen/tt1122/doc.Installing client components ...Would you like to use TimesTen Replication with Oracle Clusterware? [ no ]NOTE: The TimesTen daemon startup/shutdown scripts have not been installed.Run the 'setuproot' script :cd /u01/app/timesten/TimesTen/tt1122/bin./setuproot -installThis will move the TimesTen startup script into its appropriate location.The startup script is currently located here :'/u01/app/timesten/TimesTen/tt1122/startup/tt_tt1122'.The 11.2.2.8 Release Notes are located here :'/u01/app/timesten/TimesTen/tt1122/README.html'Starting the daemon ...TimesTen Daemon startup OK.End of TimesTen installation.[timesten@oracle linux8664]$
6. 啟動服務
[root@oracle ~]# cd /u01/app/timesten/TimesTen/tt1122/bin/[root@oracle bin]# ./setuproot -install$* is no longer supported at ./setuproot line 260.Would you like to install the TimesTen daemon startup scripts into /etc/init.d? [ yes ]Copying /u01/app/timesten/TimesTen/tt1122/startup/tt_tt1122 to /etc/init.dSuccessfully installed the following scripts :/etc/init.d/tt_tt1122/etc/rc.d/rc0.d/K45tt_tt1122/etc/rc.d/rc1.d/K45tt_tt1122/etc/rc.d/rc2.d/S90tt_tt1122/etc/rc.d/rc3.d/S90tt_tt1122/etc/rc.d/rc5.d/S90tt_tt1122/etc/rc.d/rc6.d/K45tt_tt1122
查看進程
[root@oracle bin]# ps -ef | grep timesroot 31501 31129 0 Feb24 pts/3 00:00:00 su - timestentimesten 31503 31501 0 Feb24 pts/3 00:00:00 -bashtimesten 35813 1 0 Feb24 ? 00:00:00 /u01/app/timesten/TimesTen/tt1122/bin/timestend -initfd 13timesten 35817 35813 0 Feb24 ? 00:00:00 /u01/app/timesten/TimesTen/tt1122/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000000 -facility usertimesten 35819 35813 0 Feb24 ? 00:00:00 /u01/app/timesten/TimesTen/tt1122/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000002 -facility usertimesten 35820 35813 0 Feb24 ? 00:00:00 /u01/app/timesten/TimesTen/tt1122/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000003 -facility usertimesten 35822 35813 0 Feb24 ? 00:00:00 /u01/app/timesten/TimesTen/tt1122/bin/ttcserver -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000004 -p 53397 -facility user -group timestentimesten 35834 35813 0 Feb24 ? 00:00:00 /u01/app/timesten/TimesTen/tt1122/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000005 -facility user
修改配置文件
[timesten@oracle info]$ vi sys.odbc.ini[ODBC Data Sources]TT_1122=TimesTen 11.2.2 Driversampledb_1122=TimesTen 11.2.2 Drivercachedb1_1122=TimesTen 11.2.2 Driverrepdb1_1122=TimesTen 11.2.2 Driverrepdb2_1122=TimesTen 11.2.2 DriversampledbCS_1122=TimesTen 11.2.2 Client Drivercachedb1CS_1122=TimesTen 11.2.2 Client Driverrepdb1CS_1122=TimesTen 11.2.2 Client Driverrepdb2CS_1122=TimesTen 11.2.2 Client Driver
7. 連接測試
[timesten@oracle info]$ ttIsql TT_1122Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.Type ? or "help" for help, type "exit" to quit ttIsql.connect "DSN=TT_1122";Connection successful: DSN=TT_1122;UID=timesten;DataStore=/u01/app/timesten/TimesTen/tt1122/info/TT_1122;DatabaseCharacterSet=US7ASCII;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/app/timesten/TimesTen/tt1122/lib/libtten.so;TypeMode=0;(Default setting AutoCommit=1)Command>Command> tables0 tables found.Command> create table tt_test(id number(20));Command> insert into tt_test values(12345678);1 row inserted.Command> commit;Command> select * from tt_test;< 12345678 >1 row found.Command> insert into tt_test values(1989);1 row inserted.Command> select * from tt_test;< 12345678 >< 1989 >2 rows found.Command> commit;Command> tablesTIMESTEN.TT_TEST1 table found.Command> drop table tt_test;Command> tables0 tables found.Command>
二. 同步用戶數據設置
在timesten安裝目錄的oraclescripts有相關的oracle腳本
[root@oracle tt1122]# cd oraclescripts/[root@oracle oraclescripts]# lltotal 104-r--r----- 1 timesten timesten 8815 Jan 20 18:09 cacheCleanUp.sql-r--r----- 1 timesten timesten 5840 Jan 20 18:09 cacheInfo.sql-r--r----- 1 timesten timesten 12344 Jan 20 18:09 grantCacheAdminPrivileges.sql-r--r----- 1 timesten timesten 21528 Jan 20 18:09 initCacheAdminSchema.sql-r--r----- 1 timesten timesten 9569 Jan 20 18:09 initCacheGlobalSchema.sql-r--r----- 1 timesten timesten 7217 Jan 20 18:09 initCacheGridSchema.sql-r--r----- 1 timesten timesten 5744 Jan 20 18:09 README.TXTdrwxr-x--- 3 timesten timesten 4096 Jan 20 18:09 supporting_scripts-r--r----- 1 timesten timesten 5688 Jan 20 18:09 ttca_setupRepository.sql-r--r----- 1 timesten timesten 2272 Jan 20 18:09 ttca_setupTarget.sql[root@oracle oraclescripts]#[root@oracle oraclescripts]# cp initCacheGlobalSchema.sql /tmp[root@oracle oraclescripts]# cp grantCacheAdminPrivileges.sql /tmp[root@oracle oraclescripts]# cd /tmp/[root@oracle tmp]# chmod 777 initCacheGlobalSchema.sql[root@oracle tmp]# chmod 777 grantCacheAdminPrivileges.sql
1. 創建timesten用戶使用TimesTen自帶腳本
[root@oracle tmp]# su - ora11gdb11@oracle /home/ora11g$?db11@oracle??/home/ora11g$db11@oracle /home/ora11g$?cd?/tmp/db11@oracle??/tmp$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Wed Feb 25 01:58:16 2015Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> @initCacheGlobalSchemaPlease enter the tablespace where TIMESTEN user is to be createdusersThe value chosen for tablespace is users******* 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>
2. 創建一個管理cache的用戶
SQL> create user cacheadmin identified by cacheadmin;User created.SQL> @grantCacheAdminPrivileges "cacheadmin"Please enter the administrator user idThe value chosen for administrator user id is cacheadmin***************** Initialization for cache admin begins ******************0. Granting the CREATE SESSION privilege to CACHEADMIN1. Granting the TT_CACHE_ADMIN_ROLE to CACHEADMIN2. Granting the DBMS_LOCK package privilege to CACHEADMIN3. Granting the CREATE SEQUENCE privilege to CACHEADMIN4. Granting the CREATE CLUSTER privilege to CACHEADMIN5. Granting the CREATE OPERATOR privilege to CACHEADMIN6. Granting the CREATE INDEXTYPE privilege to CACHEADMIN7. Granting the CREATE TABLE privilege to CACHEADMIN8. Granting the CREATE PROCEDURE privilege to CACHEADMIN9. Granting the CREATE ANY TRIGGER privilege to CACHEADMIN10. Granting the GRANT UNLIMITED TABLESPACE privilege to CACHEADMIN11. Granting the DBMS_LOB package privilege to CACHEADMIN12. Granting the SELECT on SYS.ALL_OBJECTS privilege to CACHEADMIN13. Granting the SELECT on SYS.ALL_SYNONYMS privilege to CACHEADMIN14. Checking if the cache administrator user has permissions on the defaulttablespaceNo existing permission.15. Altering the cache administrator to grant unlimited tablespace on USERS16. Granting the CREATE TYPE privilege to CACHEADMIN17. Granting the SELECT on SYS.GV$LOCK?privilege?to?CACHEADMIN?(optional)18.?Granting?the?SELECT?on?SYS.GV$SESSION privilege to CACHEADMIN (optional)19. Granting the SELECT on SYS.DBA_DATA_FILES privilege to CACHEADMIN(optional)20. Granting the SELECT on SYS.USER_USERS privilege to CACHEADMIN (optional)21. Granting the SELECT on SYS.USER_FREE_SPACE privilege to CACHEADMIN(optional)22. Granting the SELECT on SYS.USER_TS_QUOTAS privilege to CACHEADMIN(optional)23. Granting the SELECT on SYS.USER_SYS_PRIVS privilege to CACHEADMIN(optional)********* Initialization for cache admin user done successfully *********
3. 創建一個業務用戶
SQL> create user hxy identified by hxy;User created.進行一樣的授權SQL> @grantCacheAdminPrivileges "hxy"Please enter the administrator user idThe value chosen for administrator user id is hxy***************** Initialization for cache admin begins ******************0. Granting the CREATE SESSION privilege to HXY1. Granting the TT_CACHE_ADMIN_ROLE to HXY2. Granting the DBMS_LOCK package privilege to HXY3. Granting the CREATE SEQUENCE privilege to HXY4. Granting the CREATE CLUSTER privilege to HXY5. Granting the CREATE OPERATOR privilege to HXY6. Granting the CREATE INDEXTYPE privilege to HXY7. Granting the CREATE TABLE privilege to HXY8. Granting the CREATE PROCEDURE privilege to HXY9. Granting the CREATE ANY TRIGGER privilege to HXY10. Granting the GRANT UNLIMITED TABLESPACE privilege to HXY11. Granting the DBMS_LOB package privilege to HXY12. Granting the SELECT on SYS.ALL_OBJECTS privilege to HXY13. Granting the SELECT on SYS.ALL_SYNONYMS privilege to HXY14. Checking if the cache administrator user has permissions on the defaulttablespaceNo existing permission.15. Altering the cache administrator to grant unlimited tablespace on USERS16. Granting the CREATE TYPE privilege to HXY17. Granting the SELECT on SYS.GV$LOCK?privilege?to?HXY?(optional)18.?Granting?the?SELECT?on?SYS.GV$SESSION privilege to HXY (optional)19. Granting the SELECT on SYS.DBA_DATA_FILES privilege to HXY (optional)20. Granting the SELECT on SYS.USER_USERS privilege to HXY (optional)21. Granting the SELECT on SYS.USER_FREE_SPACE privilege to HXY (optional)22. Granting the SELECT on SYS.USER_TS_QUOTAS privilege to HXY (optional)23. Granting the SELECT on SYS.USER_SYS_PRIVS privilege to HXY (optional)********* Initialization for cache admin user done successfully *********SQL>
4. 設置/u01/app/timesten/TimesTen/tt1122/info/sys.odbc.ini
[TT_1122]Driver=/u01/app/timesten/TimesTen/tt1122/lib/libtten.soDataStore=/u01/app/timesten/TimesTen/tt1122/info/TT_1122DatabaseCharacterSet=ZHS16GBKOracleNetServiceName=db11PermSize=2048TempSize=1024
5. 啟動TimesTen
[timesten@oracle info]$?ttdaemonadmin?-stopTimesTen?Daemon?stopped.[timesten@oracle?info]$ ttdaemonadmin -startTimesTen Daemon startup OK.[timesten@oracle info]$ ttisql TT_1122Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.Type ? or "help" for help, type "exit" to quit ttIsql.connect "DSN=TT_1122";Connection successful: DSN=TT_1122;UID=timesten;DataStore=/u01/app/timesten/TimesTen/tt1122/info/TT_1122;DatabaseCharacterSet=US7ASCII;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/app/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=2048;TempSize=1024;TypeMode=0;OracleNetServiceName=db11;(Default setting AutoCommit=1)Command>
6. 創建TimesTen內存數據庫的用戶,用戶必須和Oracle數據庫名稱相同
Command> create user cacheadmin identified by cacheadmin;User created.Command> grant create session,cache_manager,create any table to cacheadmin;Command> create user hxy identified by hxy;User created.Command> grant create session,create any table to hxy;
7. 從TimesTen鏈接到Oracle數據庫
Command> connect "dsn=TT_1122;uid=cacheadmin;PWD=cacheadmin;OraclePwd=cacheadmin";Command> call ttcacheuidpwdset('cacheadmin','cacheadmin');
8. 創建Grid,TimesTen特性必須把cache group讓在grid中
connect "dsn=TT_1122;uid=cacheadmin;PWD=cacheadmin;OraclePwd=cacheadmin";
9. 創建cache grid,TimesTen特性必須把cache group讓在grid中
con1: Command> call ttGridCreate('myGrid');con1: Command> call ttGridnameSet('myGrid');
10.在Orace數據庫里面建立表和唯一索引,TimesTen必須需要是一個主鍵和唯一索引
db11@oracle /home/ora11g$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 26 01:09:06 2015Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL>SQL>SQL> conn hxy/hxyConnected.SQL> create table a (id number,name varchar2(20));Table created.SQL> create unique index a_idx on a(id);Index created.
把權限授予cache管理用戶
GRANT SELECT ON a TO cacheadmin;GRANT INSERT ON a TO cacheadmin;GRANT UPDATE ON a TO cacheadmin;GRANT DELETE ON a TO cacheadmin;
11. Load數據到TimesTen中
ttisql "dsn=TT_1122;uid=cacheadmin;PWD=cacheadmin;OraclePwd=cacheadmin";
1.啟動cache
Command>call ttcachestart
2.啟動cache之后就可以創建cache group了
創建group時,需要將表的名字和結構設置成與oracle數據庫中test用戶下的需要加載的表的名字和結構一模一樣,這樣才能匹配找到相應的表,否則無法加載數據。(這里創建的readonly類型的group)
con1: Command> create readonly cache group cache_a Autorefresh interval 5 seconds mode incremental From hxy.a(id number not null primary key , name varchar2(20));con1: Command> cachegroups;Cache Group CACHEADMIN.CACHE_A:Cache Group Type: Read OnlyAutorefresh: YesAutorefresh Mode: IncrementalAutorefresh State: PausedAutorefresh Interval: 5 SecondsAutorefresh Status: okAging: No aging definedRoot Table: HXY.ATable Type: Read Only1 cache group found.3. load cache group cache_a commit every 10 rows;
12.退出ttisql,重新進入,把對a表的查詢權限在timesten數據庫中授予cacheadmin
[timesten@oracle ~]$ ttisql TT_1122Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.Type ? or "help" for help, type "exit" to quit ttIsql.connect "DSN=TT_1122";Connection successful: DSN=TT_1122;UID=timesten;DataStore=/u01/app/timesten/TimesTen/tt1122/info/TT_1122;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/app/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=2048;TempSize=1024;TypeMode=0;OracleNetServiceName=db11;(Default setting AutoCommit=1)GRANT SELECT ON hxy.a TO cacheadmin;GRANT INSERT ON hxy.a TO cacheadmin;GRANT UPDATE ON hxy.a TO cacheadmin;GRANT DELETE ON hxy.a TO cacheadmin;
連接
Command> connect "dsn=TT_1122;uid=cacheadmin;PWD=cacheadmin;OraclePwd=cacheadmin";Connection successful: DSN=TT_1122;UID=cacheadmin;DataStore=/u01/app/timesten/TimesTen/tt1122/info/TT_1122;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/app/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=2048;TempSize=1024;TypeMode=0;OracleNetServiceName=db11;(Default setting AutoCommit=1)con1: Command> select * from hxy.a;0 rows found. ----沒有數據
在oracle數據庫中插入數據
SQL> show userUSER is "HXY"SQL>SQL> insert into a values(1,'hello');1 row created.SQL> insert into a values(2,'hxy');1 row created.SQL> commit;
去IMDB查詢
con1: Command> select * from hxy.a;< 1, hello >< 2, hxy >2 rows found.
可見,在oracle中提交,數據會自動復制到IMDB中
錯誤:
1.字符集設置成ZHS16GBK報下面的錯誤:
[timesten@oracle info]$ ttisql TT_1122Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.Type ? or "help" for help, type "exit" to quit ttIsql.connect "DSN=TT_1122";6228: Invalid value (AL32UTF8) for DatabaseCharacterSet connection attribute -- value must be the same as the current data store value (US7ASCII)The command failed.Done.Command> call ttcacheuidpwdset('cacheadmin','cacheadmin');8296: TimesTen and Oracle database character sets do not match. TimesTen: US7ASCII, Oracle: ZHS16GBK5935: Could not validate Oracle login: uid = CACHEADMIN, pwd = HIDDEN, OracleNetServiceName = db11, TNS_ADMIN = "/u01/app/oracle11g/product/11.2.0/dbhome_1/network/admin", ORACLE_HOME= "/u01/app/oracle11g/product/11.2.0/dbhome_1"The command failed.Command> exitDisconnecting...
分析
這個問題是因為已經初始化一次TT_1122后又修改了sys.odbc.ini中DatabaseCharacterSet=AL32UTF8參數。
解決方法:
刪掉TT_1122重新初始化并且重新建立用戶
[timesten@oracle info]$ ttDestroy TT_1122-bash-4.1$ ttisql TT_1122Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.Type ? or "help" for help, type "exit" to quit ttIsql.connect "DSN=TT_1122";Connection successful: DSN=TT_1122;UID=timesten;DataStore=/opt/timesten/TimesTen/tt1122/info/TT_1122;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;DRIVER=/opt/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=2048;TempSize=1024;TypeMode=0;OracleNetServiceName=NINVOICE;(Default setting AutoCommit=1)Command> exitDisconnecting...Done.
2.剛開始使用
connect "dsn=TT_1122;uid=cacheadmin;PWD=cacheadmin;OraclePwd=cacheadmin";
連接的時候一直報下面的錯誤:
Command> connect "dsn=TT_1122;uid=cacheadm;OraclePWD=cacheadm;OraclePwd=cacheadm";7001: User authentication failedThe command failed.
郁悶的不行,最后在內存數據庫中又執行了一次
Command> create user cacheadmin identified by cacheadmin;User created.Command> grant create session,cache_manager,create any table to cacheadmin;Command> create user hxy identified by hxy;User created.Command> grant create session,create any table to hxy;
然后再次連接成功,奇怪,難道內存中的用戶消失了???
3.創建cache group的時候報錯
con1: Command> create readonly cache group cache_a Autorefresh interval 5 seconds mode incremental From hxy.a(id number not null primary key , name varchar2(20));5140: Could not find HXY.A in Oracle. May not have privileges.The command failed.
解決辦法:
把對表的查詢權限授予cache管理用戶cacheadmin
GRANT SELECT ON hxy.a TO cacheadmin;GRANT INSERT ON hxy.a TO cacheadmin;GRANT UPDATE ON hxy.a TO cacheadmin;GRANT DELETE ON hxy.a TO cacheadmin;
參考:
http://blog.itpub.net/16381228/viewspace-764825 ---有錯誤,已在上文中修正
來自為知筆記(Wiz)
轉載于:https://www.cnblogs.com/haoxiaoyu/p/625fc8b1ba9a9385e3d1e38ec050e55f.html
總結
以上是生活随笔為你收集整理的一.Timesten安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 赛乐尔GS122T价格多少钱,目前跟琴行
- 下一篇: 判断年月日是否正确