Author: digitaleagle

Startup Scripts

Sohan asked about my start up scripts for booting all of the PeopleSoft services.  I have been wanting to document this anyway in case I need it again.

Here is the setup — I had trouble with the Oracle database not starting, and so, I found it easier to start the whole system this way.  The system is a single user VMWare instance, and so, I simply put the main batch file in the Startup folder of the Start menu.

So, here is my main script.  This script just simply calls the other scripts.

@echo off
echo -------------------------------------------------------------------------
echo Starting Database
echo -------------------------------------------------------------------------
cmd /c startDatabase
echo -------------------------------------------------------------------------
echo Starting App Server
echo -------------------------------------------------------------------------
cmd /c startAppServer
echo -------------------------------------------------------------------------
echo Starting Batch Server
echo -------------------------------------------------------------------------
cmd /c startBatchServer
echo -------------------------------------------------------------------------
echo Starting Web Server
echo -------------------------------------------------------------------------
cmd /c startWebServer

Here is the startDatabase script:

@echo off
sqlplus "/ as sysdba" @startup.sql

You will also need this SQL file to make it work.

startup
exit

Here is the startAppServer script:

@echo off
c:
cd \pshome\appserv
psadmin -c boot -d HCM90

Here is the startBatchServer script:

@echo off
c:
cd \pshome\appserv
psadmin -p start -d HCM90

Here is the startWebServer script — this assumes that you have installed the PIA as a service but set it to Manual start:

@echo off
net start Oracle-HCM90ProcessManager

Oracle Tip: Dropping a Database

Here is how to drop a database in Oracle.

Make sure that have ORACLE_SID set first.

Log into sqlplus with sysdba privileges:

sqlplus /nolog
connect / as sysdba

Run the following commands in sqlplus:

shutdown immediate
startup restrict mount exclusive

Before you complete the drop, verify that you are in the correct database — the one that you want to drop (thanks to Dan Norris’ comment):

select * from v$database;

Now you can drop the database.

drop database;

Tuxedo Install Error

I have been attempting to install Tuxedo on Oracle Enterprise Linux 5.  The installation presented several problems, and so, I thought it might be helpful to blog the fixes.

Both errors appear to be part of the InstallAnywhere installation system.  So, the fixes that I found were not specifically for Tuxedo or even PeopleSoft/Bea.

The first error output looked like this:

awk: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
hostname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/tmp/install.dir.5362/Linux/resource/jre/bin/java:
error while loading shared libraries: libpthread.so.0: cannot open
shared object file: No such file or directory
Tuxedo 9.1 base installation complete

I found the fix here.  Basically, you comment out the part of the script that sets the LD_ASSUME_KERNEL variable.  You can’t just use any text editor or even vi because the file actually contains the binary installation files zipped up in it.  Instead, this sed command seems to work:

cd linux/sles9/base/
cp tuxedo91_32_SLES_9_x86.bin ../Install.bak
chmod +w tuxedo91_32_SLES_9_x86.bin
cat ../Install.bak | sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > tuxedo91_32_SLES_9_x86.bin

That fixed part of the problem.  But, I still received this error:

awk: cmd. line:6: warning: escape sequence `\.' treated as plain `.'
=======================================================

Installer User Interface Mode Not Supported

Unable to load and to prepare the installer in console or silent mode.

=======================================================

The awk… message looks like it is a problem, but that can be ignored.  A couple of searches showed that other people’s successful installs had this error message.  As best I can tell, the problem lies in the packaged version of Java.

To fix the problem, I first had to install Java.  GCJ comes installed by default.  I installed Sun’s Java 1.5 by downloading and installing jdk-1_5_0_16-linux-i586-rpm.bin.

