Tuesday, May 1, 2012

Started to Learn More about Oracle...

I've started to learn more about Oracle DB.

I am collecting some of the useful links for my personal reference:

http://www.mhprofessional.com/downloads/products/0071591028/0071591028_errata.txt


http://www.idevelopment.info/

http://www.datadisk.co.uk/html_docs/oracle/db_control.htm

Monday, April 30, 2012

Linux NIC duplex settings & Routing

On Redhat:

/etc/sysconfig/network-scripts/ifcfg-ethX:

ETHTOOL_OPTS="speed 100 duplex full autoneg off"


Note: ETHTOOL_OPTS is documented in /usr/share/doc/initscripts-/sysconfig.txt.

Ref:

http://www.redhat.com/archives/taroon-list/2003-October/msg00014.html
http://www.cyberciti.biz/tips/howto-linux-add-ethtool-duplex-settings-permanent.html
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch03_:_Linux_Networking


Staitc Routes in RH:
/etc/sysconfig/network-scripts/route-
Try vi /etc/sysconfig/network-scripts/ifup-routes

Ref:
http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch03_:_Linux_Networking

Monday, April 16, 2012

Some changes in RHEL6 vs RHEL5 for RH Admins

1- If you have a HP server, onboard disks are always named: /dev/cciss/c0d0, etc.
In RHEL6, for devices attached to Smart Array using the hpsa dirver, the device
names will be /dev/sd but with ciss driver, you will see the old style name
convention.

2- Emergency mode has been removed from list of boot modes

3- Dracut has been replaced mkinitrd.

4- lvconvert --merge : Reverting to a previous snapshot

5- Tickless kernel and power management porfile support.

6- NFSv4 is the default NFS.

7- EXT-4 is the default filesystem.

8- Automated I/O alignment. SCSI and ATA standards have been extended to provide alignment and I/O hints, allowing automated tuning and I/O alignment

9- The new System Security Services Daemon (SSSD) provides centralized access to identity and authentication resources, enables caching and offline support

10- In virtualized environments, sVirt (powered by SELinux) protects guests from one another


To see more, http://www.europe.redhat.com/products/rhel/server/details/

Friday, March 23, 2012

I got this issue with a Redhat5/HP Proliant,

root]# vgs
File descriptor 4 (/dev/pts/1) leaked on vgs invocation. Parent PID 28768: sh
/dev/sdb: read failed after 0 of 4096 at 0: Input/output error
Found duplicate PV QSsOVbn2hAYPzWhviPc3nK0sT89rsB1n: using /dev/sdr not /dev/sdq
/dev/sdd: read failed after 0 of 4096 at 0: Input/output error
/dev/sde: read failed after 0 of 4096 at 0: Input/output error
/dev/sdg: read failed after 0 of 4096 at 0: Input/output error
/dev/sdj: read failed after 0 of 4096 at 0: Input/output error
/dev/sdl: read failed after 0 of 4096 at 0: Input/output error
/dev/sdm: read failed after 0 of 4096 at 0: Input/output error
/dev/sdo: read failed after 0 of 4096 at 0: Input/output error
VG #PV #LV #SN Attr VSize VFree
VG01 1 4 0 wz--n- 650.05G 180.05G
VolGroup00 1 11 0 wz--n- 136.56G 42.19G
VolGroup02 3 4 0 wz--n- 399.91G 0

root]#

I had to edit /etc/lvm/lvm.conf and define a filter.


# filter = [ "a/.*/" ]
filter = [ "a/dev/cciss/.*/", "a/dev/mpath/.*/", "r/.*/" ]

After finish with editing, you need to run pvscan and vgscan to make the change,
active.

Please consult with official manual to find a proper filter for your own environment.

https://access.redhat.com/knowledge/solutions/2989

Friday, March 2, 2012

Stale Lun!!!

[root /]# multipathd -k"show paths"|egrep -v "active\]\[ready|cciss|next_check"
1:0:1:0 sdba 67:64 1 [failed][faulty] XXXX...... 2/5
1:0:1:3 sdbf 67:144 1 [active][faulty] XXXXXXXX.. 4/5

I removed two luns in our SAN and then manually deleted the luns. Now I stuck with
this situation. Let's see if a reboot in the weekend will fix the issue!

[read my previous post!]

Update: a reboot fixed the issue.

