SQLAPI oncheck question
Posted in 2011
Running IDS 11.50.FC5 on HP-UX 11.31 PA-RISC.
According to the docs, if I run EXECUTE FUNCTION admin("check data",
"partnum"); I should get something very similar to running 'oncheck -pt ...',
and if I run EXECUTE FUNCTION task("check data", "partnum"); I should get a
count of the number of rows in the table.
First thing, the docs appear to have these reversed, as I get the detailed
report by running task() instead of admin(). I have submitted feedback to IBM
on that documentation error.
Second thing, when I run admin() against a table with zero rows, I do not get
0 as a return. Similarly, if I run it against a table with 139 rows, I do not
get 139 as a return. I get a number which appears to increment each time I run
the command. Sometimes it increments by one, sometimes by two. Actually, if I
run:
EXECUTE FUNCTION admin("check data", "10487706");
EXECUTE FUNCTION task("check data", "10487706");
EXECUTE FUNCTION admin("check data", "10487706");
I get:
(expression)
7448
(expression) Utilization report for dbname_dev:"owner".table
Physical Address 11:1516489
Creation date 06/15/2011 12:32:57
TBLspace Flags 801 Page Locking
TBLspace use 4 bit
bit-maps
Maximum row size 738
Number of special columns 0
Number of keys 0
Number of extents 1
Current serial value 1
Current BIGSERIAL value 1
Pagesize (k) 2
First extent size 8
Next extent size 8
Number of pages allocated 8
Number of pages used 1
Number of data pages 0
Number of rows 0
Partition partnum 10487706
Partition lockid 10487706
Extents
Logical Page Physical Page Size Physical Pages
0 11:1915672 8 8
(expression)
7450
In other words, the number appears to have incremented by two because I ran
the task() and the admin(). If I run task(), followed by another iteration of
task(), the number increments by one.
What is this number? Is it merely a sequential counter of how many times
task() and/or admin() have been executed? It doesn't seem to be related to the
specific partnum, as I tried running the task() with one partnum and the
admin() with another, and yet when the second task() ran, it still reported a
number two larger than the first task().
Is there any way to get a return code for success/fail? I'd like to automate
this and only set an alert if the 'check partition' reports a problem.