Tuesday, April 29, 2008

Solaris vxvm renaming diskgroup and disks

Renaming a disk group and volume
bansecdbdg -> secproddg used as an example

# Unmount all volumes in the bansecdbdg disk group.
# Stop all volumes
vxvol -g bansecdbdg stopall

# Deport bansecdbdg
vxdg deport bansecdbdg

# Import bansecdbdg using the -n option
vxdg -n secproddg import bansecdbdg

# Recover the disk group by the new dg name
vxrecover -g secproddg -sb

# Rename each volume
vxedit -g secproddg rename bansecdb01 sec01
vxedit -g secproddg rename bansecdb02 sec02
.
.
.
vxedit -g secproddg rename bansecdb08 sec08

# Update vfstab, your mount points and remount the volumes

Solaris VCS resource management

- Resources:

+ online a resouce:
# hares -online IP_192_168_1_54 -sys node1

+ offline a resouce:
# hares -offline IP_192_168_1_54 -sys node1

+ offline a resouce and propagte to children:
# hares -offprop IP_192_168_1_54 -sys node1

+ probe a resouce: you have fixed the problem, but resource still hastatus -sum still shows PARTIAL
# hares -probe IP_192_168_1_54 -sys node1

+ clear faulted resource:
# hares -clear IP_192_168_1_54 -sys node1

Solaris vxvm emc add lun and filesystem

1- run lputil to check bindings, in this RPC no need, since already capture in step 2
root:/kernel/drv # cd /usr/sbin/lpfc
root3:/usr/sbin/lpfc # ls
convert_path_lpfc* dfc64* lputil64*
dfc* lputil* resetqdepth*
dfc32* lputil32* update_lpfc*
root:/usr/sbin/lpfc # lputil
LightPulse Common Utility for Solaris/SPARC. Version 2.0a9 (8/03/2005).
Copyright (c) 2005, Emulex Corporation

Emulex Fibre Channel Host Adapters Detected: 2
Host Adapter 0 (lpfc0) is an LP9802 (Ready Mode)
Host Adapter 1 (lpfc1) is an LP9802 (Ready Mode)

MAIN MENU

1. List Adapters
2. Adapter Information
3. Firmware Maintenance
4. Reset Adapter
5. Persistent Bindings

0. Exit

Enter choice => 5

PERSISTENT BINDINGS MENU

1. Display Current Bindings
2. Display All Nodes
3. Duplicate Adapter Bindings
4. Bind Target Manually
5. Bind Automapped Targets
6. Delete Binding(s)

0. Return to Main Menu

Enter choice => 2
0. lpfc0
1. lpfc1

Select an adapter => 0

Visible Nodes:
Node Target WWPN WWNN
---- ------ --------- --------
In Transition 0 22-05-00-0d-ec-09-a1-80 20-02-00-0d-bd-af-ea-81
In Transition 0 24-8d-00-0d-ec-09-a1-80 20-02-00-0d-ec-09-a1-81
In Transition 0 50-06-04-82-cc-ab-50-a7 50-06-04-82-cc-ab-50-a7
Mapped FCP Node 19 50-06-04-8a-d5-2d-7a-a6 50-06-04-8a-d5-2d-7a-a6
Mapped FCP Node 16 50-06-04-8a-cc-36-cb-a6 50-06-04-8a-cc-36-cb-a6

Press the Enter or Return key to continue:

PERSISTENT BINDINGS MENU

1. Display Current Bindings
2. Display All Nodes
3. Duplicate Adapter Bindings
4. Bind Target Manually
5. Bind Automapped Targets
6. Delete Binding(s)

0. Return to Main Menu

Enter choice => 2
0. lpfc0
1. lpfc1

Select an adapter => 1

Visible Nodes:
Node Target WWPN WWNN
---- ------ --------- --------
In Transition 0 22-05-00-0d-ec-08-3e-80 20-02-00-0d-65-0b-2d-81
In Transition 0 24-8d-00-0d-ec-08-3e-80 20-02-00-0d-ec-08-3e-81
In Transition 0 50-06-04-82-cc-ab-50-a8 50-06-04-82-cc-ab-50-a8
Mapped FCP Node 17 50-06-04-8a-cc-36-cb-a9 50-06-04-8a-cc-36-cb-a9
Mapped FCP Node 20 50-06-04-8a-d5-2d-7a-a9 50-06-04-8a-d5-2d-7a-a9

Press the Enter or Return key to continue:

PERSISTENT BINDINGS MENU

1. Display Current Bindings
2. Display All Nodes
3. Duplicate Adapter Bindings
4. Bind Target Manually
5. Bind Automapped Targets
6. Delete Binding(s)

0. Return to Main Menu

Enter choice => 2
0. lpfc0
1. lpfc1

Select an adapter => 0

Visible Nodes:
Node Target WWPN WWNN
---- ------ --------- --------
In Transition 0 22-05-00-0d-ec-09-a1-80 20-02-00-0d-bd-af-ea-81
In Transition 0 24-8d-00-0d-ec-09-a1-80 20-02-00-0d-ec-09-a1-81
In Transition 0 50-06-04-82-cc-ab-50-a7 50-06-04-82-cc-ab-50-a7
Mapped FCP Node 19 50-06-04-8a-d5-2d-7a-a6 50-06-04-8a-d5-2d-7a-a6
Mapped FCP Node 16 50-06-04-8a-cc-36-cb-a6 50-06-04-8a-cc-36-cb-a6

Press the Enter or Return key to continue:

PERSISTENT BINDINGS MENU

1. Display Current Bindings
2. Display All Nodes
3. Duplicate Adapter Bindings
4. Bind Target Manually
5. Bind Automapped Targets
6. Delete Binding(s)

0. Return to Main Menu

Enter choice =>

2- backup and then edit /kernel/drv/lpfc.conf
# fcp-bind-WWPN="5006048acc36cba6:lpfc0t16",
# "5006048acc36cba9:lpfc1t17",
fcp-bind-WWPN="5006048acc36cba6:lpfc0t16",
"5006048acc36cba9:lpfc1t17",
"5006048ad52d7aa9:lpfc1t20",
"5006048ad52d7aa6:lpfc0t19", <------ replace ; with , "50060482CCAB50A7:lpfc0t21", <------ add this line "50060482CCAB50A8:lpfc1t22"; <------ add this line 3- backup and then edit sd.conf, add below lines

