6/16/14
truncate live file
Thread Dumps
Thread dump gives you what the jvm threads are doing, what are their status and so on info.
1. WebSphere
We can take WebSphere JVM thread by using this command
kill -3 jvmpid
This generates thread dump, by default dumps the threads to jvm/logs/jvmname/natviestdout
You can configure the jvm to generate generate file in your configured path.
2. Tomcat
/path/to/jdk/bin/jstack -l pid > nameoffile.log
You need to take thread dump as the owner of the pid. Better to use the same jdk as tomcat. As the owner of tomcat, you can say "which java" or ps -ef | grep -i java gives which java tomcat process pointed to.
3. WebLogic
kill -3 or jstack can be used.
[There are several ways. These are few]
5/26/10
uptime
This is pretty useful command.
To know since when the system is up one can do like this at the terminal prompt
$uptime
11:10:27 up 9 mins, 2 users, Load average: 0.02, 0.24, 0.18
Determining system uptime in windows -
1.C:\> systeminfo | find "Time:"
System Up Time: 0 Days, 8 Hours, 7 Minutes, 19 Seconds
Note: Windows Vista Business 64-bit and Windows 7 do not return a "System Up Time" but "System Boot Time" instead.
2.C:\> net statistics server | find "since"
Server Statistics for \\COMPUTERNAME
Statistics since 8/31/2009 8:52:29 PM
4/22/10
remove directory
say to remove cache under wstemp
rm -r wstemp/*
which removes files folders under wstemp recursively.
rm test.txt
deletes test.txt file
rm -i wstemp/*
inquires and prompts yes or no for each file
In Linux
rm -f - force removes a file
rm -fr - force removes directory
In DOS -
rmdir is the command to remove a directory.
rmdir dSample
removes if dSample dir is empty.
To force remove
rmdir /S dSample
removes dSample directory but inquires
rmdir /S /Q dSample
removes dSample directory and its sub directories quietly.
Enjoy your day.
8/20/09
64 bit or 32 bit JVM?
This is a machine which has WAS 64 bit
$ ./java -d64 -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (IBM build 1.5.0_06-erdist-20060404 20060511)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_06-erdist-20060404, mixed mode)
IBM Java ORB build orb50-20060511a (SR2)
XML build XSLT4J Java 2.7.4
XML build IBM JAXP 1.3.5
XML build XML4J 4.4.5
This is a machine which has WAS 32bit
$ ./java -d64 -version
execv(): No such file or directory
Error trying to exec /software/opt/IBM/WebSphere/AppServer/java/jre/bin/sparcv9/java.
Check if file exists and permissions are set correctly.
Failed to start a 64-bit JVM process from a 32-bit JVM.
Verify all necessary J2SE components have been installed.
(Solaris SPARC 64-bit components must be installed after 32-bit components.)
So acid Test is -
goto App Server javahome
/path/to/washome/java/jre/bin
./java -d64 -version
if it is 64 bit, it returns with version info.
otherwise returns with no such file or directory.
6/17/09
While using df
df -h is the command to display available disk free space in bytes
e.g.,
$df -h
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d84 3.9G 136M 3.8G 4% /var
swap 6.6G 992K 6.6G 1% /tmp
/dev/md/dsk/d101 20G 7.8G 12G 41% /software
Equivalent df in AIX
df -g
AIX df command
df Command
Purpose
Reports information about space on file systems. This document describes the AIX df command as well as the System V version of df.
Syntax
df [ [ -P ] | [ -I | -M | -i | -t | -v ] ] [ -k ] [ -m ] [ -g ] [ -s ] [FileSystem ... | File... ]
Description
The df command displays information about total space and available space on a file system. The FileSystem parameter specifies the name of the device on which the file system resides, the directory on which the file system is mounted, or the relative path name of a file system. The File parameter specifies a file or a directory that is not a mount point. If the File parameter is specified, the df command displays information for the file system on which the file or directory resides. If you do not specify the FileSystem or File parameter, the df command displays information for all currently mounted file systems. File system statistics are displayed in units of 512-byte blocks by default.
The df command gets file system space statistics from the statfs system call. However, specifying the -s flag gets the statistics from the virtual file system (VFS) specific file system helper. If you do not specify arguments with the -s flag and the helper fails to get the statistics, the statfs system call statistics are used. Under certain exceptional conditions, such as when a file system is being modified while the df command is running, the statistics displayed by the df command might not be accurate.
The df command does not fully support NFSv4 filesystems. Use the nfs4cl command to extract block and space information.
Flags
The values of the output parameters with the flags -m and -g would be rounded off to nearest second decimal digit. If all or any two of the -k, -m and -g flags are specified, the last one specified takes effect.
Exit Status
This command returns the following exit values:
| 0 | Successful completion. |
| >0 | An error occurred. |
Examples
- To display information about all mounted file systems, enter:
df
If your system has the /, /usr, /site, and /usr/venus file systems mounted, the output from the df command resembles the following:
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/hd0 19368 9976 48% 4714 5% /
/dev/hd1 24212 4808 80% 5031 19% /usr
/dev/hd2 9744 9352 4% 1900 4% /site
/dev/hd3 3868 3856 0% 986 0% /usr/venus - To display information about /test file system in 1024-byte blocks, enter:
df -k /test
Filesystem 1024 blocks Free %Used Iused %Iused Mounted on
This displays the file system statistics in 1024-byte disk blocks.
/dev/lv11 16384 15824 4% 18 1% /tmp/ravi1 - To display information about /test file system in MB blocks, enter:
df -m /test
Filesystem MB blocks Free %Used Iused %Iused Mounted on
This displays file system statistics in MB disk blocks rounded off to nearest 2nd decimal digit.
/dev/lv11 16.00 15.46 4% 18 1% /tmp/ravi1 - To display information about the /test file system in GB blocks, enter:
df -g /test
Filesystem GB blocks Free %Used Iused %Iused Mounted on
This displays file system statistics in GB disk blocks rounded off to nearest 2nd decimal digit.
/dev/lv11 0.02 0.02 0% 18 1% /tmp/ravi1 - To display available space on the file system in which your current directory resides, enter:
cd/
df .The output from this command resembles the following:
Device 512-blocks free %used iused %iused Mounted on
/dev/hd4 19368 9976 48% 4714 5% /
Files
| /etc/filesystems | Lists the known file systems and defines their characteristics. |
| /etc/vfs | Contains descriptions of virtual file system types. |
Solaris df, du, ls commands
New df, du, and ls Options
The df, du, and ls commands have a new h option for displaying disk usage and file or file system sizes that are easy to understand.
The default form of the df command displays file system size in blocks (512 bytes). The df output, in kilobytes, follows:
$ df -k / /usr
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 192056 94788 78063 55% /
/dev/dsk/c0t0d0s6 1982988 829966 1093533 44% /usr
The same file system sizes displayed in powers of 1024 follows:
$ df -h / /usr
Filesystem size used avail capacity Mounted on
/dev/dsk/c0t0d0s0 188M 93M 76M 55% /
/dev/dsk/c0t0d0s6 1.9G 811M 1.0G 44% /usr
The default form of the du command displays disk space in blocks (512 bytes). The du output, in blocks, follows:
% du -s k*
100 kadmin
98 kadmin.local
98 kdb5_util
90 keyserv
10 killall
The same disk space displayed in powers of 1024 follows:
% du -h k*
50K kadmin
49K kadmin.local
49K kdb5_util
45K keyserv
5K killall
The default form of the ls -l command displays file size in bytes. Use the ls -lh command to display file size in powers of 1024:
% ls -lh k
-r-xr-xr-x 1 root bin 49K Nov 30 03:32 kadmin
-r-xr-xr-x 1 root bin 49K Nov 30 03:32 kadmin.local
-r-xr-xr-x 1 root bin 49K Nov 30 03:32 kdb5_util
-r-xr-xr-x 1 root sys 44K Nov 25 04:37 keyserv
-r-xr-xr-x 1 root bin 4.3K Nov 25 04:36 killall
6/10/09
AIX Command Tips
#ps aux | head -1; ps aux | sort -rn +2 | head -10
Displaying top 10 memory-consuming processes:
#ps aux | head -1; ps aux | sort -rn +3 | head
Displaying process in order of being penalized:
#ps -eakl | head -1; ps -eakl | sort -rn +5
Displaying process in order of priority:
#ps -eakl | sort -n +6 | head
Displaying process in order of nice value
#ps -eakl | sort -n +7
Displaying the process in order of time
#ps vx | head -1;ps vx | grep -v PID | sort -rn +3 | head -10
Displaying the process in order of real memory use
#ps vx | head -1; ps vx | grep -v PID | sort -rn +6 | head -10
Displaying the process in order of I/O
#ps vx | head -1; ps vx | grep -v PID | sort -rn +4 | head -10
Displaying WLM classes
#ps -a -o pid, user, class, pcpu, pmem, args
Determinimg process ID of wait processes:
#ps vg | head -1; ps vg | grep -w wait
Wait process bound to CPU
#ps -mo THREAD -p
Cpu usage with priority levels
#topas -P
#svmon -Put 10 will give the memory mapping for the
top ten memory consuming processes.
#top
Remember, some commands needs you to be root. So, you switch to su to root.
Two important things here -
1. from ur profile, if u say
$su root
takes you to root with current shell. Means that, though u r root, u still carry ur .profile and ur env variables.
2. if u want to have root's env variables -
su - root or
su root
after getting into root
. ./.profile
AIX commands
1. Useful commands
Note All AIX commands reference can be found under
http //www.austin.ibm.com/doc_link/en_US/a_doc_lib/aixgen/wbinfnav/CmdsRefTop.htm
1.1 Memory
bootinfo –r shows how much RAM does my machine has (as root)
lsattr –E –l sys0 –a realmem shows how much RAM does my machine have (as non root)
rmss -c 512
rmss -r sets the memory size to 512 MB
resets the memory size to the original one
1.2 Devices
lsattr -El en0 displays en0 driver params
lsattr -El ent0 displays ent0 HW params
lsattr -El rmt0 displays tape params
lscfg -vp -l rmt0 (all information about a tape drive)
lsattr -El sys0 displays system type, firmware, etc driver params
lscfg –v lists all system HW config (NVRAM)
lsdev –Csscsi list all scsi devices
lsdev –Cspci list all pci devices
lsparent –Ck scsi list all scsi adapters
lsdevfc list fiberchannel devices
cfgmgr Configures devices
lsdev -Ccdisk Shows all disks
lsdev -Cctape Shows all tapes
cfgmgr -v -l device –v Specifies verbose output. The cfgmgr command writes information about what it is doing to standard output.
cfgmgr -v -l device Name Specifies the named device to configure along with its children.
If you only turned on a disk tower at e.g. scsi2 cfgmgr -v -l scsi2 will only configure this with detailed output.
lsdisp To check which graphic adapter is installed.
lscfg -vp -l mga0 (all information about a adapter)
lscfg -vp -l hdisk0 | grep Machine gives info about the disk manufacture type
lsslot -c pci For 6F1 only !!!! Lists all slots ,voltage,boards,etc !!!!
bootlist -m normal cd0 rmt0 hdisk0 Changes the default bootlist
lsmcode -c display the system firmware level and service processor
lsmcode -r -d scraid0 display the adapter microcode levels for a RAID adapter scraid0
lsmcode -A display the microcode level for all supported devices
1.3 System info
/usr/bin/uname -m Get machine ID
/usr/bin/uname -M Get platform type
oslevel Displays current AIX level
oslevel -r Displays current AIX maintenance level
oslevel -g List filesets at levels later than maintenance level !!!
lsps -a Paging space settings.
lscfg -vp -l proc0 (1,2,3) (all information about a processor[s])
lscfg -vp -l mem0 |pg (all information about memory modules installed)
env ulimit Environment setings - show user ulimit
bootinfo –s hdisk0 Displays disk size
lsattr -El sys0 -a systemid Determines the system serial number
lscfg –vp|grep ROM|grep -v CD Determines the system Firmware level
1.4 System issues
TERM=vt100 -If you execute a command/application and it responds with msg
‘ The type of your terminal is unknown to the system’,run those commands (In ‘ksh’)
set term=vt100 -Same (In tcsh’)
rcp -rp /dataVolumes/brisque1.1.0/jobs/flower.job sciroot@ripro3:/dataVolumes/ripro3.3.0/jobs/ -Copying a file from one Unix machine (Brisque) to another (Server) the assumption is that both machines know each other’s names (in hosts file)
dd if=/dev/fd0 of=/temp/diskimage bs=4096 -Duplicate a diskette copy from diskette to hard drive
dd if=/temp/diskimage of=/dev/fd0 bs=4096 -copy diskette image onto diskette
/usr/lpp/X11/bin/xset -display unix 0 s off -Kill display timeout
lsfs -v jfs -List of Filesystem items.
lsfs -q -v jfs -you can see also the parameter of a filesystem and thus see if e.g. /backup was or is a big_filesystem_enabled one.
Important for the 2GB File limit.
lsuser –f root Shows all user parameters (max .file size,etc)
sysdumpdev -L Check last system dump status
sysdumpdev -l Check system dump device settings
lslpp -f Upd_Timna_DTM.obj List contents of the package
1.5 Networking
ksh
for ENT in ` lsdev –Cs pci|grep ent | awk '{ print $1 }'|cut –c 1,2,4 `;do
mktcpip –S $ENT
done
exit -Shows all interfaces IP config+mask+router+DNS !
host timna1 displays station default IP address – works ONLY in DNS environment
ifconfig en0 displays en0 driver params
netstat -i displays network interfaces setting
mktcpip -S en0 #host:addr:mask:_rawname:nameserv:domain:gateway:type:start
syslab18:192.9.100.1:255.255.255.0:en0:10.4.2.12:csil.creoscitex.com:10.4.30.1:N/A:no
GREAT TCPIP info in one command !!!
showmount –e displays all exported volumes
showmount -a show who's got my filesystemsses mounted over IP !
lssrc –g tcpip displays all IP oriented processes status
entstat -drt ent0 |grep –i error display any communication errors on etn0
entstat -r Resets all the statistics back to their initial values.
arp -a shows a local arp cache
cd /usr/local/es/;res restarts appletalk
netstat -ptcp shows IP statistics
netstat -pudp shows UDP statistics
netstat -c
-s
-m client only;
server only
NFS mount
netstat -I en0 10 Trace en0 every 10 seconds
netstat -rn Display routing info with IP address (10.4.27.182)
netstat -in Shows the state of all configured interfaces
netstat -r Display routing info with full hostnames (timna2.csil.creoscitex)
nfsstat –z ;to reset NFS stats without reboot
cat /etc/resolv.conf Check DNS settings
stopsrc –g NFS To stop NFS services on a client
startsrc –g NFS To start NFS services on a client
traceroute 149.115.39.1 Trace all hobs (interconnections=routers) to the destination IP
netpmon -o netpmon.out
trcstop Traces all network processes activity into a logfile. Must be preceede by a trcstop command !
nslookup hostname Shows the DNS server name and address
ping -R -c 1 bnc2 Ping with displaying the routing info
namerslv -s | grep domain | awk '{ print $2 }' Displays a fully qualified domain name of a host
rup Shows the status of a remote host on the local network
nmonnfs Traces all NFS processes activity
mount hostname:/filesystem /mount-point Mount an NFS filesystem
mknfsexp -d /directory Creates an NFS export directory
mknfsmnt Creates an NFS mount directory
rmnfs Stops and un-configures NFS services
mknfs Configures and starts NFS services
exportfs -u (filesystem) Un-exports a filesystem
exportfs Lists all exported filesystems
exportfs -a Exports all fs's in /etc/exports file
1.6 Disks
synclvodm -vP svg3 synchronizes ODM and the disk VG info.
redefinevg svg3 Redfined VG definition in ODM
lqueryvg -p hdisk0 –Avt -reads logical volumes info from disk
bootinfo -s hdiskx Shows Megabytes available even if no volume group is assigned.
lspv -p hdiskx (PP's used, location on disk, mount point)
lscfg -vp -l hdiskx (all information about a disk/raid)
1.7 Filesystem
chfs -a size=+200000 /var increases /var FS by 100MB
du -sk /john shows directory used space in kb !!!!
mount all mounts all FS
umount /dataVolumes/rtest9.1.0 unmounts a FS
fuser -k /dev/cd0 Releases a CD that will not unmount !
fuser –c /dataVolumes/rtest9.1.0 -Find out which process_id lock the FS
istat
1.8 System monitoring
istat
alog -o -t boot | more displays system boot log
w Lists login users and their programs.
who Identifies the users currently logged in
/usr/local/es/swho Identifies the Ethershare users currently logged in
last |more shows last logins
last –20 Shows recent 20 lines
last root Shows username ‘root’ login/logout record
last ftp Shows all FTP session in the record
mount shows all mounted filesystems (nfs+local)
ps -ef show all running processes
ps -ef |grep Scitex show all scitex running processes
du -ak /scitex|sort -n -r|head –10 -Display 10 biggest directories on the volume by size
find /scitex -xdev -size +2048 -ls|sort -rn +6|head –10 -to find 10 top files in the root (/) directory larger than 1 MB.”-xdev” helps searching ONLY in “/” !!!!!!!!!
history Last commands run on the system by this user
alog -ot boot Lists a log of all boot operations
grep TX /etc/environment Verify daylight settings
1.9 Performance issues
nmon a nice monitor - runs only on AIX5 and up
topas a nice monitor - runs only on AIX 4.3.3 and up
monitor -top 10 -s 2 monitors system 10 top processes with 2 seconds
iostat 2 displays disks activity every 2 seconds refresh interval
iostat –a 2 AIX5 ONLY !!!!
displays disks and ADAPTER !!!! activity every 2 seconds refresh interval
vmstat 2 ;monitors virtual memory statistics every 2 seconds (see appendix A)
sar –P ALL 2 2 Show all CPU’s activity on an SMP machine
svmon –i 2 Monitors real and virtual memory
ps auxw | sort –r +3 |head –10 -Shows top 10 memory usage by process
ps auxw | sort –r +2 |head –10 -Shows top 10 CPU usage by process
ps –auw | grep defunct Shows zombies processes (to kill – reboot or kill the parent)
filemon –O all –o filemon.out ; find / -name core ; trcstop Traces FS,LV,disks,files activityof a “find” command into a logfile (filemon.out). Must be preceded by a trcstop command.
tprof –x find / -name core ; trcstop Traces CPU activityof a “find” command Severall logfile are created. Must be preceded by a trcstop command.
tprof -ske -x "sleep 30" -Trace CPU activity for next 30 seconds.Results in file sleep.tprof
lvmstat –ev svg1
lvmstat –v svg1 2 AIX5 ONLY !!!!
enable gathering the VG statistics
Display VG logical volumes statistics every 2 seconds
1.10 Remote issues (working over the modem)
pdelay tty0; pdisable tty0 >/dev/null ;penable tty0
-Resets tty0
stty erase '^?' Makes bakespace to work
/scitex/version/utils/modem/kermit -l /dev/ttyx –c atdt {phone #} Use Unix to Dail-out (for any reason) ttyx is the serial port the cable is connected
/scitex/version/utils/modem/kermit -s /u/d0/ripro_messages -i Sends a file to a remote desktop in binary mode
/scitex/version/utils/modem/kermit –r
-Receives a file to from remote desktop
1.11 Browsing errlog with errpt
errpt -a -s 0604090601 -e 0605090901 browse the errlog in detail for all errors within a timeframe
errpt -a -N SYSPROC |more
errpt -a -N SYSPROC > /tmp/err.log Browse the errlog for the SYSPROC resource, can be into the file
errpt -j 5DFED6F1 -Browse the errlog by the identifier
errpt –A -AIX5 ONLY !!!! Shows less detailes then errpt -a
errpt –D -AIX5 ONLY !!!! eliminates double entries
1.12 Security issues
chmod -s Filename Remove Sticky Bit to a file or directory
chmod +r+w+x+t Filename Add Read+Write+Execute+Temp mode to a file or directory.
This is a ‘blanket’ change for all owner, user & group.
Numeric Access Modes
0 (---) - no access
1 (--x) - execute permissions; search permissions for directories
2 (-w-) - write access
3 (-wx) - execute/search permission and write access
4 (r--) - read access
5 (r-x) - execute/search permission and read access
6 (rw-) - read and write access
7 (rwx) - execute/search permission and read and write access
mkpasswd -f rebuild the /etc/passwd indexes in case of suspected corruption
1.13 Miscellaneous
ksh
find / -type f|xargs grep "10.4.27.181" 2> /dev/null
-Find all files containing my IP address
compress -c file > file.Z Compresses the files while keeps the original
whereis
5/26/09
How to reload .profile
One way is, exit from the session, telnet or ssh again to that host. Another way is -
After you changing the .profile, save and quit. Then at the command prompt type in this
$. ./.profile
This reloads your .profile.
4/28/09
3/27/09
uninstall fixpacks
Befroe going into that, read the following from UpdateInstaller README. You can find this under Update_Inst_Path/docs/raedme_updateinstaller.txt/pdf/html
3.0 Uninstalling maintenance packages
This topic describes how to use the Update Installer for WebSphere
Software to uninstall interim fixes, fix packs, and refresh packs. The
Update Installer for WebSphere Software is also known as the update
installer program, the updateInstaller program, and the Update
installation wizard.
Use the proper authorizations to successfully uninstall product updates.
Use the update installer program as the root user on a Linux or UNIX
platform, or as the administrator on a Windows platform.
The Update Installer wizard is an InstallShield for Multiplatforms
wizard that runs with either a graphical user interface or in silent
mode with a response file.
Important: See 4.3, "Known problems and workarounds for the update
command" for information about known problems and workarounds.
The following descriptions contain reference information about
uninstalling interim fixes, fix packs, and refresh packs on WebSphere
Application Server products:
Overview of the uninstall procedure
To uninstall a maintenance package:
1. Use the update installer to install the maintenance package,
which creates a backup file in the
app_server_root/properties/version/nif/backup directory. IBM
does not support user modifications to backup files.
2. Use the update installer program to remove the maintenance
package as described in this topic.
Viewing the fix level of the node
You can use the 5.0, "versionInfo command" in the
app_server_root/bin directory to display the exact fix and
version level of the product. However, do not use the
versionInfo command while installing or uninstalling a
maintenance package.
Do not launch multiple copies of the Update Installer wizard at one
time: Concurrent launches of the update installer program are not
supported. Performing more than one update at the same time can produce
unpredictable results, which might include a failed or faulty
installation.
Required information
The graphical interface requires the following information that you
must supply:
Table 4. Information required when uninstalling a maintenance package
+-----------------------+----------------------+----------------------+
| Field | Valid values | Description |
+-----------------------+----------------------+----------------------+
| File path of the | Identify the | The Update Installer |
| installation root | installation root | application defaults |
| directory of the | directory for one of | to the last-visited |
| WebSphere product and | the following | product location. |
| the Update Installer | products: | |
| | * IBM WebSphere | |
| | Application Server | |
| | * IBM WebSphere | |
| | Application Server - | |
| | Express | |
| | * Embedded version | |
| | of the IBM WebSphere | |
| | Application Server - | |
| | Express | |
| | * IBM WebSphere | |
| | Application Server | |
| | Network Deployment | |
| | * IBM WebSphere | |
| | Extended Deployment | |
| | * IBM Application | |
| | Client for WebSphere | |
| | Application Server | |
| | * IBM WebSphere | |
| | Business Integration | |
| | Server Foundation | |
| | * Web server | |
| | plug-ins for | |
| | WebSphere | |
| | Application Server | |
+-----------------------+----------------------+----------------------+
| File name of the | Select a maintenance | The default |
| maintenance package | package to uninstall | maintenance package |
| to uninstall. | from the | is the package with |
| | app_server_root/prop | the latest date |
| | erties/version/ | stamp and time stamp |
| | update/backup | in the |
| | directory. | app_server_root |
| | | /properties/version/ |
| | | update/backup |
| | | directory. |
+-----------------------+----------------------+----------------------+
The following procedure describes how to uninstall a maintenance
package.
1. Log on to the operating system.
[Linux] In addition, verify that the umask setting is 022. To verify
the umask setting, issue the following command:
umask
To set the umask setting to 022, issue the following command:
umask 022
2. Change directories to the updi_root directory.
3. [Windows] Use the Windows Services panel to stop all services for
WebSphere Application Server processes.
4. Stop all Java processes that use the IBM Software Developer Kit (SDK)
that the WebSphere Application Server product provides.
Before uninstalling interim fixes, fix packs, and refresh packs on a
machine, stop all Java processes on the machine that use the IBM SDK,
Java Technology Edition that WebSphere Application Server provides.
WebSphere Application Server processes include:
* Application server processes
* The nodeagent process on an application server node when the node
is federated into a deployment manager cell
* The dmgr process for the deployment manager server
Stop all Java processes if necessary. If you uninstall a maintenance
package while a WebSphere Application Server-related Java process
runs, IBM does not guarantee that the product can continue to run
successfully, or without error.
5. Use the update installer to uninstall the maintenance package.
Uninstall the interim fix on each application server node in a cell
before uninstalling the maintenance package from the deployment
manager node.
Issue one of the following commands to uninstall with the graphical
interface:
Table 5. Update installer commands for uninstalling with the graphical
interface
+--------------------------------+-------------+----------------------+
| Command example | Type of | Description |
| | installatio | |
| | n | |
+--------------------------------+-------------+----------------------+
| update.bat -W | Graphical | Initializes the |
| update.type="uninstall" | interface | maintenance package |
| | mode | field with the name |
| | | of the maintenance |
| | | package that was |
| | | most recently |
| | | installed. |
| | | Accept all of the |
| | | default values to |
| | | uninstall the |
| | | maintenance package |
| | | with the most recent |
| | | date stamp and time |
| | | stamp. |
+--------------------------------+-------------+----------------------+
| update.bat -W | Graphical | Overrides the |
| product.location="e: | interface | graphical interface |
| \IBM\WebSphere\AppServer" -W | mode | with the location of |
| update.type="uninstall" | | the WebSphere |
| | | software to update. |
| | | The default |
| | | maintenance package |
| | | to uninstall is the |
| | | most recently |
| | | installed |
| | | maintenance package |
| | | for that software. |
+--------------------------------+-------------+----------------------+
| update.bat -W | Graphical | Overrides the |
| backup.package="PQ20029.pak" | interface | maintenance package |
| -W update.type="uninstall" | mode | field with the name |
| | | of the maintenance |
| | | package to |
| | | uninstall. |
+--------------------------------+-------------+----------------------+
| update.bat -W | Graphical | Overrides the |
| product.location="e: | interface | location of the |
| \IBM\WebSphere\AppServer" -W | mode | WebSphere software |
| backup.package="PQ20029.pak" | | to update and the |
| -W update.type="uninstall" | | name of the |
| | | maintenance package |
| | | to uninstall. |
+--------------------------------+-------------+----------------------+
| update.bat -options | Graphical | Overrides all |
| "responsefiles/file_name" | interface | default values with |
| | mode with | values that you |
| | an options | specified in the |
| | file | options response |
| | | file. |
| | | If you omit either |
| | | value from the |
| | | response file, the |
| | | default maintenance |
| | | package is the |
| | | installed package |
| | | with the most recent |
| | | date stamp and time |
| | | stamp. The default |
| | | software is the |
| | | software installed |
| | | in the parent |
| | | directory. |
+--------------------------------+-------------+----------------------+
Issue the following command to use the silent interface:
Table 6. Update installer command for uninstalling in silent mode
+--------------------------------+-------------+----------------------+
| Command example | Type of | Description |
| | installatio | |
| | n | |
+--------------------------------+-------------+----------------------+
| update.bat -silent -options | Silent mode | Overrides all |
| "responsefiles/file_name" | with an | default values with |
| | options | values that you |
| | file | specified in the |
| | | options response |
| | | file. |
| | | Always use a |
| | | response file that |
| | | is based on the |
| | | response file under |
| | | updi_root/responsefi |
| | | les. |
+--------------------------------+-------------+----------------------+
This procedure results in uninstalling maintenance packages to update
WebSphere software.
After uninstalling maintenance packages, you can continue to use the
WebSphere software.
Rolling back changes to existing profiles: Some maintenance packages
for WebSphere Application Server products, such as Refresh Pack 2,
update existing profiles. If you roll back a maintenance package that
contains a profile update, also use any undo scripts provided with the
profile update script to roll back changes to the existing profiles.
The readme file for a maintenance package describes scripts that update
and scripts that roll back profile fix levels. For example, Refresh Pack
2 for WebSphere Application Server includes required service for the
JDBC resource provider templates in existing profiles. See the readme
for the profile update and undo scripts for the JDBC-related update for
more information.
Deleting profiles created by a service level that is now rolled back:
See Profiles remain at the Version 6.0.2 level after roll back for a
description of a limitation that requires profiles to be at the same
service level or at a lower service level that the WebSphere Application
Server product.
For example, suppose that you install Fix Pack 1 for Version 6.1
(Version 6.1.0.1), create a new profile, and then roll back Fix Pack 1.
You must delete the profile that you created at the Version 6.1.0.1
level to avoid possible problems.
3.1 uninstall.txt
The Update Installer for WebSphere Software can use an options response
file to uninstall maintenance packages from a command line interface.
The uninstall.txt file has one directive that identifies the backup file
for uninstalling a service update. Comments in the file describe how to
set the string value.
The Update Installer for WebSphere Software wizard reads the options
file to determine uninstall choices. The Update Installer uninstalls the
maintenance package in silent mode, instead of displaying a graphical
user interface.
3.1.1 Location of the response file
The sample options response file is named uninstall.txt. The file is in
the updi_root/responsefiles directory after you unzip the Update
Installer for WebSphere Software into the installation root directory of
the WebSphere software product.
3.1.2 Uninstalling silently
The options file supplies the values to the Update installer wizard when
uninstalling silently. The wizard reads the options file to determine
responses and does not display the graphical user interface.
The following command uses a copy of the options file named
myresponsefile.txt to provide uninstall option responses during a silent
uninstall:
./update.sh -options "responsefiles/myresponsefile.txt" -silent
If you do not use the -silent option, the wizard uses the response file
to provide initial values for the graphical interface:
./update.sh -options "responsefiles/myresponsefile.txt"
3.1.3 Response file user entry validation
In a silent uninstall, response file validation has been coded into the
uninstall process. If the validation does not pass, the failure is
recorded in the log files in the app_server_root/logs/update/tmp
directory.
Location of the maintenance package to be uninstalled
Default directive setting
-W backup.package=""
Valid setting
You must set this directive to the location of the
backup file. The backup file reverses the application
of the maintenance. For example, you might specify the
following location on a Linux system:
/opt/properties/version/nif/backup/maintenance_package_to_uninstall
Error identifiers:
* The maintenance package cannot be uninstalled.
Uninstalling the maintenance would break the
following superseding maintenance packages.
Uninstall the superseding maintenance packages
first: list_of_superseding_maintenance_packages
* This maintenance package cannot be uninstalled. The
following maintenance packages are dependent on the
package that you are attempting to uninstall:
list_of_dependent_maintenance_packages
* This maintenance package cannot be uninstalled. The
following maintenance packages are dependent on the
APARs you are attempting to uninstall:
list_of_dependent_maintenance_packages
* No installation backup packages are available for
uninstalling maintenance.
Product location
Although uninstalling maintenance from another product is
possible, always use the Update installer wizard from the
directory structure of the product that you are updating if
possible. Problems can occur when a mismatch between product
SDKs occurs, for example.
Do not use this directive unless absolutely necessary.
Default directive setting
-W
product.location="SPECIFY_PRODUCT_INSTALL_LOCATION_HERE"
Valid setting
You must set this directive to the installation root
directory of the alternate product. For example, you
might specify the following location on a Linux
system:
/opt/IBM/WebSphere/AppServer2
Error identifiers:
* The maintenance package cannot be uninstalled.
Uninstalling the maintenance would break the
following superseding maintenance packages.
Uninstall the superseding maintenance packages
first: list_of_superseding_maintenance_packages
* This maintenance package cannot be uninstalled. The
following maintenance packages are dependent on the
package that you are attempting to uninstall:
list_of_dependent_maintenance_packages
* This maintenance package cannot be uninstalled. The
following maintenance packages are dependent on the
APARs you are attempting to uninstall:
list_of_dependent_maintenance_packages
* No installation backup packages are available for
uninstalling maintenance.
*
3.1.4 Usage notes
* The file is not a read-only file.
* Edit this file directly with your flat file editor of choice, such as
Kate on SLES or WordPad on a Windows platform.
* The file must exist to perform a silent uninstall. The Update
installer wizard reads this file to determine uninstall parameters.
Provide the fully qualified file path to the backup file.
* Save the copy of the options file in the responsefiles directory for
best results.
3.1.5 Example uninstall.txt file
Edit the version of the file that is included in the Update Installer
for WebSphere Software ZIP file. The following example is not guaranteed
to be an accurate representation of the actual file.
################################################################################
#
# This is the silent install response file for uninstalling maintenance packages
# using the update installer.
#
# A common use of an options file is to run the wizard in silent mode. This lets
# the options file author specify wizard settings without having to run the
# wizard in graphical or console mode. To use this options file for silent mode
# execution, *uncomment* and modify the parameters defined within.
#
# Use the following command line when running the wizard from the update
# installer directory:
#
# update -options responsefiles/uninstall.txt -silent
#
# Please enclose all values within a single pair of double quotes.
#
################################################################################
################################################################################
#
# Used to input the maintenance backup package filename to be uninstalled.
# This is the same filename as the package that was originally installed.
# A maintenance package can only be uninstalled if a backup package exists.
#
# ie. -W backup.package="PQ20029.pak"
#
# Note: If no package is specified, a default of the last installed maintenance
# package will be used.
#
#-W backup.package=""
################################################################################
#
# Used to modify the product install location that will be updated.
# This value should be left commented out if the Update Installer is
# being run from the recommended location
#
# ie. -W product.location="C:\Program Files\IBM\WebSphere\AppServer"
#
# Note: The product install location should always been specified, and it should
# always be the full path.
#
-W product.location="
################################################################################
#
# Do not edit these values.
#
-W update.type="uninstall"
.....................................................................
So, according to documentation,
1. uninstall process requires you to log in as correct privileges.
2. you need to make sure that you are using correct UpdateInstaller.
3. in general, if the uninstallation fails, may mean that, installation is partial success.
4. check the dependencies.
5. you need to tail app_server_root/logs/update/maintenance_package.uninstall this log for any issues and act accordingly
6. Sometimes, this could be a reason -
(Sep 27, 2006 12:33:10 PM), UpdateInstaller, com.ibm.ws.install.ni.ismp.actions.PopulateTitleBarAction, msg1, IBM Update Installer for WebSphere Software V6.0.2.7
(Sep 27, 2006 12:33:11 PM), UpdateInstaller, com.ibm.ws.install.ni.ismp.actions.PopulateUninstallMaintenancePanelAction, err, CWUPI0024E: /software/IBM/WebSphere/AppServer/updateinstaller/maintenance/6.0.2-WS-WAS-SolarisSparc-FP0000005.pak is not a valid maintenance package or may be corrupted.
(Sep 27, 2006 12:33:11 PM), UpdateInstaller, com.ibm.ws.install.ni.ismp.actions.SetExitCodeAction, msg1, CWUPI0000I: EXITCODE=1
(Sep 27, 2006 12:33:11 PM), UpdateInstaller, com.ibm.ws.install.ni.ismp.actions.ISMPLogSuccessMessageAction, msg1, INSTCONFFAILED
In such cases, you can manually remove the pack and update corresponding maintenance files.
9/26/08
truss
SYNOPSIS
truss [-fcaeildDE] [- [tTvx] [!] syscall ,...]
[- [sS] [!] signal ,...] [- [mM] [!] fault ,...]
[- [rw] [!] fd ,...]
[- [uU] [!] lib ,... : [:] [!] func ,...]
[-o outfile] command | -p pid[/lwps]...
DESCRIPTION
The truss utility executes the specified command and produces a trace ofthe system calls it performs, the signals it receives, and the machine faults it incurs. Each line of the trace output reports either the fault or signal name or the system call name with its arguments and return value(s).
System call arguments are displayed symbolically when possible using defines from relevant system headers. For any path name pointer argument, the pointed-to string is displayed.
Error returns are reported using the error code names described in intro(3). If, in the case of an error, the kernel reports a missing privilege, a privilege name as described in privileges(5) is reported in square brackets ([
]) after the error code name.
Optionally (see the -u option), truss also produce an entry/exit trace of user-level function calls executed by the traced process, indented to indicate nesting.
Why to know about truss?
In the day today admin job, you may want to see what a process is doing? or you may want to check an installation process. Or ur installation process is failing, you want check whats going on. You use truss in such conditions.
Some examples:
truss -p pid
gives you that specific pids systemcalls
$ truss -p 883
/14: lwp_cond_wait(0x0193BFF8, 0x0193BFE0, 0xD287F710, 0) Err#62 ETIME
/14: lwp_cond_broadcast(0x016BA688) = 0
/14: lwp_cond_broadcast(0x01299A98) = 0
/205: lwp_cond_wait(0x016BA688, 0x016BA670, 0xD187F748, 0) = 0
/205: lwp_cond_broadcast(0x0193BFF8) = 0
/14: lwp_cond_wait(0x0193BFF8, 0x0193BFE0, 0x00000000, 0) = 0
/205: lwp_mutex_wakeup(0x0193BFE0) = 0
/14: lwp_mutex_timedlock(0x0193BFE0, 0x00000000) = 0
/205: lwp_mutex_wakeup(0x000F8AD8) = 0
/14: lwp_mutex_timedlock(0x000F8AD8, 0x00000000) = 0
/14: lwp_cond_broadcast(0x000D2E80) = 0
/205: stat64("/software/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/hornblowerNode01Cell/FRPApp.ear/FRPApp-WebModule.war/WEB-INF/classes/us/ny/state/oag/model/OrganizationDetail.class", 0xD187F628) = 0
883 is a WebSphere pid.
$ truss -o example.out -p 883
truss traces pid 883 and outputs to example.out
$truss -o example.out install.sh
install.sh is an installer of a software. truss traces the installation process's system calls and outputs to example.out
9/18/08
find, grep
NAME
find - find files
SYNOPSIS
/usr/bin/find [-H -L] path... expression
/usr/xpg4/bin/find [-H -L] path... expression
DESCRIPTION
The find utility recursively descends the directory hierar- chy for each path seeking files that match a Boolean expres- sion written in the primaries given below.
find is able to descend to arbitrary depths in a file hierarchy and does not fail due to path length limitations (unless a path operand specified by the application exceeds PATH_MAX requirements).
Examples :
find . -name "bla.log" -print
This command will search in the current directory and all sub directories for a file named bla.log.
Note: The -print option will print out the path of any file that is found with that name. In general -print wil print out the path of any file that meets the find criteria.
find /usr/src -not \( -name "*,v" -o -name ".*,v" \) '{}' \; -print
This command will search in the /usr/src directory and all sub directories. All files that are of the form '*,v' and '.*,v' are excluded. Important arguments to note are:
-not means the negation of the expression that follows
\( means the start of a complex expression.
\) means the end of a complex expression.
-o means a logical or of a complex expression. In this case the complex expression is all files like '*,v' or '.*,v'
find . -exec grep "size" '{}' \; -print
This command will search in the current directory and all sub directories. All files that contain the string will have their path printed to standard output.
grep:
NAME
grep - search a file for a pattern
SYNOPSIS
/usr/bin/grep [-bchilnsvw] limited-regular-expression [filename...]
/usr/xpg4/bin/grep [-E -F] [-c -l -q] [-bhinsvwx] -e pattern_list... [-f pattern_file]... [file...]
/usr/xpg4/bin/grep [-E -F] [-c -l -q] [-bhinsvwx] [-e pattern_list...] -f pattern_file... [file...]
/usr/xpg4/bin/grep [-E -F] [-c -l -q] [-bhinsvwx] pattern [file...]
DESCRIPTION
The grep utility searches text files for a pattern and prints all lines that contain that pattern. It uses a com- pact non-deterministic algorithm.
Be careful using the characters $, *, [, ^, , (, ), and \ in the pattern_list because they are also meaningful to the shell. It is safest to enclose the entire pattern_list in single quotes '...'.
If no files are specified, grep assumes standard input. Nor- mally, each line found is copied to standard output. The file name is printed before each line found if there is more than one input file.
/usr/bin/grep The /usr/bin/grep utility uses limited regular expressions like those described on the regexp(5) manual page to match the patterns.
/usr/xpg4/bin/grep The options -E and -F affect the way /usr/xpg4/bin/grep interprets pattern_list. If -E is specified, /usr/xpg4/bin/grep interprets pattern_list as a full regular expression (see -E for description). If -F is specified, grep interprets pattern_list as a fixed string. If neither are specified, grep interprets pattern_list as a basic regular expression as described on regex(5) manual page.
Example:
U want to find a string "size" in a folder and in its subfloders. This is the example
grep -i size `find . name *.* -print`
Grep can be used in so many ways and for so many reasons.
If I want to check the java processes
ps -ef grep java
If I want to check java processes owned by a particular user
ps -ef grep java grep websphe
If I want to check network statistics and specifically for a specific host
netstat -a grep hostname
..
netstat -a grep 8080
and so on.
9/9/08
cp
But, just FYI
If you want to copy a file in UNIX, cp is the command
man cp gives the following info.
cp - copy files
SYNOPSIS /usr/bin/cp [-fip@] source_file target_file
/usr/bin/cp [-fip@] source_file... target
/usr/bin/cp -r -R [-H -L -P] [-fip@] source_dir... target
/usr/xpg4/bin/cp [-fip@] source_file target_file
/usr/xpg4/bin/cp [-fip@] source_file... target
/usr/xpg4/bin/cp -r -R [-H -L -P] [-fip@] source_dir... target
Usage Example:
$ mkdir testcp
$ mkdir testcpdest
$ cd testcp
$ touch x1.txt
$ cd ..
$ cp -r testcp testcpdest
I made a dir called testcp (which is the source dir)
I made another dir called testcpdest (destination dir)
I have touched a file x1.txt in testcp
I have copied testcp to testcpdest with files using cp -r meaning copy recursively.
Another ex.,
I have a file like this
-rw-r--r-- 1 websphe websphe 13593 Mar 18 11:53 n1.log
I want to cp it to n2.log with the same time stamp and same uid,gid permissions. This is the way
cp -p n1.log n2.log
n2.log will have same time stamp and other info as n1.log
-rw-r--r-- 1 websphe websphe 13593 Mar 18 11:53 n2.log
-rw-r--r-- 1 websphe websphe 13593 Mar 18 11:53 n1.log
8/5/08
umask
777 stands for rwxrwxrwx. first set of rwx is for user, second set of rwx for group and last set is for others. to know what umask u have, at the prompt type umask, which will return a value, say 022.
What does that mean o22?
Its simple.
777-022=755.
umask 022 = rwxr-xr-x, meaning, user has all permissions, group has read and execute, others have read and execute.
To understand umask in permissions mode try this command, umask -S
for example
$ umask
022
$ umask -S
u=rwx,g=rx,o=rx
9/24/07
tar tips
You have a mount, say, /servermount/swfcopy, in which you have to copy a folder foo to ur box.
Do like this
cd /servermount/swfcopy
tar cvf /where_to_keep_folder/filename.tar ./foo
say, tar cvf /export/home/myfolder/foo.tar ./foo