Posts Tagged ‘aix’

AIX tips

June 30th, 2013 Comments off
fuser -cuxk /oracle #kill all the process using filesystem /oracle
procstack #show current stack of a process
bootlist -m normal -o          # Lists the current bootlist
bootlist -m normal cd0 hdisk0  # To set cd0 and hdisk0 as first and second boot devices
bootlist -m service cd0 rmt0   # To change the bootlist for service mode
alog -L
alog -o -t boot
alog -L -t boot #find out the properties of boot log file
##Device Configuration Database(Predefined, Customized)
01. Available  - Device is ready and can be used
02. Defined    - Device is unavailable
03. Unknown    - Undefined
04. Stopped    - Configured but unavailable
      -C  to list customized database
      -P  to list predefined database
      -c (class)
      -t (type)
      -s (subtype)
To list all customised devices ie installed
 # lsdev -C
To list all the Hard Drives in a system
 # lsdev -Cc disk
To list all the adapters in a sytem
 # lsdev -Cc adapter
lscfg -v  #list all installed devices in detail
lscfg -vpl fcs0<ent0> #find out the WWN, FRU #, firmware level of fibre adapter fcs0
entstat -d ent0 #link status, link speed and mac address and statistics of an Ethernet adapter ent0
##Setting multiple IP address for a single network card
 # ifconfig lo0 alias
 # ifconfig en0 alias <IPadress> netmask <net_mask>
/etc/, /etc/rc.tcpip #make the above permanent
lsattr -El ent0 -a media_speed -R #find out the possible media_speed values for ethernet card ent0
lsattr -El mem0 #find out the effective attribute of a device "mem0"
lsattr -El sys0 #list the defaults in the pre-defined db for device ent0
To change the maximum number of processes allowed per user
Find out the valid range of values using lsattr command
 # lsattr -l sys0 -a maxuproc -R
 40...131072 (+1)
Change the maxuproc value using chdev command
 # chdev -l sys0 -a maxuproc=10000
rmdev -l (device) -d #delete the device
To delete a static route manually
Syntax:- chdev -l inet0 -a delroute=<net>,<destination_address>,<Gate_way_address>,<Subnet_mask>
 # chdev -l inet0 -a delroute='net','',''
To change the IP address of an interface manually
 # chdev -l en0 -a netaddr= -a netmask= -a state=up
To set the IP address initially
 # mktcpip -h <hostname> -a <ipaddress> -m <subnet_mask> -i <if_name> -n <NameServer_address>
   -d <domain_name> -g <gateway_address> -A no
##add device to system
To define a tape device
 # mkdev -d -c tape -t 8mm -s scsi -p scsi0  -w 5,0
To make the predefined rmt0 tape to available status
 # mkdev -l rmt0
##configure new devices using cfgmgr
cfgmgr -l fcs0 #configure detected devices attached to the fcs0 adapter
cfgmgr -i /tmp/drivers #cfgmgr -i /tmp/drivers
getconf -a
prtconf -c/m/s
bootinfo -K
swapon/swapoff/lsps/chps/mkps/rmps, /etc/swapspaces, /etc/filesystems
LVM - lsvg/lspv/mkvg/mklv/logform/crfs/chfs/extendvg/mklvcopy/syncvf/bosboot/synclvodm/chpv
NIM - Network Installation Management
/etc/netsvc.conf #Name resolution order
##no command is used to change the network tuning parameters. ioo for IO tuning(aio, asynchronous IO), vmo for virtual memory manager parameters
To list the current network parameters / network options
 # no  -a
To enable IP forwarding
 # no -o "ipforwarding=1"
To make ipforwarding=1 permanent now and after reboot
 # no -p -o ipforwarding=1
###/etc/tunables/xxx, tuncheck/tunsave/tunrestore/tundefault
startsrc/lssrc, iptrace, tcpdump #The startsrc command sends the System Resource Controller (SRC) a request to start a subsystem or a group of subsystems, or to pass on a packet to the subsystem that starts a subserver.
##ODM, object data manager
odmget CuDv #list all records with an Object Class CuDv
odmget -q "name=sys0 and attribute=maxuproc" CuAt
svmon -G #memory. pin(frames that cannot be swapped), pg space(paging space, ie swap)
svmon -P 13548 -i 1 2 #monitor memory leak by  looking for processes whose working segment continually grows
trcon/filemon/trcstop #Most Active Logical/physical Volumes, most active Files
rmss #a means to simulate different sizes of real memory that are smaller than your actual machine
netpmon #network monitoring
##package management
oslevel -r/s/l xxxx/-g/-rq
lslpp -l [software name]
lslpp -f <fileset name> #display the names of all the files of fileset
lslpp -w /usr/sbin/nfsd #which fileset a file belongs to
service portmap start
service nfs start
showmount -e localhost
/etc/exports #/backup/downloads *(sync,ro,root_squash,wdelay), exportfs -a, exprotfs *:/backup/downloads
mount -fv -t nfs <xx> <dir> #check ports used
lslpp -ha #installation history of filesets
To list all installable software in media /dev/cd0
 installp [-L|-l] -d /dev/cd0
To cleanup all failed installtion
 installp -C
To install software (apply and commit) package with all pre-requisites from directory /tmp/net
 installp -acgx -d /tmp/net
To commit teh applied updates
 installp -cgx all
To remove package
 installp -ug