name="sd" parent="lpfc" target=21 lun=169 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=170 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=171 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=172 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=173 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=174 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=175 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=176 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=177 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=178 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=179 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=180 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=181 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=182 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=183 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=184 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=185 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=186 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=187 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=188 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=189 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=190 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=191 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=192 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=193 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=194 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=195 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=196 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=197 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=198 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=199 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=200 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=201 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=202 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=203 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=204 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=205 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=206 hba="lpfc0"; name="sd" parent="lpfc" target=21 lun=210 hba="lpfc0"; name="sd" parent="lpfc" target=22 lun=169 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=170 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=171 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=172 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=173 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=174 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=175 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=176 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=177 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=178 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=179 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=180 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=181 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=182 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=183 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=184 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=185 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=186 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=187 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=188 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=189 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=190 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=191 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=192 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=193 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=194 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=195 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=196 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=197 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=198 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=199 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=200 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=201 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=202 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=203 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=204 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=205 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=206 hba="lpfc1"; name="sd" parent="lpfc" target=22 lun=210 hba="lpfc1"; 4- Run update_drv –f lpfc to force the Solaris 9 or later system to re-read lpfc.conf. ** for this RFC system need to be rebooted, since it is running on Sol 8 version then go to step 8

root:/kernel/drv # uname -a SunOS ntxldb3 5.8 Generic_117350-38 sun4u sparc SUNW,Sun-Fire-880 run
#update_drv -f sd
5- run #devfsadm , ** you should see wrong magic number messages ** 6- Run format to label all paths to the new lun until all new disk are labeled
7- run #vxdctl enable
8- initialize disk, run /etc/vx/bin/vxdisksetup –i ** it should be c9t21d169
run #vxdg -g datadg adddisk datadg65=c9t21d169
#vxdg -g datadg adddisk datadg66=c9t21d170
continue ...
#vxdg -g datadg adddisk datadg103=c9t21d210
9- run #vxdisk list to verify all have been added to datadg
10-check datadg new available free space
run #vxassist -g datadg maxsize
11- create new file system
----
1. /db/app/oracle/102/product – 11 GB

vxassist -g datadg make oraclevol102 11g
mkfs -F vxfs -o largefiles /dev/vx/rdsk/datadg/oraclevol102


2. /db/prd42/dbf1 – 66 GB

vxassist -g datadg make p42_dbf1 66g
mkfs -F vxfs -o largefiles /dev/vx/rdsk/datadg/p42_dbf1

3. /db/prd42/dbf2 – 66 GB

refer above, use example above accordingly and so the rest

4. /db/prd42/dbf3 – 66 GB
5. /db/prd42/dbf4 – 66 GB
6. /db/prd42/dbf5 – 66 GB
7. /db/prd42/dbf6 – 66 GB
8. /db/prd42/dbf7 – 66 GB
9. /db/prd42/dbf8 – 66 GB
10. /db/prd42/dbf9 – 66 GB
11. /db/prd42/dbf10 – 66 GB
12. /db/prd42/undo – 22 GB
13. /db/prd42/temp – 33 GB
14. /db/prd42/redo1 – 4 GB
15. /db/prd42/redo2 – 4 GB
---
12- backup and then edit /etc/vfstab, add these lines

/dev/vx/dsk/datadg/oraclevol102 /dev/vx/rdsk/datadg/oraclevol102 /db/app/oracle/102/product vxfs 2 yes -
/dev/vx/dsk/datadg/p42_dbf1 /dev/vx/rdsk/datadg/p42_dbf1 /db/prd42/dbf1 vxfs 2 yes -
dev/vx/dsk/datadg/p42_dbf2 /dev/vx/rdsk/datadg/p42_dbf2 /db/prd42/dbf2 vxfs 2 yes -
continue..** refer above

13- run #mountall
14- run #mount , check largefiles option
15- run #df -k, check if everything are mounted ok.
16. done


---------------- info from storage team -------------

Below are the details of LUN's, please let us know whether you can see these LUN's on your Host's.

LUN's configured for server, LUN ID's are 169 to 206 respectivly And 03FA has LUN ID 210.



Symmetrix ID : 000187870530

Originator Port wwn : 10000000c942386c EMC WWN: 50060482CCAB50A8
User-generated Name : ntxldb3/apl_059_0905

Sym Dev LUN
Name Dir:P Physical Device Name VBUS TID SYMM HOST Attr Cap(MB)
------ ----- ----------------------- ---- --- ---- ---- ---- -------

03A8 9A:1 Not Visible 0 0 a9 N/A (M) 23731
03AA 9A:1 Not Visible 0 0 aa N/A (M) 23731
03AC 9A:1 Not Visible 0 0 ab N/A (M) 23731
03AE 9A:1 Not Visible 0 0 ac N/A (M) 23731
03B0 9A:1 Not Visible 0 0 ad N/A (M) 23731
03B2 9A:1 Not Visible 0 0 ae N/A (M) 23731
03B4 9A:1 Not Visible 0 0 af N/A (M) 23731
03B6 9A:1 Not Visible 0 0 b0 N/A (M) 23731
03B8 9A:1 Not Visible 0 0 b1 N/A (M) 23731
03BA 9A:1 Not Visible 0 0 b2 N/A (M) 23731
03BC 9A:1 Not Visible 0 0 b3 N/A (M) 23731
03BE 9A:1 Not Visible 0 0 b4 N/A (M) 23731
03C0 9A:1 Not Visible 0 0 b5 N/A (M) 23731
03C2 9A:1 Not Visible 0 0 b6 N/A (M) 23731
03C4 9A:1 Not Visible 0 0 b7 N/A (M) 23731
03C6 9A:1 Not Visible 0 0 b8 N/A (M) 23731
03C8 9A:1 Not Visible 0 0 b9 N/A (M) 23731
03CA 9A:1 Not Visible 0 0 ba N/A (M) 23731
03CC 9A:1 Not Visible 0 0 bb N/A (M) 23731
03CE 9A:1 Not Visible 0 0 bc N/A (M) 23731
03D0 9A:1 Not Visible 0 0 bd N/A (M) 23731
03D2 9A:1 Not Visible 0 0 be N/A (M) 23731
03D4 9A:1 Not Visible 0 0 bf N/A (M) 23731
03D6 9A:1 Not Visible 0 0 c0 N/A (M) 23731
03D8 9A:1 Not Visible 0 0 c1 N/A (M) 23731
03DA 9A:1 Not Visible 0 0 c2 N/A (M) 23731
03DC 9A:1 Not Visible 0 0 c3 N/A (M) 23731
03DE 9A:1 Not Visible 0 0 c4 N/A (M) 23731
03E0 9A:1 Not Visible 0 0 c5 N/A (M) 23731
03E2 9A:1 Not Visible 0 0 c6 N/A (M) 23731
03E4 9A:1 Not Visible 0 0 c7 N/A (M) 23731
03E6 9A:1 Not Visible 0 0 c8 N/A (M) 23731
03E8 9A:1 Not Visible 0 0 c9 N/A (M) 23731
03EA 9A:1 Not Visible 0 0 ca N/A (M) 23731
03EC 9A:1 Not Visible 0 0 cb N/A (M) 23731
03EE 9A:1 Not Visible 0 0 cc N/A (M) 23731
03F0 9A:1 Not Visible 0 0 cd N/A (M) 23731
03F2 9A:1 Not Visible 0 0 ce N/A (M) 23731
03FA 9A:1 Not Visible 0 0 d2 N/A 11865



