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

相关文章

python常见环境管理工具超全解析

《python常见环境管理工具超全解析》在Python开发中,管理多个项目及其依赖项通常是一个挑战,下面:本文主要介绍python常见环境管理工具的相关资料,文中通过代码介绍的非常详细,需要的朋友... 目录1. conda2. pip3. uvuv 工具自动创建和管理环境的特点4. setup.py5.

SQL Server修改数据库名及物理数据文件名操作步骤

《SQLServer修改数据库名及物理数据文件名操作步骤》在SQLServer中重命名数据库是一个常见的操作,但需要确保用户具有足够的权限来执行此操作,:本文主要介绍SQLServer修改数据... 目录一、背景介绍二、操作步骤2.1 设置为单用户模式(断开连接)2.2 修改数据库名称2.3 查找逻辑文件名

SQL Server数据库死锁处理超详细攻略

《SQLServer数据库死锁处理超详细攻略》SQLServer作为主流数据库管理系统,在高并发场景下可能面临死锁问题,影响系统性能和稳定性,这篇文章主要给大家介绍了关于SQLServer数据库死... 目录一、引言二、查询 Sqlserver 中造成死锁的 SPID三、用内置函数查询执行信息1. sp_w

Python中使用uv创建环境及原理举例详解

《Python中使用uv创建环境及原理举例详解》uv是Astral团队开发的高性能Python工具,整合包管理、虚拟环境、Python版本控制等功能,:本文主要介绍Python中使用uv创建环境及... 目录一、uv工具简介核心特点:二、安装uv1. 通过pip安装2. 通过脚本安装验证安装:配置镜像源(可

使用jenv工具管理多个JDK版本的方法步骤

《使用jenv工具管理多个JDK版本的方法步骤》jenv是一个开源的Java环境管理工具,旨在帮助开发者在同一台机器上轻松管理和切换多个Java版本,:本文主要介绍使用jenv工具管理多个JD... 目录一、jenv到底是干啥的?二、jenv的核心功能(一)管理多个Java版本(二)支持插件扩展(三)环境隔

Go学习记录之runtime包深入解析

《Go学习记录之runtime包深入解析》Go语言runtime包管理运行时环境,涵盖goroutine调度、内存分配、垃圾回收、类型信息等核心功能,:本文主要介绍Go学习记录之runtime包的... 目录前言:一、runtime包内容学习1、作用:① Goroutine和并发控制:② 垃圾回收:③ 栈和

python获取cmd环境变量值的实现代码

《python获取cmd环境变量值的实现代码》:本文主要介绍在Python中获取命令行(cmd)环境变量的值,可以使用标准库中的os模块,需要的朋友可以参考下... 前言全局说明在执行py过程中,总要使用到系统环境变量一、说明1.1 环境:Windows 11 家庭版 24H2 26100.4061

Python中bisect_left 函数实现高效插入与有序列表管理

《Python中bisect_left函数实现高效插入与有序列表管理》Python的bisect_left函数通过二分查找高效定位有序列表插入位置,与bisect_right的区别在于处理重复元素时... 目录一、bisect_left 基本介绍1.1 函数定义1.2 核心功能二、bisect_left 与

Android学习总结之Java和kotlin区别超详细分析

《Android学习总结之Java和kotlin区别超详细分析》Java和Kotlin都是用于Android开发的编程语言,它们各自具有独特的特点和优势,:本文主要介绍Android学习总结之Ja... 目录一、空安全机制真题 1:Kotlin 如何解决 Java 的 NullPointerExceptio

pytest+allure环境搭建+自动化实践过程

《pytest+allure环境搭建+自动化实践过程》:本文主要介绍pytest+allure环境搭建+自动化实践过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录一、pytest下载安装1.1、安装pytest1.2、检测是否安装成功二、allure下载安装2.