一.Timesten安装
一,安装timesten IMDB并测试
1. 创建数据库相关用户和组
groupadd timesten
useradd -g timesten -G dba timesten
passwd timesten
2. 创建相关目录
mkdir /etc/TimesTen
chmod 775 /etc/TimesTen
chown timesten:timesten /etc/TimesTen
mkdir /u01/app/timesTen
chmod 775 /u01/app/timesTen
chown 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_1
export TIMESTEN=/opt/timesten/TimesTen/tt1122
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
PATH=$PATH:$HOME/bin
export ORACLE_BASE=/u01/app/oracle11g
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=db11
export TIMESTEN=/u01/app/timesten/TimesTen/tt1122
export LD_LIBRARY_PATH=$TIMESTEN/lib:$ORACLE_HOME/lib
export PATH=$TIMESTEN/bin:$ORACLE_HOME/bin:$PATH:$HOME/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin
unset USERNAME
export PATH
4. 上传软件,并修改软件的用户和属组,切换到timesten用户
[root@oracle timesten]# su - timesten
[timesten@oracle ~]$ gzip -d timesten112280.linux8664.gz
[timesten@oracle ~]$ ls -l
total 344792
-rw-r--r-- 1 timesten timesten 353064960 May 28 2015 timesten112280.linux8664
[timesten@oracle ~]$ ls -l
total 344792
-rw-r--r-- 1 timesten timesten 353064960 May 28 2015 timesten112280.linux8664
[timesten@oracle ~]$ tar -xvf timesten112280.linux8664
linux8664/
linux8664/uninst.sh
linux8664/install.pl
linux8664/README.html
linux8664/LINUX8664/
linux8664/LINUX8664/ttpatchinst
linux8664/LINUX8664/unzip
linux8664/LINUX8664/common.tar.bz2
linux8664/LINUX8664/ttclient.tar.bz2
linux8664/LINUX8664/perl
linux8664/LINUX8664/manifest
linux8664/LINUX8664/timesten.tar.bz2
linux8664/LINUX8664/bzip2
linux8664/LINUX8664/ttserver.tar.bz2
linux8664/3rdparty/
linux8664/3rdparty/ant-1.6.2-bin.tar.bz2
linux8664/3rdparty/jms-1_1-fr-apidocs.tar.bz2
linux8664/doc/
linux8664/doc/doc.zip
linux8664/setup.sh
[timesten@oracle ~]$ ll
total 344796
drwxrwxr-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]$ ll
total 420
drwxr-xr-x 2 timesten timesten 4096 Jan 20 18:12 3rdparty
drwxrwxr-x 2 timesten timesten 4096 Jan 20 18:12 doc
-rwxr-xr-x 1 timesten timesten 256471 Jan 20 18:10 install.pl
drwxr-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.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/timesten
[2] /home/timesten
[3] Specify a location
[q] Quit the installation
Where would you like to install the tt1122 instance of TimesTen? [ 1 ] 3
Please specify a directory to install TimesTen? [ /home/timesten ] /u01/app/timesten
The 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/info
Would 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, 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 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 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 '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/admin
Would 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/admin
You 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 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? [ 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 -install
This 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.d
Successfully 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 times
root 31501 31129 0 Feb24 pts/3 00:00:00 su - timesten
timesten 31503 31501 0 Feb24 pts/3 00:00:00 -bash
timesten 35813 1 0 Feb24 ? 00:00:00 /u01/app/timesten/TimesTen/tt1122/bin/timestend -initfd 13
timesten 35817 35813 0 Feb24 ? 00:00:00 /u01/app/timesten/TimesTen/tt1122/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000000 -facility user
timesten 35819 35813 0 Feb24 ? 00:00:00 /u01/app/timesten/TimesTen/tt1122/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000002 -facility user
timesten 35820 35813 0 Feb24 ? 00:00:00 /u01/app/timesten/TimesTen/tt1122/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000003 -facility user
timesten 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 timesten
timesten 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 Driver
sampledb_1122=TimesTen 11.2.2 Driver
cachedb1_1122=TimesTen 11.2.2 Driver
repdb1_1122=TimesTen 11.2.2 Driver
repdb2_1122=TimesTen 11.2.2 Driver
sampledbCS_1122=TimesTen 11.2.2 Client Driver
cachedb1CS_1122=TimesTen 11.2.2 Client Driver
repdb1CS_1122=TimesTen 11.2.2 Client Driver
repdb2CS_1122=TimesTen 11.2.2 Client Driver
7. 连接测试
[timesten@oracle info]$ ttIsql TT_1122
Copyright (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> tables
0 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> tables
TIMESTEN.TT_TEST
1 table found.
Command> drop table tt_test;
Command> tables
0 tables found.
Command>
二. 同步用户数据设置
在timesten安装目录的oraclescripts有相关的oracle脚本
[root@oracle tt1122]# cd oraclescripts/
[root@oracle oraclescripts]# ll
total 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.TXT
drwxr-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 - ora11g
db11@oracle /home/ora11g$
db11@oracle /home/ora11g$
db11@oracle /home/ora11g$ cd /tmp/
db11@oracle /tmp$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Feb 25 01:58:16 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> @initCacheGlobalSchema
Please enter the tablespace where TIMESTEN user is to be created
users
The value chosen for tablespace is users
******* Creation of TIMESTEN schema and TT_CACHE_ADMIN_ROLE starts *******
1. Creating TIMESTEN schema
2. Creating TIMESTEN.TT_GRIDID table
3. Creating TIMESTEN.TT_GRIDINFO table
4. Creating TT_CACHE_ADMIN_ROLE role
5. 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 id
The value chosen for administrator user id is cacheadmin
***************** Initialization for cache admin begins ******************
0. Granting the CREATE SESSION privilege to CACHEADMIN
1. Granting the TT_CACHE_ADMIN_ROLE to CACHEADMIN
2. Granting the DBMS_LOCK package privilege to CACHEADMIN
3. Granting the CREATE SEQUENCE privilege to CACHEADMIN
4. Granting the CREATE CLUSTER privilege to CACHEADMIN
5. Granting the CREATE OPERATOR privilege to CACHEADMIN
6. Granting the CREATE INDEXTYPE privilege to CACHEADMIN
7. Granting the CREATE TABLE privilege to CACHEADMIN
8. Granting the CREATE PROCEDURE privilege to CACHEADMIN
9. Granting the CREATE ANY TRIGGER privilege to CACHEADMIN
10. Granting the GRANT UNLIMITED TABLESPACE privilege to CACHEADMIN
11. Granting the DBMS_LOB package privilege to CACHEADMIN
12. Granting the SELECT on SYS.ALL_OBJECTS privilege to CACHEADMIN
13. Granting the SELECT on SYS.ALL_SYNONYMS privilege to CACHEADMIN
14. Checking if the cache administrator user has permissions on the default
tablespace
No existing permission.
15. Altering the cache administrator to grant unlimited tablespace on USERS
16. Granting the CREATE TYPE privilege to CACHEADMIN
17. 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 id
The value chosen for administrator user id is hxy
***************** Initialization for cache admin begins ******************
0. Granting the CREATE SESSION privilege to HXY
1. Granting the TT_CACHE_ADMIN_ROLE to HXY
2. Granting the DBMS_LOCK package privilege to HXY
3. Granting the CREATE SEQUENCE privilege to HXY
4. Granting the CREATE CLUSTER privilege to HXY
5. Granting the CREATE OPERATOR privilege to HXY
6. Granting the CREATE INDEXTYPE privilege to HXY
7. Granting the CREATE TABLE privilege to HXY
8. Granting the CREATE PROCEDURE privilege to HXY
9. Granting the CREATE ANY TRIGGER privilege to HXY
10. Granting the GRANT UNLIMITED TABLESPACE privilege to HXY
11. Granting the DBMS_LOB package privilege to HXY
12. Granting the SELECT on SYS.ALL_OBJECTS privilege to HXY
13. Granting the SELECT on SYS.ALL_SYNONYMS privilege to HXY
14. Checking if the cache administrator user has permissions on the default
tablespace
No existing permission.
15. Altering the cache administrator to grant unlimited tablespace on USERS
16. Granting the CREATE TYPE privilege to HXY
17. 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.so
DataStore=/u01/app/timesten/TimesTen/tt1122/info/TT_1122
DatabaseCharacterSet=ZHS16GBK
OracleNetServiceName=db11
PermSize=2048
TempSize=1024
5. 启动TimesTen
[timesten@oracle info]$ ttdaemonadmin -stop
TimesTen Daemon stopped.
[timesten@oracle info]$ ttdaemonadmin -start
TimesTen Daemon startup OK.
[timesten@oracle info]$ ttisql TT_1122
Copyright (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 sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 26 01:09:06 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL>
SQL> conn hxy/hxy
Connected.
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 Only
Autorefresh: Yes
Autorefresh Mode: Incremental
Autorefresh State: Paused
Autorefresh Interval: 5 Seconds
Autorefresh Status: ok
Aging: No aging defined
Root Table: HXY.A
Table Type: Read Only
1 cache group found.
3. load cache group cache_a commit every 10 rows;
12.退出ttisql,重新进入,把对a表的查询权限在timesten数据库中授予cacheadmin
[timesten@oracle ~]$ ttisql TT_1122
Copyright (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 user
USER 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_1122
Copyright (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: ZHS16GBK
5935: 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> exit
Disconnecting...
分析
这个问题是因为已经初始化一次TT_1122后又修改了sys.odbc.ini中DatabaseCharacterSet=AL32UTF8参数。
解决方法:
删掉TT_1122重新初始化并且重新建立用户
[timesten@oracle info]$ ttDestroy TT_1122
-bash-4.1$ ttisql TT_1122
Copyright (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> exit
Disconnecting...
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 failed
The 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 ---有错误,已在上文中修正
一.Timesten安装的更多相关文章
- Red Hat TimesTen安装记录
1:内核参数修改 # vi /etc/sysctl.conf kernel.sem= #sysctl –p 备注:此安装过程为测试环境,具体参数修改要参考TimesTen官方文档. 2:创建用户及组信 ...
- TIMESTEN安装配置指南-中文版
TimesTen内存数据库 第一章 Cache Connect to Oracle概念 TimesTen数据交换技术提供在Oracle数据库和TimesTen数据管理器之间进行连接和双向数据传送.数据 ...
- 【原创】TimeSten安装与配置
1.安装TimeSten 2.安装时要指定TNS_ADMIN_LOCATION,即tnsnames.ora的路径,因为tt会根据这个连接Oracle.C:\TimesTen\tt1122_32\net ...
- TimesTen的安装和连接
注:本文只是单独用TimesTen,和Oracle一起用的不在本文讨论之内.开发语言为C#. TimesTen的过多介绍请访问Oracle官网,不过官网打开够慢的. 1.安装驱动 本人用的是ODP.N ...
- 64位Windows 7平台安装32位Timesten,配置ODBC数据源
问题: 由于系统版本原因,客户机只能安装32位的Timesten,但客户机的平台是64位的win 7,安装完成后按照常规的控制面板->管理工具->数据源(ODBC)打开的ODBC数据源管理 ...
- Oracle安装部署之 timesten install on redhat6.5
一.安装前检查 [root@localhost ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.5 (San ...
- TimesTen学习(三)安装、连接、远程连接TimesTen数据库
TimesTen学习(三)远程连接TimesTen数据库 <TimesTen学习(一)安装篇>:http://blog.itpub.net/23135684/viewspace-71774 ...
- TimesTen LINUX 安装日志
$ ./setup.sh NOTE: Each TimesTen installation is identified by a unique instance name. The instance ...
- 二.TimesTen原理及应用场景
声明:本文章转自麻袋爸爸 一,TimesTen应用场景 在谈论TimesTen内存数据库应用场景之前,我们先来介绍一下什么是内存数据库,及其工作原理吧.内存数据库,顾名思义就是将数据存放在内存中,并通 ...
随机推荐
- Linux学习之CentOS(二十)--CentOS6.4下修改MySQL编码方法
但是当我们在试图对数据库中的数据进行备份或者将sql文件导入到我们的数据库时可能就会碰到编码的问题,在windows下安装mysql时我们可以在安装的时候就选择好整个数据库的编码方式(通常设置成utf ...
- HTML5 Drop API
转自:http://www.cnblogs.com/fsjohnhuang/p/3961066.html 一.前言 在HTML4的时代,各前端工程师为了实现拖拽功能可说是煞费苦心,初听HTML5 ...
- Swift之控件-UIlabel
let label = UILabel(frame:CGRect(x: 20,y: 100,width: 280,height: 40)) label.text = "理想接电话是否很沮丧和 ...
- Applying vector median filter on RGB image based on matlab
前言: 最近想看看矢量中值滤波(Vector median filter, VMF)在GRB图像上的滤波效果,意外的是找了一大圈却发现网上没有现成的code,所以通过matab亲自实现了一个,需要学习 ...
- 对日期 ,和 master.dbo.spt_values 表操作
if object_id('tempdb..#xs') is not null drop table #xs; ), date datetime, sale float) insert into #x ...
- 【UWP】解析GB2312、GBK编码网页乱码问题
在WebHttpRequest请求网页后,获取到的中文是乱码,类似这样: <title>˹ŵ��Ϸ���������� - ��̳������ - ˹ŵ��Ϸ����</title ...
- 简单的C语言文法
<程序>→<外部声明>|<程序><外部声明> <外部声明>→<函数定义>|<声明> <函数定义>→< ...
- spring mvc controller间跳转 重定向 传参
http://blog.csdn.net/jackpk/article/details/19121777/
- 打不死的redis集群
导读 最近遇到部分系统因为redis服务挂掉,导致部分服务不可用.所以希望搭建一个redis集群镜像,把原先散落各处的redis服务器统一管理起来,并且保障高可用和故障自动迁移. 最近遇到部分系统因为 ...
- 如何灵活运用Linux 进程资源监控和进程限制
导读 每个 Linux 系统管理员都应该知道如何验证硬件.资源和主要进程的完整性和可用性.另外,基于每个用户设置资源限制也是其中一项必备技能. 在这篇文章中,我们会介绍一些能够确保系统硬件和软件正常工 ...