Month: June 2012

PIA needs JRockit!

The other day, I was trying to finish up an install for someone, and ran into a problem.  I couldn’t get psadmin to create a new PIA domain.  Finally, thanks to OTN, I found that I had to have JRockit JDK set as the Java environment for WebLogic.  Note that this was to create the domain not just start the domain.

Logs

If there was one thing I could change about this whole thing, it would the logs.  I spent so long on this issue just because I had no clues.  We have got to have more logs to look at for clues!  If am missing something, please comment below and point it out.  If not, Oracle, please add some logging — at least maybe print out what JVM it is using.

This is the first log file that I found: <PS_CFG_HOME>/webserv/piainstall_<domain name>.log

Install Action : CREATE_NEW_DOMAIN

Creating Domain...

Deploying Web Applications...

Deploying WebLogic Extension files...

Deploying PeopleSoft Site files...

Deploying PeopleSoft Site Doc files...

Completed.

PS_CFG_HOME: /psoft/pscfgs/fnprd

PIA_INSTALL_FAIL

This is the second log: /tmp/piaInatallLog_<timestamp>

Install Action : CREATE_NEW_DOMAIN

Creating Domain...

Deploying Web Applications...

Deploying WebLogic Extension files...

Deploying PeopleSoft Site files...

Deploying PeopleSoft Site Doc files...

Completed.

Also, in <PS_CFG_HOME>, I found the  wlspiainstall.properties which included all of the settings that it was using to create the domain.

Avoiding the Error

The best way to avoid this error is to make sure that you set the JAVA_HOME to your JRockit installation before installing WebLogic.  So, assuming that you have JRockit installed at /opt/jdk, you can run something like this:

export JAVA_HOME=/opt/jdk
export PATH=$JAVA_HOME/bin:$PATH
which java
java -version

Your output should look something like this:


$export JAVA_HOME=/opt/jdk
$export PATH=$JAVA_HOME/bin:$PATH
$which java
/opt/jdk/bin/java
$java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Oracle JRockit(R) (build R28.1.0-123-138454-1.6.0_20-20101014-1350-linux-x86_64, compiled mode)

If it looks like this, you have something wrong.  This is open source OpenJDK JVM:


$which java
/usr/bin/java
$java -version
java version "1.7.0_03"
OpenJDK Runtime Environment (IcedTea7 2.1.1pre) (7~u3-2.1.1~pre1-1ubuntu3)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)

Or, this is the Sun JDK, which caused me problems:


$java -version
java version "1.5.0_30"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_30-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_30-b03, mixed mode)

Now, once you have that correct, you should run the Weblogic install from that command-line session.

Fixing the Problem

Now, my problem was that Weblogic had already been installed.  Apparently, it was using the Sun JDK instead of the JRockit JDK.  Normally, I would look in the <PS_CFG_HOME>/webserv/<domain>/bin/setcmd…. file to change the setting.  But, I don’t even have the domain installed at this point.

I found that I could set the JAVA_HOME and JAVA_VENDOR variables in the <weblogic home>/wlserver_10.3/common/bin/commEnv.sh file.  Note that the JAVA_VENDOR was required.  If it is not set, some of the logic later on in the script overwrites the JAVA_HOME.

So, I added these two lines near the top between the comments:


#
#*****************************************************************************

JAVA_HOME=/opt/jdk
JAVA_VENDOR=Oracle

#*****************************************************************************
# sub functions
#*****************************************************************************

After that, my PIA built with no problem.

Resources

OTN: unable to create Web Server Domain

Sudo Plus X11 Forwarding

I had trouble the other day running the Oracle installer in GUI mode over SSH.  I had the -X option set, and I could run a GUI program as myself.  The problem was that I couldn’t run the GUI program after I used sudo to change to my oracle user.

I found the answer on the “Bag of Tricks” blog:

Bag of Tricks: x forwarding and sudo for oracle installs

