Tops Aix Commands

Embed Size (px)

Citation preview

LAST CHANGE : 07.01.2010 OS LEVEL AIX: 4.3.3 + 5.1 + 5.2 + 5.3 + 6.1 ############## # useful links ############## http://www.rootvg.net http://publib.boulder.ibm.com/cgi-bin/ds_form http://publib16.boulder.ibm.com/pseries/en_US/infocenter/base/errorsearch.htm http://www.aixtips.com/AIXtip/ http://www.rootunix.org/AIX/ http://www.rootvg.net/ledlist.htm http://www.ibm.com/developerworks/aix/ http://www.ibm.com/developerworks/forums/forum.jspa?forumID=747 http://www.perzl.org/aix/ ############### # AIX 6 Support ############### AIX V6.1 exclusively supports 64-bit Common Hardware Reference Platform (CHRP) machines with selected processors: PowerPC 970 POWER4 POWER5 POWER6 To see if you have a supported machine, log into the machine as the root user, and run the following command: 1. prtconf grep "Processor Type"

AIX V6.1 does not support the following processor architectures: RS64 POWER3 604 ####################### # commandline or smitty ####################### Wer sich nicht sicher ist, unter intern: http://uriel/austausch/betrieb/os/aix/doc/all_fast_path.txt extern: http://www.hdkutz.de/os/aix/all_fast_path.txt sind alle smitty-menues (Menue smitty Befehl) aufgelistet. Beispiel: Processes process Aufruf smitty process Durch den smitty werden Kommandos teilweise automatisch vervollstaendigt, so das ein Fehler kaum mehr moeglich ist. Parameter werden angegeben. ############################# # determine Maintenance Level ############################# instfix -i grep AIX_ML oslevel will report the base OS level - i.e. we are at 4.3.3.04 and oslevel returns 4.3.3.0.

instfix -ik 4330-04_AIX_ML *checks* that all filesets are installed for ML 04 on AIX 4.3.3 and returns a success / failure message and instfix -ic pg will list the fields keyword name, fileset name, required level, installed level, status, and short abstract for each fileset installed - the status field allows you to identify which filesets are downlevel by showing a < in this field. See the man pages for this command ... However, to my knowledge there is no command that reports both oslevel and ML level in one. This will show you all the filesets missing for that Maintenance Level: instfix -ivk 4330-08_AIX_ML grep : grep not Nachschauen welche APARs im Verzeichnis enthalten sind: instfix -Td . To install all fixes on the disk, enter: # instfix -T -d . instfix -d . -fOnce installed, you can determine if all fileset updates for the 4330-07 level are installed using the following command. The 'oslevel' command will still indicate AIX 4.3.3.0. instfix -ik 4330-08_AIX_ML If the output indicates that not all filesets are found, you can determine which filesets are not updated using the command: instfix -qick 4330-08_AIX_ML grep ":-:" To check for filesets instfix -qick To check for filesets instfix -qick To check for filesets instfix -qick BELOW a given maintenance level: 4330-08_AIX_ML grep ":-:" ABOVE a certain maintenance level: 4330-08_AIX_ML grep ":+:" AT a certain maintenance level: 4330-08_AIX_ML grep ":=:"

To check for filesets AT a certain maintenance level: instfix -qick 5200-02_AIX_ML grep ":-:" To check for filesets AT a certain maintenance level: instfix -qick 5200-03_AIX_ML grep ":-:" To check for filesets AT a certain maintenance level: instfix -qick 5300-10_AIX_ML grep ":-:" ############################## # view fix installed on system ############################## instfix -ik IX78215 -v root@cws [~]# instfix -ik IX78215 -v IX78215 Abstract: trace allocates too much memory Fileset bos.sysmgt.trace:4.3.1.1 is applied on the system. All filesets for IX78215 were found. ############################ # view filesets in directory ############################ # instfix -T -d . IY14691 WRONG 2 DECLARATION OF SVC_REGISTER IN RPC/SVC.H

IY30887 IY31033 IY31312 IY31879 IY32007 IY32852 IY33524 ...

SDK 1.3.1 32-bit PTF 1 SDK 1.3.1 32-bit PTF 0 : ca131w-20020404 CANNOT 2 COMPILE RPC WRAPPERS IN 64BIT ON AIX 5 SYS/SHM.H 2 HEADER SHOULD NOT DEFINE _ALL_SOURCE STR() 2 OF OSTRSTREAM FREEZES JULY 2 2002 C++ RUNTIME PTF IY33524 SYMBOLS 18 SYMBOLS EXPORTED FROM OLD RTE NOT EXPORTED EXP. FROM

################# # efix management ################# # wenn man nicht weiss wie der label eines efixes ist - entpacken mit gnu-tar - ecfile anschauen # list all emgr -l ID STATE LABEL INSTALL TIME ABSTRACT === ===== ========== ================== ====================================== 1 S IY64691ML4 12/15/04 14:23:08 chvg -B causes corruption 2 S aio 12/15/04 14:23:30 Efix for AIO hang problem. 3 S 52IS63366 12/20/04 13:52:36 efix for dlsym problem on 52I # list detail of fix emgr -L 84597 # install emgr -e IYxxx # show locks emgr -P # uninstall emgr -r -L LABELNAME ###### # suma ###### # download TL suma -x -a DLTarget=/export/fixes/530TL07 -a Action=Download -a RqType=TL -a RqN ame=5300-07 # download specific fixes suma -x -w -a Action=Preview -a RqType=APAR -a RqName=IY70298 Task ID 1 created. The download list contains one or more fixes known to cause a regression: U809929 # download fixes suma -x -w -a Action=Download 1 The download list contains one or more fixes known to cause a regression: U809929 Extending the /usr filesystem by 1196427 blocks. Filesystem size changed to 10223616 Download SUCCEEDED: /usr/sys/inst.images/installp/ppc/Java131.ext.commapi.1.3.1. 2.bff

Download SUCCEEDED: /usr/sys/inst.images/installp/ppc/ICU4C.rte.5.3.0.60.bff Download SUCCEEDED: /usr/sys/inst.images/installp/ppc/Java131.adt.includes.1.3.1 .5.bff # unschedule task suma -u 1 # delete task suma -d 1 ######### # oslevel ######### # oslevel -r -q Known Recommended Maintenance Levels -----------------------------------4330-08 4330-07 4330-06 4330-05 4330-04 4330-03 4330-02 4330-01 4320-02 #################### # ML52_02 downloaden #################### http://techsupport.services.ibm.com/server/aix.fdc?toggle=DNLDLATEST ########################## # compare_report nur > 5.1 ########################## https://techsupport.services.ibm.com/server/aix.techTips?refNo=0274 get LatestFixData51 # /usr/sbin/compare_report -s -r /tmp/LatestFixData51 -l # ls -l /tmp/lower* -rw-r--r-- 1 root system 0 Feb 20 17:28 /tmp/lowerthanlatest1.r pt -rw-r--r-- 1 root system 0 Feb 20 17:28 /tmp/lowerthanmaint.rpt ab 5.2 smitty compare_report #################### # compare 2 machines #################### # lslpp -qLc >/tmp/lslpp_machine1.out copy this to the machine you want to compare # lslpp -qLc >/tmp/lslpp_machine2.out /usr/sbin/compare_report -b /tmp/lslpp_machine1.out -o /tmp/lslpp_machine2.out l -h -m -n If all reports (-l, -h, -m, and -n) are requested for this type of comparison, the following reports will be generated respectively: o baselower.rpt (generated with -l) o basehigher.rpt (generated with -h) o baseonly.rpt (generated with -m) o otheronly.rpt (generated with -n)

#################################### # update script fuer ml oder patches #################################### AIX 5 regatta1:/> file /usr/sbin/install_all_updates /usr/sbin/install_all_updates: shell script - ksh (Korn shell) regatta1:/> install_all_updates -? Usage: install_all_updates: Updates installed software to latest levels. install_all_updates -d [-picrnsxvNSYVD] -p = Preview only. -i = Update install utilities only. -r = Also update rpms if possible. -s = Skip recommended maintenance verification. -N = Skip updating install utilities first. -D = Script debug output. Installp specific option flags: -c = Commit updates. -n = Do not automaticly install requisites. -x = Do not expand automaticly. -v = Verify installation. -S = Suppress multi-volume processing. -V = Verbose output. # check install_all_updates -pYcd. # do install_all_updates -Ycd. ############################# # update rpm packages toolbox ############################# updtvpkg #################################### # restore particular file from mksysb ##################################### AIX 3 tctl -f /dev/rmt0 fsf 3 < moves tape forward from the mksysb files> tar -xvf /dev/rmt0 /etc/passwd < extracts the file > AIX 4 tctl -f /dev/rmt0 rewind restore -s4 -xqvf /dev/rmt0.1 ./var/spool/cron/crontabs/root Tapeinhalt mksysb anschauen # restore -s4 -Tvqf /dev/rmt0.1 tee filename oder # restore -s4 -Tvqf /dev/rmt0 > file what command will eject tape from tapedrive ? tctl -f /dev/rmt0 rewoffl mt -t device_file offl (will actually eject for a 4mm drive, will only take off line for a DLT) Determining a tape format It happens some time that you have an unlabeled backup tape which you don't know using which command this tape been created. This is a very easy way rather than attempting to read the tape directly with various backup command. Read a small portion of the tape using the "dd" command, then using

the "file" command to attempt to determine the format of the archive. For example : # dd if=/dev/rmt0 of=/tmp/tape.data count=4 4 + 0 records in. 4 + 0 records out. # file /tmp/tape.data /tmp/tape.data: tar archive ####################################### # doing remote mksysb without tapedrive ####################################### The mksysb script (which is also the savevg script BTW) needs to talk to a tape device. But you can edit a copy of the script, or just butcher it, to achieve what you want. If you want a bootable tape, you will have to emulate the script exactly - that is, create the four files needed and get them to the tape somehow. The first three files go on the tape with bs=512, the fourth, the backup itself, with bs=1024. Techniques like rsh remote "chdev -l rmt0 -a block_size=512" dd if=file1 bs=512 conv=sync rsh remote "dd of=/dev/rmt0.1 bs=512 conv=sync" (repeat for file 2 and file 3; note 0.1 for norewind tape device) rsh remote "chdev -l rmt0 -a block_size=1024" The above command often rewind the tape, so to avoid overwriting the first three files, skip past them after setting bs=1024. rsh remote "mt -f /dev/rmt0 rewind&&mt -f /dev/rmt0.1 fsf 3" Examine mksysb to see exactly how backup is fed - I don't have access just now, so I've put ... . Make f the last option on backup, follow with space and - to direct backup output to stdout, then pipe to rsh: find ... backup -{other options from mksysb}f - rsh remote "dd of=/dev/rmt0.1 bs=1024 conv=sy nc" ######################## # doing mksysb over pipe ######################## 1. mknod /tmp/.mksysb.pipe p 2. dd if=/tmp/.mksysb.pipe ssh servername dd of=/mksysb/filename & mksysb -e / tmp/.mksysb.pipe ############################ # exclude files from mksysb ############################ In the /etc/exclude.rootvg file, insert the names of the filesystems that you do not want backed up. Example: b508 spaldst /home/spaldst >cd /etc b508 spaldst /etc >ls -l exclude.rootvg

