TimesTen 应用层数据库缓存学习:12. 管理缓存环境

2024-02-04 13:48

本文主要是介绍TimesTen 应用层数据库缓存学习:12. 管理缓存环境,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

缓存和复制代理的启停和状态查看

cache agent的作用是将监控Oracle中数据的变化,并更新到TimesTen。因此,对于只读和AWT缓存组,cache agent都是必需的。

cache agent的启停

ttisql> call ttcachestart
ttisql> call ttcachestop
或者
$ ttadmin -cachestart DSN
$ ttadmin -cachestop DSN

replication agent的启停

ttisql> call ttrepstart
ttisql> call ttrepstop
或者
$ ttadmin -repstart DSN
$ ttadmin -repstop DSN

cache agent 和 replication agent的状态查看

法一,通过ttadmin

[oracle@timesten-hol ~]$ ttadmin -query cachedb1_1122
RAM Residence Policy            : inUse
Replication Agent Policy        : manual
Replication Manually Started    : False <- 未启动
Cache Agent Policy              : manual
Cache Agent Manually Started    : True <- 已启动

法二,通过ttstatus(见底部)

[oracle@timesten-hol ~]$ ttstatus cachedb1_1122
TimesTen status report as of Thu Apr 21 02:47:00 2016Daemon pid 2705 port 53396 instance tt1122
TimesTen server pid 2714 started on port 53397
------------------------------------------------------------------------
Data store /home/oracle/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122
There are 25 connections to the data store
Shared Memory KEY 0x6300c874 ID 2392081
PL/SQL Memory KEY 0x6400c874 ID 2424850 Address 0x7fa0000000
Type            PID     Context             Connection Name              ConnID
Cache Agent     3938    0x00000000025b5b10  Handler                           2
Cache Agent     3938    0x000000000270d2b0  Timer                             3
Cache Agent     3938    0x00000000029c3930  LogSpaceMon(1093421376)           1
Cache Agent     3938    0x0000000002d66ed0  Marker(1101457728)                4
Process         5353    0x00000000020483a0  cachedb1                          7
Process         5353    0x00007f06e12e4c10  cachedb1                          6
Replication     5501    0x0000000003a1da60  LOGFORCE:0x4182b940             129
Replication     5501    0x0000000003a87570  REPHOLD:0x40c97940              130
Replication     5501    0x0000000003aac800  REPLISTENER:0x40f98940          131
Replication     5501    0x0000000003b13f10  TRANSMITTER(M):0x41f90940       128
Replication     5501    0x0000000003b87c00  RECEIVER:0x42291940             127
Replication     5501    0x0000000003e42320  AWT_SORTER:0x42592940           126
Replication     5501    0x0000000003e575a0  AWT_APPLIER:0x42893940          125
Replication     5501    0x0000000003e6c820  AWT_APPLIER:0x42b94940          124
Subdaemon       2709    0x00000000012ac360  Manager                         142
Subdaemon       2709    0x0000000001323ac0  Rollback                        141
Subdaemon       2709    0x00000000013ebe70  Flusher                         140
Subdaemon       2709    0x0000000001401210  Monitor                         139
Subdaemon       2709    0x0000000001416490  Deadlock Detector               138
Subdaemon       2709    0x000000000146b970  Aging                           135
Subdaemon       2709    0x00000000014c0f70  AsyncMV                         133
Subdaemon       2709    0x00000000014d61f0  HistGC                          132
Subdaemon       2709    0x00000000014eb470  IndexGC                         134
Subdaemon       2709    0x00007f9d58000b00  Checkpoint                      137
Subdaemon       2709    0x00007f9d58015ea0  Log Marker                      136
Replication policy  : Manual
Replication agent is running.
Cache Agent policy  : Manual
TimesTen's Cache agent is running for this data store
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group oracle
End of report

法三,再启动一次

ttisql>call ttrepstart;
12026: The agent is already running for the data store.
The command failed.

cache agent 和 replication agent连接Oracle的行为

cache agent: 会永远尝试重连

When a connection from the cache agent to the Oracle database fails, the cache agent attempts to connect every 10 seconds. If the cache agent cannot connect to the Oracle database, the cache agent restarts after 10 minutes. This behavior repeats forever.

