Tuesday, January 20, 2009

SAP Installation



SAP installation on Linux

please check "sysctl -a" output, especially

kernel.sem = 1250 256000 100 1024

kernel.msgmnb = 65536

kernel.msgmni = 1024

kernel.msgmax = 65536

kernel.shmmni = 4096

kernel.shmall = 4294967296

kernel.shmmax = 68719476736

Enter above values in
/etc/sysctl.conf
and run "sysctl -p" and "sysctl -a"
Increase swap space
dd if=/dev/zero of=swapfile bs=1024 count=132207
chmod 600 swapfile
mkswap swapfile
swapon swapfile

/etc/security/limits.conf ( add below lines)
@sapsys hard nofile 32800
@sapsys soft nofile 32800
@dba hard nofile 32800
@dba soft nofile 32800
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
export TEMP=/tmp
umask 022 /tmp
chmod 777 /tmp


[root@broad ~]# rsh mosel -l root: vol status | grep broad
broad_sapdata online raid_dp, flex nosnap=on, nosnapdir=on,
broad_sapmirrorlog online raid_dp, flex nosnap=on, nosnapdir=on
broad_saplog online raid_dp, flex nosnap=on, nosnapdir=on
[root@broad ~]# rsh mosel -l root: vol size broad_sapdata
vol size: Flexible volume 'broad_sapdata' has size 130g.
[root@broad ~]# rsh mosel -l root: vol size broad_saplog
vol size: Flexible volume 'broad_saplog' has size 140g.
[root@broad ~]# rsh mosel -l root: vol size broad_sapmirrorlog
vol size: Flexible volume 'broad_sapmirrorlog' has size 5g.
DG
snapdrive storage create -dg CER_oracledg -lunsize 60g -lun mosel:/vol/broad_saplog/oracledglun
[root@broad ~]# cat fs.sh
lvcreate -L7g -noracle_stage CER_oracledg
lvcreate -L3g -noracle_client CER_oracledg
lvcreate -L10g -noracle_102_64 CER_oracledg
lvcreate -L5g -noracle_origlogA CER_oracledg
lvcreate -L5g -noracle_origlogB CER_oracledg
lvcreate -L10g -noracle_oraarch CER_oracledg
lvcreate -L5g -noracle_sapreorg CER_oracledg
mkfs -t ext3 /dev/CER_oracledg/oracle_stage
mkfs -t ext3 /dev/CER_oracledg/oracle_client
mkfs -t ext3 /dev/CER_oracledg/oracle_102_64
mkfs -t ext3 /dev/CER_oracledg/oracle_origlogA
mkfs -t ext3 /dev/CER_oracledg/oracle_origlogB
mkfs -t ext3 /dev/CER_oracledg/oracle_oraarch
mkfs -t ext3 /dev/CER_oracledg/oracle_sapreorg
mkdir -p /oracle/client
mkdir -p /oracle/stage
mkdir -p /oracle/CER/102_64
mkdir -p /oracle/CER/origlogA
mkdir -p /oracle/CER/origlogB
mkdir -p /oracle/CER/oraarch
mkdir -p /oracle/CER/sapreorg
mount -t ext3 /dev/CER_oracledg/oracle_stage /oracle/stage
mount -t ext3 /dev/CER_oracledg/oracle_client /oracle/client
mount -t ext3 /dev/CER_oracledg/oracle_102_64 /oracle/CER/102_64
mount -t ext3 /dev/CER_oracledg/oracle_origlogA /oracle/CER/origlogA
mount -t ext3 /dev/CER_oracledg/oracle_origlogB /oracle/CER/origlogB
mount -t ext3 /dev/CER_oracledg/oracle_oraarch /oracle/CER/oraarch
mount -t ext3 /dev/CER_oracledg/oracle_sapreorg /oracle/CER/sapreorg
[root@broad ~]# vi /etc/fstab
/dev/mapper/CER_oracledg-oracle /oracle ext3 (rw)
/dev/mapper/CER_oracledg-oracle_CER /oracle/CER ext3 (rw)
/dev/mapper/CER_oracledg-oracle_stage /oracle/stage ext3 (rw)
/dev/mapper/CER_oracledg-oracle_client /oracle/client ext3 (rw)
/dev/mapper/CER_oracledg-oracle_102_64 /oracle/CER/102_64 ext3 (rw)
/dev/mapper/CER_oracledg-oracle_origlogA /oracle/CER/origlogA ext3 (rw)
/dev/mapper/CER_oracledg-oracle_origlogB /oracle/CER/origlogB ext3 (rw)
/dev/mapper/CER_oracledg-oracle_oraarch /oracle/CER/oraarch ext3 (rw)
/dev/mapper/CER_oracledg-oracle_sapreorg /oracle/CER/sapreorg ext3 (rw)
DG
snapdrive storage create -dg CER_sapdatadg -lun mosel:/vol/broad_sapdata/saplun -lunsize 103g
[root@broad ~]# cat sapfs.sh
lvcreate -L25g -nsapdata1 CER_sapdatadg
lvcreate -L25g -nsapdata2 CER_sapdatadg
lvcreate -L25g -nsapdata3 CER_sapdatadg
lvcreate -L25g -nsapdata4 CER_sapdatadg
mkfs -t ext3 /dev/CER_sapdatadg/sapdata1
mkfs -t ext3 /dev/CER_sapdatadg/sapdata2
mkfs -t ext3 /dev/CER_sapdatadg/sapdata3
mkfs -t ext3 /dev/CER_sapdatadg/sapdata4
mkdir -p /oracle/CER/sapdata1
mkdir -p /oracle/CER/sapdata2
mkdir -p /oracle/CER/sapdata3
mkdir -p /oracle/CER/sapdata4
mount -t ext3 /dev/CER_sapdatadg/sapdata1 /oracle/CER/sapdata1
mount -t ext3 /dev/CER_sapdatadg/sapdata2 /oracle/CER/sapdata2
mount -t ext3 /dev/CER_sapdatadg/sapdata3 /oracle/CER/sapdata3
mount -t ext3 /dev/CER_sapdatadg/sapdata4 /oracle/CER/sapdata4
[root@broad ~]# mount | grep sapdata
/dev/mapper/CER_sapdatadg-sapdata1 on /oracle/CER/sapdata1 type ext3 (rw)
/dev/mapper/CER_sapdatadg-sapdata2 on /oracle/CER/sapdata2 type ext3 (rw)
/dev/mapper/CER_sapdatadg-sapdata3 on /oracle/CER/sapdata3 type ext3 (rw)
/dev/mapper/CER_sapdatadg-sapdata4 on /oracle/CER/sapdata4 type ext3 (rw)
DG
snapdrive storage create -dg CER_sapdg -lun mosel:/vol/broad_saplog/sapbinarylun -lunsize 10g
lvcreate -L3g -nsaptrans CER_sapdg
lvcreate -L3g -nsapmnt CER_sapdg
lvcreate -L3g -nusrsap CER_sapdg
mkfs -t ext3 /dev/CER_sapdg/saptrans
mkfs -t ext3 /dev/CER_sapdg/sapmnt
mkfs -t ext3 /dev/CER_sapdg/usrsap
mkdir -p /usr/sap/trans
mkdir -p /usr/sap/CER
mkdir -p /sapmnt/CER
mount -t ext3 /dev/CER_sapdg/saptrans /usr/sap/trans
mount -t ext3 /dev/CER_sapdg/sapmnt /sapmnt/CER
mount -t ext3 /dev/CER_sapdg/usrsap /usr/sap/CER
/etc/fstab
/dev/mapper/CER_sapdg-saptrans /usr/sap/trans ext3 (rw)
/dev/mapper/CER_sapdg-usrsap /usr/sap/CER ext3 (rw)
/dev/mapper/CER_sapdg-sapmnt /sapmnt/CER ext3 (rw)
DG
snapdrive storage create -dg CER_mirrorlog -lunsize 3g -lun mosel:/vol/broad_sapmirrorlog/mirrorloglun
lvcreate -L1g -nmirrorlogA CER_mirrorlog
lvcreate -L1g -nmirrorlogB CER_mirrorlog
mkfs -t ext3 /dev/CER_mirrorlog/mirrorlogA
mkfs -t ext3 /dev/CER_mirrorlog/mirrorlogB
mkdir -p /oracle/CER/mirrlogA
mkdir -p /oracle/CER/mirrlogB
mount -t ext3 /dev/CER_mirrorlog/mirrorlogA /oracle/CER/mirrlogA
mount -t ext3 /dev/CER_mirrorlog/mirrorlogB /oracle/CER/mirrlogB
[root@broad ~]# mount | grep mirr
/dev/mapper/CER_mirrorlog-mirrorlogA on /oracle/CER/mirrlogA type ext3 (rw)
/dev/mapper/CER_mirrorlog-mirrorlogB on /oracle/CER/mirrlogB type ext3 (rw)
/etc/fstab
/dev/mapper/CER_mirrorlog-mirrorlogA /oracle/CER/mirrlogA ext3 (rw)
/dev/mapper/CER_mirrorlog-mirrorlogB /oracle/CER/mirrlogB ext3 (rw)

