kfogarty.com - Database Consultants

Website of Kenny Fogarty. An independent database consultant, based in London, England.

del.icio.us |Digg it |Earthlink |Furl |iFeedReaders |ma.gnolia |Maple.nu |Netvouz |Netscape |RawSugar |reddit |Scuttle |Shadows |Simpy |Spurl |StumbleUpon |Wink |Yahoo MyWeb |

The World of Support Desks

Filed under: DB2 — Kenny at 9:26 pm on Tuesday, October 30, 2007

Nothing to do with databases DB2 or mainframes, so it might not be that interesting. H
On October 20th, I installed a game on my laptop, called Football Manager 2008. Now, I’ve played this game for years, and never once have I had any kind of a problem with it. But, Football Manager 2008 is different.

When I clicked the icon to execute the program, a strange error message appeared on my laptop, telling me that a required security module could not be loaded. A link in the error message sent me to the website of a company called secuROM, where, I was further instructed to create something called an ‘analysis file’ which could be zipped up and emailed to them.

Now, I’d never heard of secuROM, and I had serious reservations about creating a file on my laptop and emailing it to an unknown company. I did a Google search, which yielded thousands of results, and not many of them had anything good to say about the company. But, faced with an application that wouldn’t work, I did as they suggested, and emailed their support ID with the file attached.

It was the start of a long, and so far quite unrewarding email exchange with a company that has deliberately told lies in an effort to resolve the issue.

Here is that email exchange in full:

October 20

Good morning,

I have just installed Football Manager 2008 on my laptop, and attempted to start the application, only to receive an error message from your software.
I have followed the instructions on your support page, and enclosed the analysis file as requested (It is compressed using WinRAR).

Please tell me how to get around this unwelcome and unnecessary issue that is caused solely by your intrusive software.

Thank you.

Kenny Fogarty

October 22

Hello.

Thank you for your email. I’ve checked your analysis file, but unfortunately it was incomplete. Possibly the analysis file creation was started twice or the game was already running at the time.

Please follow the instructions below to launch a new analysis.

1) Make sure the original disc is in your local CD or DVD drive.
2) Please re-start your computer.
3) ‘Right-click’ on the desktop shortcut, or the application’s executable file, and a menu will appear.
4) Choose ‘Launch Analysis’ from the choices beneath ‘Open’ and release the mouse.
5) A disclaimer window may appear on your screen. To proceed, please click onto the ‘Yes’ button. A window stating that an Analysis log will be generated may appear, if so click OK. If an error message appears, please click Cancel.
6) The program will now generate a file named ‘AnalysisLog.sr0′ on the root of your hard drive (usually C:). When it finishes another window should appear stating it has finished, click OK.
7) Please ‘zip’ the file using a program such as WinZip, WinRAR, or WinAce (to avoid email corruption), then attach it to your email to support@securom.com.

As soon as we receive the new analysis file we will know more about the problem.

If you have further questions, please feel free to ask.

Best regards,

SecuROM Support Team

Here is the analysis log file as requested.
(attached analysis log file).

October 23

Hello.

Thank you for your e-mail. After careful inspection of the analysis file, it appears that SecuROM is authenticating with no errors. I would highly appreciate if you could send us a detailed error description as well as screenshots of all error messages.

To generate a screenshot please follow the instructions below:

1.) Please insert the original disc in your local CD or DVD drive.
2.) Start the application and wait until the error window appears.
3.) Press the ‘Print’ or ‘Prt Sc’ (Print Screen) button on your keyboard.
This button should be on the right side at the top of your keyboard.
4.) Click the ‘Start’ button to open your start menu.
5.) Left click on the ‘Run…’ option and a dialog box will appear.
6.) Type mspaint in this box and press ‘Enter’.
7.) Now the program ‘Microsoft Paint’ should start; from the program’s toolbar at the top, click ‘Edit’ and select ‘Paste’ and the screenshot should be imported.
8.) From the program’s toolbar at the top, click ‘File’ then select ‘Save as…’
9.) Save the image as a .GIF file, then type a name and choose a location to save the file.
10.) Attach the image to your email response.

Thank you for your cooperation and patience.

Best regards,

SecuROM Support Team

Hello,
While I am happy that your software seems to be authenticating with no errors, it still stops me from executing the program that I have bought, quite legitimately four days ago.

The error message I received from your software reads as follows:
A required security module cannot be activated. This program cannot be executed (5024).

