ttAdmin -Ramload Error TT0848: Recovery failed on 2 set(s) of data store files

rongshiyuan發表於2012-11-12

Understand TimesTen ttAdmin -Ramload Error TT0848: Recovery failed on 2 set(s) of data store files [ID 1486360.1

Applies to:

TimesTen Data Server - Version 11.2.1 and later
Information in this document applies to any platform.

Goal

Answer question about error message and demonstrate how to reproduce.

Fix

Question:
What causes error "TT0848: Recovery failed on 2 set(s) of data store files" when ramloading the database?

Answer:
This error in this case is indicating that when TimesTen is trying to recover the database it cannot locate the
transaction log files that both of the checkpoint files depend upon. Please note this is one possible cause,
there may be others. The following example demonstrates how to reproduce this error.

Resolution:
The only method to recover from this situation is to either restore the database from a backup or recreate the
database from scratch.

Example:

01. Create Database DSN

vi /home/timesten/TimesTen/mk1122a/info/sys.odbc.ini

[mk1122a]
DatabaseCharacterSet=WE8MSWIN1252
DataStore=/data/dbs/mk1122a
LogBufParallelism=1
LogFileSize=8
LogBufMB=8
PermSize=64

02. Create Database

/home/timesten/TimesTen/mk1122a/bin/ttIsql -connstr "dsn=mk1122a"
create user mkuser identified by 'mkpwd';
grant admin, create session, cache_manager, create any table to mkuser;
exit;

/home/timesten/TimesTen/mk1122a/bin/ttIsql -connstr "dsn=mk1122a;uid=mkuser;pwd=mkpwd;oraclepwd=mkpwd"
create table mkuser.t1 (c1 integer not null primary key, c2 date, c3 varchar(50));
create sequence mkuser.s1;
create or replace procedure mkuser.p1
(v1 in integer) is
begin
for i in 1 .. v1 loop
insert into mkuser.t1 values (s1.nextval, sysdate, '01234567890123456789012345678901234567890123456789');
end loop;
end p1;
/
execute mkuser.p1(1);
select count(*) from mkuser.t1;
exit;

Output:

Command> execute mkuser.p1(1);
PL/SQL procedure successfully completed.
Command> select count(*) from mkuser.t1;
< 1 >
1 row found.

03. Load Data, Create Backlog And Delete Transaction Log Files That Both Checkpoints Depends On

/home/timesten/TimesTen/mk1122a/bin/ttIsql -connstr "dsn=mk1122a;uid=mkuser;pwd=mkpwd;oraclepwd=mkpwd"
call ttckptconfig(0,0,0);
call ttlogholds;
host ls -1 /data/dbs/mk1122a.log*
execute mkuser.p1(25000);
call ttlogholds;
host ls -1 /data/dbs/mk1122a.log*
call ttckpt;
call ttlogholds;
host ls -1 /data/dbs/mk1122a.log*
execute mkuser.p1(50000);
call ttlogholds;
host ls -1 /data/dbs/mk1122a.log*
host rm /data/dbs/mk1122a.log1
host rm /data/dbs/mk1122a.log2
call ttlogholds;
host ls -1 /data/dbs/mk1122a.log*
exit;

Output:

Command> call ttckptconfig(0,0,0);
< 0, 0, 0 >
1 row found.
Command> call ttlogholds;
< 1, 6273024, Checkpoint , mk1122a.ds0 >
< 1, 6346752, Checkpoint , mk1122a.ds1 >
2 rows found.
Command> host ls -1 /data/dbs/mk1122a.log*
Command> execute mkuser.p1(25000);
PL/SQL procedure successfully completed.
Command> call ttlogholds;
< 1, 6273024, Checkpoint , mk1122a.ds0 >
< 1, 6346752, Checkpoint , mk1122a.ds1 >
2 rows found.
Command> host ls -1 /data/dbs/mk1122a.log*
/data/dbs/mk1122a.log1
/data/dbs/mk1122a.log2
Command> call ttckpt;
Command> call ttlogholds;
< 1, 6346752, Checkpoint , mk1122a.ds1 >
< 2, 5521408, Checkpoint , mk1122a.ds0 >
2 rows found.
Command> host ls -1 /data/dbs/mk1122a.log*
/data/dbs/mk1122a.log1
/data/dbs/mk1122a.log2
Command> execute mkuser.p1(50000);
PL/SQL procedure successfully completed.
Command> call ttlogholds;
< 1, 6346752, Checkpoint , mk1122a.ds1 >
< 2, 5521408, Checkpoint , mk1122a.ds0 >
2 rows found.
Command> host ls -1 /data/dbs/mk1122a.log*
/data/dbs/mk1122a.log1
/data/dbs/mk1122a.log2
/data/dbs/mk1122a.log3
/data/dbs/mk1122a.log4
Command> host rm /data/dbs/mk1122a.log1
Command> host rm /data/dbs/mk1122a.log2
Command> call ttlogholds;
< 1, 6346752, Checkpoint , mk1122a.ds1 >
< 2, 5521408, Checkpoint , mk1122a.ds0 >
2 rows found.
Command> host ls -1 /data/dbs/mk1122a.log*
/data/dbs/mk1122a.log3
/data/dbs/mk1122a.log4
Command> exit
Disconnecting...
Warning 601: Checkpoint failure
Warning 726: Log cursor is at end of log

04. Tail TimesTen Daemon Logs And Attempt To Ramload Database

tail -f /home/timesten/TimesTen/mk1122a/info/ttmesg.log | egrep "ttAdmin|Warn:|Err :"
/home/timesten/TimesTen/mk1122a/bin/ttAdmin -connstr "dsn=mk1122a" -rampolicy manual -ramload

Output:

$ /home/timesten/TimesTen/mk1122a/bin/ttAdmin -connstr "dsn=mk1122a" -rampolicy manual -ramload
ttAdmin: TimesTen Error: 703; Subdaemon connect to data store failed with error TT848

$ /home/timesten/TimesTen/mk1122a/bin/ttAdmin -connstr "dsn=mk1122a" -rampolicy manual -ramload
ttAdmin: TimesTen Error: 703; Subdaemon connect to data store failed with error TT848

$ tail -f /home/timesten/TimesTen/mk1122a/info/ttmesg.log | egrep "ttAdmin|Warn:|Err :"
21:58:32.63 Info: : 19037: Got hello from pid 28497, type library (/home/timesten/TimesTen/mk1122a/bin/ttAdminCmd -connstr dsn=mk1122a -rampolicy manual -ramload )
21:58:32.72 Warn: : 19037: 28483/0x12fd7cc0: ******* EOF failure in sbLogLRInfoRead LSN input = 2.5521600, fslsn = -1.-1,
21:58:32.72 Warn: : 19037: 28483/0x12fd7cc0: Giving up on file 0 because of failure while reading ckptBeg record 2.5521600
21:58:32.77 Warn: : 19037: 28483/0x12fd7cc0: ******* EOF failure in sbLogLRInfoRead LSN input = 1.6346944, fslsn = -1.-1,
21:58:32.77 Warn: : 19037: 28483/0x12fd7cc0: Giving up on file 1 because of failure while reading checkpoint record 1.6346944
21:58:32.78 Err : : 28483: subd: Error identified in [sub.c: line 2375]
21:58:32.78 Err : : 28483: subd: (Error 848): TT0848: Recovery failed on 2 set(s) of data store files; the TimesTen user error log has more information -- file "db.c", lineno 10398, procedure "sbDbConnect"
21:58:32.78 Err : : 28483: -- file "db.c", lineno 10398, procedure "sbDbConnect"
21:58:32.78 Warn: : 28483: subd: connect trouble, rc 1, reason 848
21:58:32.78 Err : : 28483: Err 848: TT0848: Recovery failed on 2 set(s) of data store files; the TimesTen user error log has more information -- file "db.c", lineno 10398, procedure "sbDbConnect"
21:58:32.78 Err : : 19037: TT14000: TimesTen daemon internal error: Could not send 'manage' request to subdaemon rc 400 err1 703 err2 848
21:58:32.78 Err : : 19037: TT14000: TimesTen daemon internal error: Could not manage data store /data/dbs/mk1122a as required by policy. Return code 1 Error 703 err2 848 message 'Failed in connect'
21:58:33.63 Warn: : 19037: 28483 ------------------: subdaemon process exited


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-749044/,如需轉載,請註明出處,否則將追究法律責任。

相關文章