replication agent: 重连超时后不再尝试连接
When a connection from the replication agent to the Oracle database fails, the replication agent attempts to reconnect to the Oracle database after 120 seconds. If it cannot reconnect after 120 seconds, the replication agent stops and does not restart.

监控 cache groups 和 cache grids

cachegroups命令

可以重点关注,Autorefresh的State, Interval,Cache Group Type,Where条件,Aging策略

Command> cachegroups;Cache Group CACHEUSER.RECENT_SHIPPED_ORDERS:Cache Group Type: Read OnlyAutorefresh: YesAutorefresh Mode: IncrementalAutorefresh State: OnAutorefresh Interval: 1440 MinutesAutorefresh Status: okAging: Timestamp based uses column WHEN_SHIPPED lifetime 30 days cycle 24 hours onRoot Table: ORATT.ORDERSTable Type: Read Only

监控缓存组的autorefresh操作

详见 TimesTen 应用层数据库缓存学习:10. 监控缓存组的autorefresh操作

监控AWT缓存组

详见 TimesTen 应用层数据库缓存学习:11. AWT性能监控

为缓存组配置事务日志文件数阈值

复制agent使用事务日志来传递更新到Oracle端,如果传递失败,事务日志就会不断累积,而不会被删除。
可使用ttCacheAWTThresholdSet来指定最大可累积的事务日志文件数,缺省为0,如果超出,则TimesTen不再跟踪AWT的变化,后续需要手工与Oracle同步。

cacheadm>CALL ttCacheAWTThresholdGet;
< 0 >
1 row found.
cacheadm>CALL ttCacheAWTThresholdSet(5);
cacheadm>CALL ttCacheAWTThresholdGet;
< 5 >
1 row found.
cacheadm>CALL ttCacheAWTThresholdSet(0);

Obtaining information for a cache grid

使用ttGridInfo和ttGridNodeStatus

cachedb1> call ttGridInfo;
< SAMPLEGRID, CACHEADM, Linux x86-64, 64-bit, 11, 2, 2 >
cachedb2> call ttGridNodeStatus;
< SAMPLEGRID, 1, 1, T, localhost, SAMPLEGRID_cachedb1_1, 127.0.0.1, 9991, <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< SAMPLEGRID, 2, 1, T, localhost, SAMPLEGRID_cachedb2_2, 127.0.0.1, 9992, <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >

暂停/恢复全局缓存组(Cache Grid)的AWT操作

ttGridGlobalCGSuspend 和 ttGridGlobalCGResume
注意,ttGridGlobalCGSuspend与ttCachePropagateFlagSet不一样,ttGridGlobalCGSuspend是临时的,在Resume后仍会将数据传递到Oracle。
并且ttGridGlobalCGSuspend只适用于Global Cache Group,即Cache Grid,并只用于以下操作:
- Dynamic loading
- Deleting cache instances

跟踪Oracle端缓存表的DDL语句

缺省是不跟踪Oracle的DDL语句的,如果要跟踪,可以使用以下命令:

Command> CALL ttCacheDDLTrackingConfig('enable');

Oracle端建立的trigger会将DDL语句插入表TT_*version*_DDL_L中。

Oracle端的schema发生变化,会影响到相应的Cache Group。修改Oracle端schema过程如下

1. 删除cache group
2. 确认所有的更新已同步到Oracle
cacheadm>CALL ttRepSubscriberWait('_AWTREPSCHEME','TTREP','_ORACLE','TIMESTEN-HOL',-1);
< 00 >
1 row found.
3. 停止cache agent
4. 修改Oracle的schema
5. 重建cache group

管理缓存环境中Oracle数据库中的对象

对于autorefresh的缓存组,TimesTen会在Oracle库中为每一个表建立change log 表和触发器。被缓存表发生更改时,会将更改的主键存入change log表中。
下面这段描述对于理解cache grop的概念是相当的重要:

For an autorefresh cache group, TimesTen creates a change log table and trigger in the Oracle database for each cache table in the cache group. The trigger is fired for each committed insert, update, or delete operation on the cached Oracle Database table. The trigger records the primary key of the updated rows in the change log table. The cache agent periodically scans the change log table for updated keys and then joins this table with the cached Oracle Database table to get a snapshot of the latest updates.

