Friday, May 9, 2008

HPUX NetApp add and grow file system

Basic process for resizing a file system using the HP-UX LVM and NetApp storage.
1. Create a new LUN on the filer to add to the LVM volume group and map it to the HP-UX host.
filer> lun create -t hpux -s 100g /vol/vol1/oraserv1.lun
filer> lun map /vol/vol1/oraserv1.lun oraserv
lun map: auto-assigned oraserv=1
2. Run commands on the HP-UX host to recognize the LUN and make it available to LVM.
# ioscan -fnC disk
# ioinit -i
# sanlun lun show -p
# pvcreate /dev/dsk/c4t0d1
The "sanlun" command is used to determine the path for the new LUN.
3. Add the new LUN to an existing volume group.
# vgextend vg01 /dev/dsk/c4t0d1
4. Use the Network Appliance attach kit to configure the PVlinks multipathing.
# ntap_config_paths
5. Extend the logical volume.
# lvextend -L 144 /dev/vg01/lvol1
6. If the OnlineJFS license and package are not installed, unmount the file system.
# umount /u01
Note: The command "swlist -l bundle grep JFS" will determine whether OnlineJFS is
installed.
7. Extend the file system.
For systems without OnlineJFS:
# extendfs /dev/vg01/lvol1
For systems with OnlineJFS:
# fsadm -b 147456 /u01
Note: The value 147456 is the size 144 from step 5 multiplied by 1024 to convert it to megabytes.
8. If the file system was unmounted in step 6, remount the file system.
# mount /dev/vg01/lvol1 /u01

Tuesday, May 6, 2008

AIX grow and add new jfs largefile filesystem

Requirement
1. Expand file-system
/db/tst4/dbf2 – 11 GB (Existing size is 2 GB)
/db/tst4/temp – 7 GB (Existing size is 0.5 GB)
/db/tst4/undo – 7 GB (Existing size is 0.5 GB)

2. Create file-system
/db/tst4/dbf3 – 11 GB

The Filesystems should allow large files [ > 2Gb];

Pre-implementation checkout
# lsvg hds128vg
VOLUME GROUP: hds128vg VG IDENTIFIER: 00c54e7d00004c00000001175fb130df
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 2310 (295680 megabytes)
MAX LVs: 256 FREE PPs: 507 (64896 megabytes)
LVs: 37 USED PPs: 1803 (230784 megabytes)
OPEN LVs: 37 QUORUM: 8 (Enabled)
TOTAL PVs: 14 VG DESCRIPTORS: 14
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 14 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable

Implementation Steps
1. #chfs –a size=+9G /db/tst4/dbf4
2. #chfs –a size=+6500M /db/tst4/temp
3. #chfs –a size=+6500M /db/tst4/undo

4. Create new logical volume on cbitdb3:
• Please use smit menu
# smitty mklv <-- Jump straight to "Add a Logical Volume"
Specify hds128vg for the VOLUME GROUP name
Set Logical volume TYPE to jfs

New LV NAME VGName SIZE total LP PV Name
----------------------------------------------------
tst4_dbf3 hdsvg 11 GB - -

5. Create a new Journaled Filesystem with largefile option enabled on previously defined logical volumes. Create and mount it accordingly from smit menu.
# smitty crjfslvbf <-- jumps straight to "Add a Large File Enabled Journaled File System" on a previously defined logical volume

Change the following entry accordingly in the smitty screen:
Mount AUTOMATICALLY at system restart? Yes

LOGICAL VOLUME name MOUNT POINT
-----------------------------------------
tst4_dbf3 /db/tst4/dbf3
* For LV name, use F4 to list out & select the LV to be used.
Select tst4_dbf3

6. Mount new FS
# mkdir /db/tst4/dbf3
Change the permission to “oracle:dba”
# chown –R oracle:dba /db/tst4/dbf3
# mount /db/tst4/dbf3

Review Plan
After created new FS , capture new FS output and verify that new file systems are there:
# df -g /db/tst4/dbf2 , 11GB
# df -g /db/tst4/temp , 7GB
# df -g /db/tst4/undo , 7GB
# df -g /db/tst4/dbf3 , 11GB

# su – oracle
# cd /db/tst4/dbf3
# touch testfile
# ls –l , make sure can write
# exit

AIX increase LP's

Procedure to increase the number of LP's available
Assume we receive an error that the maximum number of LP's had been exceeded, and the maximum number of LP's defined was 1100:

#lsvg , to show the total PP's available in the volume group =1250
#lsvg -l , to show the total PP's used in all logical volumes in that volume group (showed sys1log, the jfs log was using 2 PP's)
#chlv -x 1248 , to change the maximum number of LP's from 1100 to 1248 (1250 PP's in the volume group - 2 PP's used by the jfs log = 1248 available)

AIX physical disk administration

Physical Disk Procedures

Procedure to find disks/vpaths that are unallocated

#lsvpcfg
This will show disks/vpaths and the volume group they are allocated to
#lspvgrep None
This will show pvs and whether they are asssociated with a volume group
Note: For vpaths, the hdisks will show as none, but they may be allocated to a vpath - you must grep each hdisk with the lsvpcfg

Procedure to make a new lun available to AIX

Allocate the new lun on the SAN
Run "cfgmgr"
Verify the new vpatch/hdisk by running "lsvpcfg"
There should be a new vpath and it should be available with no volume group - if not, rerun cfgmgr


Procedure to list the PVs in a volume group:

#lsvg -p

AIX determine disk size

Get the size (in MB) of hdisk1
getconf DISK_SIZE hdisk1 or bootinfo -s hdisk1

Solaris VCS system maintenance

node1# hastatus -sum
node1# hagrp –switch appgrp –to node2
node1# hagrp –switch ClusterService –to node2
node1# hastatus –sum
Make sure aaprg and ClusterServices are online on node2,
then proceed to next command. See #tail –f /var/*vcs/log/engine_A.log
node1# hastatus –sum
node1# haconf –makerw
node1# hagrp –freeze – persistent oragrp
node1# hagrp –freeze – persistent appgrp
node1# hagrp –freeze – persistent ClusterService
node1# haconf –dump -makero


Stop and verify the “had daemon is gone from both node1
root@node1:/ # hastop –sys node1
root@node1/ # ps –efgrep had
root@node1/# init S

do system maintanence ..
boot node1 ...

node1# haconf –makerw
node1# hagrp –unfreeze – persistent oragrp
node1# hagrp –unfreeze – persistent appgrp
node1# hagrp –unfreeze – persistent ClusterService
node1# haconf –dump -makero
node1# hastatus -sum
node1# hagrp –switch appgrp –to node1
node1# hagrp –switch ClusterService –to node1
node1# hastatus –sum

Monday, May 5, 2008

AIX network administration

 The examples here assume that the default TCP/IP con guration
(rc.net) method is used. If the alternate method of using rc.bsdnet
is used then some of these examples may not apply.
Determine if rc.bsdnet is used over rc.net
lsattr -El inet0 -a bootup option
TCP/IP related daemon startup script
/etc/rc.tcpip
To view the route table
netstat -r
To view the route table from the ODM DB
lsattr -EHl inet0 -a route
Temporarily add a default route
route add default 192.168.1.1
Temporarily add an address to an interface
ifconfig en0 192.168.1.2 netmask 255.255.255.0
Temporarily add an alias to an interface
ifconfig en0 192.168.1.3 netmask 255.255.255.0 alias
To permanently add an IP address to the en1 interface
chdev -l en1 -a netaddr=192.168.1.1 -a netmask=0xffffff00
Permanently add an alias to an interface
chdev -l en0 -a alias4=192.168.1.3,255.255.255.0
Remove a permanently added alias from an interface
chdev -l en0 -a delalias4=192.168.1.3,255.255.255.0
List ODM (next boot) IP con guration for interface
lsattr -El en0
Permanently set the hostname
chdev -l inet0 -a hostname=www.tablesace.net
Turn on routing by putting this in rc.net
no -o ipforwarding=1
List networking devices
lsdev -Cc tcpip
List Network Interfaces
lsdev -Cc if
List attributes of inet0
lsattr -Ehl inet0
List (physical layer) attributes of ent0
lsattr -El ent0
List (networking layer) attributes of en0
lsattr -El en0
Speed is found through the entX device
lsattr -El ent0 -a media speed
Set the ent0 link to Gig full duplex
(Auto Negotiation is another option)
chdev -l ent0 -a media speed=1000 Full Duplex -P
Turn o Interface Speci c Network Options
no -p -o use isno=0
Get (long) statistics for the ent0 device (no -d is shorter)
entstat -d ent0
List all open, and in use TCP and UDP ports
netstat -anf inet
List all LISTENing TCP ports
netstat -na grep LISTEN
Remove all TCP/IP con guration from a host
rmtcpip
IP packets can be captured using iptrace / ipreport or tcpdump

UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...