Then, I found an article that explains how to override the JVM used by the installer.  To make this work, you need to edit (with either the vi command or the gedit command) the install.sh.  Change the line from (line #259):

        sh $INSTALL_BINARY -f $SILENT_INSTALL_FILE > $INSTALLER_OUTPUT;

to:

        sh $INSTALL_BINARY LAX_VM /usr/java/jdk1.5.0_16/bin/java -f $SILENT_INSTALL_FILE > $INSTALLER_OUTPUT;

After that fix, tuxedo finally installed for me!

Resources

Writing to Access Databases

We are thinking about connecting to an Access database for one of our interfaces.  Here is some PeopleCode that I threw together to make sure that it was possible.

I tested the code in a VMWare instance with HCM8.9/Tools 8.46, Windows Server 2003.  The instance did not have Microsoft Access installed, and I changed the path (c:\temp\AccessTest.mdb below) to a network (UNC) path where the computer had Access installed.

Local JavaObject &class;
Local JavaObject &connection;
Local JavaObject &driverManager;
Local JavaObject &statement;

&class = GetJavaClass("java.lang.Class");
&class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

&driverManager = GetJavaClass("java.sql.DriverManager");
&connection = &driverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\temp\AccessTest.mdb;DriverID=22;READONLY=false");
&statement = &connection.createStatement();
&statement.executeUpdate("insert into tblTest(TestMessage) values ('testing')");

Hope it helps.

Resources

Updated: File Layout SQL

My post yesterday was a little wrong. Here is a better SQL to help with the sequence of the fields in the layout:

SELECT * FROM (

  SELECT A.FLDFIELDNAME, A.FLDSTART,

        (SELECT COUNT(*) FROM PSFLDFIELDDEFN

         WHERE FLDDEFNNAME = A.FLDDEFNNAME

         AND FLDSTART < A.FLDSTART) + 1 CORRECT_SEQ,

         A.FLDSEQNO ACTUAL_SEQ

  FROM PSFLDFIELDDEFN A

  WHERE A.FLDDEFNNAME = '<file Layout Name>'

)  B

WHERE B.CORRECT_SEQ <> B.ACTUAL_SEQ

ORDER BY B.FLDSTART

I had trouble rearranging the fields though. You can drag and drop the fields, but when you reopen the file layout, you find that it didn’t actually adjust the field sequence (FLDSEQNO). So, the fields are back in the order they were in. This is true for tools 8.46; I didn’t test 8.49.The only way I could find to rearrange the fields was to delete the field from the layout. Then, click on the field that you wanted it after and re-insert it.

SQL for Maintaining File Layouts

Here are a couple of SQL statements that might help you maintain file layouts.

This SQL shows gaps in a flat file. It assumes that the next field should start at the previous field’s start + the previous field’s length. Make sure to substitute the file layout name.

SELECT A.FLDFIELDNAME, A.FLDSTART, A.FLDLENGTH, A.FLDSTART + A.FLDLENGTH SHOULD_START_POS,

       B.FLDFIELDNAME NEXT_FIELD, B.FLDSTART ACTUAL_START_POS

FROM PSFLDFIELDDEFN A, PSFLDFIELDDEFN B

WHERE A.FLDDEFNNAME = '<file Layout Name>'

AND A.FLDDEFNNAME = B.FLDDEFNNAME

AND B.FLDSTART = (SELECT MIN(FLDSTART) FROM PSFLDFIELDDEFN

                  WHERE FLDDEFNNAME = A.FLDDEFNNAME

                  AND FLDSTART > A.FLDSTART)

AND A.FLDSTART + A.FLDLENGTH <> B.FLDSTART

ORDER BY FLDSTART;

This SQL shows if the fields are out of order. If the order in the file layout designer is different from the order based on the field start position, the layout will be a little confusing and hard to maintain. This should help you correct the order. To re-order the fields in App Designer, drag the field on top of the field that you want it to come after.

SELECT A.FLDFIELDNAME, A.FLDSTART, A.FLDLENGTH, A.FLDSEQNO, A.FLDSEQNO + 1 SEQ_SHOULD_BE,

       B.FLDFIELDNAME NEXT_FIELD, B.FLDSTART NEXT_START_POS, B.FLDSEQNO ACTUAL_SEQ,

       C.FLDFIELDNAME ACTUAL_NEXT_FIELD

FROM PSFLDFIELDDEFN A, PSFLDFIELDDEFN B, PSFLDFIELDDEFN C

WHERE A.FLDDEFNNAME = '<file Layout Name>'
AND A.FLDDEFNNAME = B.FLDDEFNNAME

AND A.FLDDEFNNAME = C.FLDDEFNNAME

AND B.FLDSTART = (SELECT MIN(FLDSTART) FROM PSFLDFIELDDEFN

                  WHERE FLDDEFNNAME = A.FLDDEFNNAME

                  AND FLDSTART > A.FLDSTART)

AND C.FLDSEQNO = A.FLDSEQNO + 1

AND A.FLDSEQNO + 1 <> B.FLDSEQNO

ORDER BY FLDSTART;