Tuesday, March 21, 2017

How to resolve checktable error - 2740 One or more rows found for table not in DBC.TVM?


Problem :

How to resolve checktable error: 2740: One or more rows found for table not in DBC.TVM?

Environment/Conditions/Configuration
TDBMS 15.10.01.04

Solution :

Re- ran
checktable on quiescent system.
2740 errors were bogus due to logons were not disabled


Additional Information :

We often see instances where CHECKTABLE is run on an active system. This is not a problem but it can result in bogus errors 2740 and 7437 errors if it happens to catch a table while it is being dropped or created. To check if the error is valid, run a second checktable only against the table on which error is reported.

# psh pdestate a
all 4 nodes:
PDE state is RUN/STARTED.
DBS state is 11: Only user DBC Logons are enabled The
system is quiescent

# cnsterm 1
Attempting to connect to CNS...Completed.
Hello
Enter a command, "QUIT;", "HELP;" or F7 for interactive help:
> check all tables at level pendingop in parallel ;
check all tables at level pendingop in parallel ;
Checktable defaults to concurrent mode
on quiescent system with logons enabled.
Check beginning at 19:31:48 16/08/05.
CHECKTABLE will run from Host: 0 Session: 904,37943
Concurrent mode skips DBC checking for check all tables
><
snip>
>


Summary:

18,104 table(s) checked.
6,700 fallback table(s) checked.
11,404 nonfallback
table(s) checked.
36 no primaryindex
table(s) checked.
0 table(s) failed the check.
Check completed at 19:46:51 16/08/05.
Enter a command, "QUIT;", "HELP;" or F7 for interactive help:
> quit;
Here is how you translate the Table Id into a table name:
Sample checktable error:
7437: Table header not found for a materialized temporary table.
Temporary table ID 8000H D1E3H
2740: One or more rows found for table not in DBC.TVM.
Table Id 0001H 6352H
Rows for table found on all AMPs
The tableid in the message must be byte flipped for SQL:
e.g.
"aa" "bb" "cc" "dd" ‐> bbaa ddcc
so:
0001H 6352H ‐> 01005263

Run the following SQL to determine the Table Name:
==========================================

Locking dbc.dbase For Access

Locking dbc.tvm For Access

SELECT dbase.DatabaseName (char(20))
,tvm.TVMName (char(20))
,tvm.TableKind (char(1) ,title 'T//V//M')
,tvm.ProtectionType (char(1) ,title 'Fall//Back')
FROM dbc.dbase dbase
,dbc.tvm tvm
WHERE (dbase.databaseid = tvm.databaseid)
AND tvm.tvmid in (
'01005263'xb /** see example above for byte‐flip **/
,'02001e3f'xb
) order by 1,2;

No comments:

Post a Comment