After installation

[root@broad ~]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 66G 9.0G 53G 15% /
/dev/sda1 99M 15M 79M 16% /boot
none 1004M 106M 899M 11% /dev/shm
rtpinf02.rtp.netapp.com:/vol/local/i386-linux2.0
287G 158G 129G 56% /usr/local
rtpinf02.rtp.netapp.com:/vol/local/share
287G 158G 129G 56% /usr/local/share
rtpinf01.rtp.netapp.com:/vol/software/arch/i386-redhat-linux8.0
410G 192G 219G 47% /usr/software
/dev/mapper/CER_oracledg-oracle
3.0G 38M 2.8G 2% /oracle
/dev/mapper/CER_oracledg-oracle_CER
3.0G 38M 2.8G 2% /oracle/CER
/dev/mapper/CER_oracledg-oracle_stage
6.9G 2.7G 3.9G 42% /oracle/stage
/dev/mapper/CER_oracledg-oracle_client
3.0G 132M 2.7G 5% /oracle/client
/dev/mapper/CER_oracledg-oracle_102_64
9.9G 1.7G 7.7G 18% /oracle/CER/102_64
/dev/mapper/CER_oracledg-oracle_origlogA
5.0G 155M 4.6G 4% /oracle/CER/origlogA
/dev/mapper/CER_oracledg-oracle_origlogB
5.0G 155M 4.6G 4% /oracle/CER/origlogB
/dev/mapper/CER_oracledg-oracle_oraarch
9.9G 821M 8.6G 9% /oracle/CER/oraarch
/dev/mapper/CER_oracledg-oracle_sapreorg
5.0G 43M 4.7G 1% /oracle/CER/sapreorg
/dev/mapper/CER_sapdatadg-sapdata1
25G 2.7G 21G 12% /oracle/CER/sapdata1
/dev/mapper/CER_sapdatadg-sapdata2
25G 7.9G 16G 34% /oracle/CER/sapdata2
/dev/mapper/CER_sapdatadg-sapdata3
25G 7.9G 16G 34% /oracle/CER/sapdata3
/dev/mapper/CER_sapdatadg-sapdata4
25G 5.0G 19G 22% /oracle/CER/sapdata4
/dev/mapper/CER_sapdg-saptrans
3.0G 37M 2.8G 2% /usr/sap/trans
/dev/mapper/CER_sapdg-sapmnt
3.0G 592M 2.3G 21% /sapmnt/CER
/dev/mapper/CER_sapdg-usrsap
3.0G 2.5G 370M 88% /usr/sap/CER
/dev/mapper/CER_mirrorlog-mirrorlogA
1008M 134M 824M 14% /oracle/CER/mirrlogA
/dev/mapper/CER_mirrorlog-mirrorlogB
1008M 134M 824M 14% /oracle/CER/mirrlogB
10.61.162.28:/vol/software
400G 246G 155G 62% /SAP
triggerfish:/vol/sap_inst_sources
32G 26G 6.1G 82% /mnt/oracle10g_for_sap_64bit
[root@broad ~]# ps -ef | grep ora
oracer 19870 1 0 05:33 ? 00:00:09 /oracle/CER/102_64/jdk/bin/java -Djava.awt.headless=true -Doracle.oc4j.localhome=/oracle/CER/102_64/sqlplus -Djava.security.properties=/oracle/CER/102_64/oc4j/j2ee/home/config/jazn.security.props -jar /oracle/CER/102_64/oc4j/j2ee/home/oc4j.jar -config /oracle/CER/102_64/oc4j/j2ee/isqlplus/config/server.xml
oracer 20192 1 0 05:38 ? 00:00:01 /oracle/CER/102_64/bin/tnslsnr LISTENER -inherit
oracer 23627 1 0 06:31 ? 00:00:00 ora_pmon_CER
oracer 23629 1 0 06:31 ? 00:00:00 ora_psp0_CER
oracer 23631 1 0 06:31 ? 00:00:00 ora_mman_CER
oracer 23633 1 0 06:31 ? 00:00:04 ora_dbw0_CER
oracer 23635 1 0 06:31 ? 00:00:27 ora_lgwr_CER
oracer 23637 1 0 06:31 ? 00:00:00 ora_ckpt_CER
oracer 23639 1 0 06:31 ? 00:00:01 ora_smon_CER
oracer 23641 1 0 06:31 ? 00:00:00 ora_reco_CER
oracer 23643 1 0 06:31 ? 00:00:00 ora_cjq0_CER
oracer 23645 1 0 06:31 ? 00:00:00 ora_mmon_CER
oracer 23647 1 0 06:31 ? 00:00:00 ora_mmnl_CER
oracer 23652 1 0 06:31 ? 00:00:03 ora_arc0_CER
oracer 23654 1 0 06:31 ? 00:00:03 ora_arc1_CER
oracer 23658 1 0 06:31 ? 00:00:00 ora_qmnc_CER
oracer 23809 1 0 06:31 ? 00:00:00 ora_q000_CER
oracer 23812 1 0 06:32 ? 00:00:00 ora_q001_CER
oracer 27973 1 0 06:47 ? 00:00:13 oracleCER (LOCAL=NO)
oracer 27975 1 0 06:47 ? 00:00:19 oracleCER (LOCAL=NO)
oracer 27977 1 0 06:47 ? 00:00:18 oracleCER (LOCAL=NO)
oracer 27979 1 0 06:47 ? 00:00:16 oracleCER (LOCAL=NO)
oracer 27981 1 0 06:47 ? 00:00:00 oracleCER (LOCAL=NO)
oracer 27983 1 0 06:47 ? 00:00:00 oracleCER (LOCAL=NO)
oracer 27985 1 0 06:47 ? 00:00:03 oracleCER (LOCAL=NO)
oracer 27987 1 0 06:47 ? 00:00:00 oracleCER (LOCAL=NO)
oracer 27989 1 0 06:47 ? 00:00:00 oracleCER (LOCAL=NO)
oracer 27991 1 0 06:47 ? 00:00:00 oracleCER (LOCAL=NO)
oracer 27993 1 0 06:47 ? 00:00:00 oracleCER (LOCAL=NO)
oracer 27995 1 0 06:47 ? 00:00:00 oracleCER (LOCAL=NO)
oracer 27997 1 0 06:47 ? 00:00:00 oracleCER (LOCAL=NO)
root 1474 32419 0 07:45 pts/2 00:00:00 grep ora
[root@broad ~]# ps -ef | grep sap
root 26068 1 0 06:45 ? 00:00:11 /usr/sap/CER/SYS/exe/run/saposcol
ceradm 26121 1 0 06:45 ? 00:00:00 /usr/sap/CER/SCS01/exe/sapstartsrv pf=/usr/sap/CER/SYS/profile/START_SCS01_broad -D
ceradm 26125 1 0 06:45 ? 00:00:00 /usr/sap/CER/SCS01/exe/sapstart pf=/usr/sap/CER/SYS/profile/START_SCS01_broad
ceradm 26138 26125 0 06:45 ? 00:00:00 ms.sapCER_SCS01 pf=/usr/sap/CER/SYS/profile/CER_SCS01_broad
ceradm 26139 26125 0 06:45 ? 00:00:01 en.sapCER_SCS01 pf=/usr/sap/CER/SYS/profile/CER_SCS01_broad
ceradm 27902 1 0 06:47 ? 00:00:00 /usr/sap/CER/DVEBMGS00/exe/sapstartsrv pf=/usr/sap/CER/SYS/profile/START_DVEBMGS00_broad -D
ceradm 27906 1 0 06:47 ? 00:00:00 /usr/sap/CER/DVEBMGS00/exe/sapstart pf=/usr/sap/CER/SYS/profile/START_DVEBMGS00_broad
ceradm 27933 27906 0 06:47 ? 00:00:00 ms.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27934 27906 0 06:47 ? 00:00:02 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27935 27906 0 06:47 ? 00:00:00 co.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad -F
ceradm 27936 27906 0 06:47 ? 00:00:00 se.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad -F
ceradm 27937 27906 0 06:47 ? 00:00:00 ig.sapCER_DVEBMGS00 -mode=profile pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27938 27937 0 06:47 ? 00:00:00 /usr/sap/CER/DVEBMGS00/exe/igsmux_mt -mode=profile -restartcount=0 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27939 27937 0 06:47 ? 00:00:00 /usr/sap/CER/DVEBMGS00/exe/igspw_mt -mode=profile -no=0 -restartcount=0 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27940 27937 0 06:47 ? 00:00:00 /usr/sap/CER/DVEBMGS00/exe/igspw_mt -mode=profile -no=1 -restartcount=0 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27957 27934 0 06:47 ? 00:00:01 gwrd -dp pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27958 27934 0 06:47 ? 00:00:01 icman -attach pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27959 27934 2 06:47 ? 00:01:15 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27960 27934 1 06:47 ? 00:01:02 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27961 27934 1 06:47 ? 00:00:40 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27962 27934 1 06:47 ? 00:00:44 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27963 27934 0 06:47 ? 00:00:10 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27964 27934 0 06:47 ? 00:00:02 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27965 27934 0 06:47 ? 00:00:00 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27966 27934 0 06:47 ? 00:00:00 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27967 27934 0 06:47 ? 00:00:00 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27968 27934 0 06:47 ? 00:00:00 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27969 27934 0 06:47 ? 00:00:00 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27970 27934 0 06:47 ? 00:00:00 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 27971 27934 0 06:47 ? 00:00:00 dw.sapCER_DVEBMGS00 pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad
ceradm 972 27934 0 07:18 ? 00:00:00 jcontrol pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad -DSAPSTART=1 -DCONNECT_PORT=39692 -DSAPSYSTEM=00 -DSAPSYSTEMNAME=CER -DSAPMYNAME=broad_CER_00 -DSAPPROFILE=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad -DFRFC_FALLBACK=ON -DFRFC_FALLBACK_HOST=localhost
ceradm 1055 972 0 07:18 ? 00:00:06 /usr/sap/CER/DVEBMGS00/exe/jlaunch pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad -DSAPINFO=CER_00_sdm -nodeId=2 -file=/usr/sap/CER/DVEBMGS00/SDM/program/config/sdm_jstartup.properties -syncSem=3702869 -nodeName=sdm -jvmOutFile=/usr/sap/CER/DVEBMGS00/work/jvm_sdm.out -stdOutFile=/usr/sap/CER/DVEBMGS00/work/std_sdm.out -locOutFile=/usr/sap/CER/DVEBMGS00/work/dev_sdm -mode=JCONTROL pf=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad -DSAPSTART=1 -DCONNECT_PORT=39693 -DSAPSYSTEM=00 -DSAPSYSTEMNAME=CER -DSAPMYNAME=broad_CER_00 -DSAPPROFILE=/usr/sap/CER/SYS/profile/CER_DVEBMGS00_broad -DFRFC_FALLBACK=ON -DFRFC_FALLBACK_HOST=localhost
root 1476 32419 0 07:45 pts/2 00:00:00 grep sap