-rw-r--r-- 1 root system 54 Sep 13 07:36 exclude.rootvg b508 spaldst /etc >cat exclude.rootvg /mkcd/mksysb_image /mkcd/cd_fs /mkcd/cd_images /cdrom http://www-03.ibm.com/support/techdocs/atsmastr.nsf/84279f6ed9ffde6f86256ccf0065 3ad3/b75a2f3717807e9d86256fcd004ec329?OpenDocument http://www.dvddemystified.com/dvdfaq.html#4.3 Maxell DVD-RAM 4.7GB single sided, rewriteable media Part number 636070 Script to write mksysb to DVD echo '************************************************************' echo 'backup the rootVG volume group to DVD-RAM(daily copy)' now=`date` echo mksysb backup to DVD-RAM started on $now /usr/sbin/mkcd -U -d /dev/cd0 -P -V rootvg now=`date` echo mksysb nightly onsite backup to DVD-RAM completed on $now echo '************************************************************' ############################### # copy mksysb from tape to disk ############################### tctl -f /dev/rmt0 rewind tctl -f /dev/rmt0.1 fsf 3 dd if=/dev/rmt0.1 of=/mksysb/clone.image bs= ############## # listvgbackup ############## # listvgbackup -l -f /mksys/maschine/mksys-maschine-050317 VOLUME GROUP: rootvg BACKUP DATE/TIME: Thu Mar 17 23:30:03 NFT 2005 UNAME INFO: AIX maschine 3 4 0045C95A4C00 BACKUP OSLEVEL: 4.3.3.75 MAINTENANCE LEVEL: BACKUP SIZE (MB): SHRINK SIZE (MB): VG DATA ONLY: no # listvgbackup -l -f /mksys/maschine/mksys-maschine-041130 VOLUME GROUP: rootvg BACKUP DATE/TIME: Tue Nov 30 17:05:32 MEZ 2004 UNAME INFO: AIX maschine 2 5 0055CCFA4C00 BACKUP OSLEVEL: 5.2.0.40 MAINTENANCE LEVEL: 5200-03 BACKUP SIZE (MB): 29952 SHRINK SIZE (MB): 16886 VG DATA ONLY: no rootvg:

LV NAME hd5 hd6 hd8 hd4 hd2 hd9var hd3 hd1 hd10opt app01LV paging00 local01LV audit01LV hd7 hd77 app02LV oduct/8.1.7 app03LV oduct/9.2.0

TYPE boot paging jfs2log jfs2 jfs2 jfs2 jfs2 jfs2 jfs2 jfs2 paging jfs2 jfs2 dump dump jfs2 jfs2

LPs 1 9 1 1 88 33 32 1 1 32 7 10 2 119 119 80 144

PPs 1 9 1 1 88 33 32 1 1 64 7 10 2 119 119 160 288

PVs 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 2

LV STATE closed/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd

MOUNT POINT N/A N/A N/A / /usr /var /tmp /home /opt /usr/app/oracle N/A /usr/local /audit N/A N/A /usr/app/oracle/pr /usr/app/oracle/pr

##################### # doing remote backup ##################### Backup to a remote tape drive # rdump -fsystemwithdrive:/dev/rmt0 /data_to_backup OR # tar -cvBf - . rsh hostname dd of=/dev/rmt0 ibs=20 OR TO BACKUP # find ./home/username -print backup -iqvf- rsh remote_hostname dd ibs=1024 obs=1024 of=/dev/rmt1 # find ./ -print backup -iqvf- ssh idefix dd ibs=1024 obs=1024 of=/dev/rmt0 TO RESTORE cd "the appropriate directory for file that begin ./home/username" rsh remote_ho stname "dd if=/dev/rmt1 bs=1024" restore -xqvf # ssh remote copy to another machine with backup/restore # find ./ -print backup -iqvf- ssh idefix "cd to_be_restore && restore -xqvf -" ####################### # backing up raw-device ####################### Backing Up Raw Devices Use the dd command to back up raw devices. You should not overwrite the first 4KB block of a raw device, as the AIX Logical Volume Manager uses it. It is faster to back up with a block size of larger than 4KB. A good block size to use when backing up to tape is 256KB. The following is a sample script that can be used to back up/restore a raw device to tape: 1. To back up the raw device to tape: dd if=/dev/ of=/dev/rmt0.1 bs=256k 2. To restore the raw device from tape: dd if=/dev/rmt0.1 of=/dev/ count=63 seek=1 skip=1 bs=4k

mt -f /dev/rmt0.1 bsf 1 dd if=/dev/rmt0.1 of=/dev/ seek=1 skip=1 bs=256k ########################## # mksysb from disk to tape ########################## You could create a bootable tape with the mksysb image etc. on it, by using the commands: 1. bosboot -ad /dev/rmtx.1 2. mkinsttape /dev/rmtx.1 3. Use the tctl command to insert an EOF mark 4. Use dd to transfer the rootvg files from the disk file to tape. or in detail: http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixins/aixinsgd/creating_boot able_tapes.htm#ksxNj2a6ttay ############ # restore vg ############ VG-Infos wurden vorher mit Script austausch/betrieb/os/aix/scripte/vg_recovery gesichert. Die Dateien liegen dann unter /usr/local/vgdata/ Diese Infos koennen dann ueber restvg -q -f /usr/local/vgdata/vg01 zurueckgeholt werden. Da /usr/local in einem mksysb enthalten ist werden somit saemtliche Infos bezueg lich der anderen VG's mit aufgenommen. Creating information file for volume group ipasvgp05.. Creating list of files to back up Backing up 10 filesBacking up to /usr/local/vgdata/ipasvgp05 Cluster 51200 bytes (100 blocks). Volume 1 on /usr/local/vgdata/ipasvgp05 a c 265 ./ata/vgdata.files38786 a 265 ./tmp/vgdata/vgdata.files a 3758 ./tmp/vgdata/ipasvgp05/filesystems a 0 . a 4786 ./tmp/vgdata/ipasvgp05/ipasvgp05.data a 18 ./tmp/vgdata/ipasvgp05/logipasvgp05.map a 2700 ./tmp/vgdata/ipasvgp05/lvipasinfopool.map a 36 ./tmp/vgdata/ipasvgp05/testlv01.map a 36 ./tmp/vgdata/ipasvgp05/testlv02.map a 36 ./tmp/vgdata/ipasvgp05/testlv03.map total size: 11900 Done at Tue Oct 8 10:52:41 MSZ 2002; 100 blocks on 1 volume(s) 0512-038 savevg: Backup Completed Successfully. To restore the volume group image saved in /usr/local/vgdata/ipasvgp05 file onto the disks specified in the vgname.data file contained within the backup image, enter: restvg -f/usr/local/vgdata/ipasvgp05 Creating information file for volume group ipasvgp04. C

reating list ofk up Backing up 8 filesBacking up to /usr/local/vgdata/ipasvgp04 Cluster 51200 bytes (100 blocks). Volume 1 on /usr/local/vgdata/ipasvgp04 a 191 ./tmp/vgdata/vgdata.files39186 a 191 ./tmp/vgdata/vgdata.files a / 3758 ./tmp/vgdasvgp04/filesystems a 0 . a 2936 ./tmp/vgdata/ipasvgp04/ipasvgp04.data a 18 ./tmp/vgdata/ipasvgp04/logipasvgp04.map a 90 ./tmp/vgdata/ipasvgp04/lvsironp01.map a 90 ./tmp/vgdata/ipasvgp04/lvsironp11.map total size: 7274 Done at Tue Oct 8 10:52:56 MSZ 2002; 100 blocks on 1 volume(s) 0512-038 savevg: Backup Completed Successfully. To restore the volume group image saved in /usr/local/vgdata/ipasvgp04 file onto the disks specified in the vgname.data file contained within the backup image, enter: restvg -f/usr/local/vgdata/ipasvgp04 Creating information file for volume group ipasvgp03.. Creating list of files to back up Backing up 9 filesBacking up to /usr/local/vgdata/ipasvgp03 Cluster 51200 bytes (100 blocks). Volume 1 on /usr/local/vgdata/ipasvgp03 a 226 ./tmp/vgdata/vgdata.files34008 a 226 ./tmp/vgdata/vgdata.files a 3758 ./tmp/vgdata/ipasvgp03/filesystems a 0 . a 4764 ./tmp/vgdata/ipasvgp03/ipasvgp03.data a 17 ./tmp/vgdata/ipasvgp03/logipasvgp03.map a 6101 ./tmp/vgdata/ipasvgp03/lvipasp11.map a 3528 ./tmp/vgdata/ipasvgp03/lvipasp12.map a 1476 ./tmp/vgdata/ipasvgp03/lvipasp13.map total size: 20096 Done at Tue Oct 8 10:53:44 MSZ 2002; 100 blocks on 1 volume(s) 0512-038 savevg: Backup Completed Successfully. To restore the volumye group image s/usr/local/vgdata/ipasvgp03 file onto the di sks specified in the vgname.data file contained within the backup image, enter: restvg -f/usr/local/vgdata/ipasvgp03 Creating information file for volume group ipasvgp02.. Creating list of files to back up Backing up 9 filesBacking up to /usr/local/vgdata/ipasvgp02 Cluster 51200 bytes (100 blocks). Volume 1 on /usr/local/vgdata/ipasvgp02 a 226 ./tmp/vgdata/vgdata.files38848 a 226 ./tmp/vgdata/vgdata.files a 3758 ./tmp/vgdata/ipasvgp02/filesystems a 0 . a 4743 ./tmp/vgdata/ipasvgp02/ipasvgp02.data a 17 ./tmp/vgdata/ipasvgp02/logipasvgp02.map a 5967 ./tmp/vgdata/ipasvgp02/lvipasp01.map a 3332 ./tmp/vgdata/ipasvgp02/lvipasp02.map a 1394 ./tmp/vgdata/ipasvgp02/lvipasp03.map total size: 19663

Done at Tue Oct 8 10:54:30 MSZ 2002; 100 blocks on 1 volume(s) 0512-038 savevg: Backup C5ompleted Succes. To restore the volume group image saved in /usr/local/vgdata/ipasvgp02 file onto the disks specified in the vgname.data file contained within the backup image, enter: restvg -f/usr/local/vgdata/ipasvgp02 Creating information file for volume group ipasvgp01. Creating list of files to back up .. Backing up 8 filesBacking up to /usr/local/vgdata/ipasvgp01 Cluster 51200 bytes (100 blocks). Volume 1 on /usr/local/vgdata/ipasvgp01 a 190 ./tmp/vgdata/vgdata.files34022 a 190 ./tmp/vgdata/vgdata.files a 3758 ./tmp/vgdata/ipasvgp01/filesystems a 0 . a 2905 ./tmp/vgdata/ipasvgp01/ipasvgp01.data a 17 ./tmp/vgdata/ipasvgp01/logipasvgp01.map a 833 ./tmp/vgdata/ipasvgp01/lvoraclep01.map a 102 ./tmp/vgdata/ipasvgp01/lvuc4p01.map total size: 7995 Done at Tue Oct 8 10:55:09 MSZ 2002; 100 blocks on 1 volume(s) 0512-038 savevg: Backup Completed Successfully. To restore the volume group image saved in /usr/local/vgdata/ipasvgp01 file onto the disks specified in the vgname.data file contained within the backup image, enter: restvg -f/usr/local/vgdata/ipasvgp01 xipasp01#pwd /usr/local/vgdata xipasp01#ll total 520 -rw-r--r-- 1 root system 51200 Oct 08 10:55 ipasvgp01 -rw-r--r-- 1 root system 51200 Oct 08 10:54 ipasvgp02 -rw-r--r-- 1 root system 51200 Oct 08 10:53 ipasvgp03 -rw-r--r-- 1 root system 51200 Oct 08 10:52 ipasvgp04 -rw-r--r-- 1 root system 51200 Oct 08 10:52 ipasvgp05 ###################### # remote copy with tar ###################### cd basedir ; tar cvf - dirtocopy cd basedir ; tar cvf - dirtocopy

(ssh -q user@floyd "cd basedir ; tar xfBF -") (ssh -q user@floyd "cd basedir ; tar xvf -")

##################### # local copy with tar ##################### tar -cf - . (cd destdir; tar vpxf -) ######################## # copy with ssh and cpio ######################## find basedir -depth -print cpio -oc \ ssh2 -q remote@floyd "cd basedir && cpio -icmlMudv" # l --> create links # m --> modifikation-time files bleibt erhalten # M --> modifikation-time dirs bleibt erhalten # d --> create dirs