Tuesday, February 28, 2012

Dont remove a LUN cleanly!!! (LVM)

Recently I've added some FC LUNs and created LVM partitions on top of that in my RHEL 5 Box. Later on we had to delete the LUNs in our SAN and recreate them. I deleted the LUNs from our SAN before clean them up in the system! later on when I wanted to remove the volume groups:

UPDATE: if you haven't removed the LUNs from SAN and just deleted the LUNS
with echo 1>/sys/block//device/delete without deleteing the related
volume group, vgs command will hangs. To fix that you need to delete the
mpaths with dmsetup remove /dev/mpath/mpath and rescan the luns with
echo "- - -" > /sys/class/scsi_host/host#n/scan. It brings up sanity to
the system! (at least for me)


# vgremove VG
/dev/VG/otestapps: read failed after 0 of 4096 at 4096: Input/output error
/dev/VG/odevlapps: read failed after 0 of 4096 at 106300375040: Input/output error
/dev/VG/odevlapps: read failed after 0 of 4096 at 106300432384: Input/output error
/dev/VG/odevlapps: read failed after 0 of 4096 at 0: Input/output error
..
Volume group "VG" not found

So, dmsetup comes to rescue (after you probably lost some pounds and pulling some hair!)

# dmsetup remove --force /dev/mpath/mpath41
# for i in `ls /dev/VG/LV-0*`;do dmsetup remove $i;done

# ls -l /dev/mapper/VG* (should be gone)
# ls -l /dev/VG/* (soft link to /dev/mapper/VG*)

I also had to remove the LUNs with this commands:

echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/delete
echo 1 > /sys/class/scsi_device/0\:0\:0\:1/device/delete
echo 1 > /sys/class/scsi_device/0\:0\:1\:0/device/delete
echo 1 > /sys/class/scsi_device/0\:0\:1\:1/device/delete

multipath -F


To prevent this issue, let's see what is the best practice recemmended by Redhat:

Procedure 1. Ensuring a Clean Device Removal
1. Close all users of the device and backup device data as needed.

2. Unmount any file systems that mounted the device.

3. Remove the device from any md and LVM volume using it. If the device is a member of an LVM Volume group, then it may be necessary to move data off the device using the pvmove command, then use the vgreduce command to remove the physical volume, and (optionally) pvremove to remove the LVM metadata from the disk.

4. If the device uses multipathing, run multipath -l and note all the paths to the device. Afterwards, remove the multipathed device using multipath -F device.

5. Run blockdev –flushbufs device to flush any outstanding I/O to all paths to the device. This is particularly important for raw devices, where there is no umount or vgreduce operation to cause an I/O flush.

6.Remove any reference to the device's path-based name, like /dev/sd, /dev/disk/by-path or the major:minor number, in applications, scripts, or utilities on the system. This is important in ensuring that different devices added in the future will not be mistaken for the current device.

7.Finally, remove each path to the device from the SCSI subsystem. To do so, use the command echo 1 > /sys/block/device-name/device/delete where device-name may be sde, for example.
Another variation of this operation is echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete, where h is the HBA number, c is the channel on the HBA, t is the SCSI target ID, and l is the LUN


Ref: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/removing_devices.html

Wednesday, February 22, 2012

Resize a Lun (multipath) Linux

# multipath -ll mpath0

# for i in `multipath -ll mpath0 | grep sd | awk '{print $2}'`; do
> echo $i ; done
1:0:1:0
2:0:1:0
1:0:0:0
2:0:0:0

>>>> to reread the current (storage-based) size parameters of the devices

# for i in `multipath -ll mpath0 | grep sd | awk '{print $3}'`; \
do \
lockdev --rereadpt /dev/$i ;\
done

>>>> You can check with: blockdev –getsz /dev/$i


# multipathd -k"resize multipath mpath0"

# multipath -ll mpath0

# pvresize /dev/mapper/mpath0

# lvresize -L 50G /dev/VolGroup01/san1

# resize2fs /dev/VolGroup01/san1

# df


Ref:
http://blogs.utexas.edu/hcoyote/2009/11/12/resizing-a-linu-multipathd-san-lun/
http://run.tournament.org.il/hot-resize-multipath-disk-linux/
http://zenhat.org/2011/04/02/how-to-extend-lun-without-reboot-redhat/