Linux

Linux iSCSI discovery
[root@boxhole-vm2 ~]# iscsiadm -m discovery -t st -p 10.60.231.19

Linux : how to increase fs on lvm volume
Increase FS on linux
lvextend --size +10g /dev/CER_sapdatadg/sapdata3
resize2fs /dev/mapper/CER_sapdatadg-sapdata3


Friday, January 16, 2009

ORACLE

Enabling ARCHIVELOG Mode

SQL> SELECT LOG_MODE FROM SYS.V$DATABASE;

LOG_MODE
------------
NOARCHIVELOG

Edit the pfile in either $ORACLE_BASE/admin/SID/pfile
or $ORACLE_HOME/admin/SID/pfile

############################
# Archive Log Destinations -benr(10/15/04)
############################
log_archive_dest_1='location=/u02/oradata/cuddle/archive'
log_archive_start=TRUE

You can specify as many as 10 diffrent archive log destinations
by using the paramters log_archive_dest_1 through log_archive_dest_10.
Remember, if you run out of space in your archive log destination the
database will shut down!

SQL> startup mount

SQL> alter database archivelog;

SQL> alter database open;


To view the archive log location

SQL> select name from v$archived_log;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/dbs/arch1_8_676141561.dbf

Also , you can use.
ALTER SYSTEM SET log_archive_dest_1='LOCATION=';