Please have a look at http://www.securom.com/message.asp?m=module&c=5024 for further, more detailed information.

I performed these actions on Saturday, followed the instructions, and have contacted you as per those instructions. It is now Tuesday evening, and I STILL CANNOT EXECUTE the program I have purchased legitimately.

What kind of anti-piracy software fundamentally stops the execution of the program?

I have done some research of my own on your company, and your unwelcome, invasive program, and found that for whatever reason, your program dictates what software can, and cannot be executed on my laptop. It turns out that because I use Process Explorer extensively, this (Microsoft) program is on some sort of blacklist within your application. How laughable is that?

As I requested four days ago, please kindly tell me how to get around this unwelcome and unnecessary issue that is caused solely by your intrusive software?

Here is the screenshot as requested.

However, if you can just provide me a method to execute my legally purchased software without your unwelcome and unwarranted crippleware, I would appreciate it.

Kenny Fogarty
(attached .gif file showing the error message).

October 24
Hello,
It is now FIVE days since I first reported this issue to your company, and still I have no feedback on how to rectify this problem with your software, which is preventing me from executing a program that I have bought, legitimately.

Can I have an update to this issue as a matter of urgency - Your website does “claim” 24/7 support, but I am yet to see it.

Kenny Fogarty

Hello,

Thank you for your e-mail. It seems that the software “Process Explorer” causes a software conflict. Please close this program and try launching game again.

If the problem persists, please send us a new analysis file.

If you have any questions, please feel free to ask.

Best regards,

SecuROM Support Team

Okay, this is ridiculous.

I have informed YOU what the issue is. So to repeat that back to me, and repeat it back to me incorrectly isn’t what I call support.

If I close Process Explorer, this does not rectify the problem, because, as anyone who knows anything about operating system will confirm, in-memory executable modules are not released by the system, so your program detects that Process Explorer has ran at some point, and therefore prevents me from executing Football Manager 2008. Why is this? Why does your program see Process Explorer as some sort of threat to the integrity of Football Manager 2008?

Process Explorer is an application written and supported by Microsoft. It is a valuable replacement for Windows Task Manager, and I use it extensively, as I am an IT Consultant, and it is a valuable tool, which ensures that my system is in an optimal condition at all times.

Your program, SecuROM doesn’t like this, for some strange reason, so the problem is with your invasive, unwelcome and utterly baffling program.

As requested several times, PLEASE SUPPLY A REMEDY TO THIS ISSUE! I am fed up sending analysis files, screenshots and all the rest of it. Your company have written this program, therefore you should be able to provide even the most basic support, (which I am yet to see).

I know for an absolute fact, thanks to the power of Google, that I am not the only person in the world with this problem, so go away, look at your problem record database, and find me a workable solution which enables me to run the software I have bought, and installed on my system without your crummy program intervening and preventing this from occurring.

Kenny Fogarty

October 25

Hello,

It is now SIX days since I purchased Football Manager 2008, and it is now SIX days since I first contacted SecuROM support for assistance. I am still waiting for an adequate response to my issues, which are nothing new for your company, judging by the sheer number of results a Google search for “SECUROM” returns.

To recap, I have sent analysis files as requested, I have sent screen captures as requested (although quite what that will tell you is beyond me, but then, I’ve only been in IT for twenty years, so what woud I know?). I have also sent you error messages, and I have also told you the cause of the problem.

In return, I have received the following response:

Thank you for your e-mail. It seems that the software “Process Explorer” causes a software conflict. Please close this program and try launching game again.

So, lets run with that for a bit.

Firstly, Process Explorer is absolutely not the cause of any software conflicts on my system. That is assertion incorrect. I would, if I was being malicious say that it is also a lie, but I’ll go with incorrect for now.

Process Explorer is an application written by Microsoft, which monitors active processes on an operating system. It sits in the background, consuming little CPU, and giving a lot of pertinent information. As it’s a Microsoft application, it integrates with the operating system seamlessly.

Secondly, when Process Explorer closes, its in-memory modules are not released as this would potentially leave the operating system in a dangerous state.

Thirdly, Process Explorer is not, and cannot, be used to subvert or hack into an application program. There are other, far more suitable programs out there which can do that, and there are many methods around that bypass SecuROM.

I do not want to have to bypass anything. I want to be able to put the CD into the drive, click the icon and execute Football Manager 2008. Is that too hard a concept for you to grasp?