# u --> An older filer replaces newer # v --> verbose bash-2.03$ find . -depth -print cpio -oc /usr/local/bin/ssh -q root@verleihni x-filer.intern.rzag.net "cd /var/log/twelogbackup && cpio -icmlMudv" ########################## # tar without inbound gzip ########################## gzip -dc xyz.tar.gz tar xvf ################ # tar with xargs ################ ls /usr/bin/xargs /opt/freeware/bin/tar -czvf /oracle/E03/tmp/logarch.tar.gz ######### # ramdisk ######### mkramdisk 40000 ls -l /dev grep ram mkfs -V jfs /dev/ramdiskx mkdir /ramdiskx mount -V jfs -o nointegrity /dev/ramdiskx /ramdiskx where x is the logical RAM disk number. To remove a RAM disk, use the rmramdisk command. RAM disks are also removed when the machine is rebooted. ####################### # mksysb auf filesystem ####################### aixinstall0:/# /usr/bin/mksysb '-e' '-i' /mksysb/aixinstall2.20010516.obj -e --> exclude.rootvg Inhalte werden nicht mitgesichert ################ # mksysb auf dvd ################ /usr/sbin/mkcd -L -d '/dev/cd0' -M '/mksbcd/backup_image' -C '/mksbcd/cd_fs' -I '/mksbcd/cd_images' -V 'rootvg' ############################# # mkcd nur bootimage erzeugen ############################# # cd /var/adm/ras # ls ./bosinst.data ./images.data

backup -ivqf /tmp/520ML04.img

# mkcd -m /tmp/520ML04.img -S -V app01VG Initializing mkcd log: /var/adm/ras/mkcd.log... Verifying command parameters... Creating temporary file system: /mkcd/cd_fs... Populating the CD or DVD file system... 0512-323 mkcd: The following files are required for the creation of the CD or DVD image and are not available on the source system: /usr/lib/drivers/pci/qfcdd devices.pci.77101223.rte /usr/lib/drivers/pci/qfcddpin devices.pci.77101223.rte /usr/lib/drivers/qfscsidd devices.pci.77101223.rte /usr/lib/drivers/qfscsiddpin devices.pci.77101223.rte /usr/lib/drivers/usb/usbfd devices.usbif.080400.rte /usr/lib/drivers/usb/usbcd devices.usbif.08025002.rte /usr/lib/drivers/usb/usbcdpin devices.usbif.08025002.rte

/usr/lib/methods/cfgcdrom_usb devices.usbif.08025002.rte /usr/lib/methods/cfgfd_usb devices.usbif.080400.rte /usr/lib/methods/cfgqfc devices.pci.77101223.rte /usr/lib/methods/cfgqfscsi devices.pci.77101223.rte The files can be installed from the listed filesets. 0512-321 mkcd: Error populating the CD or DVD file system using the /usr/lpp/bosinst/cdfs.optional.list proto file. ####################### # restore informationen ####################### It is 'backup' format. You can list with 'restore' like : restore -Tqvf /dev/rmtxx ################## # test mksysb-tape ################## AIX V4: The mksysb tape has 4 images on it: -----------------------------------------------------------boot image install image empty TOC system backup image -----------------------------------------------------------To test the first 3 images, use the following commands. All this does is checks for tape media errors. If you want to be absolutely sure, boot the tape. # The first 3 images are always written in 512 byte blocks # chdev -l rmt0 -a block_size=512 dd if=/dev/rmt0.1 of=/dev/null dd if=/dev/rmt0.1 of=/dev/null dd if=/dev/rmt0.1 of=/dev/null To test the 4th image, use the commands: # The system backup image is written at whatever block size the # tape device was set to when the mksysb was made. You might # assume 512 and skip the commands up through 'chdev' and the # optional 'ibs' parameter to dd in the subsequent section. If # you do and the block size is not 512, you'll get an I/O error. # tctl rewind restore -xqvf /dev/rmt0.1 -s2 ./tapeblksz chdev -l rmt0 -a block_size=$(awk '{ print $1 }' tapeblksz) dd if=/dev/rmt0 [ibs=$(awk '{ print $1 }' tapeblksz)] restore -Tqf- >/dev/null ######### # tar ######### AIX-tar /usr/bin/tar -L tar.include -cvf /backup/backup.tar gnu-tar

/usr/local/bin/tar -czvf /dev/rmt0 --files-from ./files.2000 wobei files.2000 die Namen der zu sichernden Dateien enthaelt standard-tar find /data -name "200012*" -print > /tmp/tar.include tar -czvf /backup/backup.tgz -I /tmp/tar.include gtar -czvf /backup/backup.tgz -T /tmp/tar.include ############################################### # translation from characterset to characterset ############################################### iconv -f ISO8859-2 -t IBM-852 original > translated ############################## # determine big fs oder normal ############################## Try lsfs -q file-system-name. For example, lsfs -q /home Name Nodename Mount Pt VFS Size Options Auto Accounting /dev/hd1 -/home jfs 409600 -- yes no (lv size: 409600, fs size: 409600, frag size: 4096, nbpi: 4096, compress: no, bf: false, ag: 4) The attribute "bf" seems to indicate whether large file is enabled or not. "ag" is related to allocation group. ######################### # vi command completition ######################### AFAIR it must be \ (antislash) to do filename completion in vi mode. I like much vi editor for all its capabilities (buffers...), but I personnaly find that the emacs mode is much more user friendly for line editing in ksh. One of its greatest interest is almost undocumented : you may have aliases to use the arrow keys for line editing. Try these five lines in your .kshrc (or whatever filename your ENV variable contains) : set -o emacs alias __A=^P # cursor up alias __B=^N # cursor down alias __C=^F # cursor right alias __D=^B # cursor left The first __ (double _) replaces the ^[ sent by the vt100 mode function keys in 7bits mode. The followings are CONTROL-letter characters (one char only) that you insert in vi with CTRL-V+CTRL-letter. After that log again and you may use the arrow keys to navigate in the commands history and through the lines. You may never wanna come back to vi mode... ######################## # ksh command completion ######################## ksh can do this too: esc + \ --> completes the command esc + = --> gives a list of options with full path

############### # topas auf aix ############### topas im Paket perfagent topas -P # aehnlich top topas -C # Cross Partion - ueber alle Partions topas -L # Partion view topas -W # Workloadmanger ################# # monitor auf aix ################# monitor -Toplog -log /var/adm/monitor_colon05.log #################### # manuell cd mounten #################### crfs -v cdrfs -p ro -d'cd0' -m'/cdrom' ##################### # default TERM setzen ##################### In the /etc/profile I added TERM_DEFAULT=vt200. ########################## # reject maintenance level ########################## when you install the maintenance level, use

smitty update_all

for the COMMIT software updates? line, select no This will APPLY the updates (make a backup of the old level) If for some reason the new stuff doesnt work, you can revert back to the old level using: smitty reject ########################### # install maintenance level ########################### smitty update_all Einzelne Fixes installieren smitty update_by_fix Fixe auflisten smitty install_list_problems ################## # login verhindern ################## touch /etc/nologin ######################### # failed logins ermitteln ######################### /usr/sbin/acct/fwtmp < /etc/security/failedlogin

more

oder who /etc/security/failedlogin sudo bash -c "/usr/sbin/acct/fwtmp < /etc/security/failedlogin" ################## # wtmp verkleinern ################## # /usr/lib/acct/fwtmp < /var/adm/wtmp > /tmp/wtmp.tmp # tail -1000 /tmp/wtmp.tmp > /tmp/wtmp.tmp1 # /usr/lib/acct/fwtmp -ci < /tmp/wtmp.tmp1 >/var/adm/wtmp # wtmp lesen # /usr/sbin/acct/fwtmp /tmp /bla && mail -s login_failure [email protected] find . -type f \( -mtime 59 -o -mtime 424 \) -ls awk '{ s += $7 } END {print "sum is",s, "average is", s/NR }' sum is 948425019 average is 3.37518e+06 Q: I want to find all files in the / filesystem. But not the files in /prod/anot herfilesystem and /var etc. /prod is a directory, not a fs. /var is a fs too. A: find / -xdev Q: I want to list all files in one dir, but not the files in subdirs. A: find /dir -type f ####################### # fiberchannel settings ####################### # show settings of an attribute # lsattr -El fcs0 bus_intr_lvl 323 Bus interrupt level Fals e bus_io_addr 0xdf800 Bus I/O address Fals e bus_mem_addr 0xe8081000 Bus memory address Fals e init_link al INIT Link flags True intr_priority 3 Interrupt priority Fals e lg_term_dma 0x800000 Long term DMA True max_xfer_size 0x200000 Maximum Transfer Size True num_cmd_elems 200 Maximum number of COMMANDS to queue to the adapter True pref_alpa 0x1 Preferred AL_PA True sw_fc_class 2 FC Class for Fabric True # lsattr -El fcs0 -R -a max_xfer_size 0x100000 0x200000 0x400000 0x800000 0x1000000 # change direct (vol must be offline) # chdev -l fcs0 -a max_xfer_size=0x200000 # nur odm change # chdev -l fcs0 -P -a max_xfer_size=0x100000 (default)

# # # # #

chdev chdev chdev chdev chdev

-l -l -l -l -l

fcs0 fcs0 fcs0 fcs0 fcs0

-P -P -P -P -P

-a -a -a -a -a

max_xfer_size=0x200000 # 2GB max_xfer_size=0x400000 # 4GB max_xfer_size=0x800000 # 8GB max_xfer_size=0x1000000 # 10GB lg_term_dma=0x800000 (0x800000)

# lsattr -El fcs0 -R -a num_cmd_elems 20...2048 (+1) DS4k Clariion # chdev -l fcs0 -P -a num_cmd_elems=400 #(default 200) DS8k # chdev -l fcs0 -P -a num_cmd_elems=1024 #(default 200) # lsattr -El fscsi0 attach switch How this adapter is CONNECTED False dyntrk no Dynamic Tracking of FC Devices True fc_err_recov fast_fail FC Fabric Event Error RECOVERY Policy True scsi_id 0x10900 Adapter SCSI ID False sw_fc_class 3 FC Class for Fabric True # chdev -l fscsi0 -P -a fc_err_recov=fast_fail (default delayed_fail) # lsattr -El fcnet0 enable_farp yes Use Fiber Channel Address Resolution Protocol True num_q_bufs 75 Maximum Number of HOST buffers to queue to adapter True sw_fc_class 3 FC Class for Fabric True ################################ # disk settings for fiberchannel ################################ # lsattr -El vpath0 active_hdisk hdisk4/75235512325/fscsi2 se active_hdisk hdisk2/75235512325/fscsi0 se active_hdisk hdisk3/75235512325/fscsi0 se active_hdisk hdisk5/75235512325/fscsi2 se policy df e pvid 00025eb562b8fd8d0000000000000000 se qdepth_enable yes e serial_number 75235512325 se unique_id 210C37523551232507210790003IBMfcp se ############################# # network statistics loeschen ############################# # netstat -Zi ####################### # flags bei netstat -nr ####################### U Up.

Active hdisk Active hdisk Active hdisk Active hdisk Scheduling Policy Physical volume identifier Queue Depth Control LUN serial number

Fal Fal Fal Fal Tru Fal Tru Fal

Device Unique Identification Fal

H The route is to a host rather than to a network. G The route is to a gateway. D The route was created dynamically by a redirect. M The route has been modified by a redirect. L The link-level address is present in the route entry. c Access to this route creates a cloned route. This field only applies to AIX Version 4.2.1 or later. W The route is a cloned route. This field only applies to AIX Version 4.2.1 or later. (1) Protocol specific routing flag #1. (2) Protocol specific routing flag #2. (3) Protocol specific routing flag #3. (b) The route represents a broadcast address. (e) Has a binding cache entry. (l) The route represents a local address. (m) The route represents a multicast address. (P) Pinned route. (R) Host or net unreachable. (S) Manually added. (u) Route usable. ################################ # netstat routing table ausgeben ################################ # netstat -C Routing tables Destination Gateway

Flags

Refs

Use If 709388 en0 7 lo0 286 lo0 0 lo0

Cost Config_Cost 0 0 0 0 0 0 0 0

