Oracle 11.2.0.4应用缓存之一(TimesTen 1

2020-02-12  本文已影响0人  轻飘飘D

1.Timesten端Oracle数据库服务定义配置

[timesten@XAG816 ~]$ cd $TT_HOME/network/admin
[timesten@XAG816 admin]$ pwd
/home/timesten/TimesTen/tt1122/network/admin
[timesten@XAG816 admin]$ cat tnsnames.ora 
DG =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = XAG142)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DG)
    )
  )

[timesten@XAG816 admin]$ sqlplus sys/123456@DG as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Wed Feb 12 14:50:34 2020
Copyright (c) 1982, 2010, 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
  1. Oracle端创建ttuser用户(与Timesten中同名)
[timesten@XAG816 admin]$ sqlplus sys/123456@DG as sysdba

SQL> create user ttuser identified by oracle;               

SQL> grant create session,resource,create view to ttuser;

SQL> connect ttuser/oracle@DG
Connected.
  1. 配置字符集(两边一致)
[timesten@XAG816 admin]$ sqlplus sys/123456@DG as sysdba

SQL> select value from nls_database_parameters where parameter='NLS_CHARACTERSET';

VALUE
--------------------------------------------------------------------------------
AL32UTF8

[timesten@XAG816 network]$ cd $TT_HOME/info
[timesten@XAG816 info]$ pwd
/home/timesten/TimesTen/tt1122/info

[timesten@XAG816 info]$ sed -n '/\[cachedb1_1122\]/,/^$/p' sys.odbc.ini
[cachedb1_1122]
Driver=/home/timesten/TimesTen/tt1122/lib/libtten.so
DataStore=/etc/TimesTen/DemoDataStore/cachedb1_1122
PermSize=40
TempSize=32
PLSQL=1
DatabaseCharacterSet=AL32UTF8
OracleNetServiceName=DG
  1. Tiemsten端创建 ttuser 用户
[timesten@XAG816 info]$ ttisql -v1 cachedb1_1122
Command> create user ttuser identified by timesten;
Command> grant create session,create table,create view,create sequence to ttuser;
Command> disconnect;
Command> connect "DSN = cachedb1_1122; uid = ttuser;pwd = timesten";
Command> exit
  1. 连通性连接测试1
[timesten@XAG816 info]$ ttisql "DSN=cachedb1_1122; uid = ttuser;pwd = timesten;oraclenetservicename=dg;oraclepwd=oracle";

Command> call ttversion;
< 11, 2, 2, 8, 47 >
1 row found.

Command> passthrough 3;
Passthrough command has set autocommit off.

Command> select * from v$version;
< Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production >
< PL/SQL Release 11.2.0.4.0 - Production >
< CORE  11.2.0.4.0  Production >
< TNS for Linux: Version 11.2.0.4.0 - Production >
< NLSRTL Version 11.2.0.4.0 - Production >
5 rows found.

Command> exit
Rolling back active transaction...
Disconnecting...
Done.

6.连通性连接测试2

[timesten@XAG816 info]$ ttisql -connstr "dsn=cachedb1_1122; uid = ttuser;pwd = timesten; oraclepwd=oracle" -e 'set prompt "TTUSER>"' 

TTUSER>call ttversion;
< 11, 2, 2, 8, 47 >
1 row found.

TTUSER>select * from v$version;
 2206: Table TTUSER.V$VERSION not found
The command failed.

TTUSER>passthrough 3;
Passthrough command has set autocommit off.

TTUSER>select * from v$version;
< Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production >
< PL/SQL Release 11.2.0.4.0 - Production >
< CORE  11.2.0.4.0  Production >
< TNS for Linux: Version 11.2.0.4.0 - Production >
< NLSRTL Version 11.2.0.4.0 - Production >
5 rows found.
上一篇下一篇

猜你喜欢

热点阅读