To build upon that, I turned it into a script.  The script adds the x cookie, runs an interactive bash, and finally removes the cookie at the end.


#!/bin/sh

user=$1
if [ -z "$user" ]; then
 user=<default user>
fi

displayNum=`echo $DISPLAY | sed -e 's/^.*://' -e 's/\.[0123456789]*//'`
echo "Display # = $displayNum"
cookie=`xauth list | grep ":$displayNum"`
echo "Cookie = $cookie"
cookiename=`echo $cookie | sed 's/\s*MIT-MAGIC.*$//'`
echo "Cookie Name: $cookiename"
echo "user = $user"
sudo -u $user bash -c "xauth list; xauth add $cookie; bash; xauth remove $cookiename"

I put the script in my ~/bin directory and called it ms (my-sudo).  That way I could call it easily.

I hope someone finds that usedful.  Any comments are welcomed.

HP_RTBC:RTBCMain/HP_RTBC_INSTALL_DEPT_SEL Issues

After installing a series of updates (852825, 872267, 872523, 874418), I ran into a SQL error.  I am not sure which update it was, and actually, the find definition references pointed to 808749, which is HRMS 9.1 Bundle #1.

As I am not able to open a ticket on this issue currently, this is what I did to fix the problem …

I noticed this error in one of my CI logs.

SQLExec: 3 select list items in parameter list, but SQL has 1 select columns. (2,124) HP_RTBC.RTBCMain.OnExecute  Name:Job_RTBC  PCPC:4183  Statement:89
Called from:HP_RTBC.RTBCMain.OnExecute  Name:MainProcess  Statement:9
Called from:JOB.LASTUPDOPRID.SaveEdit  Statement:3(2,124)

As a result, I couldn’t hire anyone.  The problem appeared to be this line:

SQLExec(SQL.HP_RTBC_INSTALL_DEPT_SEL,
        &rsJobTmp(&i).JOB.SETID_DEPT.Value,
        &rsJobTmp(&i).JOB.DEPTID.Value,
        &rsJobTmp(&i).JOB.EFFDT.Value,
        &DeptUseEncumbrances,
        &ProcOption,
        &HP_AUTO_RTBC);

I decided to inspect the SQL, and I found this code:

SELECT USE_ENCUMBRANCES
FROM PS_DEPT_TBL A
WHERE A.SETID=:1
AND A.DEPTID =:2
AND A.EFFDT = (
SELECT MAX(B.EFFDT)
FROM PS_DEPT_TBL B
WHERE B.SETID=A.SETID
AND B.DEPTID = A.DEPTID
AND B.EFFDT<=%DateIn(:3))

That’s the problem.  The SQL only has 1 field in the select list (USE_ENCUMBRANCES), and the PeopleCode expects 3 for the 3 variables (&DeptUseEncumbrances, &ProcOption, &HP_AUTO_RTBC);

I did a little research, and as best I could tell, this PeopleCode is the only one that uses the SQL definition.

I couldn’t do a Find Definition References on the Application Package PeopleCode, but I could do a SQL query to determine which projects it was involved in:

SELECT * FROM PSPROJECTITEM
WHERE OBJECTVALUE1 = 'HP_RTBC'
AND OBJECTVALUE2 = 'RTBCMain';

These are some of the updates that I just installed, so I bet that was my problem.

So, I updated the HP_RTBC_INSTALL_DEPT_SEL SQL definition and added the two extra fields as best as I could figure.

SELECT USE_ENCUMBRANCES
 , HP_RTBC_OPTION
 , HP_AUTO_RTBC
 FROM PS_DEPT_TBL A
 WHERE A.SETID=:1
 AND A.DEPTID =:2
 AND A.EFFDT = (
 SELECT MAX(B.EFFDT)
 FROM PS_DEPT_TBL B
 WHERE B.SETID=A.SETID
 AND B.DEPTID = A.DEPTID
 AND B.EFFDT<=%DateIn(:3))

And, that fixed my problem!

