FInd Row Id in Partition Table
Posted in 2011
Topics: General Discussion
Hi, How can we identify RowId for a Partition/Fragmented Table in IDS 11.50.FC6. Thanks.
Unless the table was created WITH ROWID or your altered it to ADD ROWID, fragmented tables do not have a ROWID pseudo-column you can query. That is because each partition/fragment's n-th row would have the same physical rowid. Using the WITH ROWID/ADD ROWID appends a hidden SERIAL type column named rowid, populates it with sequential values, and indexes it to simulate a rowid. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Jan 4, 2011 at 10:24 AM, SHAHZAD SALAM KASI <skasi@i2cinc.com>wrote: > Hi, > How can we identify RowId for a Partition/Fragmented Table in IDS > 11.50.FC6. > > Thanks. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001636c5a78f65b8cc04990706cd
Thanks for the help.
But when we get the data using onstat -k command, we get rowid. How can we map
this value to the Partitioned table row ?
Thanks.
You cannot easily do that. Look in the SMI (sysmaster) table syslcktab
which will tell you which partnum (ie which fragment - look it up in
systabnames or <databasename>:sysfragments) and the partnum within the
fragment. However, there is still no way to determine exactly which row
that is from any SQL statement.
You can poke at the physical disk page contents and decode the slot table on
the page (the rowid is the ordinal page number within the partition * 256
plus the slot number) using the sysmaster tables or an oncheck -p, but
that's a lot of work and you may still have to decode the binary contents of
the page to see the actual row keys if any are binary data types.
The oncheck command is:
oncheck -pP <tablename>%<fragment_partnum> rowid
Don't forget to translate the partnum and rowid to decimal from hex, so, a
recent transaction of mine showed:
*IBM Informix Dynamic Server Version 11.70.FC1 -- On-Line -- Up 37 days
00:03:49 -- 671908 Kbytes
Locks
address wtlist owner lklist type
tblsnum rowid key#/bsiz
4467a5b8 0 5c660110 0
HDR+S 100002 204 0
4467a638 0 5c661240 0
S 100002 204 0
4467acb8 0 5c660110 4467a5b8
S 100002 201 0
4467ad38 0 5c669328 0
HDR+S 100002 201 0
44681e38 0 5c6681f8 447b5838
HDR+X 40011f 102 0
447b2db8 0 5c6609a8 0
S 100002 204 0
447b3bb8 0 5c6681f8 447b43b8
HDR+X 400121 102 0
447b43b8 0 5c6681f8 44681e38
HDR+X 400121 101 0
447b5838 0 5c6681f8 447c32b8
HDR+X 40011f 101 0
447bd938 0 5c6681f8 0
HDR+S 100002 207 0
447c32b8 0 5c6681f8 447bd938
HDR+IX 40011f 0 0
11 active, 20000 total, 16384 hash buckets, 0 lock table overflows
*
The locks held by session owner at address *5c6681f8* belong to that
session. So, to see the data for the row locked by the lock at address *
447b3bb8*, which happens to be entirely text and which I know to be part of
table states in the database big_test, I would:
oncheck -pp big_test:states%4194593 258
Can't show you the output because this function seems to be broken in 11.70
which is the version of my local server. <sigh> Bleeding edge and all that.
Looks like I'll be opening another support case with IBM today.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Tue, Jan 4, 2011 at 10:43 AM, SHAHZAD SALAM KASI <skasi@i2cinc.com>wrote:
> Thanks for the help.
>
> But when we get the data using onstat -k command, we get rowid. How can we
> map
> this value to the Partitioned table row ?
>
> Thanks.
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--20cf30433efe42e614049907d853
That oncheck should be 'oncheck -pp ...' as shown in the example lower down,
not -pP as in the first notation - forgot to correct that before I sent the
posting out.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Tue, Jan 4, 2011 at 11:34 AM, Art Kagel <art.kagel@gmail.com> wrote:
> You cannot easily do that. Look in the SMI (sysmaster) table syslcktab
> which will tell you which partnum (ie which fragment - look it up in
> systabnames or <databasename>:sysfragments) and the partnum within the
> fragment. However, there is still no way to determine exactly which row
> that is from any SQL statement.
>
> You can poke at the physical disk page contents and decode the slot table
> on
> the page (the rowid is the ordinal page number within the partition * 256
> plus the slot number) using the sysmaster tables or an oncheck -p, but
> that's a lot of work and you may still have to decode the binary contents
> of
> the page to see the actual row keys if any are binary data types.
>
> The oncheck command is:
>
> oncheck -pP <tablename>%<fragment_partnum> rowid>
> Don't forget to translate the partnum and rowid to decimal from hex, so, a
> recent transaction of mine showed:
>
> *IBM Informix Dynamic Server Version 11.70.FC1 -- On-Line -- Up 37 days
> 00:03:49 -- 671908 Kbytes
>
> Locks
> address wtlist owner lklist type
> tblsnum rowid key#/bsiz
> 4467a5b8 0 5c660110 0
> HDR+S 100002 204 0
> 4467a638 0 5c661240 0
> S 100002 204 0
> 4467acb8 0 5c660110 4467a5b8
> S 100002 201 0
> 4467ad38 0 5c669328 0
> HDR+S 100002 201 0
> 44681e38 0 5c6681f8 447b5838
> HDR+X 40011f 102 0
> 447b2db8 0 5c6609a8 0
> S 100002 204 0
> 447b3bb8 0 5c6681f8 447b43b8
> HDR+X 400121 102 0
> 447b43b8 0 5c6681f8 44681e38
> HDR+X 400121 101 0
> 447b5838 0 5c6681f8 447c32b8
> HDR+X 40011f 101 0
> 447bd938 0 5c6681f8 0
> HDR+S 100002 207 0
> 447c32b8 0 5c6681f8 447bd938
> HDR+IX 40011f 0 0
> 11 active, 20000 total, 16384 hash buckets, 0 lock table overflows
> *
> The locks held by session owner at address *5c6681f8* belong to that
> session. So, to see the data for the row locked by the lock at address *
> 447b3bb8*, which happens to be entirely text and which I know to be part of
> table states in the database big_test, I would:
>
> oncheck -pp big_test:states%4194593 258>
> Can't show you the output because this function seems to be broken in 11.70
> which is the version of my local server. <sigh> Bleeding edge and all that.
> Looks like I'll be opening another support case with IBM today.
>
> Art
>
> Art S. Kagel
> Advanced DataTools (www.advancedatatools.com)
> IIUG Board of Directors (art@iiug.org)
> Blog: http://informix-myview.blogspot.com/
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions
> and
> do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
> organization with which I am associated either explicitly, implicitly, or
> by
> inference. Neither do those opinions reflect those of other individuals
> affiliated with any entity with which I am affiliated nor those of the
> entities themselves.
>
> On Tue, Jan 4, 2011 at 10:43 AM, SHAHZAD SALAM KASI <skasi@i2cinc.com
> >wrote:
>
> > Thanks for the help.
> >
> > But when we get the data using onstat -k command, we get rowid. How can
> we
> > map
> > this value to the Partitioned table row ?
> >
> > Thanks.
> >
> >
> >
> >
>
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
>
> --20cf30433efe42e614049907d853
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--20cf3054ace33b0398049907fd51
Related threads
- record locked
- who locks a record?
- Regarding Non-Default Page Sizes
- Don't Understand Table's Space Requirement