Route Tree for Protocol Family 2 (Internet): 10.50.5/24 aix_52_test U 10 aix_52_test loopback UGHS 2 127/8 loopback U 8 Route Tree for Protocol Family 24 (Internet v6): ::1 ::1 UH 0 #################################### # netmask einstellungen herausfinden #################################### lsattr -El en0 -a netmask -F value root@cws [~]# lsattr -El en0 -a netmask -F value

255.255.255.0 ##################### # interface erstellen ##################### smitty mkinet1en oder NETADDR=10.50.11.22 NETMASK=255.255.255.0 BROAD=10.50.11.255 chdev -l en2 -a netaddr='10.50.11.22' -a netmask='255.255.255.0' -a broadcast='1 0.50.11.255' oder mkdev -c if -s EN -t en -a netaddr='10.50.11.22' -a netmask='255.255.255.0' -w ' en2' -a state='up' -a arp='on' -a broadcast='10.50.11.255' ################################ #alias definieren fuer Interface ################################ ifconfig en0 alias Check ifconfig en0 or netstat -i after addition/removal to make sure that it has been created/removed. chdev -l en1 -a alias4=172.28.64.129,255.255.255.0 ##################################### # check welche aliases sind definiert ##################################### for i in `ifconfig -a grep -w inet grep -v 127.0.0.1 awk '{print $2}'` do host $i done ############### #alias loeschen ############### ifconfig en0 delete 20.9.167.45

- this is to remove the alias

chdev -l en1 -a delalias4=172.28.64.129,255.255.255.0 ############################# # interface andere ip-adresse ############################# ifconfig en0 down chdev -l en0 -a netaddr='10.0.0.1' ifconfig en0 up oder chdev chdev chdev chdev -l -l -l -l en0 en0 en0 en0 -a -a -a -a state=down state=detach netaddr='10.0.0.1' state=up

oder ohne aenderung am interface aber mit aenderung in der ODM chdev -l en0 -P -a netaddr='10.0.0.1'

############################################# # interface andere geschwindigkeit einstellen ############################################# ifconfig en? down detach chdev -l en? -a media_speed=100_Full_Duplex 10_Half_Duplex 10_Full_Duplex 100_Half_Duplex 100_Full_Duplex Auto_Negotiation ifconfig en? up REBOOT REQUIRED? NO OR Take the adapter down and detach it: ifconfig en0 detach chdev -a media_speed=100_Full_Duplex ent0 @ This point you can ifconfig it up, but you will have to put in all the informa tion ( IP,SM ) for it come up right. ifconfig en0 netmask < if not base on s egment > up I prefer to do a smitty chinet, select en0, and make sure the information is correct to bring it up. ################# # vipa interfaces ################# virtuelle interfaces welches ueber mehrere andere netzbeine gelegt wird. Beispiel: en0=192.168.1.x en1=192.168.2.x vi0=192.168.3.x http://www16.boulder.ibm.com/pseries/en_US/aixbman/commadmn/tcp_vipa.htm mkdev -c if -s VI -t vi -a netaddr='172.31.109.101' -a netmask='255.255.255.0' w 'vi0' -a state='up' # mit zuweisung interfaces mkdev -c if -s VI -t vi -a netaddr='172.31.109.101' -a netmask='255.255.255.0' w 'vi0' -a state='up' -a interface_names='en0,en2' lsdev -HCc if -F 'name class subclass type status description' ################## # config interface ################## INTERFACE=en0 INTERFACE=en1 IP= BC= # gigabit chdev -l $INTERFACE -a netaddr=$IP chdev -l $INTERFACE -a netmask=255.255.255.0 chdev -l $INTERFACE -a broadcast=$BC

chdev chdev chdev chdev

-l -l -l -l

$INTERFACE $INTERFACE $INTERFACE $INTERFACE

-a -a -a -a

tcp_nodelay=1 tcp_recvspace=655350 tcp_sendspace=655350 state=up

####################### # restore static routes ####################### If you lose any routes ( static ) they can be restored by doing a: mkdev -l inet0 ################################################################### # routen die beim anlegen des interfaces automatisch erzeugt werden ################################################################### route add -net 10.42.1/24 10.42.1.10 route add 10.42.1.10 loopback ###################################### # routingtable flushen und neu anlegen ###################################### route -f mkdev -l inet0 ######################## # defaultroute eintragen ######################## /usr/sbin/chdev -l inet0 -a route=net,-hopcount,1,-netmask,255.255.255.0,0,172.3 1.64.1 /usr/sbin/chdev -l inet0 -a route=net,-hopcount,1,-netmask,255.255.255.0,0,10.42 .1.1 ####################### # defaultroute loeschen ####################### /etc/route -n -f; odmdelete -o CuAt -q "name=inet0 and attribute=route";savebase ##################### # netzroute eintragen ##################### chdev -l inet0 -a route=net,-hopcount,1,-netmask,255.255.255.0,172.31.16.0,172.3 1.64.1 ################################### # route von einer maschine kopieren ################################### lsattr -El inet0 grep route awk '{ print $2 }' > /tmp/routes move /tmp/routes to the target system and run this command : for RR in $(cat /tmp/routes) do chdev -l inet0 -a route=$RR done ##################### # hostroute erstellen ##################### chdev -l inet0 -a route=,-hopcount,,,, Beispiel: Einrichten einer Hostroute von 164.61.197.27 uerb Default-Gateway der MGI

chdev -l inet0 -a route=host,-hopcount,1,,164.61.197.27,193.168.131.20 chdev -l inet0 -a route=host,-hopcount,1,,172.26.241.12,172.31.64.1 #################### # hostroute loeschen #################### chdev -l inet0 -a delroute=host,,172.26.129.23,172.28.64.19 Beispiel: # chdev -l inet0 -a delroute=host,,172.26.129.23,172.28.64.19 inet0 changed ################ # route loeschen ################ chdev -l inet0 -a delroute=net,-netmask,255.255.255.0,172.26.129.23,172.28.64.19 chdev -l inet0 -a delroute=net,-netmask,255.255.0.0,172.26.0.0,172.31.64.18 ##################### # route informationen ##################### odmget -q attribute=route CuAt And if you change it in the odm, you have to do a bosboot. So just change it with chinet/smit. ########################## # mac-adresse herausfinden ########################## entstat grep Hardware Address Hardware Address: 00:06:29:c3:49:07 oder entstat ent0 grep "Hardware Address" tr -d ":" oder entstat -d ent1 grep ardw awk '{print $3}' sed '1,$s/://g' #################### # display open ports #################### netstat -af inet ############################################### # display tcp sockets in Listen and udp in wait ############################################### lsof -i egrep "COMMAND LISTEN UDP" lsof -i @ lsof -i : ################################ # eintraege in inittab erstellen ################################ Shutdown commands can be put into /etc/rc.shutdown. For startup I do the following to tell AIX about an /etc/rc.local script: /etc/rc.shutdown MUST be executable! mkitab -i rcnfs "rclocal:2:wait:/etc/rc.local >/dev/console 2>&1"

################# # shutdown script ################# /etc/rc.shutdown is the place to put things for shutdown: ! su - dba = 4k. Failure to implement these agblksize guidelines i s likely to result in a severe performance penalty. # Do not under any circumstances, use CIO mount option for the filesystem contai ning the Oracle binaries (!!!). Additionally, do not use DIO/CIO options for fil esystem containing archive logs or any other files not already discussed. #################################### # defragmentiere alle gemounteten fs #################################### for i in `df grep -v Mounted awk '{print $7}'` do defragfs $i done #################### # defrag pagingspace #################### Paging space hd6 on volume group rootvg is fragmented reorgvg rootvg hd6 ###################### # creating large files ###################### 1. Create a 1GB file: /usr/sbin/lmktemp filename1 10737418424 2. Create a second 1GB file: cp filename1 filename2 3. To create a 2GB file, append the first file to the second file: cat filename1 >> filename2 4. To create a 3GB file, append the first file to the second file again: cat filename1 >> filename2 #################### # find growing files ####################

find . -type f -xdev -ls ore

awk '{print $7" "$8" " $9" "$10" "$11}'

sort -rn m

############## # enable quota ############## lslpp -l grep bos.sysmgt.quota umount /home chfs -a "quota = userquota,groupquota" /home mount /home edquota -u user_who_gets_quota quotaon -u /home quotacheck /home ########################### # managing hang print queue ########################### - one device has "dev/wait" lpstat - stop spooler stopsrc -c -s qdaemon - spooler down? lssrc -s qdaemon - checken der queue lpstat oder lpstat -W (detailed) oder enq -sA - in spool-verzeichnis schauen cd /var/spool/lpd/stat ls -al p* cat /var/spool/lpd/stat/p.lpforu.lp0 - in prozesstabelle nach prozess schauen ps -ef grep `cat /var/spool/lpd/stat/p ` - killen - start spooler startsrc -s qdaemon ################# # cancel printjob ################# qcan -Plpforu -xJOBnummer oder cancel JOBnummer ############################## # default systemdrucker setzen ############################## smitty qdefault oder /usr/lib/lpd/pio/etc/piochdfq -q 'xyz'

oder export LPDEST=xyz ########################### # change ascii pass through ########################### /usr/lib/lpd/pio/etc/piochpq -q 'DRUCKERNAME' -d 'HOSTNAME' -d 'a' oder /usr/lib/lpd/pio/etc/piochpq -q 'DRUCKERNAME' -d 'HOSTNAME' -d 'p' ########################################## # Migrating Print Queues to Another System ########################################## 1. copy the /etc/qconfig (make a copy of the original before) 2. Copy the following files: /var/spool/lpd/pio/@local/custom/* /var/spool/lpd/pio/@local/dev/* /var/spool/lpd/pio/@local/ddi/* 3. change the permissions on the copied files to 664 chmod 664 filename 4. redigest the queue's enq -d 5. run the chvirprt command on each queue chvirprt -q -d Note: If you have a lot of queues, the best thing is to create a short scri pt to do this for you. I grab the queue name and device name by running lsallq -c and saving it to a file. 6. cycle the printer subsystem stopsrc -cg spooler startsrc -g spooler ########################## # create new printer queue ########################## /usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'generic' -D asc -q print38 h '53.239.67.32' -x 9100 Make sure you edit /etc/host and enter queue name and ipaddress Print38 53.239.67.32 Then issue stopsrc -s qdaemon ; startsrc -s qdaemon ################################################ # setting up remote printing form solaris to aix ################################################ I have set up a remote print que on our AIX server2 wich uses AIX server1's loca l que successfully. servers1,s qconfig entry is >lp4: > device = lp0 >lp0: > file = /dev/lp0 > header = never > trailer = never > access = both > backend = /usr/lib/lpd/piobe I have set up another remote que on the sun solaris 5.5.1 machine to use AIX ser ver1,s local que. using 'lpadmin -p rempri -s server1!lp4 -T unknown -I any'

this looks OK until I try 'lpstat -p', it gives me 'printer rempri faulted. enabled since Mon..... . available. system not responding.' You left out three commands. Here is the full procedure: lpsystem -t bsd server1 lpadmin -p rempri -s server1\!lp4 -T unknown -I any enable rempri accept rempri The lpsystem, enable, and accept commands are needed on Solaris 2.5.1 (SunOS 5.5.1) and previous, unless you have the SunSoft Print Client (SSPC) package installed. Solaris 2.6 and later, or machines with SSPC, only need the lpadmin command. ################################################ # moving print queues from one to another system ################################################ This is how you do it in AIX : Migrating Print Queues to Another System 1. copy the /etc/qconfig (make a copy of the original before) 2. Copy the following files: /var/spool/lpd/pio/@local/custom/* /var/spool/lpd/pio/@local/dev/* /var/spool/lpd/pio/@local/ddi/* 3. change the permissions on the copied files to 664 chmod 664 filename 4. redigest the queue's enq -d 5. run the chvirprt command on each queue chvirprt -q -d Note: If you have a lot of queues, the best thing is to create a short script to do this for you. I grab the queue name and device name by running lsallq -c and saving it to a file. 6. cycle the printer subsystem stopsrc -cg spooler startsrc -g spooler ################### # print queue start ################### smitty qstart oder qadm -U QueueName ################## # print queue stop ################## smitty qstop

