About Us

RSInfoMinds, a web based IT Training and Consultancy firm. It is established with high dreams in training people in IT Infrastructure Field. We provide Online and Class Room training in various fields of IT Infrastructure Management.

Join Us: http://www.facebook.com/RSInfoMinds
Mail Us: rsinfominds@gmail.com
Twitter: @RSInfoMinds

We are specialized in the below courses:

Redhat Linux Admin Redhat Linux Cluster
Redhat Virutualization IBM AIX Admin
IBM AIX Virtualization IBM AIX Cluster
HP Unix Admin HP Unix Cluster
HP Unix Virtualization Shell Scripting
Veritas Volume Manager Veritas Cluster
Oracle Core DBA VMWare


We provide training in such a way, So that you get in depth knowledge on the Courses you look for.

And we ensure you are very confident from each and every Techincal aspect that the IT Industry needs and expects from you.

We also conduct Workshops on the latest technology and the real time faculties sharing their work experiences to make you the best.

Monday, 28 July 2014

Who Can Fix This YUM Issue ?






I am getting the above error upon giving the yum command.

CD is mounted.

Please find the YUM conf file:

[root@node1 yum.repos.d]# cat rhel-source.repo
[rhel source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///mnt/
enabled=1
gpgcheck=0

[root@node1 yum.repos.d]#

Sunday, 20 July 2014

Friday, 18 July 2014

What is a Mirror Log ?


LVM maintains a small log which it uses to keep track of which regions are in sync with the mirror or mirrors. 

By default, this log is kept on disk, which keeps it persistent across reboots and ensures that the mirror does not need to be re-synced every time a machine reboots or crashes. 

You can specify instead that this log be kept in memory with the --mirrorlog core argument; this eliminates the need for an extra log device, but it requires that the entire mirror be resynchronized at every reboot.

Linux LVM Mirroring (RAID -1 ) Part II

Now going to mirror the logical volume:

[root@test ~]# lvconvert -m1 /dev/oracle/oracle_lv
  oracle/oracle_lv: Converted: 0.0%
  oracle/oracle_lv: Converted: 100.0%
[root@test ~]#

[root@test ~]# lvdisplay -m /dev/oracle/oracle_lv
  --- Logical volume ---
  LV Name                /dev/oracle/oracle_lv
  VG Name                oracle
  LV UUID                O9W6go-l2AC-0XP9-GvLw-tL2C-bjeI-YoWmDG
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.00 GiB
  Current LE             256
  Mirrored volumes       2
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Segments ---
  Logical extent 0 to 255:
    Type                mirror
    Mirrors             2
    Mirror size         256
    Mirror log volume   oracle_lv_mlog
    Mirror region size  512.00 KiB
    Mirror original:
      Logical volume    oracle_lv_mimage_0
      Logical extents   0 to 255
    Mirror destinations:
      Logical volume    oracle_lv_mimage_1
      Logical extents   0 to 255


[root@test ~]#

[root@test ~]# pvs -o +lv_name
  PV         VG     Fmt  Attr PSize PFree LV
  /dev/sdb   oracle lvm2 a--  5.00g 4.00g [oracle_lv_mimage_1]
  /dev/sdb   oracle lvm2 a--  5.00g 4.00g
  /dev/sdc   oracle lvm2 a--  5.00g 3.99g [oracle_lv_mimage_0]
  /dev/sdc   oracle lvm2 a--  5.00g 3.99g [oracle_lv_mlog]
  /dev/sdc   oracle lvm2 a--  5.00g 3.99g
[root@test ~]#



Linux LVM Mirroring (RAID -1 ) Part I

This post I am going to show how to mirror a logical volume:

[root@test ~]# df -TH /oracle
Filesystem    Type     Size   Used  Avail Use% Mounted on
/dev/mapper/oracle-oracle_lv
              ext4     1.1G   1.1G      0 100% /oracle
[root@test ~]#


Before mirroring:

[root@test ~]# lvdisplay -m /dev/oracle/oracle_lv
  --- Logical volume ---
  LV Name                /dev/oracle/oracle_lv
  VG Name                oracle
  LV UUID                O9W6go-l2AC-0XP9-GvLw-tL2C-bjeI-YoWmDG
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.00 GiB
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Segments ---
  Logical extent 0 to 255:
    Type                linear
    Physical volume     /dev/sdc
    Physical extents    0 to 255


Initializing and adding a new disk to the VG Oracle:

[root@test ~]# pvcreate /dev/sdb
  Writing physical volume data to disk "/dev/sdb"
  Physical volume "/dev/sdb" successfully created

[root@test ~]# vgextend /dev/oracle /dev/sdb
  Volume group "oracle" successfully extended
[root@test ~]# 


RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/09/2014 11:21:25 ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode

The reason for the above error is the due to the database is configured to run in NOARCHIVE Mode.

So to fix the error, We need to convert the database to ARCHIVE Mode.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence     2
Current log sequence           4
SQL>

Converting  to ARCHIVE Mode.

SQL> alter database archivelog;
alter database archivelog
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any instance


SQL>

So, doing that before the database should be in Mounted state.

Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  392495104 bytes
Fixed Size                  2213696 bytes
Variable Size             138414272 bytes
Database Buffers          247463936 bytes
Redo Buffers                4403200 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence     2
Next log sequence to archive   4
Current log sequence           4
SQL> alter database open;

Database altered.

SQL> 

Bingo...!!!!!!!!!!!!!

Wednesday, 16 July 2014

Configure Virtual Serial Port

1)      /etc/securetty  -append
ttyS0
ttyS1