Symmetrix ID : 000187870530

Originator Port wwn : 10000000c943c7ed EMC WWN: 50060482CCAB50A7
User-generated Name : ntxldb3/10000000c943c7ed

Sym Dev LUN
Name Dir:P Physical Device Name VBUS TID SYMM HOST Attr Cap(MB)
------ ----- ----------------------- ---- --- ---- ---- ---- -------

03A8 8A:1 Not Visible 0 0 a9 N/A (M) 23731
03AA 8A:1 Not Visible 0 0 aa N/A (M) 23731
03AC 8A:1 Not Visible 0 0 ab N/A (M) 23731
03AE 8A:1 Not Visible 0 0 ac N/A (M) 23731
03B0 8A:1 Not Visible 0 0 ad N/A (M) 23731
03B2 8A:1 Not Visible 0 0 ae N/A (M) 23731
03B4 8A:1 Not Visible 0 0 af N/A (M) 23731
03B6 8A:1 Not Visible 0 0 b0 N/A (M) 23731
03B8 8A:1 Not Visible 0 0 b1 N/A (M) 23731
03BA 8A:1 Not Visible 0 0 b2 N/A (M) 23731
03BC 8A:1 Not Visible 0 0 b3 N/A (M) 23731
03BE 8A:1 Not Visible 0 0 b4 N/A (M) 23731
03C0 8A:1 Not Visible 0 0 b5 N/A (M) 23731
03C4 8A:1 Not Visible 0 0 b7 N/A (M) 23731
03C6 8A:1 Not Visible 0 0 b8 N/A (M) 23731
03C8 8A:1 Not Visible 0 0 b9 N/A (M) 23731
03CA 8A:1 Not Visible 0 0 ba N/A (M) 23731
03CC 8A:1 Not Visible 0 0 bb N/A (M) 23731
03CE 8A:1 Not Visible 0 0 bc N/A (M) 23731
03D0 8A:1 Not Visible 0 0 bd N/A (M) 23731
03D2 8A:1 Not Visible 0 0 be N/A (M) 23731
03D4 8A:1 Not Visible 0 0 bf N/A (M) 23731
03D6 8A:1 Not Visible 0 0 c0 N/A (M) 23731
03D8 8A:1 Not Visible 0 0 c1 N/A (M) 23731
03DA 8A:1 Not Visible 0 0 c2 N/A (M) 23731
03DC 8A:1 Not Visible 0 0 c3 N/A (M) 23731
03DE 8A:1 Not Visible 0 0 c4 N/A (M) 23731
03E0 8A:1 Not Visible 0 0 c5 N/A (M) 23731
03E2 8A:1 Not Visible 0 0 c6 N/A (M) 23731
03E4 8A:1 Not Visible 0 0 c7 N/A (M) 23731
03E6 8A:1 Not Visible 0 0 c8 N/A (M) 23731
03E8 8A:1 Not Visible 0 0 c9 N/A (M) 23731
03EA 8A:1 Not Visible 0 0 ca N/A (M) 23731
03EC 8A:1 Not Visible 0 0 cb N/A (M) 23731
03EE 8A:1 Not Visible 0 0 cc N/A (M) 23731
03F0 8A:1 Not Visible 0 0 cd N/A (M) 23731
03F2 8A:1 Not Visible 0 0 ce N/A (M) 23731
03FA 8A:1 Not Visible 0 0 d2 N/A 11865


-------------------------------------------------------------------------------

Below are the Details of LUN's configured for ebitb2b3, LUN ID's are 207,208 & 209 respectivly.




Symmetrix ID : 000187870530

Originator Port wwn : 10000000c93f44b3 EMC WWN: 50060482CCAB50A7
User-generated Name : ebitb2b3/10000000c93f44b3

Sym Dev LUN
Name Dir:P Physical Device Name VBUS TID SYMM HOST Attr Cap(MB)
------ ----- ----------------------- ---- --- ---- ---- ---- -------

03F4 8A:1 Not Visible 0 0 cf N/A (M) 23731
03F6 8A:1 Not Visible 0 0 d0 N/A (M) 23731
03F8 8A:1 Not Visible 0 0 d1 N/A (M) 23731




Symmetrix ID : 000187870530

Originator Port wwn : 10000000c93f482e EMC WWN: 50060482CCAB50A8
User-generated Name : ebitb2b3/10000000c93f482e

Sym Dev LUN
Name Dir:P Physical Device Name VBUS TID SYMM HOST Attr Cap(MB)
------ ----- ----------------------- ---- --- ---- ---- ---- -------

03F4 9A:1 Not Visible 0 0 cf N/A (M) 23731
03F6 9A:1 Not Visible 0 0 d0 N/A (M) 23731
03F8 9A:1 Not Visible 0 0 d1 N/A (M) 23731


------------------------------------------------------------------------------------


Solaris VCS test import deport diskgroup

On source server
#vxvol -g ora45dg stopall
#vxdisk -o alldgs list
#vxdg deport ora45dg
#vxdisk list -o alldgs list
#vxdisk -o alldgs list
On target server
#vxdg import ora45dg
#vxvol -g ora45dg startall
#vxprint -ht grep ora45dg
#mount -o forcedirectio /dev/vx/dsk/ora45dg/ora10agea /db/oracle10

Solaris Vxvm mirror rootdisk

1. /etc/vx/bin/vxdisksetup -i c1t1d1
2. vxdg -g rootdg adddisk rootmirror=c1t1d1
3. /etc/vx/bin/vxrootmir rootmirror
4. vxassist -g rootdg mirror swapvol rootmirror
5. vxassist -g rootdg mirror var rootmirror
6. vxassist -g rootdg mirror opt rootmirror
7. vxdisk -g rootdg list

Monday, April 28, 2008

AIX set ulimit for user

How to change ulimit/limit for certain user under AIX

1) edit /etc/security/limits like example below. No need to restart anything


Set "ulimit" to "unlimited" for interfac@AMSDC1U043 Unix Account: interfac / mireports


vi /etc/security/limits

interfac:
fsize = -1
fsize_hard = -1
cpu_hard = -1
data_hard = -1
stack_hard = -1
rss_hard = -1
nofiles_hard = -1

mireport:
fsize = -1
fsize_hard = -1
cpu_hard = -1
data_hard = -1
stack_hard = -1
rss_hard = -1
nofiles_hard = -1

Thursday, April 24, 2008

HPUX how to install patch

Patch

patch install eg:
(patch is obtained in a "depot" file format, which is really a tar.
Instruction presented in here is also in a text file inside the tar.)

http://www2.itrc.hp.com/service/patch/patchDetail.do?patchid=PHSS_20055&context=hpux:800:11:00

1. Back up your system before installing a patch.

2. Login as root.

3. Copy the patch to the /tmp directory.

4. Move to the /tmp directory and unshar the patch:

cd /tmp
sh PHSS_20055

5. Run swinstall to install the patch:

[ to check that depot has been downloaded correctly:
swlist -d @ /full/absolute/path/PHSS_20055.depot
]

swinstall -x autoreboot=true -x patch_match_target=true \
-s /tmp/PHSS_20055.depot

By default swinstall will archive the original software in
/var/adm/sw/save/PHSS_20055. If you do not wish to retain a
copy of the original software, use the patch_save_files option:

swinstall -x autoreboot=true -x patch_match_target=true \
-x patch_save_files=false -s /tmp/PHSS_20055.depot

WARNING: If patch_save_files is false when a patch is installed,
the patch cannot be deinstalled. Please be careful
when using this feature.

For future reference, the contents of the PHSS_20055.text file is
available in the product readme:

swlist -l product -a readme -d @ /tmp/PHSS_20055.depot

To put this patch on a magnetic tape and install from the
tape drive, use the command:

dd if=/tmp/PHSS_20055.depot of=/dev/rmt/0m bs=2k

HPUX mirror root disk

The /etc/fstab before mirroring is:
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /tmp vxfs delaylog 0 2
/dev/vg00/lvol5 /lhome vxfs delaylog 0 2
/dev/vg00/lvol6 /opt vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2

ioscan -funC disk
pvdisplay /dev/dsk/c1t2d0 # get lvm info of existing disk.
pvdisplay /dev/dsk/c2t2d0 # get err, no lvm def on it, raw disk.

pvcreate -B /dev/rdsk/c2t2d0 # add physical disk to be used by LVM
vgextend /dev/vg00 /dev/dsk/c2t2d0 # incorporate new disk to existing vg00

# do some checking
strings /etc/lvmtab # see new disk used by lvm
lifls /dev/rdsk/c1t2d0 # see lot of boot util
lifls /dev/rdsk/c2t2d0 # no boot util, add next...

mkboot /dev/rdsk/c2t2d0 #
mkboot -a "hpux -lq" /dev/rdsk/c2t2d0 # SECONDARY disk, add AUTO, low quorum
mkboot -a "hpux -lq" /dev/rdsk/c1t2d0 # PRIMARY disk, low quorum (??)

lifls /dev/rdsk/c2t2d0 # see boot util, but not as extensive
# as primary disk. It is ok.

###
### The next steps will actually perform the mirror,
### and it will fail if -m mirroring option is not activated with valid license
###

lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t2d0 # add mirror for lvol1=/stand
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t2d0 # add mirror for lvol2=/ (root)
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t2d0 # add mirror for lvol3=(swap)
# Repeat for all lvolX...
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t2d0 # add mirror for lvol8=(/var)
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t2d0 # add mirror for lvol7=(/usr)
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t2d0 # add mirror for lvol6=(/opt)
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t2d0 # add mirror for lvol5=(/lhome)
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t2d0 # add mirror for lvol4=(/tmp)

setboot # check current PDC bootpath
setboot -a 0/0/2/0.2.0 # set PDC> BO SEC (if needed)

###
### To undo the mirroring prep work:
###

vgreduce /dev/vg00 /dev/dsk/c2t2d0
pvremove /dev/rdsk/c2t2d0

###
### Replacing a mirror disk 149
###

vgcfgrestore -n /dev/vgXX /dev/rdsk/c... # vol grp conf restore
vgchange -a y /dev/vgXX # change vol grp to avai
lable (-a y)
vgsync /dev/vgXX # resync logical vol in
vol grp.

###
### Replace mirrored disk boot disk
### In addition to normal mirror disk replacements steps above,
### add:
###

mkboot /dev/rdsk/c.t...
mkboot -a "hpux lq" /dev/rdsk/c...

reboot # vgcfgbackup is run automatically on reboot

HPUX volume management

ioscan -fnC disk # scan for disk dev path
pvcreate -B /dev/rdsk/c3t15d0 # mark disk for use as PV in LVM
dd if=/dev/zero of=/dev/rdsk/c3t15d0 bs=64k count=10
# wipe out obsolete LVM marking on disk so that
# pvcreate will not complain, re run pvcreate cmd

mkdir /dev/vg01
mknod /dev/vg01/group c 64 0xNN0000 # c 64 is disk major number
# 0xNN0000 is uniq minor number hex, try 01, 02, ...
# eg, chk against ls -l /dev/vg*/group

vgcreate -s8 /dev/vg01 /dev/dsk/c3t15d0 # create a new vol grp. w/ Phy Extend = 8 mb

mkboot /dev/rdsk/c3t15d0 # make it bootable disk

lvcreate -C y -r n -L 1024 /dev/vg01 # create contiguous dev lvol1 size 1024 MB
lvcreate -C y -r n -L 1024 /dev/vg01 # ditto, will be named lvol2 automatically

lvlnboot -r /dev/vg01/lvol1 # make lvol1 a boot partition
lvlnboot -s /dev/vg01/lvol2 # make lvol2 a swap dev


newfs -F vxfs /dev/vg01/rlvol1 # create the fs as veritas fs
swapon /dev/vg01/lvol2 # activate swap
vi /etc/fstab...

# swap addition like this req disk to have a boot partition, even on 2nd disk.
# sam may provide easier alternative.
# also, may need to set kernel param maxswapchunk which limit max swap size in byte
# calc as swchunk * DEV_BSIZE, whose def are 2048 and 1024, resp.



non "system" volumes can be created as, eg /usr/local:
lvcreate /dev/vg00
lvextend -L 2000 /dev/vg00/lvol11 # allocate 2 GB for the Log Vol.
newfs -F vxfs /dev/vg00/rlvol11 # lvol11 assigned dyn from above

Clean up procedure, reverse of create...
lvrmboot -r /dev/vg01 # remove root vol req for the LV.
# undo lvlnboot -r and -s
lvremove /dev/vg01/lvol2 # remove the logic vol lvol2 from vg01
lvremove /dev/vg01/lvol1
vgremove vg # remove the whole vol grp

bdf # df, berkeley version

growfing the fs:
lvdisplay /dev/vg00/lvolX
# find out LE value
umount /fsmount
lvextend -l le_number /dev/vg00/lvolX # where le_number is new LE value
# or -L sizeInMB (final size)
extendfs /dev/vg00/lvolX # will fill up all allocated LE, JFS
fsadm -F vxfs size /fsmount # increase fs for onlineJFS.
mount /fsmount

