dbTalk Databases Forums  

Re: finding inplace alters

comp.databases.informix comp.databases.informix


Discuss Re: finding inplace alters in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Andreas Legner
 
Posts: n/a

Default Re: Re: finding inplace alters - 01-12-2011 , 04:10 AM






Hi Fernando,

you mean how to determine engine's endianess using an SQL query?

There might be more elegant ways, but what about

select first 1 hexdata from sysmaster:sysrawdsk;

This would return first 16 raw bytes from root chunk, so something
starting on "00000000 0001" from big endian and "00000000 0100" from
little endian servers.
Of course this is restricted to user informix.

In case this page zero uses an old page header (pre-9.40 page), you'd get
"00000001" or "01000000" respectively. You could tell the two cases by
checking if first 8 nibbles all are zeroes.

More easily, you could:

select first 1 hexdata[1,4] from sysshmem;

This should return first shmem segments magic number 0xe0b7, as either
"e0b7" or "b7e0".

Cheers,
Andreas





From:
Fernando Nunes <domusonline (AT) gmail (DOT) com>
To:
Andreas Legner/Germany/IBM@IBMDE
Cc:
informix-list (AT) iiug (DOT) org
Date:
12.01.2011 03:06
Subject:
Re: Re: finding inplace alters



Andreas,

Thanks for the reply, and don't bother... You were right... A checkpoint
is needed.
So, at this moment I have something that apparently works... But needs
some refinement and further testing...
Also... I need a way to find out if the platform is little endian or big
endian.... any ideas?

Regards!

Reply With Quote
  #22  
Old   
Fernando Nunes
 
Posts: n/a

Default Re: Re: finding inplace alters - 01-12-2011 , 10:14 AM






Thanks Andreas. I did something similar:

SELECT
s.hexdata[1,8]
INTO
v_hexdata
FROM
sysmaster:syssltdat s
WHERE
s.partnum = '0x100001' AND
s.pagenum = 1 AND
s.slotnum = 1 AND
s.slotoff = 0;

IF v_hexdata = '01001000'
THEN
LET v_endian = 'LITTLE';
ELSE
IF v_hexdata = '00100001'
THEN
LET v_endian = 'BIG';
ELSE
RAISE EXCEPTION -746, 0, 'Invalid Endianess calculation...
Check procedure code!!!';
END IF
END IF

Tested on little endian and apparently it works.
If somebody can test it on a Big Endian machine (Solaris, AIX, HP-UX
Itanium....) I'd appreciate...
Just run the query and see if it returns '00100001'

Kind regards.

P.S.: Pending IPA finder through SQL looks good (although the code is a bit
odd, it is working).
I'll post it as soon as I test it on a "real" system to check the running
time... For now, just on my VM which is just a "toy"...



On Wed, Jan 12, 2011 at 10:10 AM, Andreas Legner
<andreas.legner (AT) de (DOT) ibm.com>wrote:

Quote:
Hi Fernando,

you mean how to determine engine's endianess using an SQL query?

There might be more elegant ways, but what about

select first 1 hexdata from sysmaster:sysrawdsk;

This would return first 16 raw bytes from root chunk, so something starting
on "00000000 0001" from big endian and "00000000 0100" from little endian
servers.
Of course this is restricted to user informix.

In case this page zero uses an old page header (pre-9.40 page), you'd get
"00000001" or "01000000" respectively. You could tell the two cases by
checking if first 8 nibbles all are zeroes.

More easily, you could:

select first 1 hexdata[1,4] from sysshmem;

This should return first shmem segments magic number 0xe0b7, as either
"e0b7" or "b7e0".

Cheers,
Andreas




From:
Fernando Nunes <domusonline (AT) gmail (DOT) com
To:
Andreas Legner/Germany/IBM@IBMDE
Cc: informix-list (AT) iiug (DOT) org Date: 12.01.2011 03:06 Subject: Re: Re: finding
inplace alters
------------------------------



Andreas,

Thanks for the reply, and don't bother... You were right... A checkpoint is
needed.
So, at this moment I have something that apparently works... But needs some
refinement and further testing...
Also... I need a way to find out if the platform is little endian or big
endian.... any ideas?

Regards!



--
Fernando Nunes
Portugal

http://informix-technology.blogspot.com
My email works... but I don't check it frequently...

Reply With Quote
  #23  
Old   
Art Kagel
 
Posts: n/a

Default Re: Re: finding inplace alters - 01-12-2011 , 10:25 AM



There used to be a third alternative to big-endian and little-endian. Call
it big-little. The result would look like: '00010010'. But, the only
processors I can think of that used that format were DEC processors, so I
guess your OK with what you have.

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art (AT) iiug (DOT) 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 Wed, Jan 12, 2011 at 11:14 AM, Fernando Nunes <domusonline (AT) gmail (DOT) com>wrote:

Quote:
Thanks Andreas. I did something similar:

SELECT
s.hexdata[1,8]
INTO
v_hexdata
FROM
sysmaster:syssltdat s
WHERE
s.partnum = '0x100001' AND
s.pagenum = 1 AND
s.slotnum = 1 AND
s.slotoff = 0;

IF v_hexdata = '01001000'
THEN
LET v_endian = 'LITTLE';
ELSE
IF v_hexdata = '00100001'
THEN
LET v_endian = 'BIG';
ELSE
RAISE EXCEPTION -746, 0, 'Invalid Endianess calculation...
Check procedure code!!!';
END IF
END IF

Tested on little endian and apparently it works.
If somebody can test it on a Big Endian machine (Solaris, AIX, HP-UX
Itanium....) I'd appreciate...
Just run the query and see if it returns '00100001'

Kind regards.

P.S.: Pending IPA finder through SQL looks good (although the code is a bit
odd, it is working).
I'll post it as soon as I test it on a "real" system to check the running
time... For now, just on my VM which is just a "toy"...



On Wed, Jan 12, 2011 at 10:10 AM, Andreas Legner
andreas.legner (AT) de (DOT) ibm.com> wrote:


Hi Fernando,

you mean how to determine engine's endianess using an SQL query?

There might be more elegant ways, but what about

select first 1 hexdata from sysmaster:sysrawdsk;

This would return first 16 raw bytes from root chunk, so something
starting on "00000000 0001" from big endian and "00000000 0100" from little
endian servers.
Of course this is restricted to user informix.

In case this page zero uses an old page header (pre-9.40 page), you'd get
"00000001" or "01000000" respectively. You could tell the two cases by
checking if first 8 nibbles all are zeroes.

More easily, you could:

select first 1 hexdata[1,4] from sysshmem;

This should return first shmem segments magic number 0xe0b7, as either
"e0b7" or "b7e0".

Cheers,
Andreas




From:
Fernando Nunes <domusonline (AT) gmail (DOT) com
To:
Andreas Legner/Germany/IBM@IBMDE
Cc: informix-list (AT) iiug (DOT) org Date: 12.01.2011 03:06 Subject: Re: Re:
finding inplace alters
------------------------------



Andreas,

Thanks for the reply, and don't bother... You were right... A checkpoint
is needed.
So, at this moment I have something that apparently works... But needs
some refinement and further testing...
Also... I need a way to find out if the platform is little endian or big
endian.... any ideas?

Regards!




--
Fernando Nunes
Portugal

http://informix-technology.blogspot.com
My email works... but I don't check it frequently...

_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list


Reply With Quote
  #24  
Old   
Fernando Nunes
 
Posts: n/a

Default Re: Re: finding inplace alters - 01-12-2011 , 10:33 AM



Yes... Wikipedia talks about it... I guess that if someone ports Informix to
PDP-11 we'll see a -746 exception
Thanks. Andreas already tested this on Solaris and apparently it works.

Regards.

On Wed, Jan 12, 2011 at 4:25 PM, Art Kagel <art.kagel (AT) gmail (DOT) com> wrote:

Quote:
There used to be a third alternative to big-endian and little-endian. Call
it big-little. The result would look like: '00010010'. But, the only
processors I can think of that used that format were DEC processors, so I
guess your OK with what you have.

Art


Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art (AT) iiug (DOT) 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 Wed, Jan 12, 2011 at 11:14 AM, Fernando Nunes <domusonline (AT) gmail (DOT) com>wrote:

Thanks Andreas. I did something similar:

SELECT
s.hexdata[1,8]
INTO
v_hexdata
FROM
sysmaster:syssltdat s
WHERE
s.partnum = '0x100001' AND
s.pagenum = 1 AND
s.slotnum = 1 AND
s.slotoff = 0;

IF v_hexdata = '01001000'
THEN
LET v_endian = 'LITTLE';
ELSE
IF v_hexdata = '00100001'
THEN
LET v_endian = 'BIG';
ELSE
RAISE EXCEPTION -746, 0, 'Invalid Endianess calculation...
Check procedure code!!!';
END IF
END IF

Tested on little endian and apparently it works.
If somebody can test it on a Big Endian machine (Solaris, AIX, HP-UX
Itanium....) I'd appreciate...
Just run the query and see if it returns '00100001'

Kind regards.

P.S.: Pending IPA finder through SQL looks good (although the code is a
bit odd, it is working).
I'll post it as soon as I test it on a "real" system to check the running
time... For now, just on my VM which is just a "toy"...



On Wed, Jan 12, 2011 at 10:10 AM, Andreas Legner
andreas.legner (AT) de (DOT) ibm.com> wrote:


Hi Fernando,

you mean how to determine engine's endianess using an SQL query?

There might be more elegant ways, but what about

