Note: Technical Talk being moved to:
www.nazimcricket.com/wiki


Sunday, 26 October 2008

Geoff Lawson Sacking

The sacking of Geoff Lawson by the Pakistan Cricket Board has left me fuming. When Lawson was selected over Dav Whatmore, I was amazed to say the least. He just didn't seem to be the right choice and nothing Lawson has done to-date has changed my opinion on that.

However, the manner in which he has been sacked is reprehensible. First the new PCB Chairman Ijaz Butt announces in a press conference that Lawson is useless. He then goes on to say that whilst he isn't impressed by Lawson, he will support him for the remainder of his contract (August 2009) and then out of the blue he sacks the man.

According to reports, Lawson met with Butt-head, agreed to a follow up meeting and then heard about his sacking from the media. When he attempted to contact the Chairman to clarify his position, he was stone-walled.

In justification of their unprofessional behaviour, statements such as these have been made:

"Lawson had not even attempted to meet the chairman even once since he took over,” said the official. “We felt it reflected poorly on his attitude that he didn’t want to meet the chairman and explain what he wanted and where he wanted the team to go.”

When told that Lawson was upset that the chairman had not made any effort to meet him, the official asked simply: “Why should it be that way round? He is the chairman. The coach should seek him out.”

This high and mighty Chairman had no problem "summoning" several people to his office, including the current captain, yet he did not have the common decency to extend the same courtesy to the coach? What a load of garbage.

The Pakistan Cricket Board and it's new officials are an absolute disgrace and I for one fervently hope that Lawson is able to sue the pants off them (not that it would matter to these egotistical jerks).

Phew .... I did say I was fuming, didn't I? :-)

Saturday, 18 October 2008

How Times Have Changed

Cricket civilises people and creates good gentlemen. I want everyone to play cricket in Zimbabwe; I want ours to be a nation of gentlemen. Robert Mugabe

Friday, 17 October 2008

PeopleSoft Shutdown Process Scheduler

Had a very specific task today, which I thought would be good to document for future reference. Others may also find some parts of it useful.

Background:
We have a PeopleSoft Reporting database (PeopleTools Version 8.43.16) which suffers constantly from rogue nvision and excel processes hanging around on the Windows process schedulers for days on end.

The database is refreshed nightly from our Production environment and any reports running at the time of refresh need to be cleared out. Simply shutting down the Windows process scheduler is not always sufficient to address the issue, as Excel spreadsheets in particular may be left hanging around.

The other side-effect is inspite the process scheduler being shutdown, some reports get left with a status of "Processing" on the process monitor. These can later on impede other jobs in the queue.