在创建cache group时,这些对象会自动建立,你也可以通过如cachesqlget得到SQL脚本并执行来手工建立。
这些对象中,最重要的有两个:
change log table: TT_*version_object-ID*_L
Trigger: TT_*version_object-ID*_T

例如,在创建了readonly缓存组RO后,可以查看信息:

$ sqlplus cacheadm/oracle@ttorclSQL*Plus: Release 11.2.0.2.0 Production on Thu Apr 21 23:01:34 2016Copyright (c) 1982, 2010, Oracle.  All rights reserved.Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> @cacheInfo
*************Autorefresh Objects Information  ***************
Host name: timesten-hol
Timesten datastore name:
/home/oracle/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122
Cache table name: TTHR.ORDERS
Change log table name: tt_06_87144_L
Number of rows in change log table: 1
Maximum logseq on the change log table: 0
Timesten has autorefreshed updates upto logseq: 0
Number of updates waiting to be autorefreshed: 0
Number of updates that has not been marked with a valid logseq: 0
****************************
*************No DDL Tracking objects are found*************PL/SQL procedure successfully completed.

其中change log table表名为tt_06_87144_L

SQL> select owner || '.' || object_name from all_objects where object_id = 87144;OWNER||'.'||OBJECT_NAME
-------------------------------------------------------------
TTHR.ORDERS
SQL> select owner, object_name, object_type from all_objects where object_name like '%87144%';OBJECT_NAME                    OBJECT_TYPE
------------------------------ -------------------
TT_06_87144_L                  TABLE
TT_06_87144_LL                 INDEX
TT_06_87144_T                  TRIGGER# change log table中只记录了主键
SQL> desc TT_06_87144_L;Name                                      Null?    Type----------------------------------------- -------- ----------------------------LOGSEQ                                             NUMBERFT_CACHEGROUP                             NOT NULL NUMBERORD_NUM                                            NUMBERXID                                                VARCHAR2(150)

trigger的定义为:

create or replace TRIGGER CACHEADM.TT_06_87144_t AFTER DELETE OR INSERT OR UPDATE ON "TTHR"."ORDERS" FOR EACH ROW DECLARE MAX_INT CONSTANT INT := 99999999999999999999999999999999999999; minReportTS DATE; minBookmark NUMBER; reqdEmptySpaces INT := 2; err_num NUMBER; dummy INT; dummyName CHAR(100); noRecovery INT := 0; BEGIN <<retry>> BEGIN IF (INSERTING) THEN INSERT INTO CACHEADM.TT_06_87144_l (logseq, ft_cachegroup, "ORD_NUM", xid) VALUES(MAX_INT, 0, :NEW."ORD_NUM", dbms_transaction.local_transaction_id); 
ELSE IF (UPDATING AND ((:OLD."ORD_NUM" <> :NEW."ORD_NUM"))) THEN INSERT INTO CACHEADM.TT_06_87144_l (logseq, ft_cachegroup, "ORD_NUM", xid) VALUES(MAX_INT, 0, :NEW."ORD_NUM", dbms_transaction.local_transaction_id); 
END IF; INSERT INTO CACHEADM.TT_06_87144_l (logseq, ft_cachegroup, "ORD_NUM", xid) VALUES(MAX_INT, 0, :OLD."ORD_NUM", dbms_transaction.local_transaction_id); END IF;
EXCEPTION WHEN OTHERS THEN err_num := SQLCODE; BEGIN execute immediate 'select objectname from CACHEADM.TT_06_SYNC_OBJS where objectname = :objectName' into dummyName using 'DONOTTRUNCATE'; IF(SQL%ROWCOUNT > 0) THEN RAISE; END IF; EXCEPTION WHEN NO_DATA_FOUND THEN dummy := 0; END; noRecovery := 0; IF(err_num = -1536 OR err_num = -1653 OR err_num = -1654 OR err_num = -1688 OR err_num = -3233) THEN BEGIN execute immediate 'select value from CACHEADM.TT_06_ar_params where param = :paramName and value = :paramValue and upper(tblowner) = upper(:owner) and upper(tblname) = upper(:tbl)' into dummyName using 'TblSpaceFullRecovery','reload' ,'TTHR','ORDERS'; IF(SQL%NOTFOUND OR SQL%ROWCOUNT <= 0) THEN noRecovery := 1; END IF; EXCEPTION WHEN NO_DATA_FOUND THEN noRecovery := 1; END; IF (noRecovery = 1) THEN RAISE; END IF; execute immediate 'select min(bookmark) from CACHEADM.TT_06_agent_status where object_id = 87144 and cgType = 0' into minBookmark; delete from CACHEADM.TT_06_87144_l where logseq <= minBookmark; IF(SQL%ROWCOUNT >= reqdEmptySpaces) THEN insert into CACHEADM.TT_06_87144_l(logseq, ft_cachegroup) values (minBookmark, 0); goto retry; ELSE execute immediate 'select min(reportTS) from CACHEADM.TT_06_agent_status where object_id = 87144 and cgType = 0' into minReportTS; execute immediate 'select bookmark from CACHEADM.TT_06_agent_status where object_id = 87144 and reportTS = :minReportTS  and cgType = 0' into minBookmark using minReportTS; delete from CACHEADM.TT_06_87144_l where logseq <= minBookmark; IF(SQL%ROWCOUNT >= reqdEmptySpaces) THEN insert into CACHEADM.TT_06_87144_l(logseq, ft_cachegroup) values (minBookmark, 0); goto retry; ELSE delete from CACHEADM.TT_06_87144_l; IF(SQL%ROWCOUNT < reqdEmptySpaces) THEN RAISE; END IF; goto retry; END IF; END IF; ELSE RAISE; END IF; END; END; SELECT DBMS_METADATA.GET_DDL('TRIGGER', 'TT_06_87144_T', 'CACHEADM' ) txt
FROM DUAL;