select first 1 hexdata from sysmaster:sysrawdsk;

This would return first 16 raw bytes from root chunk, so something
starting on "00000000 0001" from big endian and "00000000 0100" from little
endian servers.
Of course this is restricted to user informix.

In case this page zero uses an old page header (pre-9.40 page), you'd get
"00000001" or "01000000" respectively. You could tell the two cases by
checking if first 8 nibbles all are zeroes.

More easily, you could:

select first 1 hexdata[1,4] from sysshmem;

This should return first shmem segments magic number 0xe0b7, as either
"e0b7" or "b7e0".

Cheers,
Andreas




From:
Fernando Nunes <domusonline (AT) gmail (DOT) com
To:
Andreas Legner/Germany/IBM@IBMDE
Cc: informix-list (AT) iiug (DOT) org Date: 12.01.2011 03:06 Subject: Re: Re:
finding inplace alters
------------------------------



Andreas,

Thanks for the reply, and don't bother... You were right... A checkpoint
is needed.
So, at this moment I have something that apparently works... But needs
some refinement and further testing...
Also... I need a way to find out if the platform is little endian or big
endian.... any ideas?

Regards!




--
Fernando Nunes
Portugal

http://informix-technology.blogspot.com
My email works... but I don't check it frequently...

_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list




--
Fernando Nunes
Portugal

http://informix-technology.blogspot.com
My email works... but I don't check it frequently...

Reply With Quote
  #25  
Old   
Fernando Nunes
 
Posts: n/a

Default Re: Re: finding inplace alters - 09-09-2011 , 05:34 PM



Following up on this very old thread....
I managed to get a quick and reliable way of identifying tables with pending
inplace alters.

It's just an SQL script that creates the function. You can create it in any
database on your system.
AFAIK it works. But please report any issues.

The explanation and code is here:

http://informix-technology.blogspot....-obter-as.html

I'd like to publicly send a big "thank you" to Andreas Legner from German
tech support and Art Kagel for providing info, help, guidance and some debug
skills

Regards.


On Wed, Jan 12, 2011 at 4:14 PM, Fernando Nunes <domusonline (AT) gmail (DOT) com>wrote:

Quote:
Thanks Andreas. I did something similar:

SELECT
s.hexdata[1,8]
INTO
v_hexdata
FROM
sysmaster:syssltdat s
WHERE
s.partnum = '0x100001' AND
s.pagenum = 1 AND
s.slotnum = 1 AND
s.slotoff = 0;

IF v_hexdata = '01001000'
THEN
LET v_endian = 'LITTLE';
ELSE
IF v_hexdata = '00100001'
THEN
LET v_endian = 'BIG';
ELSE
RAISE EXCEPTION -746, 0, 'Invalid Endianess calculation...
Check procedure code!!!';
END IF
END IF

Tested on little endian and apparently it works.
If somebody can test it on a Big Endian machine (Solaris, AIX, HP-UX
Itanium....) I'd appreciate...
Just run the query and see if it returns '00100001'

Kind regards.

P.S.: Pending IPA finder through SQL looks good (although the code is a bit
odd, it is working).
I'll post it as soon as I test it on a "real" system to check the running
time... For now, just on my VM which is just a "toy"...




On Wed, Jan 12, 2011 at 10:10 AM, Andreas Legner
andreas.legner (AT) de (DOT) ibm.com> wrote:


Hi Fernando,

you mean how to determine engine's endianess using an SQL query?

There might be more elegant ways, but what about

select first 1 hexdata from sysmaster:sysrawdsk;

This would return first 16 raw bytes from root chunk, so something
starting on "00000000 0001" from big endian and "00000000 0100" from little
endian servers.
Of course this is restricted to user informix.

In case this page zero uses an old page header (pre-9.40 page), you'd get
"00000001" or "01000000" respectively. You could tell the two cases by
checking if first 8 nibbles all are zeroes.

More easily, you could:

select first 1 hexdata[1,4] from sysshmem;

This should return first shmem segments magic number 0xe0b7, as either
"e0b7" or "b7e0".

Cheers,
Andreas




From:
Fernando Nunes <domusonline (AT) gmail (DOT) com
To:
Andreas Legner/Germany/IBM@IBMDE
Cc: informix-list (AT) iiug (DOT) org Date: 12.01.2011 03:06 Subject: Re: Re:
finding inplace alters
------------------------------



Andreas,

Thanks for the reply, and don't bother... You were right... A checkpoint
is needed.
So, at this moment I have something that apparently works... But needs
some refinement and further testing...
Also... I need a way to find out if the platform is little endian or big
endian.... any ideas?

Regards!




--
Fernando Nunes
Portugal

http://informix-technology.blogspot.com
My email works... but I don't check it frequently...



--
Fernando Nunes
Portugal

http://informix-technology.blogspot.com
My email works... but I don't check it frequently...

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.