3rd Party Utilities:
Implemented my solution with the aid of the following utilities:

  • SCHEDULED TASK MANAGER from Microsoft.
  • SQLPLUS from Oracle.
  • PSADMIN from PeopleSoft.
  • PSKILL from SysInternals.
  • BAT2EXE Shareware.

    Implemented Solution - Summary:
    Created a batchfile which:

  • Executes a sqlplus script. This script parses the specified windows process scheduler server name and updates the process monitor tables, placing all reports which have a status of "Initiated" or "Processing" to a status of "Cancelled". Results of this are written to a logfile.
  • Invokes psadmin to shutdown the process scheduler.
  • Uses pskill to eliminate any Excel or Nvision processes.
  • Invokes psadmin to start up the process scheduler.
  • Invokes psadmin to verify the status of the process scheduler and writes this to a logfile.

    To Finish Off:

  • Converted the batchfile to an executable using BAT2EXE. This was done to mask the credentials used in the call to the sqlplus script.
  • Created a Scheduled Task to run the executable nightly with the windows process scheduler server name used as a variable. This allows me the flexibility of rolling the script out to various windows process scheduler servers.

    Implemented Solution - Syntax:
    The batchfile contains the following lines of code:

    sqlplus username/password@DATABASE @sqlscript.sql %1% > logfile.log
    psadmin -p stop -d DATABASE
    pskill EXCEL.exe
    pskill psnvs.exe
    psadmin -p start -d DATABASE
    psadmin -p status -d DATABASE > logfile2.log

    The sqlplus script contains the following lines of code:

    def server=&1
    update psprcsrqst set runstatus=8 where runstatus in (6,7) and servernamerun='&1';
    update psprcsque set runstatus=8 where runstatus in (6,7) and servernamerun='&&1';
    commit;
    exit;

    The scheduled task manager calls the executable as follows:

    {path}\executablename servername_variable
  • Thursday, 2 October 2008

    SQLPLUS Ignore Ampersands

    In SQLPLUS when an ampersand (&) is encountered, Oracle treats it as a value prompt. For example, if you try to execute the following statement: INSERT INTO DEPARTMENT (DEPARTMENT_NAME) VALUES ('Finance & Treasury'); SQLPLUS will return a prompt: Enter value for treasury: To have SQLPLUS ignore the ampersand, use the following command prior to executing your query:
    SET DEFINE OFF
    INSERT INTO DEPARTMENT (DEPARTMENT_NAME) VALUES ('Finance & Treasury');

    Wednesday, 1 October 2008

    Lookup SQL Error on Unix

    command is:
    oerr ORA 99999

    PeopleSoft Monitor Message

    These queries replicate the Monitor Message Page.

    Message Instance

    SELECT A.CHNLNAME AS "Channel Name"
         , SUM(C.APMSG_XTB_0) AS "Error"
         , SUM(C.APMSG_XTB_1) AS "New"
         , SUM(C.APMSG_XTB_2) AS "Started"
         , SUM(C.APMSG_XTB_3) AS "Working"
         , SUM(C.APMSG_XTB_4) AS "Done"
         , SUM(C.APMSG_XTB_5) AS "Retry"
         , SUM(C.APMSG_XTB_6) AS "Timeout"
         , SUM(C.APMSG_XTB_7) AS "Edited"
         , SUM(C.APMSG_XTB_8) AS "Canceled"
      FROM PSAPMSGPUBHDR A
         , PSAPMSGXTB C
    WHERE A.PUBSTATUS = C.APMSG_XTB_STAT
    GROUP BY A.CHNLNAME
    ORDER BY A.CHNLNAME;

    Publication Contract

    SELECT A.CHNLNAME AS "Channel Name"
         , SUM(C.APMSG_XTB_0) AS "Error"
         , SUM(C.APMSG_XTB_1) AS "New"
         , SUM(C.APMSG_XTB_2) AS "Started"
         , SUM(C.APMSG_XTB_3) AS "Working"
         , SUM(C.APMSG_XTB_4) AS "Done"
         , SUM(C.APMSG_XTB_5) AS "Retry"
         , SUM(C.APMSG_XTB_6) AS "Timeout"
         , SUM(C.APMSG_XTB_7) AS "Edited"
         , SUM(C.APMSG_XTB_8) AS "Cancelled"
      FROM PSAPMSGPUBCON A
         , PSAPMSGPUBHDR B
         , PSAPMSGXTB C
     WHERE A.PUBID = B.PUBID
       AND A.PUBNODE = B.PUBNODE
       AND A.CHNLNAME = B.CHNLNAME
       AND A.PUBCONSTATUS = C.APMSG_XTB_STAT
    GROUP BY A.CHNLNAME
    ORDER BY A.CHNLNAME;

    Subscription Contract

    SELECT A.CHNLNAME AS "Channel Name"
         , SUM(C.APMSG_XTB_0) AS "Error"
         , SUM(C.APMSG_XTB_1) AS "New"
         , SUM(C.APMSG_XTB_2) AS "Started"
         , SUM(C.APMSG_XTB_3) AS "Working"
         , SUM(C.APMSG_XTB_4) AS "Done"
         , SUM(C.APMSG_XTB_5) AS "Retry"
         , SUM(C.APMSG_XTB_6) AS "Timeout"
         , SUM(C.APMSG_XTB_7) AS "Edited"
         , SUM(C.APMSG_XTB_8) AS "Canceled"
      FROM PSAPMSGSUBCON A
         , PSAPMSGPUBHDR B
         , PSAPMSGXTB C
     WHERE A.PUBID = B.PUBID
       AND A.PUBNODE = B.PUBNODE
       AND A.CHNLNAME = B.CHNLNAME
       AND A.SUBCONSTATUS = C.APMSG_XTB_STAT
    GROUP BY A.CHNLNAME
    ORDER BY A.CHNLNAME;

    Note: You could use the field LASTUPDDTTM to filter by "Days"