Tuesday, January 13, 2009

AIX

Logical Volume Manager (LVM) Commands for AIX

(Increase FS size in AIX with native LVM )
"chfs -a size= +4194304 " to grow the filesystem by 2 GB (4194304=2*1024*1024*1024/512)


http://networktechnologist.com/tips-aix-lvm.html


Logical Volume Manager (LVM) Commands for AIX


Glossary

Term
Definition
Journaled File System (JFS)
File system that uses a journaled log for faster, more reliable data recovery
Logical Partition (LP)
The LV is made up of LPs. The LP corresponds to 1 or more (in the case of mirroring) PPs.
Logical Volume (LV)
The VG is subdivided into logical volumes and each LV can have a file system on it.
Physical Partition (PP) All physical volumes are subdivided into pps. PPs are all the same size.
Physical Volume (PV)
Disk that is being managed by LVM.
Rootvg
Default volume group created during installation. The vg holds the OS filesystems ( /,/usr, /home, /proc /opt, /tmp, /var and swap space )
Volume Group (VG)
Area of storage that consists of one or more PVs


Command Summary

Command
Definition
chfs -a size=<#512 byte blocks>
Increases the size of a journaled file system to the total number of 512 byte blocks specified
chfs -a size=<+512 byte blocks> Increases the size of a journaled file system by the addional number of 512 byte blocks specified. For example "chfs -a size=+393216 /usr"
chlv -n Change the name of a logical volume (it must be inactive)
crfs -v jfs -m -g -a size=<# of 512 byte blocks>