The issue is this: My legitimate copy of Football Manager 2008 carries with it a payload called SecuROM, which activates upon installation, scans my memory for any modules it doesn’t like (without my permission), then actively disables Football Manager 2008 from executing on my laptop.

In other words, your program, your product, is hidden away from view, and then purposely disables execution of an application I have bought quite legitimately. Another word for programs like yours is “Trojan”. Another word, although I am being generous with my definition is “Virus”.

Six days and still no answer from SecuROM support.

Do you think that is an acceptable turnaround given that I have given the answer to the issues, and am only waiting for you to provide me with a method to disable your deceitful program from executing? So, as the people monitoring this email address are unable, or unwilling to provide me with a solution, can we now escalate and talk to the people who actually know what they’re doing?

Is there an escalation procedure within your company, so that I can actually start to use the program I’ve bought, and not be blocked off by your application?

Kenny Fogarty

October 26

Hello,

Thank you for your e-mail. It seems that the software “Process Explorer” causes a software conflict. Please close this program and try launching game again.

If the problem persists, please send us a new analysis file.

If you have any questions, please feel free to ask.

Best regards,

SecuROM Support Team

Hello,

I see you completely ignored the content of my previous email.

To recap:

  1. Process Explorer is absolutely not the cause of any software conflicts on my system.
  2. Process Explorer closes, its in-memory modules are not released as this would potentially leave the operating system in a dangerous state.
  3. SecuROM activates on installation, scans my memory for any modules it doesn’t like (without my permission), then actively disables Football Manager 2008 from executing on my laptop.

Given this information, kindly stop lying and PROVIDE ME WITH A SOLUTION TO THIS PROBLEM THAT YOUR PRODUCT HAS CAUSED.

Kenny Fogarty

Hello,

Have you tried the solution that we have provided? Have you stopped the running process of ‘Process Explorer’, rebooted and tried to launch your SecuROM protected application?

Best regards,

SecuROM Support Team

Hello,

Yes I have tried the “solution” you provided. The result is the same - SecuROM disables my “protected” application from running because it detects the Process Explorer DLL in memory. So, we now approach seven days where I cannot actually execute a program that I have bought legitimately.

But let me add here - rebooting a laptop, or a PC, is under no circumstances, to be considered a “solution” to a problem that has been brought about thanks to your trojan. To therefore suggest - in a round about way, admittedly - that a user should reboot their PC any time they want to use their SecuROM “protected” application is - well, I think the technical term I should use here is “complete bollocks”.

Kindly provide a fix to your application, which either stops it scanning the contents of my laptop memory (which it does without my permission), or, remodel it to ignore the Process Explorer modules it thinks are going to be used maliciously.

Kenny Fogarty

Hello,

If you could please provide us with a analysis file with Process Explorer not running in the back ground or resident in memory.

In order to generate the analysis file of an attempted software launch for us to evaluate, please do the following:

1) Place the original disc in a local physical drive.
2) Re-boot the computer.
3) Locate the application file, ‘right-click’ on it and a dialogue window will appear.
4) Choose ‘Launch Analysis’ from the choices and release the mouse. If this not available, under the command prompt, type the name of the application, followed by a space, followed by ‘/secuexp’.
5) A disclaimer window will appear.
6) To proceed, please click on the ‘Yes’ button.
7) The application will now generate an ‘AnalysisLog.sr0′ file within the root of your hard drive.
8) Please ‘zip’ this file (to avoid email corruption) and submit it to support@securom.com

The log file should tell us more about the problem.

If you have any questions, please feel free to ask.

Best regards,

SecuROM Support Team

Hello,

I have already presented you with two analysis files. These were sent to you on 20/10/2007, and again on 23/10/2007. Both analysis files were taken directly after a reboot, and without Process Explorer being invoked, which, as anyone knows, means their memory-resident modules were not present. Thus far, the only comment I have received in response to the analysis files that have been presented, is that your program authenticated with no errors.

No errors, apart from the fact that SecuROM deliberately disabled execution of my legitimate copy of Football Manager 2008. But then, I don’t think that you regard this malicious action as an error whatsoever.

Please try to provide me with a solution, the same solution I have been asking for since 20/10/2007, without resorting to lies, such as “Process Explorer causes conflicts”, and low-level catch all solutions such as “Reboot before you execute the program” because this falls well short of what we both know to be the root cause of the problem - your software.

