Author: digitaleagle

HCM9.0: Resizing the Virtual Hard Drive

Once I reclaimed the hard drive space from my database, I had to shrink the hard drive in order to get my image smaller. Here is what I did.

Shrinking the Partition

I used a version of Linux called Knoppix. You can download it from here.

I never actually burned the image to CD. I just opened the properties of the CD drive in the virtual machine (while it was shutdown) and told it to use the iso image that I downloaded instead of the physical drive.

Determining the how small you can shrink the drive:

sudo ntfsresize --info /dev/sda1

Changing the size of the drive (test)

sudo ntfsresize --no-action --size=42831122432 /dev/sda1

Changing the size of the drive

sudo ntfsresize --size=42831122432 /dev/sda1

Changing the size of the partition

sudo fdisk /dev/sda

  • m for help
  • p for print (note the partition number and type/id)
  • d for delete
  • n for new partition (choose primary and same partition number and desired size +###M)
  • t for changing the partition type/id
  • p for print ( verify everything is the correct)
  • w for write

Shrinking an Unshrinkable Hard Drive

The only way that you can get a smaller hard drive if you can’t shrink the drive is to copy the data to a new virtual drive.

Copy the partition table.

sudo dd if=/dev/sda of=/dev/sdb bs=512 count=1

Copy the partition itself.

sudo dd if=/dev/sda1 of/dev/sdb1

Note: I had to reboot between copying the partition table and the actual partition.

Shrinking a Shrinkable Hard Drive

Shutdown the virtual machine.

From a command window run:

"C:\Program Files\VMware\VMware Server\vmware-mount " m: c:\VirtualMachines\HCM90\Database.vmdk
"C:\Program Files\VMware\VMware Server\vmware-vdiskmanager.exe" -p m:
"C:\Program Files\VMware\VMware Server\vmware-mount " m: /d
"C:\Program Files\VMware\VMware Server\vmware-vdiskmanager.exe" -k WindowsServer2003Standard.vmd

Note: to expand, you would use the -x option

"C:\Program Files\VMware\VMware Server\vmware-vdiskmanager.exe" -x 30Gb WindowsServer2003Standard.vmdk

HCM9.0: Automatic Windows Login for VMWare

You would never want to do this in the corporate world, but with a test VMWare instance, it makes sense. I am already logging into the host machine, and so, why should I log into the VMWare machine again each time that I boot it.

So. I used the link below to have the machine automatically login when it boots:

How to turn on automatic logon in Windows XP

It did work for Windows Server 2003. I used the registry method, but I opened the dialog with the Start > Run … control userpasswords2, and it looked like it would have worked as well.

Response: Array Class Generic Sort

Here is my attempt at providing details in response to an article by ChiliJoe called PeopleCode Array Class’ Generic Sort.

Basically, ChiliJoe is referring to a vague example in PeopleBooks that says, “For example, suppose you want to provide a more generic sort, with comparison function at the end of it.” This is in the section: “When Would You Use Application Classes?“.

The key to this example is that you have to write the sort by extending the array class. Here is an attempt at writing an example:

Read More

HCM9.0: Compiling COBOL

Here are the commands that I executed in a command window. Adjust the paths as necessary.
set PS_HOME=c:\pshome\hcm90
set PATH=%ps_home%\src\cbl\win32;%path%
set COBROOT="c:\program files\micro focus\net express\base"
cd %PS_HOME%\setup
cblbld c: \temp\compile

(make sure you have a space between the c: and the \temp\compile)

Here is the output:

ASCII Cobol Compilations Proceeding
Creating Directory c:\temp\compile
Logging progress to file c:\temp\compile\CBLBLD.LOG
COBOL compiler found in “c:\program files\micro focus\net express\base”
The system cannot find the path specified.
Target directory (c:\pshome\hcm90\CBLBINA) exists and is writable

Copying source files …

Building the COBOL targets …
……

That is all there is to it!

HCM9.0: Init Ora File

Here is my Init Ora file for the database of my VMWare image. Hope this helps if you are attempting something similar.  This is what I finally got to work during installation.

DB_NAME = hcm90
DB_FILES = 1021
CONTROL_FILES = (E:\oradata\hcm90\CONTROL01.CTL,
E:\oradata\hcm90\CONTROL02.CTL,
E:\oradata\hcm90\CONTROL03.CTL)
OPEN_CURSORS = 255
db_block_size = 8192
UNDO_MANAGEMENT = AUTO
shared_pool_size = 72265318

Note: I am still trying to get the shared pool size to a good number.  I have lowered it considerably, but before I post that, I need to work out the kinks.  I had to have the shared pool size at 72,265,318 in order to get it to install.  When I had it set lower, I got an error message about memory.

Response: Private/Instance Variables

ChiliJoe posted in Access to Instance Variables within the Same Class that an instance can change the value of another instance’s private variable.

At first, this sounds like it doesn’t make sense — an instance shouldn’t be able to access something private to another instance. But, in my opinion, the private is to protect it from code that may not understand or may violate rules the class depends on. From that point of view, it does make sense. Whoever wrote the code for the class knows what the value should be, and therefore, can be trusted to change it. Therefore, it can change any instance’s private variable as long as it is the same class. Whoever wrote the other class may not even be able to look at the code to see if they are going to mess things up, and therefore, cannot access the variable.

I think the PeopleSoft names make it confusing. Instead of calling it private, PeopleCode calls it instance, which would lead you to think that only that instance could access it. Actually, it is private to the class, not the instance.

So, to take the challenge, I translated ChiliJoe’s code to Java just to see if it works the same in Java. It does:

package com.skp.peoplecodejavacompare;

public class Example {
private Example newInstance;
private int num = 0;

public void createNewInstance() {
newInstance = new Example();
}

public int incrementNewInstanceNum() {
newInstance.num++;
return newInstance.num;
}

public int incrementThisInstanceNum() {
num++;
return num;
}

public void incrementPassedNum(Example passed) {
passed.num ++;
}

public int getThisInstanceNum() {
return num;
}

public static void main(String[] args) {
Example test1 = new Example();
test1.createNewInstance();

System.out.println(“incrementNewInstanceNum returns “ + test1.incrementNewInstanceNum());
System.out.println(“getThisInstanceNum returns “ + test1.getThisInstanceNum());
System.out.println(“incrementThisInstanceNum returns “ + test1.incrementThisInstanceNum());
System.out.println(“incrementNewInstanceNum returns “ + test1.incrementNewInstanceNum());

Example test2 = new Example();
System.out.println(“test2.getThisInstanceNum returns “ + test2.getThisInstanceNum());
test1.incrementPassedNum(test2);
System.out.println(“test2.getThisInstanceNum returns “ + test2.getThisInstanceNum());
}
}

Output:

incrementNewInstanceNum returns 1
getThisInstanceNum returns 0
incrementThisInstanceNum returns 1
incrementNewInstanceNum returns 2
test2.getThisInstanceNum returns 0
test2.getThisInstanceNum returns 1

HCM9.0: Resizing the Database

The database of my PeopleSoft HRMS 9.0 VMWare Image was larger than I expected. I had to get the database down to a manageable size so that we can easily make backup copies of the image. Here is what I did:

  • Starting Size: 63.6 Gb
  • Finishing Size: 39.8 Gb

Query to Determine Where to Free Up Space

SELECT a.tablespace_name,
total_free_space,
ROUND(total_free_space / 1042, 2) free_k,
ROUND(total_free_space / 1042 / 1042, 2) free_m,
ROUND(total_free_space / 1042 / 1042 / 1042, 2) free_g,
largest_free_extent,
total_size,
ROUND(total_free_space / total_size *100, 2) percent_free
FROM
(SELECT tablespace_name,
SUM(bytes) total_free_space,
MAX(bytes) largest_free_extent
FROM dba_free_space
GROUP BY tablespace_name)
a,
(SELECT tablespace_name,
SUM(bytes) total_size
FROM dba_data_files
GROUP BY tablespace_name)
b
WHERE a.tablespace_name = b.tablespace_name
ORDER BY 2 DESC;

Query to Determine Files for the Tablespace

SELECT file_name,
file_id,
tablespace_name,
bytes,
ROUND(bytes / 1042 / 1042, 2) mb,
maxbytes,
ROUND(maxbytes / 1042 / 1042, 2) maxmb,
(SELECT ROUND(SUM(bytes) / 1024 / 1024, 2) mb
FROM dba_segments
WHERE tablespace_name = a.tablespace_name
AND header_file = a.file_id)
used_mb,
(SELECT ROUND(((header_block + blocks) *8192) / 1024 / 1024, 2) end_mb
FROM dba_segments
WHERE tablespace_name = a.tablespace_name
AND header_block =
(SELECT MAX(header_block)
FROM dba_segments
WHERE tablespace_name = a.tablespace_name)
)
lastused_position
FROM dba_data_files a
WHERE tablespace_name = ‘PSDEFAULT’;

How I Resized My Tablespaces

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\PSINDEX2.DBF’
RESIZE 6266M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\SYSTEM01.DBF’
RESIZE 600M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\PSIMAGE.DBF’
RESIZE 1300M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\TLWORK.DBF’
RESIZE 477M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\TLAPP.DBF’
RESIZE 80M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\GPAPP.DBF’
RESIZE 890M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\PSUNDOTS01.DBF’
RESIZE 150M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\HRLARGE.DBF’
RESIZE 650M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\PTTLRG.DBF’
RESIZE 300M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\HRAPP.DBF’
RESIZE 375M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\SAAPP.DBF’
RESIZE 325M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\CCAPP.DBF’
RESIZE 290M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\PY0LRG.DBF’
RESIZE 280M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\PTTBL.DBF’
RESIZE 250M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\FAAPP.DBF’
RESIZE 225M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\TLLARGE.DBF’
RESIZE 210M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\AAAPP.DBF’
RESIZE 170M;

ALTER DATABASE DATAFILE ‘E:\ORADATA\HCM90\PSDEFAULT.DBF’
RESIZE 5M;

Resources

Tablespace Information

Alter Tablespace Syntax

Oracle Data & Temp Files

PeopleSoft 9.0 Hard Drive Space

Here is a list of the directories on my PeopleSoft 9.0 HRMS image and their sizes. Hopefully, this will give you an idea of the hard drive space required to install PeopleSoft 9.0 should you want to do something similar.

c:\ 22.2 GB used / 2.75 GB free = 24.9 GB total
  c:\bea = 176 MB
    c:\bea\jre142 = 40.0 MB
    c:\bea\Tuxedo9.1 = 135MB
  c:\Documents and Settings = 598 MB
  c:\install = 1.72 GB
  c:\NetExpressRuntime = 1.38 MB
  c:\oracle = 2.67 GB
    c:\oracle\appserv10g = 738 MB
    c:\oracle\oradata = 1.46 GB
  c:\Program Files = 529 MB
  c:\ps = 303 MB
  c:\psca = 91.6 MB
  c:\pshome = 10.6 GB
    c:\pshome\hcm90\bin = 296 MB
    c:\pshome\hcm90\data = 3.78 GB
    c:\pshome\hcm90\projects = 2.70 GB
    c:\pshome\hcm90\setup = 855 MB
    c:\pshome\hcm90\src = 225 MB
    c:\pshome\hcm90\verity = 2.07 GB
  c:\windows = 2.7 GB
e:\ 63.6 GB used / 16.3 GB free = 79.9 GB total
  e:\oradata\hcm90\PSINDEX.DBF = 23.4 GB
  e:\oradata\hcm90\PSINDEX2.DBF = 23.4 GB
  e:\oradata\hcm90\PSIMAGE.DBF = 2.04 GB
  e:\oradata\hcm90\SYSTEM01.DBF = 2.04 GB
  e:\oradata\hcm90\GPAPP.DBF = 21.94 GB
  e:\oradata\hcm90\TLWORK.DBF = 1.24 GB
  e:\oradata\hcm90\HRLARGE.DBF = 942 MB
  e:\oradata\hcm90\TLAPP.DBF = 800 MB

PeopleTools Tip: Finding a Component Interfaces

If you know the name of the component interface, you can easily find it in App Designer.  Just press Ctrl+O or File > Open and search for it by name.  But, what if you only know the name of the component that the component interface accesses?

You have to go to the database.  Try this SQL (replacing <Component_Name> with your actual component) :

SELECT * FROM PSBCDEFN
WHERE BCPGNAME = '<Component_Name>'