2)      /etc/inittab  - uncomment and modify
S0:12345:respawn:/sbin/agetty -L 115200 ttyS0 vt100

3)      /boot/grub/menu.lst – modify the line of running kernel
root (hd0,0)
    kernel /vmlinuz-2.6.16.60-0.69.1-smp root=/dev/vg00/lvol1 vga=normal nomodeset 3 resume=/dev/vg00/lvol2 splash=silent showopts
crashkernel=256M@16M console=ttyS0,115200
    initrd /initrd-2.6.16.60-0.69.1-smp

Kdump memory requirement

---------------------------------------------------------------------------
    Configuring crashkernel on RHEL6.0 and RHEL6.1 kernels
---------------------------------------------------------------------------

Some mappings of ram and appropriate crashkernel values:

ram size        crashkernel parameter        ram / crashkernel factor
>0GB            128MB                        15
>2GB            256MB                        23
>6GB            512MB                        15
>8GB            768MB                        31

Linux Swapiness

The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.

swappiness can have a value of between 0 and 100

swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible
swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache


The default setting in Linux is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.

To check the swappiness value use command: cat /proc/sys/vm/swappiness

To make a change permanent, edit the configuration file with your favorite editor:

vi /etc/sysctl.conf
and add following parameter to the end of the file like so:
vm.swappiness=10
Save the file and reboot.

System-wide File Descriptors (FD) Limits


Many application such as Oracle database or Apache web server needs this range quite higher. So you can increase the maximum number of open files by setting a new value in kernel variable /proc/sys/fs/file-max as follows (login as the root):
# sysctl -w fs.file-max=100000

Above command forces the limit to 100000 files. You need to edit /etc/sysctl.conf file and put following line so that after reboot the setting will remain as it is:
# vi /etc/sysctl.conf

Append a config directive as follows:
fs.file-max = 100000

Save and close the file. Users need to log out and log back in again to changes take effect or just type the following command:
# sysctl -p

Verify your settings with command:
# cat /proc/sys/fs/file-max

OR
# sysctl fs.file-max

1) Add the following line to /etc/security/limits.conf

webuser hard nofile 64000
then login as webuser

su - webuser
2) Edit following two files for webuser

append .bashrc and .bash_profile file by running

echo "ulimit -n 64000" >> .bashrc ; echo "ulimit -n 64000" >> .bash_profile
3) Log out, then log back in and verify that the changes have been made correctly:

$ ulimit -a | grep open
open files                      (-n) 64000

Saturday, 5 July 2014

fsck - check and repair a Linux file system


       The exit code returned by fsck is the sum of the following conditions:
            0    - No errors
            1    - File system errors corrected
            2    - System should be rebooted
            4    - File system errors left uncorrected
            8    - Operational error
            16   - Usage or syntax error
            32   - Fsck canceled by user request
            128  - Shared library error

