Jan 31

IBMi where i really does stand for integration…

We have been running 3 separate IBM i systems for a number of years now so that we could test the products we develop and provide some level of recovery should one of the systems have a failure. We also run a number of Linux based systems which we have used for virtualization projects and development of the PHP websites we run as well as Windows desktops and Servers. As you can imagine that burns up not only a lot of power but a lot of time to manage each of the separate environments and keep each one up to date with fixes and software patches.

Previously we never felt we had an IBMi system that could handle a Virtualized environment so we never attempted to put one in place and just kept replacing the existing systems as needed. At the end of last year we looked at getting one of the new Power7 systems to replace the old iSeries (520) we have and use it to build our dream setup of multiple partitions running on a single footprint. Unfortunately we felt IBM’s pricing policy (we pay 30% more than our US cousins for the same system due to IBM’s pricing policy for Canada. They are not the only ones that do it either as we found out so any tech solution from US base providers costs you more in Canada than it does in the US.) was out of touch with reality with the Loonie now being on par if not higher than the greenback.. So we decided to take an alternative route, after some discussion with a close friend and hardware guru we decided to beef up our existing 8203-E4A Power6 system and test out what the performance would be in a virtualized environment.

First thing we needed to do was to decide whether to run this under a HMC or go for the new Power VM Virtualization method. The Power VM seemed like a suitable option but we wanted to gain some experience with HMC and the restriction of the number of LPAR’s you could create under Power VM plus micro partitioning of the CPU sealed the deal. This meant we had to order a new copy of the PowerVM standard edition, we also added AIX Version 7 and a 3 year SWMA for each of the products. Next we needed to order a HMC and some additional disks (4 x 140GB), a Raid controller and more memory (additional 4 GB), we looked at IBM but again found the pricing to be too high for us to make it worth our while. So we found a HMC on eBay and ordered disk, Raid controller and memory for an IBM business partner in Europe (Yes it was far cheaper to order and pay delivery from Europe than to order in North America).

Once the disk and memory was installed and configured with the new Raid capabilities we set up the HMC and made it the console for all of our existing systems which replaced the old LAN console technology we had been using. All we needed now was the software to allow us to partition the systems CPU, this was where the fun started.
We placed the order before the Christmas break for all of the software in the hopes of being able to download the software and get started while there wasn’t much customer activity in the expectation it would be a pretty simple affair. 6 weeks later and we still don’t have the software. Some of that is due to our request to download the software originally but after seeing that the download was over 70GB we decided it was too much and would be far quicker to order the media. That was after it took IBM nearly a month just to get the downloads to show up on our entitlement page. Then IBM said it would take a week to deliver the media which came and went with only an update being delivered and not the actual based installation media! I have to say the invoicing department is on the ball though as we did get the invoices almost as soon as the orders were placed.

This did not stop us from doing anything though, we were installing IBMi and SuSe Linux on the system as well so we could moved ahead with that while IBM sorts out the other issues. The SuSe Linux media was easily obtained and downloaded and we already have copies of the IBMi software so we moved ahead and installed those first. The next post will be about the experiences we had while installing each of those LAPR’s and some of the problems we stumbled across especially with the lack of clear and understandable documentation for installing guest partitions under IBMi.

Hope fully IBM will get us the AIX software before we write about the other installs, but I have to say my fears about the performance hit the partitioning would have on the work we carry out was totally unfounded, it even seems to run better now than it did before and the guest partition that replaced an old 515 system is definitely faster than we could have hoped for. The older 520 and 515 will still be around as they will be our recovery systems should anything happen to the new setup but they are powered down and off line for now.

So this post started off with the heading of “IBMi where i really does stand for integration” and I am going to say we are very happy with the results so far, we do have integrated the work of 4 systems into one and seen no detrimental performance issues so far. Once we have AIX we will have our dream system all under one roof.

Chris…

Jan 16

New support forum for Easycom and iAMP server.

A new support forum has been created for the i5_toolkit and the new iAMP server. Th forums will be monitored by the Aura Technical team as well as the community at large. This will hopefully provide a better resource for those users of the i5 toolkit functions and help with further integration of PHP on the IBMi. If you would like a higher level of support we will be offering a support subscription service through Shield Advanced Services Ltd.

The forums can be found here

Look forward to seeing you on the forums.

Chris…

Jan 16

New Apache, MySQL PHP stack for IBMi called iAMP Server

Aura Equipments of France has just announced a new Apache, MySQL and PHP stack for the IBMi, the new stack has been compiled from standard open source code and is available for free download from the Aura website .

iAMP server is a fully integrated stack which runs in the PASE environment on IBMi, this means the standard Apache Server is also running in the PASE environment allowing a close connection between it and the extensions and modules provided by other parties. While you still have the option of connecting to the IBM HTTP server via a FASTCGI port you now have the option of running the entire stack in the PASE environment. Why is this important you may ask, well one of the reasons for the new stack is a growing concerns from a number of IBMi users about the slow introduction of some of the newer Apache releases on the IBMi with its Powered by Apache server. IBMi does a very good job of making the security releases available but sometimes lacks the additional features Apache provides especially in the earlier version of iOS.

Aura have built the entire stack from the freely available open source code, this means it follows the standards you will find in many of the other AMP Stacks out there for Linux and Windows. If you have your own modules you can add them to the stack in the same way as you can with other Linux and Windows stacks without any problems. Many of the restrictions found where proprietary modules are included with a stack do not exist in the iAMP server, everything is from the open source community and will work with any other modules they provide. While this release of iAMP server does not have every module available, it does have the main ones that are used by most shops. As more modules are compiled they will be added to the stack by Aura and will be supported in the same manner as the existing modules. If there is a module which is not provided and you need it before Aura gets round to making it available you have the ability to add the module yourself or may even find a compatible binary elsewhere, that’s the beauty of having a standards based open source stack.

Shield Advanced solutions will provide support for the iAMP server for North America via a fee based support contract or on a consultancy basis if required. Free community based support will be available via forums which will be dedicated to the iAMP server which is just as you get with any other AMP stack available on Linux or Windows.

One item we need to clarify is the inclusion of the i5_toolkit, this is a proprietary solution from Aura equipments and is not shipped as part of the iAMP stack. The original i5_toolkit which shipped with the Zend product will still be available to the users of the Zend product and you can update the version using the downloads available from the Aura Equipments website. However this version of the toolkit only accepts requests from the local server (Zend HTTP Server) and cannot be accessed from remote HTTP servers. Aura will continue to support the users of the i5_toolkit for FREE using the forums which are to be setup for this purpose. However for a small fee you can upgrade that support to premium level which will entitle you to full technical support from the Aura support team. Anyone who has registered with Aura will be receiving a notification which will include a special reduced rate for support for the i5_toolkit and the iAMP server. If you have not registered your copy of Easycom with Aura now would be a good time to do it!

Any new customer which requires the i5_toolkit will be offered full support for the toolkit PLUS the iAMP server for a single price, this offer will be especially important for the smaller customer who needs support for their entire stack not just the i5_toolkit. The FREE support will still be available via the forums and will be monitored by the Aura tech support team.

iAMP is a new alternative and one which customers should look into, the support costs and level of technical support you will get should make this an easy decision if you are looking at developing a web based interface to your IBMi data and objects.

If you would like to see a demo of the iAMP server in action or have any questions please feel free to contact us, this is a major step in bringing a standards based alternative AMP stack to the IBMi.

Chris…

Jan 06

Fetching LOB Data in DB2


We have recently had to look at the LOB data contained within a database while working with a prospect and having never done this before thought we would share the experience. The prospect has a large number of LOB fields in their database and is looking at the Easycom server as a possible solution so they asked us to help resolve a couple of issues they were having.

There first problem was the query would return no data at all, this was because they did not set the commitment control level as we had mentioned previously when we did the tests for the Display_Journal UDTF, that was a pretty easy fix and after a slight change to their code the query would run and the data would be returned to the script. That is all except for the content of the LOB columns, this would just return a garbled value or end the data display at that point. This is because the data returned by the query for an LOB column is just a pointer to the actual data which can be stored outside of the database. So we then had to run the i5_getblob() function to get the content of the LOB column. Unfortunately the sample code was wrong in the documentation so a call into Aura support put us back on the right track and we can now retrieve the LOB data without any problems. As it turns out the prototype for the function call is correct but the sample code is not.

Here is the test we set up to test the LOB support in Easycom. First we created a file with LOB columns defined, we did have a slight problem because the default journal was not defined in our library but after building the journal manually and journaling the file we saw no other issues. I created this in a STRSQL session I notice that as soon as the first file was journaled in the library consequent creates did not return the same journal issue?


CREATE TABLE CHLIB/TEST (
USERNAME VARCHAR(100) DEFAULT NULL ,
SYSNAME VARCHAR(255) DEFAULT NULL ,
TITLE VARCHAR(100) DEFAULT NULL ,
TEST_VALUE CLOB(1048576) DEFAULT NULL ,
ID NUMERIC(5, 0) DEFAULT NULL ,
YEAR NUMERIC(4, 0) DEFAULT NULL ,
TEMP_ID BIGINT DEFAULT NULL ,
TEST_VARCHAR VARCHAR(5000) DEFAULT NULL )

Next we just wanted to insert a single record so it could be tested. Again I used a STRSQL session to insert the record using this request.

INSERT INTO CHLIB/TEST
(username,sysname,title,test_value,test_varchar) VALUES
('admin1','shield3','boss','some clob text','Some varchar text')

I have a test page that I use for all of my tests that requires a signon to be carried out first and then call what ever functions I am testing. This is the function I wrote to test the LOB data returned.


function get_lob(&$conn) {
// set the transaction level for lob's
if(!i5_transaction(I5_ISOLEVEL_CHG, $conn)) {
echo("Failed to set transaction level CHG");
}
// build the query
$query = "SELECT TITLE,TEST_VALUE,SYSNAME FROM CHLIB/TEST";
// get the record
$result = i5_query($query,$conn);
if(!$result){
echo("Failed to get the data
" .$query);
$_SESSION['ErrMsg'] = "Error code: " .i5_errno($result) ." Error message: " .i5_errormsg($result);
}
$rec = i5_fetch_assoc($result);
// dump out the record data
var_dump($rec);
// get the LOB data and show
$lob_data = i5_getblob($result, 'TEST_VALUE');
echo("
LOB Data = " .$lob_data ."
");
// need to roll back to allow the transaction to be closed
i5_rollback($conn);
// close the transaction
if(!i5_transaction(I5_ISOLEVEL_NONE, $conn)) {
echo("Failed to set transaction level NONE");
}
// free the resources
i5_free_query($query);
}

Here is the output of the above

array(3) { [“TITLE”]=> string(4) “boss” [“TEST_VALUE”]=> int(256) [“SYSNAME”]=> string(7) “shield3″ }
Blob Data = some clob text

As you can see the dump of the $rec variable shows an int(256), if you ran the query in a STRSQL session you would see *POINTER for the data in this field, iNavigator SQL will resolve the pointer automatically and display the actual data immediately. Running the i5_getblob() function correctly returns the content of the pointer, you should note that you do not need to pass in $rec[‘TEST_VALUE’] just ‘TEST_VALUE’ for the function to work correctly.

And that was our first foray into LOB columns in DB2… Hope you found some useful information from this.

Happy PHP’ing

Chris…