To find out whether a Fix is installed or not
 # instfix -i -k <APAR Number>
To list all the fixes that are installed on your system
 # instfix -i -v
To list filesets which are lesser than the specified maintenance level
 # instfix -ciqk 5100-04_AIX_ML | grep ":-:"
To install all filesets associated with fix Ix38794 from the tape
 # instfix  -k Ix38794  -d /dev/rmt0
To Display the entire list of fixes present on the media
 # instfix -T -d /dev/cd0
To confirm the AIX preventive maintenance level on your system
 # instfix -i | grep ML
 All filesets for were found.
 All filesets for were found.
 All filesets for were found.
 All filesets for 5100-01_AIX_ML were found.
 All filesets for 5100-02_AIX_ML were found.
Updating the software to the latest level
01. Using smit
    # smit update_all
02. To update all filesets in a system using command line
    a. Create the list of filesets installed
       # lslpp -Lc | awk -F: '{print $2}'| tail -n +2 > /tmp/lslpp
    b. Update the softwares using installp command
       # installp -agxYd /dev/cd0 -e /tmp/<exclude_list> -f /tmp/lslpp
Another way of updating all the filesets
 # /usr/lib/instl/sm_inst installp_cmd  -acgNXY -d <localtion_of_updates> -f '_update_all'
For not committing and saving all replaced files
 # /usr/lib/instl/sm_inst installp_cmd  -agX -d <localtion_of_updates> -f '_update_all'
To list all the installed efixes on a system
 # emgr -l
To install a efix IY93496.070302.epkg.Z in /mnt directory
 # emgr -e /mnt/IY93496.070302.epkg.Z
The inutoc command creates the .toc file in Directory. If a .toc file already exists, it is recreated with new information. The inutoc command adds table of contents entries in the .toc file for every installation image in Directory.
The installp command and the bffcreate command call this command automatically upon the creation or use of an installation image in a directory without a .toc file
To create a .toc file for the /tmp/images directory, enter:
 # inutoc /tmp/images
The bffcreate command creates an installation image file in backup file format (bff) to support software installation operations. It creates an installation image file from an installation image file on the specified installation media
To create an installation image file from the software package on the tape in the /dev/rmt0 tape drive and use /var/tmp as the working directory, type:
 # bffcreate  -d /dev/rmt0.1 -w /var/tmp
chsec -f /etc/security/limits -s joe -a cpu=3600 #change the CPU time limit of user joe to 1 hour
chuser rlogin=true smith #enable user smith to access this system remotely
pwdadm -c user1 # To reset the ADMCHG flag for the user user1<forces the user to change the password the next time a login command or an su command is given for the user>
who -a /etc/security/failedlogin # read failed login attempts
##LPAR and HMC<logical partition and hardware management console>
lsslot/hmcshutdown/chsysstate/lsrsrc/smtctl/vtmenu/mkvterm/rmvterm/lssysconff/lssysconn/ssysconn/lssyscfg/lsled/chled/lparstat -i/chhmc/mkvdev
HACMP Daemon
01. clstrmgr
02. clinfo
03. clmuxpd
04. cllockd
fcstat -D fcs0 | grep Attention #To find out the fiber channel link status
lsvpcfg #List all Vpath devices and their states
dpovgfix vg00 #fixe a DPO Vpath Volume group that has mixed vpath and hdisk volumes
###EMC powerpath
To configure all the emc hdisks, run emc_cfgmgr script. This script invokes the AIX cfgmgr tool to probe each adapter bus separately
To remove the Symettrix hdisks
 # lsdev -CtSYMM* -Fname | xargs -n1 rmdev -dl
To remove hdisks corresponding to CLARiiON devices
 # lsdev -CtCLAR* -Fname | xargs -n1 rmdev -dl
To probe all emc disks
 # inq
To set up multipathing to the root device
 # pprootdev on
To Remove all hdiskpower devices
 # lsdev -Ct power -c disk -F name | xargs -n1 rmdev -l
To find out which hdiskpower device contains hdsik132
 # powermt display dev=hdisk132
###HP Autopath
dlnkmgr view -drv
dlmrmdev #remove all the DLM drivers
dlmpr -a -c #To clear the SCSI reserves on the disks
To list all the paths which are in Enabled status
 # lspath -s ena -Fname -p fscsi0
 # chpath -s ena -l hdisk0
 paths Enabled
To list all available disks and their paths
  # lspath | sort +1
To list all disks which paths are in failed state
 # lspath -s failed
To list all disks which paths are in Defined state
 # lspath -s defined
To remove a path
 rmpath -dl <disk_name> -p <parent> -w <connection>
 rmpath -dl hdisk3 -p fscsi0 -w 5005076801105daf,1000000000000
Categories: IT Architecture, Systems, Unix Tags:

resolved – aix create and remove swap space

July 14th, 2012 Comments off

To add a paging space "paging0"

  • Create a new LV for paging space

mklv -t paging -y paging0 rootvg 10

  • Add the entry in /etc/swapspaces to activate the paging space during next reboot

chps -a y paging0

  • Activate the paging space

swapon /dev/paging0

To remove an active paging space "paging00"

  • Deactivate the paging space using swapoff commnad

swapoff /dev/paging00

  • remove the paging space using rmps command

rmps paging00

  • Remove the entry from /etc/swapspaces so that it is not activated during next reboot

chps -a n paging00

Categories: IT Architecture, Systems, Unix Tags: