HPUX Quick Reference to Commands

By David Lopez,2014-09-17 22:38
10 views 0
HPUX Quick Reference to Commands

    1.1.1 HPUX Unix Reference Pages

    ; Installed Configuration

    ; Performance Meters

    ; Kernel Configuration

    ; Semaphores

    ; Shared Memory

    ; File/Process Tables

    ; Limit Summary

    ; Disks

    ; File Access

    ; Memory

    ; CPU

    ; Network

    ; TCP

    ; Keepalive

    ; Process Debugging

    ; To help with Debugging

    ; Compilation

    ; Miscellaneous

    ; Tuning Oracle on HPUX

    HPUX - Installed Configuration

    Hardware /usr/sbin/ioscan -fn scans i/o system

    /usr/sbin/lsdev drivers in current kernel

    /usr/sbin/sam -> Kernel Configuration All drivers -> Drivers

    /usr/sbin/dmesg Amount of RAM, memory page size

    grep Physical Amount of RAM /var/adm/syslog/syslog.log

    grep physical memory page size [if info still being in /var/adm/syslog/syslog.log system buffer]

    /usr/sbin/pvdisplay / lvdisplay / Logical Volume Management vgdisplay

    Packages /usr/sbin/swlist -a state -l fileset Installed and configured SW

     OS Version uname -r

     Node Name uname -n; hostname

     Hardware Model model

    32/64 bit HP 11 getconf KERNEL_BITS returns 32 or 64

     Unix is /stand/vmunix

     Error Log /var/adm/syslog/syslog.log

    Installed and configured patches O/S Patches /usr/sbin/swlist -a state -l fileset <Note:43507.1>

    HPUX - Performance Meters

    glance (gpm); top; sar; vmstat

    q4 <Note:69039.1> <Note:66637.1>

    swapinfo <Note:68056.1>

    HPUX - Kernel Configuration

    /usr/sbin/sam -> Kernel Configuration Set DISPLAY first, root only (can also Main Tool -> Configurable Parameters use in char mode)

    kmtune - HP-UX 11 only <Note:68794.1> man kmtune

     Display /etc/sysdef

     /usr/sbin/kmtune (HP11 only)

     view /stand/build/*.c

     File/s /stand/build/*.c

    Tunable Parameters

    Files nfile, nflocks, ninode Main tables

    maxfiles, maxfiles_lim Process Soft/Hard limit

    Static UNIX Buffer Cache should set Memory bufpages, nbuf to 0;use dynamic buffer cache

    Dynamic UNIX Buffer Cache dbc_max_pct, dbc_min_pct <Note:62589.1>

    Allow 'memory paging' (allow Swap swapmem_on memory > swap) <Note:68056.1>

    swchunk size of swap chunks

    maxswapchunks number of swap chunks

    Process nproc, maxuprc Nproc per system, per user

    Memory limits for data, stack, text maxdsiz, maxssiz, maxtsiz sizes

    translation of O_SYNC to O_DSYNC File Open Mode o_sync_is_o_dsync in open() <Note:34372.1>

    SHMEM SHMMAX SHMMNI Shared Mem See Kernel Configuration below SHMSEG

    SEMA SEMMNS SEMMNI Semaphores See Kernel Configuration below SEMMAP

    Special fs_async Async on FS. Leave at 0. Do not set.

    maxusers drives nproc, nfile in SAM

    Recommended <Note:68105.1>


    HPUX - Semaphores

     Usage ipcs -sa

    Test /etc/sysdef | grep sem doesn't show SEMMNS

    grep SEM /stand/build/*.c does show SEMMNS

     HPUX-11 only kmtune -q <parameter> <Note:68794.1> man kmtune

    /usr/sbin/sam -> Kernel Configuration Set Set DISPLAY first, root only -> Configurable Parameters

     HPUX-11 only kmtune <Note:68794.1> man kmtune Parameters semmni Identifiers system-wide

    semmns Semaphores system-wide

    semmap Entries in Sem Map

    sema Enable semaphores

    HPUX - Shared Memory

     Usage ipcs -ma

    Test /etc/sysdef | grep shm doesn't show SHMMAX

    grep SHM /stand/build/conf.c does show SHMMAX (in hex?)

     HPUX-11 only kmtune -q <parameter> <Note:68794.1> man kmtune

    /usr/sbin/sam -> Kernel Configuration Set Set DISPLAY first, root only -> Configurable Parameters

     HPUX-11 only kmtune <Note:68794.1> man kmtune Parameters shmmax Max Segment Size

    shmseg shmmni Num Segs /process, /system

    shmem Enable shared mem

    SGA See <Note:69119.1>

    HPUX - File/Process Tables

    Usage sar -v 5 5 proc inod file. Check ov (overflow)

     Test sar -v 5 5


    /usr/sbin/sam -> Kernel Configuration Set Set DISPLAY first, root only -> Configurable Parameters


    nfile(based on maxusers), maxfiles, Recommended values see Files maxfiles_lim <Note:68105.1>

     Process nproc (based on maxusers), maxuprc "

    HPUX - Limit Summary

    Limit Query Set

    no of processes per user id /etc/sysdef|grep change kernel parameter maxuprc

     Recommended:<Note:68105.1> maxuprc

    ulimit <no of blocks> max file size ulimit (file) Recommended:<Note:62407.1>

    max memory usage per process ulimit -m <# kb> ulimit -a (memory) (includes data, stack and mem limit memoryuse <# kb> limit (memoryuse) mapped files) Recommended:unlimited

    ulimit -a (data)

    limit (datasize) change kernel parameter maxdsiz max data segment size per process /etc/sysdef|grep Recommended:<Note:68105.1>


    ulimit -a (stack)

    limit (stacksize) change kernel parameter maxssiz max stack segment size per process /etc/sysdef|grep Recommended:<Note:68105.1>


    ulimit -a ulimit -c <no of blocks> (coredump) max size of core file limit coredumpsize <# kb> limit Recommended:unlimited (coredumpsize)

    ulimit -t <# seconds> ulimit -a (time) max cpu time allowed limit cputime <# secs> limit (cputime) Recommended:unlimited

    change kernel parameter maxfiles (also ulimit -a (nofiles) max no of files open per user-id maxfiles_lim) limit (descriptors) Recommended:<Note:68105.1>

    1.1.2 Additional Notes: 1. <Note:62407.1> details filesize limits on HP-UX

    2. ulimit is a ksh/sh utility 3. limit is a csh utility

    HPUX - Disks

    Mounted mount [-p]; bdf; -p reports in /etc/fstab format

     cat /etc/fstab

    /usr/sbin/devnm <dir> lv on which dir's fs resides

    /usr/sbin/lssf <special file> HW info on device

    Build/Change tunefs HFS tuning

    newfs; mkfs; Make Filesystem

    fsadm Administer filesystem

    quota [-v] [user] Quotas

     quotacheck -v; /etc/edquota

     VTOC/Partition diskinfo device

     LVM/SVM /usr/sbin/vgdisplay

     /usr/sbin/lvdisplay -v <lv>

    lvcreate; lvextend; lvremove Create / manage LV

    pvcreate Create PV

    Free Space bdf df -k style output

     df -t; du -sk

     Usage iostat; vmstat -d

    HPUX - File Access

    Open Files sar -v 5 5 text proc inod file (system)

    /etc/fuser Who is using file?, root only

    files, sockets, shared memory etc. See lsof Note#1 below Open Files (user) gpm (glance) Tune maxfiles/maxfiles_lim File Size sh ulimit In 512 byte blocks

    quota -v Check quotas

    Protections chacl; lsacl Access Control

    chmod -R; chown -R Recursive Change

    /usr/sbin/sam -> Disks and File logical volumes Set DISPLAY first, root only Systems

    Note: alternatively use SAM to manage file systems, disk, volume groups and

    log vols

     /usr/sbin/sam Set DISPLAY first, root only

     -> Disks and File Systems


     lsof is available at many locations on the Net, including

    HPUX - Memory

     System Usage vmstat -n

     Kernel Usage top


     Show swapinfo -m <Note:68056.1>

     Add /etc/swapon


     Size ps, top, q4 <Note:66637.1>

     Show Limits ulimit, limit

     Set Limits Change max[ds]siz <Note:68105.1>

    HPUX - CPU

     Usage sar -u

    top Continuous monitor

    Run Queue vmstat (r b w)

     Limits None

    HPUX - Network

     Usage netstat

     Tune -

    HPUX - TCP

     Configure /usr/sbin/ifconfig, /usr/sbin/lanconfig

     Addresses /usr/sbin/arp


    HPUX - Keepalive

    HPUX 10.20

     Query: /usr/contrib/bin/nettune [-l] <parameter>

     Set: /usr/contrib/bin/nettune -s <parameter> <value>

     Parameters: /usr/contrib/bin/nettune -h lists all parameters, with explanation

     Configure /etc/conf/netinet/tcp_timer.h

    HPUX 11

     Query: /usr/bin/ndd -get /dev/tcp <parameter>

     Set: /usr/bin/ndd -set /dev/tcp <parameter> <value>

     Parameters: /usr/bin/ndd -get /dev/tcp ? lists all parameters for TCP

    /usr/bin/ndd -h <parameter> explanation of paramater

     Configure /usr/conf/netinet/tcp.h, tcpip.h

     Eg: For Hp-UX 10.20:

     tcp_keepstart - no of seconds that a TCP connection can be idle

     before keepalive packets sent

     tcp_keepfreq - interval in seconds at which keepalive packets will

     be sent, once started

     tcp_keepstop - no of seconds keepalive packets sent without the

     receipt of a packet after which the connection will be


     Eg: For Hp-UX 11.X:

     tcp_keepalive_interval - no of seconds that a TCP connection can be idle

     before keepalive packets sent

    HPUX - Process Debugging

    adb; xdb; 'xdb -P PID' for a process. Best if linked with 'end.o'. See Debug gdb <Note:69975.1>


     HPUX shareware utility trace 10.20 See Note#1 below

     HPUX-11 tusc See <Note:180364.1>

     Kernel q4

    Info ps -efl Use a loop to monitor



     'trace' is available from HP at

    HPUX - To help with Debugging

     Find Executable csh which; sh type

    Scripting script [outfile] Copy output to 'outfile'

     Expand Text expand

     Fold Text fold -w N

    HPUX - Compilation

     Compiler cc options dependent on product and release

     Environment ensure LDOPTS and LDFLAGS are not set Executable type

     depending on PA RISC architecture

    and cc flags:

     PA-RISC1.1 shared For 10.20 and 11.00 <Note:60856.1> executable dynamically linked-not stripped 32 bit executables,

     s800 shared

    executable -not stripped

    For 11.00 64 bit ELF-64 executable object file - PA-RISC 2.0 executables (LP64)

    Shared Libraries

    10.20 odump -sllibloadlist <prog> Like 'ldd'

    Like 'ldd' for 32 bit 11.00 chatr <prog> executables

    For 64bit compiled ldd <prog> binaries

    LD_LIBRARY_PATH, SHLIB_PATH, "chatr" shows actual paths Shared Library Paths Executable used by an executable Sysliblist

    HPUX 10.20

     V733 -lcl -lm

     V734 -lcl -lm -l:libcl.a

     V804 -lcl -lm

     V805 -lcl -lm /usr/lib/ /usr/lib/ -lc

HPUX-11 32 bit

     V733 -l:libcl.a -lm <Note:51059.1>

     V734 -lcl -lm -l:libcl.a <Note:51059.1>

    -l:libcl.a -lm -lpthread /usr/lib/ V804 /usr/lib/

    -l:libcl.a -lpthread -l:libnss_dns.1 V805

     HPUX 11.00 64 bit

    -l:libcl.a -lpthread -l:libnss_dns.1 V805

    HPUX - Miscellaneous Add Users vipw; /etc/pwck; /etc/grpck Edit / check password file

    /usr/bin/getpriv RTPRIO,MLOCK,CHOWN,SETRUGID

    /etc/setpriv Set Privs

    Reboot reboot, shutdown see man pages

    Reboot shutdown N to single user in N seconds Auto /sbin/init.d/oracle main start/shut script of Oracle Start/Stop

    /etc/rc.config.d/oracle enable auto start/shut

    /sbin/rc1.d/Kxxxoracle shutdown script symbolic linked to /sbin/init.d/oracle

    /sbin/rc2.d/Sxxxoracle startup script symbolic linked to /sbin/init.d/oracle

    **Can't HOT backup - fbackup loses inodes changes

    Backup that occur during a backup fbackup, frecover Tools frecover -s causes sparse files causes paging for >1GB

    files - see man page


    tar; cpio; ftio (9 trk); tcio 'tcio' with cartridges

    JFS snapshots <Note:62355.1>

    Default /dev/rmt/0m Tape

     Others finger

    HPUX - Tuning

    IO limitation

     HPUX 64k 10.20

     HPUX 11 256k

     Async IO raw only

     Kernel configure async driver max_async_ports limits max no of processes using

    /dev/async. Default=50. Should set to max no of shadow and regen HP-UX kernel

    procs + pq slaves + no of bgd processes <Note:139272.1> /sbin/mknod /dev/async

    c 101 0x0

    chown oracle:dba


     chmod 660 /dev/async


     pre 7.3 no init.ora parameters

     for 7.3 set use_async_io = onwards TRUE

    set disk_asynch_io = for 8.X TRUE

     List IO not used



    Post/Wait not used Driver



    Multiple <Note:62589.1> dbwr


Report this document

For any questions or suggestions please email