I expect a resolution to this problem within the next 24 hours.

Kenny Fogarty

Hello,

We will need to consult our programers about your case. We will come back to you as soon as possible.

Best regards,

SecuROM Support Team

Hello,

Well, it’s only taken seven days to get some kind of action out of your support desk.

In the meantime, because there are absolutely no problems with my laptop, and no problems with the operating system, or any other applications running on it, and your software is solely responsible for the fact that I cannot get Football Manager 2008 to execute at all, can you please send me details of who I should contact within your company, so that I can seek a full refund from secuROM for the cost of the application that I have bought, but am unable to run.

Many thanks for your appalling, lie-filled, inaccurate, mockery of a support desk.

Kenny Fogarty

October 29

Hello.

The reboot might only be necessary with some older versions of Process Explorer, because the drivers this program is using are still active after closing the tool.
If you are running the latest version of Process Explorer, simply close it and then start your game.

Best regards,

SecuROM Support Team

Hello,

Thank you for your mail.

For your information, I have upgraded to Process Explorer V11.3. This version was released on October 26, 2007.

I my laptop, invoked the new version of Process Explorer to see what has changed, and what is new within the application, and finally, I have clicked on my Football Manager 2008 icon on the desktop, and the same error as previously reported has appeared.

Again, I put it to you that SecuROM has deliberately, and maliciously prevented my legal copy of Football Manager 2008 from starting, for no apparent reason.

As a means of copy protection, I would suggest that your software is fundamentally flawed, because it cannot distinguish that my legal copy of the software should be allowed to execute without any restrictions on my laptop. It appears to me that your system isnt performing any sort of CD validation, in order to see if my copy is valid or not, rather your product is deliberately stopping the application from executing because it can see some Process Explorer modules in memory.

There is no reason, that I can see, why your software should be scanning the memory of my system, and making arbitrary decisions, based on what it finds, as a form of copy protection. Process Explorer is not and cannot be used to violate copy protection, so why is your software behaving in this manner?

I want what I have paid for - a working, executable copy of the software I bought on 20/10/2007. After nine days of dealing with your support, I fear that this is not going to happen.

I have repeatedly asked for a resolution to this problem, and I do not regard Reboot your laptop as any form of workaround or solution. This is 2007, not 1983. I can run more than one application on my system without any issue. I have a dual core laptop, not a Commodore VIC 20, so please do not try to fob me off with that as a resolution to a problem which has been created solely by your malicious, trojan.

If a workaround, or resolution cannot be found, then please furnish me with the contact details of a person, or group within your organisation who I can contact to seek a full refund for the cost of the product I have bought, but your software will not allow to execute.

Kenny Fogarty

October 30

Hello.

The Process Monitor program from Sysinternals has dumping capabilities as well as registry monitor / file monitor capabilities. This could be used to trace the behavior of SecuROM. Therefore we do not allow the game to start when this software is active.

Best regards

SecuROM Support Team

Hello,

Many thanks for your email.

I am fully aware of what Process Monitor contains and can be used for, but thanks for the information. Now, if you can please tell me why your software prevents the execution of Football Manager 2008, after it detects PROCESS EXPLORER, which is a replacement for Windows Task Manager, and how you plan to rectify it, as per my request in each email to your “support” desk, I’d love to hear it.

Ten days, and you can’t even get the name of the program you’re blocking correct. I wonder how many people in your organisation it takes to change a lightbulb?

Kenny Fogarty

Sphere: Related Content

del.icio.us |Digg it |Earthlink |Furl |iFeedReaders |ma.gnolia |Maple.nu |Netvouz |Netscape |RawSugar |reddit |Scuttle |Shadows |Simpy |Spurl |StumbleUpon |Wink |Yahoo MyWeb |

CICS Wiki

Filed under: CICS, wiki, z/OS — Kenny at 7:27 pm on Monday, October 15, 2007

The collaboration effort which appears to be sweeping the mainframe world continues apace, with the latest wiki - CICS wiki. I’ve applied for a userid.

del.icio.us |Digg it |Earthlink |Furl |iFeedReaders |ma.gnolia |Maple.nu |Netvouz |Netscape |RawSugar |reddit |Scuttle |Shadows |Simpy |Spurl |StumbleUpon |Wink |Yahoo MyWeb |

DB2 for z/OS Space