How to Change the SysAdm Password

Nicolas Gasparato wrote a rather thorough article on the subject of user password, and mostly, I just want to capture a bookmark to it on my blog:

On The Peoplesoft Road: PeopleSoft Passwords

The best way that I have found to change the SYSADM password (the database user that PeopleSoft uses to connect) is to use Data Mover and the change_access_password command.

You can read the official documentation on the command here:

PeopleBooks: change_access_password

The syntax looks something like this:


change_access_password SYSADM1 <new password>;

The first parameter is the Symbolic ID.  While it is probably SYSADM1, you can read it from the PSACCESSPRFL table:


select * from PSACCESSPRFL

The second parameter is the new password that you want to use.

The command will both change the password in the database and change the place where PeopleTools stores the password to use when connecting.  You will still probably still want to clear the cache and restart the servers including app, batch, and web.

Experiments with Project Compares

Just recently, a question came up about customizing just a label.  So, I thought I would run a little experiment, and confirm how project compares work.

My plan is to go through compares and give a good background to how project compares work as well.

The actual question was: can you add a label to a delivered field without customizing the entire field.  I have seen how you can add just a label to a project, and the thought is to migrate just the label so that the field stays uncustomized.

So, here it goes…

Read More

Script for Finding PeopleSoft Processes

I accidentally deleted a PeopleSoft Home without shutting down the app server.  So, I had to find all of the processes and manually kill each one of them.  A normal “ps -ef | grep FN91TST” didn’t cut it.  The app server spins off some JSL and WSL processes that don’t have the environment name anywhere in the command.

Here’s the script that ended up doing the job:


#!/bin/bash

PS_USER=psoft
TARGET_PS_HOME=/psoft/FN91TST

for e in `ls /proc/*/environ`; do
  PID=`echo $e | sed -e 's#/proc/##' -e 's#/environ##' `
  if [ -e $e ]; then
    if [ `stat -c %U $e` == $PS_USER ]; then
      CURR_PS_HOME=`cat $e | tr '\0' '\n' | grep "^PS_CFG_HOME" | sed 's/^PS_CFG_HOME=//'`
      if [ "$CURR_PS_HOME" == "$TARGET_PS_HOME" ]; then
        echo "PID: $PID Home: $CURR_PS_HOME"
        ps $PID
      fi
    fi
  fi
done

Note: This script assumes that you are using PeopleTools 8.52 with the PS_CFG_HOME variable configured. If not, you’ll need to change it to either the PS_HOME or PS_APP_HOME variable.

Oracle DBA: EMPLID Table Counts Script

Here’s a handy script that I put together today.  It finds all of the tables with the EMPLID field in it and prints a count of the rows that have a non-blank EMPLID value.

You can tweak it to work with other fields or find a certain value.

declare
   cursor tbls is select distinct a.recname
                  from psrecfieldall a, psrecdefn b
                  where a.recname = b.recname
                  and b.rectype = 0
                  and a.fieldname = 'EMPLID';
   tbl tbls%ROWTYPE;
   cnt number;
   tablename varchar2(50);
   sqltext varchar2(200);
begin
   open tbls;
   loop
     fetch tbls into tbl;
     exit when tbls%NOTFOUND;

     select sqltablename into tablename from psrecdefn where recname = tbl.recname;
     if tablename = ' ' then
        tablename := 'PS_' || tbl.recname;
     end if;
     sqltext := 'select count(*) from ' || tablename || ' where EMPLID <> '' '' ';
     execute immediate sqltext into cnt;
     if cnt > 0 then
        dbms_output.put_line(tbl.recname || ' = ' || cnt);
     end if;
   end loop;
   close tbls;
exception
   when others then
      dbms_output.put_line('error with table: ' || tbl.recname);
      dbms_output.put_line('    ' || SQLCODE || ': ' || SQLERRM);
      dbms_output.put_line('    sql: ' || sqltext);
end;
/

 

Any suggestions are welcome.