unless have onlineJFS, need unmount before extend. /var, /usr need boot into
single user mode (ISL hpux -is, -lm main mode won't work!)
lvextend, extendfs, then reboot to increase such fs.
Not sure how to do / !!

Sunday, April 20, 2008

AIX Determine disk size without assign it to vg

Displays disk size
#bootinfo –s hdisk0

Solaris/Veritas how to recover server quickly

1. Add MAC address to /etc/ethers

2. Add IP Address to /etc/hosts

3. cd /jumpstart/Solaris_8/Tools

4. ./add_install_client -s jumpstart:/jumpstart -c jumpstart:/jumpstart -p jumpstart:/jumpstart machine_name sun4u

Then tarred the Veritas Netbackup Client Software from the jumpstart server (it gets backed up), to the mini-root of boot area.

5. cd /usr

6. tar cvf openv.tar openv

Next copy your /etc/shadow, /etc/inet/services, /etc/inetd.conf, and /etc/default/login with the CONSOLE line commented out.

7. cp /etc/shadow /jumpstart/Solaris_8/Tools/Boot/etc
8. cp /etc/inet/services /jumpstart/Solaris_8/Tools/Boot/etc/inet
9. cp /etc/inet/inetd.conf /jumpstart/Solaris_8/Tools/Boot/etc/inet
10. cp /etc/default/login /jumpstart/Solaris_8/Tools/Boot/etc/default

Move the openv.tar file to the mini-root user location

11. mv /usr/openv.tar /jumpstart/Solaris_8/Tools/Boot/usr

12. cd /jumpstart/Solaris_8/Tools/Boot/usr && tar xvf openv.tar

Netbackup uses a Java GUI that is why you need to copy the services and inetd.conf files. The shadow and edited /etc/default/login file will allow you to telnet into the remote server as root.

Now we are ready to rebuild the server
At the ok> prompt type:

13. boot net

14. On mine it loaded OpenWindows and then stopped, since there was no CD Media.

Open a command tool and start the inetd daemon.

15. /usr/sbin/inetd -s

Now you should be able to connect using your Veritas Netbackup Client Software I have copy locally on my box.

16. Login

17. Restore whatever you need. If you have separate partitions (/,/opt, /var, /usr, etc...), then you probably want to mount those separately after each successfull restore. You can do this by telneting in remotely.

Friday, April 18, 2008

AIX print job

Check the print queue
# lpstat -vlpforu
Queue Dev Status Job Files User PP % Blks Cp Rnk
------ ---- -------- --- ---------------- -------- ---- -- ---- -- ---
lpforu lp0 RUNNING 3 /etc/passwd root 1 100 1 1 1

Disable the print queue
# enq -D -P 'lpforu:lp0'

Check the printer queue
# qchk -P lpforu
Queue Dev Status Job Files User PP % Blks Cp Rnk
------ ---- -------- --- ---------------- -------- ---- -- ---- -- ---
lpforu lp0 DOWN 3 /etc/passwd root 1 100 1 1 1


To restart the print queue and finish the print job after loading the paper, use the following commands:
# lpstat -vlpforu
Queue Dev Status Job Files User PP % Blks Cp Rnk
------ ---- -------- --- ---------------- -------- ---- -- ---- -- ---
lpforu lp0 DOWN 3 /etc/passwd root 1 100 1 1 1

# enq -U -P 'lpforu:lp0'
# qchk -P lpforu
Queue Dev Status Job Files User PP % Blks Cp Rnk
------ ---- -------- --- ---------------- -------- ---- -- ---- -- ---
lpforu lp0 RUNNING 3 /etc/passwd root 1 100 1 1 1

-or-

# enable lpforu:lp0

Flushing a print job

# lpstat -vlpforu
Queue Dev Status Job Files User PP % Blks Cp Rnk
------ ---- -------- --- ---------------- -------- ---- -- ---- -- ---
lpforu lp0 RUNNING 3 /etc/passwd root 1 100 1 1 1
QUEUED 4 /etc/hosts root 1 100 2 1 2

Cancel the print job for /etc/passwd using one of the following commands:
# qcan -P lpforu -x 3
# cancel 3
# lprm -P lpforu 3
# enq -P lpforu -x 3

Check the print queue using the qchk command.
# qchk -P lpforu
Queue Dev Status Job Files User PP % Blks Cp Rnk
------ ---- -------- --- ---------------- -------- ---- -- ---- -- ---
lpforu lp0 RUNNING 4 /etc/hosts root 1 100 2 1 2

AIX sendmail queue full

To flush queue
#sendmail -q -v
-or-
1. Stop the sendmail daemon.
2. Move the entire queue directory by entering:
#cd /var/spool
#mv mqueue omqueue
3. Restart the sendmail daemon.
4. Process the old mail queue by entering:
#sendmail -oQ/var/spool/omqueue -q
The -oQ flag specifies an alternate queue directory. The -q flag specifies to
run every job in the queue. To get a report about the progress of the
operation, use the -v flag. This operation can take a long time.
5. Remove the log files and the temporary directory when the queue is empty by
entering:
#rm /var/spool/omqueue/*
#rmdir /var/spool/omqueue

AIX reduce wtmp size

To edit the /var/adm/wtmp file, first copy the file temporarily with the following
command:
# /usr/sbin/acct/fwtmp < /var/adm/wtmp >/tmp/out
#
Edit the /tmp/out file to remove unwanted entries, then replace the original file
with the following command:
# tail -1000 /tmp/out > /tmp/in
# /usr/sbin/acct/fwtmp -ic < /tmp/in > /var/adm/wtmp

or

#cp /dev/null /var/adm/wtmp

AIX remove a filesystem

# lsvg -l testvg
testvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv00 jfslog 1 1 1 closed/syncd N/A
lv00 jfs 1 1 1 closed/syncd /fs1
loglv01 jfs2log 1 1 1 open/syncd N/A
fslv00 jfs2 1 1 1 closed/syncd /fs2
testlv jfs2 1 1 1 open/syncd /test
# rmfs /test
rmfs: 0506-921 /test is currently mounted.
# umount /test
# rmfs /test
rmlv: Logical volume testlv is removed.
# lsvg -l testvg
testvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv00 jfslog 1 1 1 closed/syncd N/A
lv00 jfs 1 1 1 closed/syncd /fs1
loglv01 jfs2log 1 1 1 closed/syncd N/A
fslv00 jfs2 1 1 1 closed/syncd /fs2
# cat /etc/filesystemsgrep test

#

AIX remove a copy of logical volume

Removing a copy of a logical volume
You can use the rmlvcopy command to remove copies of logical partitions of a logical volume. Use the rmlvcopy command to remove a set of copies for the logical partitions testlv as follows:
1. lslv -m testlv shows that testlv has three mirror copies located on hdisk5,
hdisk6, and hdisk7.
2. rmlvcopy testlv 2 hdisk6 removes copies located on hdisk6 and leaves two
mirror copies.
3. lslv -m testlv shows that testlv now has two mirror copies located on
hdisk5 and hdisk7.


Example:
# lslv -m testlv
testlv:/test
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0056 hdisk5 0056 hdisk6 0059 hdisk7
0002 0057 hdisk5 0057 hdisk6 0060 hdisk7
0003 0058 hdisk5 0058 hdisk6 0061 hdisk7
# rmlvcopy testlv 2 hdisk6
# lslv -m testlv
testlv:/test
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0056 hdisk5 0059 hdisk7
0002 0057 hdisk5 0060 hdisk7
0003 0058 hdisk5 0061 hdisk7

AIX how to mirror rootvg

Using the mirrorvg command to mirror rootvg volume group
# lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 546 526
109..105..94..109..109
# extendvg rootvg hdisk1
0516-1254 extendvg: Changing the PVID in the ODM.
# mirrorvg rootvg
0516-1124 mirrorvg: Quorum requirement turned off, reboot system for this
to take effect for rootvg.
0516-1126 mirrorvg: rootvg successfully mirrored, user should perform
bosboot of system to initialize boot records. Then, user must modify
bootlist to include: hdisk0 hdisk1.
# bosboot -ad /dev/hdisk1
bosboot: Boot image is 23795 512 byte blocks.
# bootlist -m normal hdisk0 hdisk1
# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 4 8 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A
hd4 jfs2 1 2 2 open/syncd /
hd2 jfs2 9 18 2 open/syncd /usr
hd9var jfs2 1 2 2 open/syncd /var
hd3 jfs2 1 2 2 open/syncd /tmp
hd1 jfs2 1 2 2 open/syncd /home
254 IBM Eserver p5 and pSeries Administration and Support for AIX 5L V5.3
hd10opt jfs2 1 2 2 open/syncd /opt
#shutdown -Fr

VERITAS Cluster command list

Cluster operations
Start VCS

hastart [-force-stale]
hasys -force system
Stop VCS

hastop -local [-force-evacuate]
hastop -sys system [-force-evacuate]
hastop -all [-force]
Open, save, save and close configuration

haconf -makerw -dump -dump -makero
Add user

hauser -add user
Basic configuration
Configure service groups

hagrp -add -delete group
hagrp -modify group attribute value
hagrp -link parent_group child_group dependency firmsoft
Configure resources

hares -add resource type group
hares -delete resource
hares -modify resource attribute value
hares -link parent_resource child_resource
Configure Agents, types

hatype -modify type attribute value
Basic operations
Online, offline, switch, flush service group

hagrp -online group -sys system; hagrp -online group -any
hagrp -offline group -sys system; hagrp -offline group -any
hagrp -switch group -sys system; hagrp -switch group -any
hagrp -flush group -sys system
Online, offline resources

hares -online [-ignoreparent] ressource -sys system
hares -offline [-ignoreparent] ressource -sys system
Clear faulted resources

hares -clear resource [-sys system]
hagrp -clear group [-sys system]
hares -probe resource -sys system
Status and verification
VCS status (system,group,resource,agent)

hastatus -summary
LLT status, verification

lltconfig
lltconfig -a list
lltstat
lltstat -nvv

GAB status, verification

gabconfig -a
gabdiskhb -l
gabdiskx -l
Communication
Starting and stopping LLT

lltconfig -c
lltconfig -U
Starting and stopping GAB

gabconfig -c -n seed_number
gabconfig -U
Administration
Freezing, unfreezing groups

hagrp -freeze group [-persistent]
hagrp -unfreeze group [-persistent]
Freezing, unfreezing systems

hasys -freeze system [-persistent][-evacuate]
hasys -unfreeze system [-persistent]
Autoenabling groups

hagrp -autoenable group -sys system
Configuration files
llthosts: list of node and name of the each node

cat /etc/llthosts
0 sldnc062dn1
1 sldnc062dn2
llttab: node info + link configuration1

cat /etc/llttab
set-node sldnc062dn2
set-cluster 62
link ce0 /dev/ce:0 - ether - -
link ce3 /dev/ce:3 - ether - -
link-lowpri ce4 /dev/ce:4 - ether - -
start
gabtab: Start gabconfig, -n 2 mean at least to node should be running

cat /etc/gabtab
/sbin/gabconfig -c -n 2
main.cf: Main configuration file

ls /etc/VRTSvcs/conf/config
OracleTypes.cf main.cf.09May2006.14.51.36
OracleTypes.cf.13Apr2006.10.13.09 main.cf.13Apr2006.10.13.09
OracleTypes.cf.previous main.cf.13Apr2006.10.37.22
VRTSWebAppType.cf main.cf.13Apr2006.10.45.09
main.cf main.cf.13Apr2006.10.50.32
main.cf.08May2006.12.43.07 main.cf.13Apr2006.11.56.48
main.cf.08May2006.12.45.11 main.cf.13Apr2006.14.31.46
main.cf.09May2006.11.30.58 main.cf.13Apr2006.16.17.02
main.cf.09May2006.12.01.47 main.cf.13Apr2006.16.20.24
main.cf.09May2006.12.39.24 main.cf.previous
main.cf.09May2006.14.23.55 types.cf
main.cf.09May2006.14.28.37 types.cf.13Apr2006.10.13.09
main.cf.09May2006.14.39.32 types.cf.previous
This file will be duplicated on each node, if you need to make a change you will have to run the command "haconf -makerw" then the configuration is "open, read-write mode" all the changes will be apply in memory and a lock file will be creat ".stale", if all cluster node reboot or stop for any reason and the configuration is still open then the cluster will not restart because of the ".stale" file, once you've done a changed you will have to "close, read-only mode" the configuration file using the command "haconf -dump [-makero]". Running this command, will apply changes in conf file on every nodes, remove ".stale" and save the old configuration adding the date at the end of the file.

Log files
/var/VRTSvcs/log

ls /var/VRTSvcs/log
CmdServer-log_A.log NIC_A.log Volume_A.log notifier-out_A.log
DiskGroup_A.log Netlsnr_A.log engine_A.log tmp
IP_A.log Oracle_A.log hashadow-err_A.log
Mount_A.log Proxy_A.log hashadow_A.log
The main log file is "engine_A.log"

Basic work
Get the group list
# hagrp -list
ClusterService clust00
ClusterService clust01
arnaudsg clust00
arnaudsg clust01
Get resources list
# hagrp -resources arnaudsg
rno_IP
rno_MNT
Get one resource info
# hares -display rno_IP
#Resource Attribute System Value
rno_IP Group global arnaudsg
rno_IP Type global IP
rno_IP AutoStart global 1
rno_IP Critical global 1
rno_IP Enabled global 1
rno_IP LastOnline global clust01
rno_IP MonitorOnly global 0
rno_IP ResourceOwner global unknown
rno_IP TriggerEvent global 0
rno_IP ArgListValues clust00 le1 10.3.1.181 255.255.255.0 "" 1 0
rno_IP ArgListValues clust01 le1 10.3.1.181 255.255.255.0 "" 1 0
rno_IP ConfidenceLevel clust00 0
rno_IP ConfidenceLevel clust01 100
rno_IP Flags clust00
rno_IP Flags clust01
rno_IP IState clust00 not waiting
rno_IP IState clust01 not waiting
rno_IP Probed clust00 1
rno_IP Probed clust01 1
rno_IP Start clust00 0
rno_IP Start clust01 1
rno_IP State clust00 OFFLINE
rno_IP State clust01 ONLINE
rno_IP Address global 10.3.1.181
rno_IP ArpDelay global 1
rno_IP ComputeStats global 0
rno_IP Device global le1
rno_IP IfconfigTwice global 0
rno_IP NetMask global 255.255.255.0
rno_IP Options global
rno_IP ResourceInfo global State Stale Msg TS
rno_IP MonitorTimeStats clust00 Avg 0 TS
rno_IP MonitorTimeStats clust01 Avg 0 TS

Veritas Netbackup handy command

To release a tape if it is full...
\volmgr\bin\vmquery -m to check the tape and take note of the status at the bottom...
\volmgr\bin\vmquery -deassignbyid ie. vmquery -deassignbyid 0x0
\NetBackup\bin\admincmd\bpexpdate -m -d 0 (Expires a tape from the database)
Check which schedules do not cover drives/mount points from servers.
\NetBackup\bin\goodies\check_coverage
Grep these results for frozen tapes etc
\NetBackup\bin\goodies\available_media
Convert ctime to real date/time
\NetBackup\bin\bpdbm -ctime xxxxxxxxxx
Checks for errors encountered
\NetBackup\bin\admincmd\bperror -problems -hoursago 24 -U
Lists the error code and resolution
\NetBackup\bin\admincmd\bperror -S -r
Backup Status
\NetBackup\bin\admincmd\bperror -U -backstat -s info -d mo/da/yr hr:mn:sc -e mo/da/yr hr:mn:sc
Client Backups
\NetBackup\bin\admincmd\bpimagelist -U [-A-client name] -d mo/da/yr hr:mn:sc -e mo/da/yr hr:mn:sc
Problems Report
\NetBackup\bin\admincmd\bperror -U -problems -d mo/da/yr hr:mn:sc -e mo/da/yr hr:mn:sc
All Log Entries
\NetBackup\bin\admincmd\bperror -U -all -d mo/da/yr hr:mn:sc -e mo/da/yr hr:mn:sc
Media List
\NetBackup\bin\admincmd\bpmedialist -U -mlist [-m media ID]
Media Contents
\NetBackup\bin\admincmd\bpmedialist -U -mcontents [-m media ID]
Images on Media
\NetBackup\bin\admincmd\bpimmedia -U -client ([-mediaid media_ID [-m media_ID NBU 3.2])
Media Log Entries
\NetBackup\bin\admincmd\bperror -U -media -d mo/da/yr hr:mn:sc -e mo/da/yr hr:mn:sc
Media Summary
\NetBackup\bin\admincmd\bpmedialist -summary
Media Written
\NetBackup\bin\admincmd\bpimagelist -A -media -d mo/da/yr hr:mn:sc -e mo/da/yr hr:mn:sc
Volume detail
\volmgr\bin\vmquery -a
Check Robotics contents from the command line
\volmgr\bin\vmcheckxxx -rt -rn -rh

VERITAS netbackup test client connection

Veritas NetBackup (tm) 6.0 supplies a new command to test connections to clients. This command is the bptestbpcd command. This command is helpful because, unlike ping or nslookup, it tests for connection to a NetBackup Client using client connection options at the NetBackup communication level. Parameter switches allow a user to target a NetBackup Client or a host. Connection using the different Client Connect Options can also be tested. Troubleshooting is made easier by including the -verbose and -debug switches.


TO TEST DEFAULT CLIENT CONNECTIONS USING BPTESTBPCD
1. From a Windows command prompt change into the \veritas\netbackup\bin\admincmd directory, or in a UNIX console window, change into the /usr/openv/netbackup/bin/admincmd directory.
2. Type bptestbpcd /? to list the command parameters.
3. Run the command bptestbpcd -client xxxx (where xxxx is a clientname) to test connection to a client.
4. To view further details, run the command #bptestbpcd -client xxxx -verbose (where xxxx is a clientname).
5. To trace through the connection process, run the command bptestbpcd -client xxxx -debug (where xxxx is a clientname).

Sunday, April 13, 2008

Solaris/AIX Saving routing table before reboot

To capture routes
# ls
add_all_routes capture.sh
root@nstgdb2:/tmp/imran # more capture.sh
#! /bin/sh
netstat -rn |egrep -v "127.0.0.1|-|Routing|Destination" | awk '{ print $1"\t "$2
}'|cut -d"%" -f1 >routes
awk '{ print "route add ", $1,$2 }' routes >add_all_routes
#
To restore routes just run
#sh all_all_routes

VERITAS What is auto:cdsdisk

What is cdsdisk?
c1t0d0s2 auto:cdsdisk data1dg01 data1dg online
ANS: For a disk to be accessible by multiple platforms, the disk must be consistently recognized by the platforms, and all platforms must be capable of performing I/O on the disk. CDS disks contain
specific content at specific locations to identify or control access to the disk on different platforms.
The same content and location are used on all CDS disks, independent of the platform on which the
disks are initialized.


VERITAS Volume Manager (tm) 4.0 revised vxdg init default options ( cds=off ) need to be specified for all non-cdsdisk types when creating a new disk group.

Details:
In VERITAS Volume Manager 4.0, changes were made to the default disk group type and disk type attributes. Prior to Volume Manager 4.0, the default disk type was "simple" it is now "cdsdisk". If a device has a disk type of "cdsdisk", the additional vxdg init attribute is not required ( cds=off ).

Example
-------------
Create a new disk group using a cdsdisk type defined disk:

DEVICE TYPE DISK GROUP STATUS
c0t0d0s2 auto:none - - online invalid
c1t0d1s2 auto:cdsdisk - - online <-- Using this disk for this exercise
c1t0d2s2 auto:sliced - - online
c1t0d3s2 auto:sliced - - online
c1t0d8s2 auto:sliced ctd1 emcdg online
c1t0d10s2 auto:sliced - - online invalid
emcpower8c simple emc8 rootdg online
emcpower9c simple - - online

CDSDISK
# vxdg init testdg c1t0d1s2
The vxdg init command works fine, without the need for the "cds=off" argument as the disk type was cdsdisk.

Revised output:
c1t0d1s2 auto:cdsdisk c1t0d1s2 testdg online

Simple or sliced disk:
Sliced:
# vxdg init testdg2 c1t0d1s2
VxVM vxdg ERROR V-5-1-6478 Device c1t0d1s2 cannot be added to a CDS disk group

Workaround:
Add the cds=off argument:
# vxdg init testdg2 c1t0d1s2 cds=off

Simple:

# vxdg init newemcdg disk01=emcpower9c
VxVM vxdg ERROR V-5-1-6478 Device emcpower9c cannot be added to a CDS disk group

Now add the new attribute cds=off:
# vxdg init newemcdg disk01=emcpower9c cds=off
Revised output:
emcpower9c simple disk01 newemcdg online

Further Information
If the "cds=off" attribute is not specified with the vxdg init command, the /etc/default/vxdg file is searched for a definition of this attribute. If no such definition is found, the value "cds=on" is assumed. Add such a definition to this file if you wish to change the new default back.

Saturday, April 12, 2008

VERITAS to check volume size

root # more volume.txt
db_bkup
usrvol
root # more c.sh
#! /bin/sh
for i in `cat volume.txt`
do
vxprint -ht $i | grep -i fsgen | nawk '{print "volume ",$2,"Total size: " $6/2/1024 " Mb"}'
done
root # sh c.sh
volume db_bkup Total size: 138620 Mb
volume usrvol Total size: 2048 Mb

Veritas Mirror volume notes

# ls -l
total 64
-rw-r--r-- 1 root other 119 Apr 11 01:21 a.sh
-rw-r--r-- 1 root other 151 Apr 11 20:48 b.sh
-rw-r--r-- 1 root other 78 Apr 11 20:48 tmp.out
-rw-r--r-- 1 root other 61 Apr 11 20:34 volume.txt
# cat a.sh
#! /bin/sh
vxdg -g oradg free | nawk '
{
if ($5/2/1024 > 0)
print "... Free chunk on "$1"("$2")"" " $5/2/1024, "MB"
}'
# cat b.sh
#! /bin/sh
for i in `cat volume.txt`
do
echo $i
df -k | grep $i > tmp.out
cat tmp.out | awk '{print "Volume ",$1, "Total size: " $2/1024 " Mb"}'
done
# cat tmp.out
/dev/vx/dsk/oradg/s33_redo2 2097152 1273531 772150 63% /db/stg33/redo2
# cat volume.txt
s33_dbf1
s33_dbf2
s33_dbf3
s33_dbf4
s33_redo1
s33_redo2
#

Friday, April 11, 2008

VERITAS Calculate free disk space on each disk

root$ sh a.sh
... Free chunk on rootmirr(c0t1d0s2) 25226.6 MB
... Free chunk on rtdisk(c0t0d0s2) 5122.05 MB
... Free chunk on rtdisk(c0t0d0s2) 0.250977 MB
... Free chunk on rtdisk(c0t0d0s2) 0.255859 MB
... Free chunk on rtdisk(c0t0d0s2) 2049.67 MB
... Free chunk on rtdisk(c0t0d0s2) 550.151 MB
root$ more a.sh
#! /bin/sh
vxdg -g rootdg free | nawk '
{
if ($5/2/1024 > 0)
print "... Free chunk on "$1"("$2")"" " $5/2/1024, "MB"
}'
root@ebitb2b2 $

Thursday, April 10, 2008

VERITAS mirror volume to specific disk

# vxassist mirror swapvol alloc=rootmiror
# vxassist mirror var alloc=rootmiror

Veritas how to change the vxfs fs size

#fsadm -b 10m /opt/apps
- works even on a mounted fs
- increase does not work if fs 100% full ;-( errno 28 )

Thursday, April 3, 2008

AIX Restricted Shell to certain user

#vi /etc/security/login.cfg
* Others Security Attribute
usw:
shells = /bin/sh, .....,/usr/bin/Rsh

#chuser shell=/usr/bin/Rsh john
Now, John can't
- change the current dir
- Change the PATH variable
- Use COMMANd contains slashes
- Redirect standard output (>, >>)

Providing a limited set of commands
To give a limited set of commands to a user, copy the command to /usr/rbin and add /usr/rbin to the user 's PATH

AIX Performance Tools

Cpu Bottlenecks
#tprof -x sleep 60
#more sleep.prof (aix 5.3) or #more __prof.all (aix 5.2)


Memory Bottlenecks
global report
#svmon -G
top 3 users of memory
#svmon -Pt 3

I/O Bottlenecks
start monitoring disk activity
# filemon -o fmout
stop monitoring and create report
#trcstop
to see the report
#more fmout

To break it down further, seeing individual files
#filemon -O all -o fmout

Wednesday, April 2, 2008

AIX backup/restore a non-rootvg volume group

To list VG
# lsvg
old_rootvg
rootvg
testvg10
testvg1
#
To Save **this only backups mounted filesystem on that VG
#savevg -f /louisedata/testvg10_backup testvg10
To Rstore
#restvg -l -f /louisedata/testvg10_backup

AIX Tape Operation

To change block size
# chdev -l rmt0 -a block_size=512
# chdev -l rmt0 -a block_size=0 ##if need to use dd command for tape

The most common tctl subcommands are: fsf Moves the tape forward the number of file marks specified by Count.
# tctl -f bsf
Moves the tape backwards the number of file marks specified by Count.
# tctl -f rewind
Rewinds the tape.
# tctl -f erase
Erases all contents on the tape and rewinds it.
# tctl -f retension
Fast-forwards, then rewinds the tapeBackupsAIXbackup_AIXAIXBackupsbackup_AIX

Tuesday, April 1, 2008

AIX telinit and run levels

Examples
To request the init command to reexamine the /etc/inittab file, enter:
telinit q

To request the init command to enter maintenance mode, enter:
telinit s

Aix How to check if disk is bootable(mirror environment)

see last line
#ipl_varyon -i
PVNAME BOOT DEVICE PVID VOLUME GROUP ID
hdisk0 YES 0002f67fafcf9d4d0000000000000000 0002f67f00004c00
hdisk1 NO 0002f67f0a7b63c30000000000000000 0002f67f00004c00
hdisk2 NO 0002f67ff0849cc60000000000000000 0002f67f00004c00
hdisk3 NO 0002f67f0a7338570000000000000000 0002f67f00004c00
hdisk4 NO 0002f67f0a5c6f180000000000000000 0002f67f00004c00
#