Cleaning AIX fileset

From VVCWiki
Jump to navigationJump to search

Using Script

#!/bin/ksh
#
#
# NAME: mqsi61_odmcleanup
#
# PURPOSE: To cleanup any remaining entries left in the AIX
#          ODM after uninstalling WMB v6.1
#
# DISCLAIMER: Provided AS-IS
#

cleanup_odm ()
{  

echo "Deleting matching entries for $FILESET_PREFIX* from $ODMDIR"

# Delete from history
for i in `odmget -q "name like $FILESET_PREFIX*" lpp | grep lpp_id | awk '{ print $3 }'`
do
  odmdelete -o history -q lpp_id=$i
done

# Delete from inventory
for i in `odmget -q "name like $FILESET_PREFIX*" lpp | grep lpp_id | awk '{ print $3 }'`
do
  odmdelete -o inventory -q lpp_id=$i
done

# Delete from vendor
for i in `odmget -q "name like $FILESET_PREFIX*" lpp | grep lpp_id | awk '{ print $3 }'`
do
  odmdelete -o vendor -q lpp_id=$i
done

# Delete from product
odmdelete -o product -q "name like $FILESET_PREFIX*"

# Delete from lpp
odmdelete -o lpp -q "name like $FILESET_PREFIX*"

}

#-----------------End of functions--------------------------

#-----------------Main Routine------------------------------

# Delete all entries with a name beginning "mqsi61"
FILESET_PREFIX="mqsi61"

# Delete entries from /usr/lib ODM database
ODMDIR=/usr/lib/objrepos
export ODMDIR

cleanup_odm;

# Delete entries from /etc ODM database
ODMDIR=/etc/objrepos
export ODMDIR

cleanup_odm;

#-----------------End of Main Routine-----------------------

Manually


1. Uninstall the product using the uninstaller.
2. Compile a list of GUIDs (or UIDs) for your product. These are referenced in the Key for each Product, Feature, and Component in your project.
3. For each GUID, determine if it is referenced in any of the five classes in the SWVPD:
i) To search the lpp class run:
ODMDIR=/usr/lib/objrepos odmget -q "name = GUID" lpp
If the GUID is found, you will see output like the following:
lpp:
name = "Product GUID"
size = 0
state = 5
cp_flag = 131345
group = ""
magic_letter = ""
ver = 1
rel = 1
mod = 0
fix = 0
description = "Description of Product"
lpp_id = 1043

- Record the lpp_id associated with each GUID as shown in the output of this command.
- For each entry found, run the following command to remove it:
ODMDIR=/usr/lib/objrepos odmdelete -o lpp -q "name = Product GUID"
To verify the entry was removed, rerun the command(there should be no output):
ODMDIR=/usr/lib/objrepos odmget -q "name = GUID" lpp

ii) To search the product class run:
ODMDIR=/usr/lib/objrepos odmget -q "lpp_name = Product GUID" product
If the GUID is found, you will see output like the following:
product:
lpp_name = "Product GUID"
comp_id = ""
update = 0
cp_flag = 131345
fesn = ""
name = "Product GUID"
state = 5
ver = 1
rel = 1
mod = 0
fix = 0
ptf = ""
media = 0
sceded_by = ""
fixinfo = ""
prereq = ""
description = "Description of Product"
supersedes = ""

- For each entry found, run the following command to remove it:
ODMDIR=/usr/lib/objrepos odmdelete -o product -q "lpp_name = Product GUID"
To verify the entry was removed, rerun the command(there should be no output):
ODMDIR=/usr/lib/objrepos odmget -q "lpp_name = Product GUID" product

iii)To search the vendor class run:
ODMDIR=/usr/lib/objrepos odmget -q "GUID = Product GUID" vendor
If the GUID is found, you will see output like the following:
vendor:
GUID = "Product GUID"
ver = 1
rel = 1
mod = 0
fix = 0
type = 1
ddir = "install/directory"
uninstaller = "location/of/uninstaller"
msgcat = ""
msgnumber = 0
msgset = 0
lpp_id = 1043
PGUID = "Parent GUID"
time = 1023223295
instance = 1
description = "Description of Product"
misc1 = ""
misc2 = ""
misc3 = ""

Note that the lpp_id is also included in this record.
- For each entry found, run the following command to remove it:
ODMDIR=/usr/lib/objrepos odmdelete -o vendor -q "GUID = Product GUID"
To verify the entry was removed, rerun the command(there should be no output):
ODMDIR=/usr/lib/objrepos odmget -q "GUID = Product GUID" vendor

iv) To search the history class, you must use the lpp_id (takes the place of id in the command shown here) that you got from either step i) or step iii) above. Run:
ODMDIR=/usr/lib/objrepos odmget -q "lpp_id = id" history
If the lpp_id is found, you will see output like the following:
history:
lpp_id = id
event = 2
ver = 1
rel = 1
mod = 0
fix = 0
ptf = ""
corr_svn = ""
cp_mod = ""
cp_fix = ""
login_name = ""
state = 1
time = 1023223295
comment = ""
- For each entry found, run the following command to remove it:
ODMDIR=/usr/lib/objrepos odmdelete -o history -q "lpp_id = id"
To verify the entry was removed, rerun the command(there should be no output):
ODMDIR=/usr/lib/objrepos odmget -q "lpp_id = id" history

v) To search the inventory class, you must use the lpp_id (takes the place of id in the command shown here) that you got from either step i) or step iii) above. Note that only Components will have inventory entries (so you don't have to check lpp_id's for Products or Features)Run:
ODMDIR=/usr/lib/objrepos odmget -q "lpp_id = id" inventory
If the lpp_id is found, you will see output like the following:
inventory:
lpp_id = id
private = 0
file_type = 0
format = 1
loc0 = "location/of/file/installed/with/component
loc1 = ""
loc2 = ""
size = 779
checksum = 25483

Note: You will have an inventory entry for each file that is installed for a particular lpp_id associated with a component, so in most cases, you will see multiple entries after running this comand.
To remove all entries for a particular lpp_id, run the command:
ODMDIR=/usr/lib/objrepos odmdelete -o inventory -q "lpp_id = id"
To verify the entry was removed, rerun the command(there should be no output):
ODMDIR=/usr/lib/objrepos odmget -q "lpp_id = id" inventory

4. Finally, make sure that there are no entries for your product in the file /usr/lib/objrepos/vpd.properties. This is a plain ascii file. You can remove any lines that refer to your product simply by deleting them.