autorefresh操作失败带来的影响

例如由于cache agent没有启动,或TimesTen数据库宕机等导致autorefresh失败,会导致在Oracle端的change log table中数据堆积。
空间还是其次,最重要会影响autorefresh的性能。
特别是同一表被多个TimesTen缓存时,只有所有的autorefresh完成后,change log才能被删除。因此可以设置一个超时,以防止change log中的数据累积和不能删除。

cacheadm>CALL ttCacheConfig('AgentTimeout');
< AgentTimeout, <NULL>, <NULL>, 0 >
1 row found.
cacheadm>CALL ttCacheConfig('AgentTimeout',,,'900');
< AgentTimeout, <NULL>, <NULL>, 900 >
1 row found.
cacheadm>CALL ttCacheConfig('AgentTimeout',,,'0');
< AgentTimeout, <NULL>, <NULL>, 0 >
1 row found.
cacheadm>CALL ttCacheConfig('AgentTimeout');
< AgentTimeout, <NULL>, <NULL>, 0 >
1 row found.

ttCacheDbCgStatus可以显示数据库和缓存组的autorefresh状态,第一列为数据库状态,第二列为缓存组状态

获取TimesTen数据库的autorefresh状态:
ok:change log表中删除的数据已加载到cache table
dead:change log表中的一些数据未加载到cache table,非同步状态,待恢复

获取缓存组的autorefresh状态:
alive:所有的缓存组autorefresh状态为ok
dead:所有的缓存组autorefresh状态为dead

cacheadm>CALL ttCacheDbCgStatus;
< alive, <NULL> >
1 row found.
cacheadm>CALL ttCacheDbCgStatus('cacheadm','RO');
< alive, ok >
1 row found.

清理 Oracle遗留的缓存组对象

如果TimesTen数据库被意外删除,Oracle数据库中就会遗留一些为autorefresh缓存组建立的对象,这时可以用TimesTen_install_dir/oraclescripts/cacheCleanUp.sql 来删除,这个脚本带的参数可以首先用cacheInfo.sql得到。