oder qadm -D QueueName ######################### # set default print queue ######################### smitty qdefault oder /usr/lib/lpd/pio/etc/piochdfq -q ########################## # hold a job or printqueue ########################## smitty qhld oder qlhd -# JOBNUMMER qhld -P QUEUENAME qhld -u USERNAME #################### # release a printjob #################### qlhd -r -# JOBNUMMER qhld -r -P QUEUENAME qhld -r -u USERNAME ############################## # move printjob between queues ############################## smit qmov oder qmov -m DestinationQueue -# JobNumber qmov -m DestinationQueue -P Queue qmov -m DestinationQueue -u User ############################ # list all supported printer ############################ lsdev -P -c printer -F "type subclass description" ########################### # list all defined printers ########################### lsdev -C -c printer sort -u ######################### # check queue qchk lpstat ######################### # qchk -A Queue Dev Status Job Files User PP % Blks Cp Rnk ------- ----- --------- --- ------------------ ---------- ---- -- ----- --- --pcl7872 hp@hp READY QUEUED 1 STDIN.20880 root 7 1 1 ps78720 hp@hp READY ############## # qprt options ############## -q quality 0 Fast font

sort -u

1 Draft quality 2 Near letter quality 3 Enhanced quality 300 300 dots per inch (dpi) 600 600 dpi -#{j h v} Specifies a special functionality. The possible values for the Value variable are: j Displays a job number for the specified print job. H Queues the print job but holds it in a HELD state. v Validates the specified printer backend flag values. As part of the validation process, the command performs legality checking for illegal flag values, type checking, range checking, list checking, and other types of validation. Typically, the validation of backend flag values is useful because illegal flags are identified when the print job is submitted rather than at a later stage when the print job is processed. -d input data a Extended ASCII c PCL d Diablo 630 g Hewlett-Packard GL p Pass-through (sent to printer unmodified) s PostScript -j Init Initializes the printer before each file is printed. You can specify any of the following: 0 No initialization 1 Full initialization 2 Emulator selection only -O PaperHand Sets the type of input paper handling to one of the following: 1 Manual (insert one sheet at a time) 2 Continuous forms 3 Sheet feed -Y Duplex Sets duplexed output. Duplexed output uses both the front and back of each sheet of paper for printing. You can set one of the following: 0 Simplex 1 Duplex, long edge binding 2 Duplex, short edge binding ##################### # No login name found ##################### Found this on the IBM Website after doing a search on "no login name found" [1]http://www-1.ibm.com/support/docview.wss?uid=aix1d689ba01c7447fc285256cdb007d f019 0781-111 * No login name found * This problem often occurs during the process of trying to cancel jobs to remote system, especially with Windows/NT servers when using AIXSHORT for stat filter. Be sure to use bsdshort and bsdlong.

* Clear unwanted files out of /var/spool/lpd/qdir. These frequently give this problem. * Remove /etc/qconfig.bin, and rerun lpstat. ##### # ntp ##### /etc/ntp.conf server 172.28.2.8 --> btr008 ntpdate 172.28.2.8 --> sychronisiert die Zeit setclock 172.28.2.8 --> tut dasselbe ntpq -p --> zeigt infos an # ntpq -p remote refid st t when poll reach delay offset disp ============================================================================== *colonia.sp.medi LOCAL(2) 4 u 41 64 377 1.19 0.326 0.03 ################ # 32 oder 64 bit ################ To find out if server is running 32 or 64 bit enter; # bootinfo -K 32 find out machine supports 64-bit enter bootinfo -y The 64-bit support is in bos.64bit. lslpp -L bos.64bit. or check for the presence of the line "load64bit" in your inittab. load64bit:2:once:/etc/methods/cfg64 >/dev/console 2>&1 # Enable 64-bit execs To truly change the kernel to 64-bit, you need to be at the 5.1 oslevel. The mea ns to change to a 64-bit kernel are: From 32-bit to 64-bit: ln -sf /usr/lib/boot/unix_64 /unix ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix lslv -m hd5 bosboot -ad /dev/hdisk0 bosboot -ad /dev/hdisk1 shutdown -Fr bosboot -ad /dev/ipldevice # als alternative To change the kernel back to 32-bit: From 64-bit to 32-bit: Monoprozessor: ln -sf /usr/lib/boot/unix_up /unix ln -sf /usr/lib/boot/unix_up /usr/lib/boot/unix lslv -m hd5 bosboot -ad /dev/ipldevice shutdown -Fr Multiprozessor: ln -sf /usr/lib/boot/unix_mp /unix ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix

lslv -m hd5 bosboot -ad /dev/ipldevice shutdown -Fr ################### # ipldevice corrupt ################### 0514-508 Cannot save the base customized information on /dev/ipldevice ipldevice neu anlegen bosboot -ad /dev/hdiskx savebase -v cd /dev rm ipldevice ln /dev/rhdiskx /dev/ipldevice ################################## # groesse einer Platte feststellen ################################## bootinfo -s hdisk0 #################### # anzahl prozessoren #################### bootinfo -z aixinstall0:/export/conf#bootinfo -z 0 Running this command returns one of the following: 0 = up (single processor) or 1 = mp (multiprocessor). #################### # determing platform #################### aixinstall0:/export/conf#bootinfo -T rspc ######################### # determing boot platform ######################### aixinstall0:/export/conf#bootinfo -p rspc or lscfg -vp grep Arch ################# # last bootdevice ################# root@cws [~]# bootinfo -b hdisk0 ######################## # change / show bootlist ######################## to modify the bootlist where x is either 0 or 1, then reboot. Type: change the bootlist bootlist -m normal hdiskx cd0 rmt0 netboot

bootlist -m normal ent0 hdisk0 list the bootlist bootlist -m normal -o oder # ipl_varyon -i PVNAME BOOT DEVICE hdisk0 YES hdisk1 NO PVID 0045cfaa54ca198e 0045cfaa70510c0a VOLUME GROUP ID 0045cfaabb9ec85b 0045cfaabb9ec85b

##################################### # check from which disk last boot was ##################################### # bootinfo -b #################### # bootblock loeschen #################### mkboot -c -d /dev/hdisk0 -->to clear the boot image off a defective disk ########################## # bosboot bootlv erstellen ########################## 1. To create a boot image on the default boot logical volume on the fixed disk from which the system is booted, enter: bosboot -a 2. To create a bootable image called /tmp/tape.bootimage for a tape device, enter: bosboot -ad /dev/rmt0 -b /tmp/tape.bootimage 3. To copy a given tape boot image to a tape device, enter: bosboot -w /tmp/tape.bootimage -d rmt0 4. To create a boot image file for an Ethernet boot, enter: bosboot -ad /dev/ent0 -M both 5. To create an uncompressed boot image for a hard disk /dev/hdisk1, enter: bosboot -ad /dev/hdisk1 -U 6. To create a token ring boot image for a machine whose hardware platform type is rspc while you are running on a machine whose hardware platform type is rs6k, enter: bosboot -ad /dev/tok -T rspc ################# # shutdown system ################# maintenance shutdown -m reboot shutdown -Fr ###################### # remote reboot string ######################

# find out which tty is used for console # grep cons /etc/inittab # lscons -a # odmget -q 'attribute=reboot_string AND name=tty0' CuAt # chdev -l 'tty0' -a reboot_enable='reboot' -a reboot_string='#@pw@#' -P aktivieren ueber Eingabe des Strings an der Console If you set the REMOTE reboot enable parameter to reboot or dump, once the chosen character sequence is typed on the terminal attached to the TTY device, the character sequence will be erased and a prompt (>) will be presented. You have the following two options at this prompt: - Press 1 on the keyboard Instructs the AIX kernel to perform a defined action (reboot or dump). - Press any other key The typed remote reboot string reappears on the screen as if you just typed it now. Therefore, nothing will happen, and the current session on this terminal will continue to be available. ################## # times for a file ################## "ls -l" shows atime "ls -lc" shows ctime "ls -lm" shows mtime "istat filename" will show all three. $ istat bb18b3.tar.gz Inode 20 on device 10/9 File Protection: rw-r--r-Owner: 100(bb) Group: 100(bb) Link count: 1 Length 427247 bytes Last updated: Tue Aug 14 11:01:46 2001 Last modified: Thu Jun 21 07:36:32 2001 Last accessed: Thu Nov 01 20:38:46 2001 ########################### # datei auf welcher platte? ########################### fileplace -p foo.dbf when you have the information about the filename or his inode I think you can determine the pv and the file-location with the following command: fileplace -piv ######## # ncheck ######## List i-Nodes in Dirs ncheck -a /VZ List Filenames from Inodes ncheck -i INODENR INODENR /VZ List special and SUID Files ncheck -s /VZ

############################################ # ssh benutzt priviligierten port unter 1024 ############################################ Initial connection via port 22 is established ok. Looking at iptrace output and netstat output I notice that the local port allocation appears to be above the 1024 boundary. i.e. port 2151 is being assigned. Is there a flag on AIX or SSH that I can use to force the allocation of ports below 1024 for ssh tasks?. I think you might be looking for ssh -P, or in the config file: man ssh ==> UsePrivilegedPort Specifies whether to use a privileged port for outgoing connections. The argument must be ``yes'' or ``no''. The default is ``yes''. Note that setting this option to ``no'' turns off RhostsAuthentication and RhostsRSAAuthentication. ################# # sendmail-config ################# In /etc/sendmail.cf Fuer DMZ Dm --> Dmrzag.net Cw localhost $?$m$. Dj$m DSmail.?.de --> DSmail.rzag.net DM --> DMrzag.net Fuer intern Dm --> Dmrzag.net Cw localhost $?$m$. Dj$m DSmail.?.de --> DSmail.intern.rzag.net DM --> DMrzag.net refresh -s sendmail ######################### # sendmail which version? ######################### According to O'Reilly, this is the command to find the version: # /usr/lib/sendmail -d0.1 -bt < /dev/null Version AIX 4.1/UCB 5.64. Address Test Mode: Enter ######################### # start sendmail over SRC ######################### stopsrc -s sendmail startsrc -s sendmail -a "-bd -q30m" ######################### # start sendmail sendonly ######################### stopsrc -s sendmail startsrc -s sendmail (ohne Parameter)

####################### # sendmail queue leeren ####################### sendmail -q -v ############################### # mail mit attachment versenden ############################### cat /etc/motd uuencode test mail -s test2 recipient will mail /etc/motd as a attachment called "test" to recipient with subject t est2 ################ # mailstatistics ################ # mailstats Statistics from Tue Feb 7 02:15:25 MEZ 2006 M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis Mailer 3 23 579K 0 0K 0 0 local 8 1 1K 24 582K 0 0 relay ============================================================= T 24 580K 24 582K 0 0 C 24 24 0 ######################## # sendmail config mit mc ######################## sendmail.mc # # Restricted Materials of IBM # # (C) COPYRIGHT International Business Machines Corp. 1999,2003 # All Rights Reserved # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # IBM_PROLOG_END_TAG # Sample AIX file #DOMAIN(`generic')dnl divert(0)dnl OSTYPE(`aixsample')dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA') MASQUERADE_AS(`example.org')dnl MASQUERADE_DOMAIN(`example.org')dnl FEATURE(`masquerade_envelope')dnl FEATURE(`masquerade_entire_domain')dnl FEATURE(`no_default_msa')dnl MAILER(local)dnl MAILER(smtp)dnl define(`SMART_HOST', `host.xyz.example.org')dnl cd /usr/samples/tcpip/sendmail/cf /usr/bin/m4 ../m4/cf.m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf ##################### # rewrite mailaccount