Filed under: DB2, Developerworks, z/OS — Kenny at 3:04 pm on Friday, October 12, 2007

I’ve just been confirmed as a member of the IBM DeveloperWorks DB2 for z/OS Space.
If this takes off, it could be the place on the internet for all things DB2 on z/OS.

Sphere: Related Content

del.icio.us |Digg it |Earthlink |Furl |iFeedReaders |ma.gnolia |Maple.nu |Netvouz |Netscape |RawSugar |reddit |Scuttle |Shadows |Simpy |Spurl |StumbleUpon |Wink |Yahoo MyWeb |

Maximising IBM DB2 V8 Using the DB2 Utilities

Filed under: DB2, Events, Utilities — Kenny at 7:15 am on Sunday, June 24, 2007

I recently dialled into a new teleconference, given by IBM called Maximising IBM DB2 V8 Using the DB2 Utilities. The conference was hosted by Bryan Smith, and is well worth an hour of anyone’s time. The link to the presentation, and the replay of the teleconference can be found here.

Sphere: Related Content

del.icio.us |Digg it |Earthlink |Furl |iFeedReaders |ma.gnolia |Maple.nu |Netvouz |Netscape |RawSugar |reddit |Scuttle |Shadows |Simpy |Spurl |StumbleUpon |Wink |Yahoo MyWeb |

DB2 Version 7 End of Service Announced

Filed under: DB2 — Kenny at 8:16 pm on Tuesday, February 6, 2007

IBM have finally announced the end of service date for DB2 Version 7. Stick a date in your diary for June 30, 2008, that’s when DB2 Version 7 will no longer be supported by IBM. I wonder how many companies are still working away on V7, afraid to make the tricky jump up to V8? Here’s a link to IBM’s Information Management product lifecycle dates page. DB2 Version 7. Here’s the announcement letter too.

Sphere: Related Content

del.icio.us |Digg it |Earthlink |Furl |iFeedReaders |ma.gnolia |Maple.nu |Netvouz |Netscape |RawSugar |reddit |Scuttle |Shadows |Simpy |Spurl |StumbleUpon |Wink |Yahoo MyWeb |

A Relational Model of Data for Large Shared Data Banks

Filed under: DB2 — Kenny at 10:55 am on Saturday, January 13, 2007

Right back to basics with this PDF document, it is the original specification for relational data base models by Dr E.F.Codd. Download it by clicking here.

Sphere: Related Content

del.icio.us |Digg it |Earthlink |Furl |iFeedReaders |ma.gnolia |Maple.nu |Netvouz |Netscape |RawSugar |reddit |Scuttle |Shadows |Simpy |Spurl |StumbleUpon |Wink |Yahoo MyWeb |

DB2 Estimator

Filed under: Basics, DB2 — Kenny at 8:40 pm on Saturday, December 2, 2006

DB2 Estimator is a free stand-alone tool runs on a personal computer and can be that can be used to estimate the performance of applications that run against DB2 V5, V6, V7 or V8 subsystems. DB2 Estimator does not need to connect to a DB2 subsystem in order to function.

DB2 Estimator can be used to provide a table sizing information, and can be used to provide detailed performance analysis of an entire DB2 application.

DB2 Estimator is a proven aid to application DBA’s and can help to save time, lower costs migrate applications into production environments, enhance and modify existing applications.

DB2 Estimator can be used throughout all phases of the life cycle of a relational database application.

Initial Design Phase

In the initial design phase, the detailed specifications of the tables,indexes and SQL statements used by your application might not be available. Using DB2 Estimator, you can quickly and easily determine whether your proposed design is feasible and optimal.

Tables can be defined in DB2 Estimator ahead of time. Columns and significant attributes of the table can be entered into DB2 Estimator. Index creation is as simple as choosing the columns that need to be added From these basic definitions, DASD space requirements can be viewed, giving you a ball-park figure for the space needed to accomodate your application.

SQL statements can be defined or imported into DB2 Estimator which will approximate those statements that will be used within the application. Then DB2 Estimator can be used to view the cost and performance of running those SQL statements in terms of CPU and I/O capacity. SQL statements can be grouped together to model DB2 transactions and costs can then be viewed at the transaction level.

Finally, DB2 applications can be modelled by grouping transactions and specifying a rate for each transaction type. DB2 estimator estimates the amount of CPU and I/O capacity needed to run the application in your environment as well as the average elapsed time for each transaction type. The sample results screen contains the results of such an estimate.