crfs -v jfs -m -d
This command makes a logical volume, mount point with a journaled file system:


creates a jfs file system on a logical volume
df -k
Shows the disk usage of logical volumes on the server.
exportvg
removes a volume group from a machine
extendvg Adds a new physical volume to an existing volume group
importvg -y
add a volume group to another machine
lslv [-l, m]
Lists information about the logical volumes. The -l option lists the disks in the logical volume.
lspv [-l, M, p]
Lists the disks on the server, including the physical volume will give details about that disk. The -l option will list the details of how the filesystems are distributed on the disk.
lsvg [-l]
Lists the volume groups on the server, including the volume group name will give details about that vg. The -l option will list the logical volumes in the volume group.
lsvpcfg
Lists each vpath and the hdisks that make up the vpath
mklv -y Makes a logical volume in a volume group
mksysb -l -f
makes a bootable backup of rootvg
mkvg -y . . . Makes a volume group out of one or more physical volumes
mount or
mount if it is already in /etc/filesystems
Mounts the file system for use.
reducevg Removes a physical volume from a volume group
rmfs
removes a file system and it's logical volume
rmlv Removes a logical volume (it must be inactive)
savevg -l -f
makes a backup copy of another volume group
umount dismount the file system
Unmounts the filesystem.


Sample LVM Procedures:

Filesystem Procedures

Procedure to create a filesystem using JFS:
  • See below the procedure for creating a logical volume and a filesystem using JFS:

Procedure to extend the size of filesystem using JFS:
  1. "df" to see the filesystem, it's current size, % utilization and the name of it's logical volume
  2. "lslv " to show information about the logical volume including it's volume group name.
  3. "lsvg " to show information about the volume group, including number of free pp's and the pp size
  4. If there are not enough free pp's then see below for procedure to add a disk to a volume group.
  5. "chfs -a size= +4194304 " to grow the filesystem by 2 GB (4194304=2*1024*1024*1024/512)
    • NOTE: Growing the file system will automatically grow the logical volume
  6. df" shows the file system's current size is 2 GB more than before.
Troubleshooting extending the size of a filesystem using JFS:
  • Error Message: 0516-787 extendlv: Maximum allocation for logical volume is 512.
    • Maximum number of LPs for the logical volume has been exceeded - must increase the allocation
    • Calculate the number of LPs needed = LV Size in MB / LP size in MB
    • chlv -x
Procedure to remove a file system
  1. Unmount the filesystem
  2. Remove the logical volume "rmlv "
  3. Remove the filesystem information from /etc/filesystems
Procedure to reduce the size of a file system - shareold is 8mb and needs to be reduced to 4mb
  1. Create the file system
    1. crfs -v jfs -m /usr/sharenew -g rootvg -a size=8192
    2. this makes a logical volume in the root volume group of 4MB that uses jfs
  2. Mount the volume
    1. mount /usr/sharenew
  3. Move the files from the old file system (/usr/shareold)
    1. cd /usr/shareold
    2. tar cf - | (cd /usr/sharenew; tar xvf -)
    3. cd
  4. Unmount the file systems
    1. umount /usr/sharenew
    2. umount /usr/shareold
  5. Remove the old file system and it's logical volume
    1. rmfs /usr/shareold
    1. chfs -m /usr/shareold /usr/sharenew
  6. Mount the new filesystem
    1. mount /usr/shareold
  7. Delete the temporary mount point
    1. rmdir /usr/share