$ ttdestroy cachedb1_1122
Failed to destroy data store: TT10026: Some cache groups that hold triggers and other objects in Oracle may exist in the datastore, drop all the cache groups before destroying the datastore -- file "db.c", lineno 20679, procedure "sbDbDestroy"$ ttdestroy -force cachedb1_1122# TimesTen数据库被强行删除了,但这时还有对象遗留在Oracle中$ sqlplus cacheadm/oracle@ttorclSQL*Plus: Release 11.2.0.2.0 Production on Fri Apr 22 02:15:28 2016Copyright (c) 1982, 2010, Oracle.  All rights reserved.Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> @cacheInfo
*************Autorefresh Objects Information  ***************
Host name: timesten-hol
Timesten datastore name:
/home/oracle/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122
Cache table name: TTHR.ORDERS
Change log table name: tt_06_87144_L
Number of rows in change log table: 1
Maximum logseq on the change log table: 0
Timesten has autorefreshed updates upto logseq: 0
Number of updates waiting to be autorefreshed: 0
Number of updates that has not been marked with a valid logseq: 0
****************************
*************No DDL Tracking objects are found*************PL/SQL procedure successfully completed.SQL> @cacheCleanUp Please enter the hostname
timesten-hol
The value chosen for the hostname is timesten-holPlease enter the datastore
/home/oracle/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122
The value chosen for the datastore is /home/oracle/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122*****************************OUTPUT**************************************
Performing cleanup for object_id: 87144 which belongs to table : ORDERS
Executing: delete from tt_06_agent_status where LOWER(host) = timesten-hol and
LOWER(datastore) = /home/oracle/timesten/tt1122/info/demodatastore/cachedb1_1122
and object_id = 87144
Executing: drop trigger tt_06_87144_T
Executing: drop table tt_06_87144_L
Executing: delete from tt_06_user_count where object_id = object_id1
Executing: delete from tt_06_databases where LOWER(host) = timesten-hol and
LOWER(datastore) = /home/oracle/timesten/tt1122/info/demodatastore/cachedb1_1122
**************************************************************************PL/SQL procedure successfully completed.

Monitoring the cache administration user’s tablespace

由于change log表频繁更新,可能会导致表空间碎片,因此可以设定碎片率的阈值,缺省为40%。

cacheadm>CALL ttCacheConfig('AutoRefreshLogFragmentationWarningPCT');
< AutoRefreshLogFragmentationWarningPCT, <NULL>, <NULL>, 40 >
1 row found.
cacheadm>CALL ttCacheConfig('AutoRefreshLogFragmentationWarningPCT',,,'50');
< AutoRefreshLogFragmentationWarningPCT, <NULL>, <NULL>, 50 >
1 row found.
cacheadm>CALL ttCacheConfig('AutoRefreshLogFragmentationWarningPCT');
< AutoRefreshLogFragmentationWarningPCT, <NULL>, <NULL>, 50 >
1 row found.

可以设定当超过阈值时采取的动作,缺省无动作,可以设定Compact,Reclaim。

cacheadm>CALL ttCacheConfig('AutoRefreshLogDeFragmentAction');
< AutoRefreshLogDeFragmentAction, <NULL>, <NULL>, MANUAL >
1 row found.
cacheadm>CALL ttCacheConfig('AutoRefreshLogDeFragmentAction',,,'CompactAndReclaim');
< AutoRefreshLogDeFragmentAction, <NULL>, <NULL>, compactandreclaim >
1 row found.

使用ttCacheAutorefreshStatsGet 可以得到表空间当前的碎片率,就是最后几列

cacheadm>call ttCacheAutorefreshStatsGet('cacheadm', 'ro');
< 3766608, 2016-04-22 00:59:14.000000, 80457680, 1444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Complete, 0, 0, 0, 2016-04-22 00:58:22.000000, 0 >
< 3766608, 2016-04-22 00:59:09.000000, 80452680, 1443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Complete, 0, 0, 0, 2016-04-22 00:58:22.000000, 0 >
......

也可以直接对change log table执行defrag和reclaim.

CALL ttCacheAutoRefreshLogDeFrag('CompactAndReclaim');

除碎片外,另一个问题就是防止表空间满,缺省的警告阈值为50%

cacheadm>CALL ttCacheConfig('AutoRefreshLogTblSpaceUsagePCT');
< AutoRefreshLogTblSpaceUsagePCT, <NULL>, <NULL>, 50 >
1 row found.
cacheadm>CALL ttCacheConfig('AutoRefreshLogTblSpaceUsagePCT',,,'80');
< AutoRefreshLogTblSpaceUsagePCT, <NULL>, <NULL>, 80 >
1 row found.
cacheadm>CALL ttCacheConfig('AutoRefreshLogTblSpaceUsagePCT');
< AutoRefreshLogTblSpaceUsagePCT, <NULL>, <NULL>, 80 >
1 row found.

也可以设定表空间满时相应的操作