DB2 Estimator can be used to model standalone DB2 systems, or distributed DB2 Server Systems and include Data-Sharing. DB2 Estimator also provides several predefined utilities and determine the costs of running them.

DB2 Estimator allows the definitions contained within the project to help evaluate alternative application designs. By comparing the cost and performance of these designs, it is possible to determine which design provides the optimum cost/performance ratio before valuable time and resources are invested in developing the application or creating a real database.

Developing Application and Database Objects

When you are ready to create real database objects, you can use the models specified in DB2 Estimator as a guide for naming columns and specifying attribute values. As application modules or individual programs are designed and coded, DB2 Estimator can be used to get a quick estimate of the expected performance without the need for creating real database objects. These estimates can alert you to problems that are easiest to fix at this early stage.

As application code and database design nears completion. DB2 Estimator can be used to ensure that performance is still optimal.

The accuracy of the estimates generated by DB2 Estimator can be enhanced by inputting data into DB2 Estimator from the DB2 EXPLAIN statement, or from such tools as DB2 PM.

Production Application

Performance monitoring tools such as Mainview or DB2PM are commonly used to detect application performance problems during production. Common solutions to these performance problems include changes in index and SQL design. DB2 Estimator can be used to evaluate alternative SQL designs and the resulting effects on system performance before any production database objects are modified. DB2 Estimator can also help to determine the impact resulting from a hardware and/or workload change.

Major Benefits of DB2 Estimator

  • Can provide accurate estimates of DB2 application capacity requirements
  • Can handle DB2 UDB for OS/390 versions 5, 6, and 7
  • The easiest way to estimate performance of alternative Table structures and SQL coding. DB2 application capacity requirements
  • Lets you view costs instantly online, and print or export files to spreadsheet applications
  • Easily obtain DASD size calculations by table, index and application.
  • Provides online help and an easy-to-use graphical user interface
  • Can be used without a connection to a DB2 subsystem
  • Can be used as a training and learning tool
  • You can download table, index, view and SQL definitions via flat files

Assumptions
DB2 Estimator assumes that only one table exists per table space.
DB2 Estimator assumes that each table and index is on a separate disk device and that each partition of a table or index is on a separate device.
It is not possible to override DB2 Estimator and allocate more than one table or index on a disk device.
It is not possible to put more than one table in a table space.

With this simplification, DB2 Estimator does not need to mention table spaces in the table sizing reports, utility performance estimates, or in Capacity Runs reports.

Sphere: Related Content

del.icio.us |Digg it |Earthlink |Furl |iFeedReaders |ma.gnolia |Maple.nu |Netvouz |Netscape |RawSugar |reddit |Scuttle |Shadows |Simpy |Spurl |StumbleUpon |Wink |Yahoo MyWeb |

SELECT *

Filed under: Basics, DB2 — Kenny at 3:23 pm on Tuesday, October 31, 2006

It is best enforce a standard whereby SELECT * is not used in any host programs.

The SELECT * statement is a temptation because it allows the programmer to avoid having to explicitly name each of the required columns. However, this convienience can be costly in terms of CPU time, elapsed time and maintenance of host programs.

When an SQL statement SELECTs data for use by a program, the program must have a host variable to receive a value from each column selected. If a column were added to the table, the embedded SELECT * would automatically pass its value to the program. If there is no host variable defined for the new column, there is no place to store the returned value for access by the program.

Similarly, if a column is deleted from the table, SELECT * would not return the values expected by the program, as one of the columns is no longer present.

If the columns required by the program are listed explicitly, any changed and/or deleted columns would not affect the program unless the program explicitly references a column that has been removed.

As stated above, SELECT * is a temptation to code because it avoids the programmer having to name each of the columns required by the program. However, this convenience can have a detrimental effect on CPU time, elapsed time, and maintenance of host programs (see above).

If SELECT * is used within the code of a host program, there could be instances where an unnecessary number of columns are fetched from the database and passed back to the host program. (The more columns that are processed, the more CPU is required). Also, if there is a large number of columns returned, it is less likely that a sort can be done in a sort pool in central storage, and will increase the number of work files that must be written to DASD and then merged, before the rows are returned to the host program.

If the rows returned by the SELECT * is from a distributed process, the rows must be returned over the network, which can be expensive, and cause bottlenecks and other network/performance issues.