Logical Volume Procedures

Procedure to create a logical volume and filesystem in a volume group using JFS:
  1. lsvg to determine the size of the PP
  2. lslv in similar logical volumes to determine if mirroring is in effect
  3. Calculate the number of PPs needed for the logical volume
    1. bc
    2. scale=2
    3. /
    4. quit
  4. mklv -y "" <# of LPS> --> creates the logical volume
  5. crfs -v jfs -d -m / -A yes --> makes the filesystem, creates the mountpoint and puts it in /etc/filesystems
  6. mount / --> mounts the new fileystem
  7. df / --> verifies the mount and the size of the new filesystem
  8. Check the ownership and permissions of the new mount point
    • ls -ld
    • chown owner:group
    • chmod XXX
  9. If mirroring is in effect, then mirror this logical volume to another disk (original and 1 mirror):
    • mklvcopy -s y 2

Check to see if all of the logical volumes in a volume group are mirrored
  • lsvg -l

Mirror a logical volume after the fact
  • mklvcopy -s y 2


Volume Group Procedures

Procedure to create a volume group:
  1. lsdev -C -c disk -> lists available disks (and the hdisk#) on the server
  2. mkvg -y "" hdisk# --> creates the volume group on the named hard disk
  3. varyonvg --> activates the volume group
Procedure to add a disk to a volume group (extend the volume group)
  • extendvg
    • Verify the disk has been successfully added to the vg
  • lsvg -p

Procedure to mirror the rootvg:
  1. lspv --> determine the hdisk#
  2. extendvg rootvg hdisk --> add the hdisk to the volume group
  3. lspv --> verify that the hdisk has been successfully added to the volume group
  4. chvg -Q 'n' rootvg --> change the quorum so that the vg will stay active if one of the mirrors fail
  5. mirrorvg -S -c 2 rootvg --> mirror all of the logical volumes in the volume group
  6. lsvg -l rootvg --> verify successful mirroring (pps will appear "stale" until synchronization is complete).
  7. bosboot -a --> update the boot image information
  8. bootlist -m normal -o hdisk0 hdisk1 --> create a new bootlist
  9. bootlist -m normal -o --> verify the bootlist is correct
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:
  1. "lsvg " to show the total PP's available in the volume group =1250
  2. "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)
  3. "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)


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
  • lspv|grep 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