##################### to rewrite account [email protected] do: - comment out the genericstable entry in sendmail.cf - echo "account [email protected]" > /etc/mail/genericstable - makemap hash /etc/mail/genericstable.db < /etc/mail/genericstable - restart sendmail ############ # subsystems ############ $ lssrc -Ss sshd #subsysname:synonym:cmdargs:path:uid:auditid:standin:standout:standerr:action:mu lti:contact:svrkey:svrmtype:priority:signorm:sigforce:display:waittime:grpname: sshd::-D:/usr/local/sbin/sshd:0:0:/dev/console:/dev/console:/dev/console:-R:-Q:S:0:0:20:15:9:-d:20:tcpip: ########################### # aio-server running oracle ########################### lsattr -El aio0 pstat -A grep aioserver ps aux grep kproc # pstat 14 a 29 a 30 a 32 a 33 a 92 a 121 a 131 a 132 a 133 a 134 a 208 a 209 a -a grep aio more e72 1 e72 1d3c 1 1d3c 1e44 1 1e44 2048 1 2048 214a 1 214a 5cba 1 5cba 791c 1 791c 830c 1 830c 8408 1 8408 850a 1 850a 860c 1 860c d0ea 1 d0ea d106 1 d106 0 0 0 0 0 400 400 400 400 400 400 400 400 0 0 0 0 0 400 400 400 400 400 400 400 400 1 1 1 1 1 1 1 1 1 1 1 1 1 aioserver aioserver aioserver aioserver aioserver aioserver aioserver aioserver aioserver aioserver aioserver aioserver aioserver

################### # change aio server ################### # default chdev -l aio0 -P -a minservers=1 -a maxservers=10 -a maxreqs=4096 # oracle chdev -l aio0 -P -a minservers=150 -a maxservers=750 -a maxreqs=16384 ######################## # check idle aio servers ######################## ps -elfk > /tmp/ps.out.1 sleep 60 ps -elfk > /tmp/ps.out.2 echo "Idle AIO-Server:" egrep aioser /tmp/ps.out.2 /tmp/ps.out.1 sort -n +4 +13 +14 cut -f2-99 -d: uni q -c awk '$1==2{print}' wc -l rm -f /tmp/ps.out.1 rm -f /tmp/ps.out.2 #################

# check ssa place ################# If you want to check a pdisk or hdisk connected to which ssa adapater : # ssaadap -l or looking in /usr/ssa/ssaraid/ssaraid.README gives: ssaraid -I -z -l ssa{n} -z is summary and you get output like pdisk1 pdisk17 pdisk20 pdisk2 pdisk4 pdisk5 pdisk6 pdisk21 pdisk23 pdisk9 pdisk3 pdisk0 hdisk11 0004AC509E8C00D 0004AC50E80800D 0004AC51B98200D 0004AC51BB5C00D 0004AC51D83F00D 0004AC7D540D00D 0004AC7D74C000D 0004AC7DBD9F00D 0004AC9D4DB100D 0006294FAD6900D 00062992371600D 000629D0BA2B00D 239F3694BC71A4K member system system member spare member member system system member member member good n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a 4.5GB 2.3GB 4.5GB 4.5GB 4.5GB 4.5GB 4.5GB 2.3GB 2.3GB 4.5GB 4.5GB 4.5GB 27.1GB Physical disk Physical disk Physical disk Physical disk Physical disk Physical disk Physical disk Physical disk Physical disk Physical disk Physical disk Physical disk RAID-5 array

without the -z you obviously get much more detail. The examples worked through in the above README are useful. ssaraid -Il ssa0 -n hdisk2 name pdisk0 id 0004AC9DF01600D class disk use system blocksize 512 size 4.5GB state good network_id A fastwrite off # ssaxlate -l pdisk28 hdisk30 ################################ # ssa-platte zum blinken bringen ################################ um platte leichter zu identifizieren (LED leuchtet) # bash # ssaxlate -l hdisk2 pdisk0 # ssaidentify -l pdisk0 -y Platte sollte jetzt blinken # ssaidentify -l pdisk0 -n Blinken sollte abgeschaltet sein VG=oracle02VG for i in `lsvg -p $VG grep hdisk awk '{print $1}'` do PDISK=`ssaxlate -l $i`

ssaidentify -l $PDISK -y done VG=oracle02VG for i in `lsvg -p $VG grep hdisk awk '{print $1}'` do PDISK=`ssaxlate -l $i` ssaidentify -l $PDISK -n done ########################## # pruefen auf welcher loop ########################## ZAEHLER=1 PLATTEBIS=27 while true do HDISK=`ssaxlate -l pdisk${ZAEHLER}` SIZE=`bootinfo -s $HDISK` CONN=`ssaconn -l pdisk${ZAEHLER} -a ssa0` echo "$CONN $HDISK $SIZE" if [ $ZAEHLER = $PLATTEBIS ] then break else let ZAEHLER=$ZAEHLER+1 fi done pdisk18 ssa0 2 4 pdisk19 ssa0 0 6 pdisk20 ssa0 2 pdisk21 ssa0 0 pdisk22 ssa0 1 pdisk23 ssa0 5 pdisk25 ssa0 3 pdisk27 ssa0 6

4 6 5 1 3 0

hdisk20 hdisk21 hdisk22 hdisk23 hdisk4 hdisk5 hdisk27 hdisk29

8689 8689 8689 8689 8689 8689 8689 8689

Bedeutung: pdisk19 und pdisk27 sind in unterschiedlichen Drawern, aber am selben Platz! ####################### # microcode ssa-platten ####################### # ssadload -s pdisk0 294D2E1E 9191 pdisk1 29CA0E99 9595 pdisk2 29D1499C 0048 pdisk3 29D302C6 9902 pdisk4 294CB30F 8181 pdisk5 29CA0E22 9595 pdisk6 29D3081E 9902 pdisk7 29D148C0 0048 pdisk8 29D302BC 9902 pdisk9 29D098F3 9902 pdisk10 29D2608D 9902 ####################### # microcode ssa-adapter ####################### lscfg -v -l ssa0 grep ROS

DCHC DCHC DGHC DGHC DCHC DCHC DGHC DGHC DGHC DGHC DGHC

################## # ssa-shared disks ################## ssa_rescheck -l hdisk# ########## # ssa raid ########## States: Good State The array is online and it can be read and written. All the array components are present. All parity data (except that affected by recently completed write operations) is synchronized. No data or parity rebuilding is outstanding. The array is fully protected against the loss of one component. Exposed State One component is missing from the array. When the array is read, data can be reconstructed for the missing component. The first write operation causes the array to enter the "Degraded" state, unless there is no hot spare available that can be used to replace the missing component. In the "Exposed" state, the missing component can be reintroduced or replaced. Then, after any necessary rebuilding, the array is returned to the "Good" state. Degraded State One component is missing and a write operation has been received for the array. Read and write operations to the array are supported. However, if power is lost before all the parity data has been written, it might not be possible to recreate all the data for the missing component. The missing component is permanently excluded from the array. Note :- While in Degraded state, an array is not protected. If another disk drive in the array fails, or the power fails during a write operation, data might be lost. Rebuilding State The array is online and it can be read and written. The full complement of array components are present but data and parity are being rebuilt on one of the components. Offline State An array enters Offline state when two or more member disk drives become missing. Read and write operations are not allowed. ###################### # show status of array ###################### summary ssaraid -Il ssa0 -z detail ssaraid -Il ssa0 -n arrayname ############################ # change from system to free ############################ change pdisk0 to array-candidate SSARAID -H -l ssa0 -n pdisk0 -a use=free

################## # ssa raid anlegen ################## no hotspare SSARAID -C -l ssa0 -t raid_5 -s pdisk0 pdisk1 pdisk2 pdisk3 -d -k hdisk1 -a spare=false hotspare SSARAID -C -l ssa0 -t raid_5 -s pdisk0 pdisk1 pdisk2 pdisk3 -d -k hdisk1 -a spare=true ################## # disk replacement ################## change pdisk0 to array-candidate SSARAID -H -l ssa0 -n pdisk0 -a use=free ################# # fastwrite cache ################# check if possible lscfg -v -l ssa0 grep "(Z1)" SSARAID -H -l ssa0 -n hdisk1 -a fastwrite=on ##################################### # adding extra disks to an raid array ##################################### * Backup the filesystems on the RAID array to tape or other media. * Umount the filesystems on the RAID array. * Remove the filesystems and logical volumes on the RAID array. * Varyoff the volume group that is on the RAID array * Export the volume group that is on the RAID array. * Delete the RAID array * Create a new RAID array including any new additional disks * Re-create the volume group on the hdisk associated with the new RAID array. * Re-create the logical volume and filesystems on the new RAID array. * Mount the filesystems on the RAID array. * Restore the backup from the tape or other media ################# # ssa raid delete ################# SSARAID -l ssa0 -d -l ssa0 -n hdisk1 -u ############## # ftpd timeout ############## You need to change the parameters in /etc/inetd.conf ftp stream tcp6 nowait root /usr/sbin/ftpd ftpd -t 1200 -t TimeOut Logs out inactive sessions after the number of seconds specified by the TimeOut variable. The default limit is 15 minutes (900 seconds). -T MaxTimeOut Logs out inactive client sessions after a maximum number of seconds specified by the MaxTimeOut variable. The default limit is 2 hours (7200 seconds). Once you make the change you will need to refresh inetd. ################################# # Changing umask behaviour in ftp #################################

In /etc/inetd.conf change the ftpd command to "ftpd -u OctVal" where "OctVal" is the umask you want (default umask for ftpd is 027). Refresh inetd so it recognizes the change: refresh -s inetd ######################### # configure anonymous ftp ######################### /usr/samples/tcpip/anon.ftp node5:/> lslpp -w /usr/samples/tcpip/anon.ftp File Fileset Type ---------------------------------------------------------------------------/usr/samples/tcpip/anon.ftp bos.net.tcp.client File ################# # interactive ftp ################# echo "user username password" > ftp.txt echo "cd /some/directory" >> ftp.txt echo "put filename" >> ftp.txt echo "bye" >> ftp.txt ftp -nv xxx.xxx.xxx.xxx < ftp.txt > ftp.log ############## # group limits ############## I ran into this problem with NIS a long time ago. I believe it's limited to 255 or 255 characters per line after that just make a new line in your group file something like this: group1:123:user1,user2,user3 group1:123:user255,user256,user257 You can continue this forever as far as I know without any problems. We ran like this for years and never had any problems with doing this. OR: group file has a line length limit, this can be got round by hand defining multiple groups with the same id staff:!:1:fred,jim,john,.... staff1:!:barny,david,ann,jane,.... ######################################## # carriage return aus DOS-Datei loeschen ######################################## tr -d '\r" ######### # filemon ######### 1. To monitor the physical I/O activity of the virtual memory, logical volume, and physical volume levels of the file system, enter: filemon The filemon command automatically starts the system trace and puts itself in the background. After this command, enter the application programs and system commands to be run at this time, then enter: trcstop

After the trcstop command is issued, the I/O activity report is displayed on standard output (but will probably scroll off the screen). The virtual memory I/O report will be limited to the 20 segments that incurred the most I/O. 2. To monitor the activity at all file system levels, and write the report to the fmon.out file, enter: filemon -o fmon.out -O all # check complete system filemon -v -o /tmp/fmon_all.out -O all trcstop # check only pv,lv filemon -d -o /tmp/fmon_pv_lv.out -O pv,lv trcoff trcon trcstop # monitor 90 seconds sudo filemon -o /tmp/filemon.out -O lv,pv -T 5000000;sleep 90;sudo trcstop ########################## # filemon.pl im scripte VZ ########################## filemon -T 320000 -o /tmp/filemon.out; sleep 20; trcstop /usr/local/bin/filemon.pl /tmp/filemon.out ######### # telnetd ######### Q:What does the -a switch do in telnetd -a? It's the kerberised version of telnetd: -a authmode This option may be used for specifying what mode should be used for authentication. ###################### # large memory support ###################### ORACLE_HOME=/opt/oracle/product/9.2.0 ORACLE_HOME=/opt/oracle/product/10.2.0 ORACLE_HOME=/opt/oracle/product/11.1.0 ORACLE_HOME=/opt/oracle/product/11.2.0 lgpg_regions*lgpg_size=Memory_Configured_for_LP_Support Vorarbeiten: 1 GB Large memory = vmo -r -o lgpg_regions=64 -o lgpg_size=16777216 vmo -o lgpg_regions=64 -o lgpg_size=16777216 2 GB Large memory = vmo -r -o lgpg_regions=128 -o lgpg_size=16777216 vmo -o lgpg_regions=128 -o lgpg_size=16777216 4 GB Large memory = vmo -r -o lgpg_regions=256 -o lgpg_size=16777216 vmo -o lgpg_regions=256 -o lgpg_size=16777216 8 GB Large memory = vmo -r -o lgpg_regions=512 -o lgpg_size=16777216 vmo -o lgpg_regions=512 -o lgpg_size=16777216