# 缺省无动作
cacheadm>CALL ttCacheConfig('TblSpaceFullRecovery','tthr','orders');
< TblSpaceFullRecovery, TTHR, ORDERS, none >
1 row found.
# 表空间满时,删除change log table,并reload
cacheadm>CALL ttCacheConfig('TblSpaceFullRecovery','tthr','orders', 'reload');
< TblSpaceFullRecovery, TTHR, ORDERS, reload >
1 row found.

grid node的错误恢复

数据库从错误中恢复后,可以自动的加入cache grid。
正常的状态如下:

cacheadm>CALL ttRepStateGet;
< IDLE, AVAILABLE >
1 row found.

本例中没有cache grid,因此

cacheadm>CALL ttRepStateGet;
< IDLE, NO GRID >
1 row found.

带缓存组数据库的备份和恢复

带缓存组数据库可以用ttbackup和ttmigrate备份和恢复

tthr>select count(*) from orders;
< 2091 >
1 row found.
$ mkdir /tmp/dump
$ ttBackup -dir /tmp/dump -connstr "DSN=cachedb1_1122"
Backup started ...
Backup complete
$ ls -l /tmp/dump
total 84724
-rw------- 1 oracle oracle 61047272 Apr 22 01:29 cachedb1_1122.0.bac
-rw------- 1 oracle oracle 25604096 Apr 22 01:29 cachedb1_1122.0.bac19
-rw------- 1 oracle oracle      720 Apr 22 01:29 cachedb1_1122.sta
cacheadm>call ttcachestop;
cacheadm>drop cache group cacheadm.ro;
$ ttdestroy cachedb1_1122
$ ttRestore -dir /tmp/dump -connstr "DSN=cachedb1_1122"
Restore started ...
Restore complete
$ rm -fr /tmp/dump/tthr>select count(*) from orders;
< 2091 >
1 row found.
cacheadm>call ttCacheUidGet();
< CACHEADM >
1 row found.
cacheadm>cachegroups;Cache Group CACHEADM.RO:Cache Group Type: Read OnlyAutorefresh: YesAutorefresh Mode: IncrementalAutorefresh State: OnAutorefresh Interval: 5 SecondsAutorefresh Status: CAging: No aging definedRoot Table: TTHR.ORDERSTable Type: Read Only1 cache group found.# 本以为unload+load就可以恢复,但却出错了
cacheadm>call ttcachestart;
cacheadm>alter cache group ro set autorefresh state paused;
cacheadm>load cache group ro commit every 256 rows;5919: The log table TT_06_87144_L is different from when the cache was created or no longer exists.  The cache group definition is no longer valid.
The command failed.# 看来只有删除重建
cacheadm>drop cache group ro;
cacheadm>CREATE READONLY CACHE GROUP "RO" >  AUTOREFRESH MODE INCREMENTAL INTERVAL 5 SECONDS>  STATE ON>  FROM>   "TTHR"."ORDERS" (>     "ORD_NUM"   NUMBER(38)   NOT NULL,>     "SHIP_TIME" TIMESTAMP(6) NOT NULL,>     PRIMARY KEY("ORD_NUM")>   );

ttmigrate/ttrestore的操作大同小异,就不赘述了。

修改 cache用户的用户名和口令

cache用户有两个,在TimesTen中的叫cache manager,在Oracle中的叫cache admin。
修改用户名牵扯的东西太多了,不建议。用户名我们建议Oracle和TimesTen一样,cacheadm或cacheuser
修改cache manager的口令不会有什么影响。
修改cache admin的口令后,需要用ttCacheUidPwdSet 重新设置,如下:

cacheadm>passthrough 3
Passthrough command has set autocommit off.
cacheadm>alter user cacheadm identified by cacheadm;
cacheadm>passthrough 0;
cacheadm>alter cache group ro set autorefresh state paused; <- 改口令后,就连不上了5213: Bad Oracle login error in OCISessionBegin(): ORA-01017: invalid username/password; logon denied rc = -15131: Cannot connect to backend database: OracleNetServiceName = "ttorcl", uid = "CACHEADM", pwd is hidden, TNS_ADMIN = "/u01/app/oracle/product/11.2.0/dbhome_1/network/admin", ORACLE_HOME= "/u01/app/oracle/product/11.2.0/dbhome_1"5109: Cache Connect general error: BDB connections not open.
The command failed.
cacheadm>rollback;
cacheadm>call ttCacheUidPwdSet('cacheadm', 'cacheadm');
cacheadm>alter cache group ro set autorefresh state paused;