Improve Faster IO for your filesystem by chaning the READ AHEAD Value

[root@test oracle]# df -Th /oracle
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/oracle-oracle_lv
              ext4   1008M   34M  924M   4% /oracle

[root@test oracle]# time dd if=/oracle/test of=/tmp/test count=500 bs=1M
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 6.2385 s, 84.0 MB/s

real    0m6.249s
user    0m0.001s
sys     0m1.886s
[root@test oracle]#

[root@test oracle]# blockdev --report /dev/sdb
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096          0      5368709120   /dev/sdb
[root@test oracle]#


I changed the read ahead value from 256 to 1024:

[root@test ~]#  blockdev --setra 1024 /dev/sdb
[root@test ~]# blockdev --getra /dev/sdb
1024
[root@test ~]# blockdev --report /dev/sdb
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw  1024   512  4096          0      5368709120   /dev/sdb
[root@test ~]#

[root@test oracle]# time dd if=/oracle/test of=/tmp/test count=500 bs=1M
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 3.79428 s, 138 MB/s

real    0m3.819s
user    0m0.003s
sys     0m1.589s
[root@test oracle]#


The read performace has improved from 6.2 Sec to 3.8 Sec. Faster IO.

Currently set to and Block device in lvdisplay ?

[root@test ~]# lvdisplay /dev/hits/hits1
  --- Logical volume ---
  LV Name                /dev/hits/hits1
  VG Name                hits
  LV UUID                W7uUkN-WAIf-MrY7-u7oE-x9uy-AegG-WYATjI
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                1.00 GiB
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

[root@test ~]#

Most of us would wonder few things with the output of # lvdisplay especially the bottom two lines.
currently set to and Block device.

Block device:

Block Devices refers to the DM (Device Multipath) Associated with the logical volume.

[root@test ~]# dmsetup ls --tree
hits-hits1 (253:0)
 └─ (8:16)

[root@test dev]# ls -l | grep -i "253"
brw-rw----. 1 root disk    253,   0 Jul  4 17:50 dm-0
[root@test dev]#

dm-0 is the device multipath associated with the logical volume hits1.



How to check the Block Size and Sector Size of HDD in Linux ?

[root@test ~]# blockdev --report /dev/sdb
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096          0      5368709120   /dev/sdb
[root@test ~]#


RA : Read Ahead.
SSZ : Sector Size.
BSZ : Block Size.
Size : Size of the disk.

Available commands:
        --getsz                        get size in 512-byte sectors
        --setro                        set read-only
        --setrw                        set read-write
        --getro                        get read-only
        --getss                        get logical block (sector) size
        --getpbsz                      get physical block (sector) size
        --getiomin                     get minimum I/O size
        --getioopt                     get optimal I/O size
        --getalignoff                  get alignment offset
        --getmaxsect                   get max sectors per request
        --getbsz                       get blocksize
        --setbsz BLOCKSIZE             set blocksize
        --getsize                      get 32-bit sector count
        --getsize64                    get size in bytes
        --setra READAHEAD              set readahead
        --getra                        get readahead
        --setfra FSREADAHEAD           set filesystem readahead
        --getfra                       get filesystem readahead
        --flushbufs                    flush buffers
        --rereadpt                     reread partition table

Tuesday, 1 July 2014

Check The DATABASE_STATUS


SQL> select STARTUP_TIME,STATUS,LOGINS,DATABASE_STATUS from v$instance where INSTANCE_NUMBER=1;

STARTUP_T STATUS       LOGINS     DATABASE_STATUS
--------- ------------ ---------- -----------------
23-JUN-14 OPEN         ALLOWED    ACTIVE

SQL>


This would show when the DB was started, status and the mode of the DB Started.

How to check with the Database is running in Dedicated or Shared mode?


SQL> select username,status,server from v$session where username='SYS';

USERNAME                       STATUS   SERVER
------------------------------ -------- ---------
SYS                            ACTIVE   DEDICATED

SQL>


The Server states would show the Mode of Database Activation.