16 GB Large memory = vmo -r -o lgpg_regions=1024 vmo -o lgpg_regions=1024 -o 32 GB Large memory = vmo -r -o lgpg_regions=2048 vmo -o lgpg_regions=2048 -o 64 GB Large memory = vmo -r -o lgpg_regions=4096 vmo -o lgpg_regions=4096 -o

-o lgpg_size=16777216 lgpg_size=16777216 -o lgpg_size=16777216 lgpg_size=16777216 -o lgpg_size=16777216 lgpg_size=16777216

To use large pages for shared memory, you must enable the SHM_PIN shmget() syste m call with the following command, which persists across system reboots: vmo -p -o v_pinshm=1 lsuser -a capabilities oracle chuser capabilities=CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle lsuser -a capabilities oracle vi init.ora LOCK_SGA=true # Edit the XCOFF file header in the oracle bin enable it to use large page data: ldedit -b lpdata $ORACLE_HOME/bin/oracle ldedit: File /opt/oracle/product/10.2.0/bin/oracle has been updated. or LDR_CNTRL=LARGE_PAGE_TEXT=Y@LARGE_PAGE_DATA=M export LDR_CNTRL BEFORE starting Instance and Listener ############################# # check for largepages in use ############################# vmstat -l ps -Z pagesize -af ######### # backout ######### vmo -r -o lgpg_regions=0 -o lgpg_size=0 lsuser -a capabilities oracle chuser capabilities= oracle lsuser -a capabilities oracle ldedit -b nolpdata $ORACLE_HOME/bin/oracle ldedit: File /opt/oracle/product/10.2.0/bin/oracle has been updated. or vi ~oracle/.profile chmod 6751 $ORACLE_HOME/bin/oracle bosboot -ad /dev/ipldevice shutdown -Fr vmstat -l 2 (look for alp, flp) alp allocated Large Pages flp free Large Pages ##############################

# ps memory und cpu auslastung ############################## you can see all your processes with %MEM and %CPU for each one with Usage Memory + CPU ps ug more hierbei wird die RSS-spalte (Real Mem Usage of Process) der ersten 6 Prozesse ausgewertet ps auxwww awk '{ sum +=$6} END { print "SUM = ", sum; }' SUM = 195464 RSS (v flag) The real-memory (resident set) size of the process (in 1KB units). im obigen Beispiel wird 195464 KB also 195 MB genutzt! oder svmon -G memory pg space pin in use size 65372 193536 work 6135 23721 inuse 42740 391 pers 194 19019 free 22632 clnt 0 0 pin 6329 virtual 17492

# memory Usage 1 User svmon -U # memory usage per user svmon -Uut 10 more svmon -Put 10 # top 10 users of memory svmon -Pgt 10 # top 10 users or paging space 1) svmon -Put 10 more The top line will provide you with all the info you need, and it will list your top 10 (oracle) memory hogs FYI...(Inuse / 256) = MB (approximate) 2) ps vg head -1;ps vg sort -r +5 head Sorts on the SIZE column, then you can use the PID to find the offender (oracle) - notice there is no '-' in front of the vg...very important 3) ps aux head -1;ps aux sort -nr +3 head Lists the %MEM column - +2 lists %CPU. Again, no '-' in front of the aux. #################### # ipcs shared memory #################### # all info # ipcs -a # shared mem # ipcs -m # semaphores

# ipcs -s # unbenutzte shared mem segmente loeschen ipcs -m suche in spalte NATTCH nach 0, diese koennen mit ipcrm -m NUMMER entfer nt werden # unbenutzte semaphoren loeschen for i in `ipcs -s grep "00000000 -----------" awk '{print $2}'` do echo ${i} ipcrm -s ${i} done ############################# # opened libraries at runtime ############################# aixinstall0:/#which genld /usr/bin/genld Proc_pid: 0 Proc_name: swapper Proc_pid: 5.o d0001000 /usr/lib/libpthreads.a/shr_com ... 1- To get a listing of the libraries an executable file needs to run: # dump -Hv exec_file To get a listing of the libraries a process uses: # genld grep -p pid ##################################### # dump header information of a binary ##################################### # dump -ov /usr/java131/jre/bin/java /usr/java131/jre/bin/java: ***Object Module Header*** # Sections Symbol Ptr # Symbols Opt Hdr Len 4 0x00009160 669 72 Flags=( EXEC DYNLOAD ) Timestamp = "May 17 16:29:56 2004" Magic = 0x1df (32-bit XCOFF) ***Optional Header*** Tsize Dsize Bsize Tstart Dstart 0x0000696b 0x00000301 0x0000081c 0x10000128 0x20000a93 SNloader 0x0004 TXTalign 0x0005 SNentry 0x0002 SNtext 0x0001 SNtoc 0x0002 SNdata 0x0002 entry 0x20000c14 modtype UR Flags 0x1002 1 Proc_name: init d0004000 /usr/lib/libpthreads.a/shr_xpg

DATAalign TOC vstamp 0x0003 0x20000c70 0x0001 magic 0x010b

maxSTACK maxDATA SNbss 0x00000000 0x80000000 0x0003 ########################

# performance diagnostic ######################## /usr/sbin/perf/diag_tool/pdt_config http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixbman/prftungd/2365cd4.htm ###### # nmon ###### # alte 9er Version export NMON="vlntDpkA" # neue 10er Version export NMON="BlnmtdkAa" # vpathdevs export NMON="BlnmtekAa" # Linux export NMON="Blnmtkd" nmon -h Hint: nmon [-h] [-s ] [-c ] [-f -d -t -r ] [-x] -h FULL help information - much more than here Interactive-Mode: read startup banner and type: "h" once it is running For Data-Collect-Mode (-f) -f spreadsheet output format [note: default -s300 -c288] optional -s between refreshing the screen [default 2] -c of refreshes [default millions] -t spreadsheet includes top processes -x capacity planning (15 min for 1 day = -fdt -s 900 -c 96) For Interactive-Mode -s between refreshing the screen [default 2] -c of refreshes [default millions] -g User decided Disk Groups - file = on each line: group_name space seper ated - like: rootvg hdisk0 hdisk1 hdisk2 - upto 32 groups hdisks can appear more than once -b black and white [default is colour] example: nmon -s 1 -c 100 For Data-Collect-Mode = spreadsheet format (comma separated values) Note: use only one of f,F,z,x or X and make it the first argument -f spreadsheet output format [note: default -s300 -c288] output file is _YYYYMMDD_HHMM.nmon -F same as -f but user supplied filename -r goes into spreadsheet file [default hostname] -t include top processes in the output -T as -t plus saves command line arguments in UARG section -s between snap shots -c of refreshes -l disks/line default 150 to avoid spreadsheet issues. EMC=64 . -g User decided Disk Groups (see above -g) -D Skip disk configuration sections -E Skip ESS configuration sections -I Ignore process percent threshold (default 0.1)

-A -m e

don't save TOP stats if proc using less CPU than this % Include Async I/O Section nmon changes to this directory before saving data to a fil

example: collect for 1 hour at 30 second intervals with top procs nmon -f -t -r Test1 -s30 -c120 To load into a spreadsheet like Lotus 1-2-3: sort -A *nmon >stats.csv transfer the stats.csv file to your PC Start 1-2-3 and then Open Capacity planning mode - use cron to run each day -x sensible spreadsheet output for CP = one every 15 mins for 1 day ( i.e. -ft -s 900 -X sensible spreadsheet output for CP = busy every 30 secs for 1 hour ( i.e. -ft -s 30 day -c 96) hour -c 120)

Set-up and installation If you get a "can't open /dev/kmem" message then as root run: chmod ugo+r /dev/kmem or run the tool as the root user To enable disk stats as root: chdev -l sys0 -a iostat=true - this adds the disk % busy numbers (otherwise they are zero) If you have hundreds of disk this can take 1% to 2% CPU Interactive key h r LPAR c l m k n d D o g a e j f t u w A v b . key + q 0 Mode Commands --- Toggles to control what is displayed --= Online help information = RS6000/pSeries type, machine name, cache details and AIX version + = = = = = = = = = = = = = = = = = = = = CPU by processor stats with bar graphs long term CPU (over 75 snapshots) with bar graphs Memory and Paging stats Kernel Internal stats Network stats Disk I/O Graphs Disk I/O Stats Disk I/O Map (one character per disk showing how busy it is) Disk Group I/O Stats (have to use -g commandline option) Adapter I/O Stats ESS vpath Logical Disk I/O Stats JFS Stats Fast Response Cache Accelerator Stats (IBM HTTP web server) Top Process Stats 1=Basic-Details 2=Accumulated-CPU Performance sorted by 3=CPU 4=Size 5=I/O Top but with command arguments shown (used with 3,4 & 5) to refresh arguments (for new processes) hit u twice use with top to show AIX wait processes (good for SMP) Summarise Async I/O (aioserver) processes Verbose this highlights problems on the machine and categorises them as either danger, warnings or OK black and white mode (or use -b option) minimum mode i.e. only busy disks and processes

--- Other Controls --= double the screen refresh time = halves the screen refresh time = quit (also x, e or control-C) = reset peak counts to zero (peak = ">")

space = refresh screen now Startup Control If you find you always type the same toggles every time you start then place them in the NMON shell variable. For example: export NMON=cmdrvtan Others: a) Use shell variable NMONAIX=4.3.2 to a force AIX version To you want to stop nmon - kill -USR2 b) Use -p and nmon outputs the background process pid c) To limit the processes nmon lists (online and to a file) Either set NMONCMD0 to NMONCMD63 to the program names or use -C cmd:cmd:cmd etc. example: -C ksh:vi:syncd d) If you want to pipe nmon output to other commands use a FIFO: mkfifo /tmp/mypipe nmon -F /tmp/mypipe & grep /tmp/mypipe e) If nmon fails please report it with: 1) nmon version like: v9a 2) the output of lslpp -L bos.mp (or for uniprocessor bos.up) 3) some clue of what you were doing 4) I may ask you to run the debug version f) From version 7 nmon can output rrdtool friendly output Use -R - you then have to create suitable rrd databases and can run nmon output via ksh to update them This is still experimental - help needed (see the README.txt) Written by Nigel Griffiths [email protected] and Richard Cutler Feedback welcome - on the current release only and state exactly the pro blem Version v9a - updated for each AIX release No warranty given or implied. ####################################### # daten fuer einen Tag mit nmon sammeln ####################################### alle 300 sekunden (5 minuten) + 288 = 1 Tag cd /tmp nmon -f -s300 -c288 ######## # vpaths ######## 0:root@testy:/ # lsdev -Cl dpo dpo Available Data Path Optimizer Parent 0:root@testy:/ # lsattr -El dpo Enterpr_maxlun 600 Maximum LUNS allowed for Enterprise Products => Wieviele ESS, DS8000, DS6000 LUNs kann ich anschliessen? Virtual_maxlun 512 Maximum LUNS allowed for Virtualization Products => Wieviele SAN Volume Controller LUNS kann ich anschliessen? persistent_resv yes Subsystem Supports Persistent Reserve Command qdepth_enable no Queue Depth Control

True False False True

= =

