Wednesday, June 25, 2008

Change WAS 5.1.x default log level

1) Create a file "commons-logging.properties" in /properties
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger

2) Edit logging.properties in /jre/lib
Change the line .level = INFO to .level = ERROR|WARN

# For example, set the com.mypackage.myapp logger to only log SEVERE
# messages:
com.mypackage.myapp.level = SEVERE

Oracle on HP-UX - lock SGA

If oracle instance in HP-UX is set to lock sga as below:

ALTER SYSTEM SET lock_sga=TRUE SCOPE=SPFILE;

There will be error:-

SQL> ORA-27126: unable to lock shared memory segment in core
HP-UX Error: 1: Not owner

Solution:
1) Create a file /etc/privgroup with this entry
dba MLOCK RTSCHED RTPRIO

2) Run
# setprivgroup -f /etc/privgroup

3) Check that above is successful
# getprivgrp
global privileges: CHOWN
dba: RTPRIO MLOCK RTSCHED

Reference:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=729423

Tuesday, June 3, 2008

Use WebSphere MQ 6 with WLS 9.2 MP1

0) Copy providerutil.jar & fscontext.jar from <MQM_HOME>/java/lib to <DOMAIN_HOME>/lib

1) Create .bindings file

$ jmsAdmin.sh -cfg myConfig.config
def qcf(myQCF) qmanager(myQM) host(hostname) transport(client) port(1414)
def q(myQ) queue(myQ)

=== jmsAdmin.sh ===
JAVA_HOME=[PATH_TO_JAVA]
MQLIB=/opt/mqm/java/lib
CP=$MQLIB

for i in $MQLIB/*.jar
do
CP=$CP:$i
done

$JAVA_HOME/bin/java -classpath $CP com.ibm.mq.jms.admin.JMSAdmin $@

=== myConfig.config ===
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
PROVIDER_URL=file:[some_directory]
SECURITY_AUTHENTICATION=none


2) Define JMS module from admin console -> Services -> Messaging -> JMS Modules -> New
- enter a name and leave the rest empty

3) Create new resource type "Foreign Server"
Name: Anyname
JNDI Initial Context Factory: com.sun.jndi.fscontext.RefFSContextFactory
JNDI Connection URL: file:[some_directory]
Default Targeting Enabled: true

4) Add destination & connection factory
Name: [AS PER MDB]
Local JNDI Name: [SAME AS ABOVE]
Local JNDI Name: [SAME AS ABOVE]

Sunday, June 1, 2008

Tracing system calls in HP-UX 11.x

The tool to use is tusc. Available from http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/tusc-7.8/.

1) Download the file (it is in .shar)
2) Unpack is by running (may need to strip off the ^M characters first from the .shar file)
# sh tusc.xx.shar
3) There will be a binary named "tusc" and some other files.
4) tusc -help

Below is the output from tusc -help:

Usage: tusc [-]  -OR- 
-a: show exec arguments
-A: append to output file
-b bsize: dump 'bsize' max bytes (-r/-w)
-c: count syscalls instead of printing trace
-d [+][!][fd | all]: select only syscalls using fd
-e: show environment variables
-E: show syscall entries
-f: follow forks
-F: show kernel's ttrace feature level
-g: don't attach to members of my session
-h: show state of all processes when idle
-i: don't display interruptible syscalls
-I start[/stop]: single-step and show instructions
-k: keep alive (wait for *all* processes)
-l: print lwpids
-n: print process names
-o [file|fd]: send trace output to file or fd
-p: print pids
-Q: be quiet about some warnings
-r [!][fd | all]: dump read buffers
-R: show syscall restarts
-s [!]syscalls: [un]select these syscalls
-S [!]signals: [un]select these signals
-t: detach process if it becomes traced
-T timestamp: print time stamps
-u: print user thread IDs (pthreads)
-v: verbose (some system calls only)
-V: print version
-w [!][fd | all]: dump write buffers
-x: print raw (hex) arguments
-z: only show failing syscalls
Similar system calls tracing tools exist for other unixes:
AIX: truss
Linux: strace
Linux 64bit: strace32
Solaris: truss