It increases the likelihood that a compiled column assignment procedure is greater than 4 KB at bind time and thus not stored in the plan or package. A compiled assignment procedure is used rather than an interpretative process to move columns to host variable output area. If more than 100 rows are fetched, the procedure is compiled each time the SQL is executed rather than only at bind time, which increases the CPU time.

Sphere: Related Content

del.icio.us |Digg it |Earthlink |Furl |iFeedReaders |ma.gnolia |Maple.nu |Netvouz |Netscape |RawSugar |reddit |Scuttle |Shadows |Simpy |Spurl |StumbleUpon |Wink |Yahoo MyWeb |

General Rules of Thumb

Filed under: Basics, DB2 — Kenny at 8:42 am on Tuesday, October 31, 2006

Here are some general rules of thumb that can be used in a DB2 environment:

  • Never use SELECT *:
    As a general rule, a query should never ask DB2 for anything more than is required to satisfy the desired task. For maximum flexibility and efficiency, each query should access only the columns needed for the function that will be performed.

  • Singleton SELECT versus the cursor:
    To return a single row, an application program can use a cursor or a singleton SELECT. A cursor requires an OPEN, FETCH, and CLOSE to retrieve one row, whereas a singleton SELECT requires only SELECT… INTO. Usually, the singleton SELECT outperforms the cursor.

    When the selected row must be updated after it is retrieved, however, using a cursor with the FOR UPDATE OF clause is recommended over a singleton SELECT. The FOR UPDATE OF clause ensures the integrity of the data in the row because it causes DB2 to hold an exclusive lock on the page containing the row to be updated. The singleton select provides no such locking.

  • Use FOR FETCH ONLY:
    When a SELECT statement will be used only for retrieval, use the FOR FETCH ONLY clause.
  • Avoid using DISTINCT:

    The DISTINCT verb removes duplicate rows form an answer set. If duplicates will not cause a problem, do not code distinct, because it adds overhead by invoking a sort to remove the duplicates.

  • Limit the data selected:
    Return the minimum number of columns and rows needed by your application program by making efficient use of the WHERE (SQL predicate) clause. It is almost always more efficient to allow DB2 to use the WHERE clause to limit the data returned.
  • Code predicates on indexed columns:

    DB2 usually performs more efficiently when it can satisfy a request using an existing index rather than no index. Design all SQL statements to take advantage of indexes.

  • Multicolumn indexes:
    If a table has only multicolumn indexes, try to specify the high-level column in the WHERE clause of your query. This results in an index scan with at least one matching column.
  • Use ORDER BY only when sequence is important:
    Code the ORDER BY clause when the sequence of rows being returned is important. Order only those columns that are absolutely necessary in order to improve efficiency.

    Use equivalent data types: Use the same data types and lengths when comparing column values to host variables or literals. This eliminates the need for data conversion and allows for the use of an index. For example, comparing a column defined as CHAR(6) to a field which is CHAR(4) or CHAR(7) will cause data conversion and should be avoided at all costs. The easiest way to ensure datatype consistency is to use the DCLGEN fields whenever possible.

  • Use BETWEEN rather than <= and >= :
    BETWEEN allows the optimizer to select a more efficient access path.
  • Use IN instead of LIKE:
    If you know that only a certain number of occurrences exist, using IN with the specific list is more efficient than using LIKE. The functionality of LIKE can be imitated using a range of values. For example, if you want to retrieve all employees with a last name starting with “M,” use BETWEEN ‘maaaaaaaaaaaaaaa’ and ‘mzzzzzzzzzzzzzzz’ instead of LIKE ‘m%’
  • Avoid using NOT (except with EXISTS):
    Not should only be used as an alternative to very complex predicates.
Sphere: Related Content

del.icio.us |Digg it |Earthlink |Furl |iFeedReaders |ma.gnolia |Maple.nu |Netvouz |Netscape |RawSugar |reddit |Scuttle |Shadows |Simpy |Spurl |StumbleUpon |Wink |Yahoo MyWeb |

II14224 DB2 V8.1 MIGRATION/FALLBACK INFOAPAR TO/FROM DB2 V9.1 AND UPGRADING R810

Filed under: DB2, Informational APARs — Kenny at 2:58 pm on Friday, October 20, 2006

Informational APAR on migrating from DB2 V8 to DB2 V9 on z/OS. The text can be viewed by clicking here.

Next Page »