Das kann man entsprechend anpassen: chdev -l dpo -a Enterpr_maxlun=zzz. Algorithmen zur Wahl des Pfades Der SDD Treiber setzt verschiedene Algorithmen zur Verteilung des I/O auf die vo rhandenen Pfade ein. Dieses lassen sich mit dem datapath-Kommando setzten.

* fo - Failover Only Saemtlicher Verkehr geht ueber einen preferred Adapter. Faellt der aus, wird ein anderer Adapter genutzt. * lb - Load Balancing Anhand der aktuellen I/O Operationen eines Adapters we rden die Adapter priorisiert. Die Last wird so gleichverteilt; sind Adapter glei ch ausgelastet, so wird per Zufall zwischen ihnen gewaehlt. Diese Policy wird au ch als Optimized bezeichnet. * rr - Round Robin Der Pfad fuer die anstehende I/O Operation wird per Zufal l unter den Pfaden verteilt, der letzte aktive Pfad bzw. Adapter bleibt ausgenom men. * df - Default Die Default-Policy ist Load Balancing. Die aktuelle Policy eines vpath findet sich in der Ausgabe des lsattr-Kommandos (oder in der Ausgabe von datapath query device: 0:root@testy:/root # lsattr -El vpath5 active_hdisk hdisk7/00C27913/fscsi0 active_hdisk hdisk17/00C27913/fscsi1 policy df pvid 00c8ca9d7853d4340000000000000000 serial_number 00C27913 Active hdisk Active hdisk Scheduling Policy Physical volume identifier LUN serial number False False True False False

Der vpath5 zeigt also ueber die (virtuellen) Platten hdisk7 und hdisk17 und die beiden Fiber-Channel Adapter fscsi0 und fscsi1 auf die ESS C27913. Die Policy st eht auf Default, als wird die Last ueber Load Balancing verteilt. Die Policy kan n man veraendern mit den datapath-Kommando: 0:root@testy:/root # datapath query device Total Devices : 10 .... DEV#: 5 DEVICE NAME: vpath5 TYPE: 2105800 POLICY: Optimized SERIAL: 00C27913 ========================================================================== Path# Adapter/Hard Disk State Mode Select Errors 0 fscsi0/hdisk7 CLOSE NORMAL 3345 0 1 fscsi1/hdisk17 CLOSE NORMAL 3417 0 .... 0:root@testy:/root # datapath set device 5 policy rr DEV#: 5 DEVICE NAME: vpath5 TYPE: 2105800 POLICY: Round Robin SERIAL: 00C27913 ========================================================================== Path# Adapter/Hard Disk State Mode Select Errors 0 fscsi0/hdisk7 CLOSE NORMAL 3345 0 1 fscsi1/hdisk17 CLOSE NORMAL 3417 0 Es ist dabei egal, ob das Device OPEN oder CLOSE ist. Welche Programme / Befehle kommen mit SDD? Eine Auswahl der Dienstprogramme, die mit dem SDD Fileset installiert werden. Di e Befehle sind teilweise sehr wichtig: * addpaths - Fuegt einem bestehenden vpath-Device weitere Pfade zu. Das Komm ando ist dynamisch, der vpath ist aktiv und im Status "available".

* * * * * * * * * vices *

cfallvpath - Legt das SDD Pseudo-Device dpo an sowie alle vpath Devices. chgvpath - aendert vpath Attribute. datapath - Eine Administrations-Konsole fuer SDD Treiber. lquerypr - Zeigt und setzt persistente Reservierungen (SCSI Locks). lsvpcfg - Zeigt die Zuordnung Platte - vpath Device. querysn - Zeigt die serielle Nummer der Devices. mkvg4vp - Legt SDD Volume Groups an. extendvg4vp - Erweitert SDD Volume Groups. dpovgfix - Repariert eine SDD Volume Group, die gemischte hdisk / vpath De aufweist. pathtest - Umfangreiches Tool zum Testen und Debuggen.

Wie sind meine (virtuellen) Platten auf die vpath verteilt? Dazu dient das Kommando lsvpcfg: 0:root@testy2:/root # lsvpcfg vpath0 (Avail pv testy_vg) 00427298 = hdisk2 (Avail ) hdisk12 (Avail ) vpath1 (Avail ) 10427298 = hdisk3 (Avail ) hdisk13 (Avail ) vpath2 (Avail ) 30427298 = hdisk4 (Avail ) hdisk14 (Avail ) vpath3 (Avail pv hbb_vg) 30627298 = hdisk5 (Avail ) hdisk15 (Avail ) vpath4 (Avail ) 50427298 = hdisk6 (Avail ) hdisk16 (Avail ) vpath5 (Avail pv testy_vg) 00C27913 = hdisk7 (Avail ) hdisk17 (Avail ) vpath6 (Avail pv hbb_vg) 00D27913 = hdisk8 (Avail ) hdisk18 (Avail ) vpath7 (Avail pv ) 10727913 = hdisk9 (Avail ) hdisk19 (Avail ) vpath8 (Avail ) 20327913 = hdisk10 (Avail ) hdisk20 (Avail ) vpath9 (Avail ) 30227913 = hdisk11 (Avail ) hdisk21 (Avail ) Hier ist jeder vpath mit den zugeordneten Platten gezeigt. Platte hdisk2 und hdi sk12 sind also "virtuelle" Platten auf der lokalen Maschine, die ueber zwei vers chiedene Fiber-Channel Adapter auf diesselbe, physikalische Platte in einer Stor age Box zeigen - das ist der vpath. Wichtig ist, dass pro vpath mindestens 2 Platten im Zustand "Available" stehen. Das Attribut pv (AIX sieht dieses Device als physikalisches Volume) darf nur dem vpath zugeordnet sein. Taucht es bei hdisk-Devices auf, so muss das mit dem dpo vgfix Kommando korriert werden. Man kann die Ausgabe auf einzelne Typen von Storage Boxen oder Virtualisierungs Einheiten beschren, z.B. lsvpcfg -d 2105. datapath Kommando Ist eine Administrations-Konsole, mit der man Parameter auslesen und Setzen sowi e Pfade oeffnen und schliessen kann. Dazu dienen entsprechende Subkommandos. Nue tzlich sind folgende Kommandos zum Auslesen von Information: * datapath query mation. * datapath query * datapath query r Storage Box an. * datapath query * datapath query * datapath query device - Zeigt jedes bekannte Device mit zugehoeriger Infor essmap - Zeigt Pfad und Lokation an. portmap - Zeigt die Verteilung der Devices auf die Ports de wwpn - Zeigt die World Wide Port Number der FC Adapter. adapter - Zeigt Informationen zu den FC Adaptern. adaptertats - Zeigt Statistiken der Adapter.

Setzt man den Befehl ohne Subkommandos ab, so werden alle aktuellen Moeglichkeit en angezeigt. Damit ist es leicht, die Kommandos zum Setzen der Parameter zu fin den. Was passiert, wenn ich cfgmgr oder chdev ausfuehrt

Beim Kommando cfgmgr ist zu beachten, dass er bei Platten, die schon eine PVID h aben, pro Fiber-Channel Adapter einmal ausgefuehrt werden muss (cfgmgr findet di e PVID, traegt sie in die ODM ein und setzt das Device in den Status "defined". Findet er diese PVID dann nochmal ueber den anderen Adapter, macht er nichts meh r. Ruft man cfgmgr nochmal auf, ist die Platte im Zustand "Available" und wird n ochmal eingerichtet). Beim Kommando chdev gegen eine der hdisk wird die PVID der Platte ausgelesen und von der chdev-Methode in die ODM eingetragen. Das hat zur Folge, das sowohl fue r vpath Device wie fuer eine der "virtuellen" hdisk eine PVID existiert und AIX davon ausgeht, dass es sich um physikalische Devices handelt. Dieser Fehler tauc ht in der Ausgabe des lsvpcfg-Kommandos auf (Attribut "pv" einer hdisk zugeordne t) sowie in der Ausgabe des lsvg -p-Kommandos (statt eines vpath erscheint eine hdisk). Dieses Problem muss mit dem dpovgfix-Kommando behoben werden, da sonst e in vpath verloren geht. Die VG muss varyon sein, aber die Filesysteme sollten ni cht gemountet sein. Wie lege ich richtig Volume Groups an? Anlegen von Volume Groups mit SDD Platten erfordert bestimmte Kommandos, die "no rmalen" LVM Kommandos reichen nicht aus. Es gibt fuer alle SMIT Fenster und Komm andozeilen Befehle spezielle Versionen fuer vpath Devices: mkvg4vp, extendvg4vp, savevg4vp. Weitere Befehle sind zugleich auch SMIT Fenster und spezifisch fuer vpath Devices: lsvpcfg, cfallvpath, addpaths. Fehlermeldungen im Error-Report Es werden eine Reihe Nachrichten zu vpath-Devices und sddsrv (errpt -a grep VPA TH bzw. SDD). Das ist teilweise nuetzlich, wenn man mit gelockten Devices kaempf t. * VPATH_FAIL_RELPRESERVE - Wird ausgegeben, wenn ein Device geschlossen wurd e, aber die persistent reserve nicht geloest werden konnte. Das Device ist also weiterhin gesperrt, und ein Versuch, es zu oeffnen, gibt den folgenden Fehler. * VPATH_RESV_CFLICT - Der aktuelle Reservation Key ist nicht der, mit dem da s SDD vpath-Device gesperrt ist. Jemand anders sperrt die Platte bzw. den vpath. Besonders im HACMP Umfeld notorisch. Hier muss man mit lquerypr -vh das Lock we gnehmen. * VPATH_PATH_OPEN - Einer der Pfade eines vpath-Devices konnte nicht geoeffn et werden (trotzdem ist der vpath ueber die anderen Pfade verfuegbar. Erst wenn keiner der Pfade funktioniert, wird die Meldung VPATH_OUT_SERVICE geschrieben. * VPATH_XBUF_NOMEM - Fuer ein vpath-Device sollte ein Device-special File an gelegt werden. Es war aber kein Kernel-Memory mehr verfuegbar und der Aufruf ist fehlgeschlagen. * VPATH_DEVICE_OFFLINE - Nach mehreren erfolglosen Versuchen, I/O ueber eine n Pfad abzusetzten, ist dieser Offline genommen und in den Status DEAD gesetzt w orden. * VPATH_DEVICE_ONLINE - Wenn ein Pfad nicht erreichbar ist (DEAD), kann er p er auto_failback wieder aktiviert werden. Dabei wird nach 2000 I/O Aufrufen der Pfad wieder angesprochen. Funktioniert es, geht der Status nach OPEN. Funktionie rt der I/O nicht, so wird der Pfad zwar wieder online genommen, aber erst nach w eiteren 50000 I/O Operationen auf den anderen Pfaden in den Status OPEN gesetzt. In beiden Faellen gibt es diese Meldung. * VPATH_OUT_SERVICE - Ein vpath Device hat keinen Pfad zu keiner Platte mehr . Das Device ist damit im LIMBO, und jeder Aufruf wird sofort an den Verursacher zurueckgegeben. Wichtige Kommandos Welche Devices sind an meine Maschine angeschlossen? 0:root@testy:/ # lsdev -C -t 2105

hdisk2 hdisk3 hdisk4 hdisk5 hdisk6 hdisk7 hdisk8 hdisk9 2105 2107 1750 2145 2062 ==> ==> ==> ==> ==>

Available Available Available Available Available Available Available Available

05-08-01 05-08-01 05-08-01 05-08-01 05-08-01 05-08-01 05-08-01 05-08-01

IBM IBM IBM IBM IBM IBM IBM IBM

FC FC FC FC FC FC FC FC

2105 2105 2105 2105 2105 2105 2105 2105

ESS (mit FC ==> Fiber Channel connected, sonst SCSI) DS8000 DS6000 SAN Volume Controller Device SAN Volume Controller for Cisco MDS 9000

Wie sehe ich den all die Sachen, die ich fuer meine Pfade definiert habe? Mit lsattr -El vpathX und lsattr -El hdiskX. 0:root@testy:/ # lsattr -El vpath0 active_hdisk hdisk2/00427298/fscsi0 Active hdisk active_hdisk