这篇关于TimesTen 应用层数据库缓存学习:12. 管理缓存环境的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/677716

相关文章

mac安装nvm(node.js)多版本管理实践步骤

《mac安装nvm(node.js)多版本管理实践步骤》:本文主要介绍mac安装nvm(node.js)多版本管理的相关资料,NVM是一个用于管理多个Node.js版本的命令行工具,它允许开发者在... 目录NVM功能简介MAC安装实践一、下载nvm二、安装nvm三、安装node.js总结NVM功能简介N

MySQL8.0设置redo缓存大小的实现

《MySQL8.0设置redo缓存大小的实现》本文主要在MySQL8.0.30及之后版本中使用innodb_redo_log_capacity参数在线更改redo缓存文件大小,下面就来介绍一下,具有一... mysql 8.0.30及之后版本可以使用innodb_redo_log_capacity参数来更改

Python调用Orator ORM进行数据库操作

《Python调用OratorORM进行数据库操作》OratorORM是一个功能丰富且灵活的PythonORM库,旨在简化数据库操作,它支持多种数据库并提供了简洁且直观的API,下面我们就... 目录Orator ORM 主要特点安装使用示例总结Orator ORM 是一个功能丰富且灵活的 python O

使用 sql-research-assistant进行 SQL 数据库研究的实战指南(代码实现演示)

《使用sql-research-assistant进行SQL数据库研究的实战指南(代码实现演示)》本文介绍了sql-research-assistant工具,该工具基于LangChain框架,集... 目录技术背景介绍核心原理解析代码实现演示安装和配置项目集成LangSmith 配置(可选)启动服务应用场景

SpringBoot中使用 ThreadLocal 进行多线程上下文管理及注意事项小结

《SpringBoot中使用ThreadLocal进行多线程上下文管理及注意事项小结》本文详细介绍了ThreadLocal的原理、使用场景和示例代码,并在SpringBoot中使用ThreadLo... 目录前言技术积累1.什么是 ThreadLocal2. ThreadLocal 的原理2.1 线程隔离2

Java深度学习库DJL实现Python的NumPy方式

《Java深度学习库DJL实现Python的NumPy方式》本文介绍了DJL库的背景和基本功能,包括NDArray的创建、数学运算、数据获取和设置等,同时,还展示了如何使用NDArray进行数据预处理... 目录1 NDArray 的背景介绍1.1 架构2 JavaDJL使用2.1 安装DJL2.2 基本操

使用Navicat工具比对两个数据库所有表结构的差异案例详解

《使用Navicat工具比对两个数据库所有表结构的差异案例详解》:本文主要介绍如何使用Navicat工具对比两个数据库test_old和test_new,并生成相应的DDLSQL语句,以便将te... 目录概要案例一、如图两个数据库test_old和test_new进行比较:二、开始比较总结概要公司存在多

MySQL数据库函数之JSON_EXTRACT示例代码

《MySQL数据库函数之JSON_EXTRACT示例代码》:本文主要介绍MySQL数据库函数之JSON_EXTRACT的相关资料,JSON_EXTRACT()函数用于从JSON文档中提取值,支持对... 目录前言基本语法路径表达式示例示例 1: 提取简单值示例 2: 提取嵌套值示例 3: 提取数组中的值注意

查询SQL Server数据库服务器IP地址的多种有效方法

《查询SQLServer数据库服务器IP地址的多种有效方法》作为数据库管理员或开发人员,了解如何查询SQLServer数据库服务器的IP地址是一项重要技能,本文将介绍几种简单而有效的方法,帮助你轻松... 目录使用T-SQL查询方法1:使用系统函数方法2:使用系统视图使用SQL Server Configu

SQL Server数据库迁移到MySQL的完整指南

《SQLServer数据库迁移到MySQL的完整指南》在企业应用开发中,数据库迁移是一个常见的需求,随着业务的发展,企业可能会从SQLServer转向MySQL,原因可能是成本、性能、跨平台兼容性等... 目录一、迁移前的准备工作1.1 确定迁移范围1.2 评估兼容性1.3 备份数据二、迁移工具的选择2.1