Wednesday, June 17, 2020

SQLNET.ORA Parameters: SQLNET.EXPIRE_TIME & SQLNET.INBOUND_CONNECT_TIMEOUT

Finally after a long long time posting on this blog. 


Hi All, 

In our environment both parameters are set for default value which I feel were too low SQLNET.EXPIRE_TIME (0 - disabled) & SQLNET.INBOUND_CONNECT_TIMEOUT (60 seconds), potentially causing some connectivity issue when users trying to run some batch jobs which establishes 60-70 connections. 
   After 2-3 weeks of discussions and other workarounds (server, network and storage side) we finally decided to set these parameters as user were still facing same connection problems all at once (ORA-12547: TNS:lost contact). So we defined the following values: 

SQLNET.INBOUND_CONNECT_TIMEOUT=300  (default is 60 & 0 means indefinite)

SQLNET.EXPIRE_TIME=5  (default is 0(disabled) & 10 is recommended).

   Haven't received any complains after setting that  but fingers crossed. 😉


Oracle Doc Says: 

SQLNET.EXPIRE_TIME

Purpose
To specify a time interval, in minutes, to send a check to verify that client/server connections are active.
Usage Notes
Setting a value greater than 0 ensures that connections are not left open indefinitely, due to an abnormal client termination. If the system supports TCP keepalive tuning, then Oracle Net Services automatically uses the enhanced detection model, and tunes the TCP keepalive parameters
If the probe finds a terminated connection, or a connection that is no longer in use, then it returns an error, causing the server process to exit.
This parameter is primarily intended for the database server, which typically handles multiple connections at any one time.
Limitations on using this terminated connection detection feature are:
  • It is not allowed on bequeathed connections.
  • Though very small, a probe packet generates additional traffic that may downgrade network performance.
  • Depending on which operating system is in use, the server may need to perform additional processing to distinguish the connection probing event from other events that occur. This can also result in degraded network performance.
Default - 0
Minimum Value - 0
Recommended Value - 10
SQLNET.INBOUND_CONNECT_TIMEOUT
Purpose
To specify the time, in seconds, for a client to connect with the database server and provide the necessary authentication information.
Usage Notes
If the client fails to establish a connection and complete authentication in the time specified, then the database server terminates the connection. In addition, the database server logs the IP address of the client and an ORA-12170: TNS:Connect timeout occurred error message to the sqlnet.log file. The client receives either an ORA-12547: TNS:lost contact or an ORA-12637: Packet receive failed error message.
The default value of this parameter is appropriate for typical usage scenarios. However, if you need to explicitly set a different value, then Oracle recommends setting this parameter in combination with the INBOUND_CONNECT_TIMEOUT_listener_name parameter in the listener.ora file. When specifying the values for these parameters, note the following recommendations:
  • Set both parameters to an initial low value.
  • Set the value of the INBOUND_CONNECT_TIMEOUT_listener_name parameter to a lower value than the SQLNET.INBOUND_CONNECT_TIMEOUT parameter.
For example, you can set INBOUND_CONNECT_TIMEOUT_listener_name to 2 seconds and SQLNET.INBOUND_CONNECT_TIMEOUT parameter to 3 seconds. If clients are unable to complete connections within the specified time due to system or network delays that are normal for the particular environment, then increment the time as needed.
Default - 60 seconds

Friday, May 6, 2016

How to resolve "`/root/.gvfs':Permission denied" when running df command from non-root user

When root user is logging in to GNOME, error "`/root/.gvfs':Permission denied" occurs if a normal user runs df.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 6
  • GNOME Desktop Environment

Issue

  • When root user is logging in to GNOME, the following error occurs if a normal user runs df.
$ df -kl
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2             24670076   3751464  19665444  17% /
tmpfs                  1030908       100   1030808   1% /dev/shm
/dev/sda1                99150     25491     68539  28% /boot
df: `/root/.gvfs': Permission denied

Resolution

  • To disable gvfs-fuse-daemon, the GVFS_DISABLE_FUSE environment needs to be set.
  • Create the file /etc/X11/xinit/xinitrc.d/00-gvfs-disable-fuse.sh with the follwing contents:
GVFS_DISABLE_FUSE=1
export GVFS_DISABLE_FUSE

Root Cause

  • On GNOME desktop environment, a hidden directory ~/.gvfs exists under home directory, gvfs-fuse-daemon mounts special filesystem to ~/.gvfs using FUSE system.
# mount
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
  • An error occurs because a normal user cannot access other user's directories.

Monday, November 9, 2015

Moving a volume group to another system

- Moving a volume group to another system

It is quite easy to move a whole volume group to another system if, for example, a user department acquires a new server. To do this we use the vgexport and vgimport commands.

Notevgexport/vgimport is not necessary to move drives from one system to another. It is an administrative policy tool to prevent access to volumes in the time it takes to move them.

1. Unmount the file system

First, make sure that no users are accessing files on the active volume, then unmount it. Here the mount point directory is /mnt/temp1.

# unmount /mnt/temp1
          

2. Mark the volume group inactive

Marking the volume group inactive removes it from the kernel and prevents any further activity on it.Here users is the volume group name.

# vgchange -an users
vgchange -- volume group "users" successfully deactivated
          

3. Export the volume group

It is now necessary to export the volume group. This prevents it from being accessed on the ``old'' host system and prepares it to be removed.

# vgexport users
vgexport -- volume group "users" successfully exported
          
When the machine is next shut down, the disk can be unplugged and then connected to it's new machine

4. Import the volume group

When plugged into the new system it becomes /dev/sdb so an initial pvscan shows:

# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/sdb1"  is in EXPORTED VG "users" [996 MB / 996 MB free]
pvscan -- inactive PV "/dev/sdb2"  is in EXPORTED VG "users" [996 MB / 244 MB free]
pvscan -- total: 2 [1.95 GB] / in use: 2 [1.95 GB] / in no VG: 0 [0]
          
We can now import the volume group (which also activates it) and mount the file system.
If you are importing on an LVM 2 system, run:

# vgimport users
  Volume group "users" successfully imported
          
If you are importing on an LVM 1 system, add the PVs that need to be imported:

# vgimport users /dev/sdb1 /dev/sdb2
vgimport -- doing automatic backup of volume group "users"
vgimport -- volume group "users" successfully imported and activated
          

5. Activate the volume group

You must activate the volume group before you can access it.

# vgchange -ay users
          

6. Mount the file system


# mkdir -p /mnt/temp1
# mount /dev/users/lv00 /mnt/temp1
          
The file system is now available for use.

Wednesday, September 2, 2015

Linux Rename Eth0 Network Interface Card Name [ Udev ]



wireless NIC is showing as wlan0 but I need to be appear as eth1. How can I rename wlan0 devices through udev as eth1? How do I change or rename eth0 as wan0 under Linux operating systems?
A

The best way to rename Ethernet devices is through udev. It is the device manager for the Linux kernel. Primarily, it manages device nodes in /dev. It is the successor of devfs and hotplug, which means that it handles /dev directory and all user space actions when adding/removing devices, including firmware load.
The order of the network interfaces may be unpredictable under certain configurations. Between reboots it usually stays the same, but often after an upgrade to a new kernel or the addition or replacement of a network card (NIC) the order of all network interfaces changes. For example, what used to be rl0 now becomes wlan0 or what used to be eth0 now becoems eth2 or visa versa.

Step #1: Find out the MAC address of the Ethernet device

Type the following command:
# ifconfig -a | grep -i --color hwaddr
Sample outputs:
eth0      Link encap:Ethernet  HWaddr b8:ac:6f:65:31:e5
pan0      Link encap:Ethernet  HWaddr 4a:71:40:ed:5d:99
vmnet1    Link encap:Ethernet  HWaddr 00:50:56:c0:00:01
vmnet8    Link encap:Ethernet  HWaddr 00:50:56:c0:00:08
wlan0     Link encap:Ethernet  HWaddr 00:21:6a:ca:9b:10
Note down the MAC address.

Step #2: Rename eth0 as wan0

To rename eth0 as wan0, edit a file called 70-persistent-net.rules in /etc/udev/rules.d/directory, enter:
# vi /etc/udev/rules.d/70-persistent-net.rules
The names of the Ethernet devices are listed in this file as follows:
 
# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="b8:ac:6f:65:31:e5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
 
Locate and identify the line with the NIC from step 1 (look for the MAC address). It may look like above. In this example, the interface eth0 will be renamed to wan0 (change NAME="eth0" toNAME="wan0"):
 
# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="b8:ac:6f:65:31:e5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="wan0"
 
Save and close the file. Reboot the system to test changes:
# reboot
Verify new settings:
# ifconfig -a
# ifconfig wan0
# ifconfig -a | less
# ip addr show

Sunday, July 5, 2015

How to use a new partition in RHEL6 without reboot?

 Issue

  • Added a new partition to a disk that have some existing partitions already mounted. Can the new partition be used without reboot in RHEL6?
  • New partition created with fdisk command is not visible in the OS.

Resolution

partprobe was commonly used in RHEL 5 to inform the OS of partition table changes on the disk. In RHEL 6, it will only trigger the OS to update the partitions on a disk that none of its partitions are in use (e.g. mounted). If any partition on a disk is in use, partprobe will not trigger the OS to update partitions in the system because it is considered unsafe in some situations.
So in general we would suggest:
  1. Unmount all the partitions of the disk before modifying the partition table on the disk, and then run partprobe to update the partitions in system.
  2. If this is not possible (e.g. the mounted partition is a system partition), reboot the system after modifying the partition table. The partitions information will be re-read after reboot.
If a new partition was added and none of the existing partitions were modified, consider using the partx command to update the system partition table. Do note that the partx command does not do much checking between the new and the existing partition table in the system and assumes the user knows what they are are doing. So it can corrupt the data on disk if the existing partitions are modified or the partition table is not set correctly. So use at one's own risk.
For example, a partition #1 is an existing partition and a new partition #2 is already added in /dev/sdb by fdisk. Here we usepartx -v -a /dev/sdb to add the new partition to the system:

# ls /dev/sdb*  
/dev/sdb  /dev/sdb1  
List the partition table of disk:

# partx -l /dev/sdb
# 1:        63-   505007 (   504945 sectors,    258 MB)  
# 2:    505008-  1010015 (   505008 sectors,    258 MB)  
# 3:         0-       -1 (        0 sectors,      0 MB)  
# 4:         0-       -1 (        0 sectors,      0 MB)  
Read disk and try to add all partitions to the system:

# partx -v -a /dev/sdb                                         
device /dev/sdb: start 0 size 2097152  
gpt: 0 slices  
dos: 4 slices  
# 1:        63-   505007 (   504945 sectors,    258 MB)  
# 2:    505008-  1010015 (   505008 sectors,    258 MB)  
# 3:         0-       -1 (        0 sectors,      0 MB)  
# 4:         0-       -1 (        0 sectors,      0 MB)  
BLKPG: Device or resource busy
error adding partition 1
(These last 2 lines are normal in this case because partition 1 is already added in the system before partition 2 is added)
Check that we have device nodes for /dev/sdb itself and the partitions on it:

# ls /dev/sdb*  
/dev/sdb  /dev/sdb1  /dev/sdb2
-> Referred to Redhat official site: 
https://access.redhat.com/solutions/57542

Sunday, June 14, 2015

Switching to Graphical Login - Red Hat Enterprise Linux 6

To switch to a graphical environment, you might need to install extra software from a repository. You can access Red Hat Enterprise Linux repositories with your Red Hat Network subscription through the Internet or use a Red Hat Enterprise Linux installation DVD as a repository. 

If you installed using a text login and wish to switch to a graphical login, follow this procedure.
  1. If you are not already root, switch users to the root account:
    su -
    Provide the administrator password when prompted.
  2. If you have not already done so, install the X Window System and a graphical desktop environment. For example, to install the GNOME desktop environment, use this command:
    yum groupinstall "X Window System" Desktop
    To install the KDE desktop environment, use:
    yum groupinstall "X Window System" "KDE Desktop"
    This step may take some time as your Red Hat Enterprise Linux system downloads and installs additional software. You may be asked to provide the installation media depending on your original installation source.
  3. Run the following command to edit the /etc/inittab file:
    vi /etc/inittab
  4. Press the I key to enter insert mode.
  5. Find the line that includes the text initdefault. Change the numeral 3 to 5.
  6. Type :wq and press the Enter key to save the file and exit the vi text editor.
Reboot the system using the reboot command. Your system will restart and present a graphical login.
If you encounter any problems with the graphical login, refer to Chapter 10, Troubleshooting Installation on an Intel or AMD System.

35.3.1. Enabling Access to Software Repositories from the Command Line

The usual way to install new software on a Red Hat Enterprise Linux system is through a software repository. You can access Red Hat Enterprise Linux repositories through the Internet with your Red Hat Network subscription, or use a Red Hat Enterprise Linux installation DVD as a repository. The software that you access through online repositories is more up-to-date than what is available on an installation DVD. Furthermore, configuring a Red Hat Enterprise Linux system to access online repositories is generally easier than configuring the system to use an installation DVD as a repository, as long as you have an existing, wired network connection available.

35.3.1.1. Enabling Access to Software Repositories Through the Internet

If you supplied your Red Hat Network subscription number during the installation process, your system is already configured to access Red Hat Enterprise Linux repositories through the Internet. Therefore, all you must do is ensure that the system can access the Internet. If you have an existing, wired network connection available, this process is straightforward:
  1. If you are not already root, switch users to the root account:
    su -
  2. Ensure that the system is plugged into your network. Note that your network might be as small as two devices — a computer and an external modem/router.
  3. Run system-config-network. The network configuration tool starts and displays the Select Action screen.
  4. Select Device configuration and press Enter. The network configuration tool displays the Select A Device screen with a list of network interfaces present on your system. The first interface is named eth0 by default.
  5. Select a network interface to configure and press Enter. The network configuration tool takes you to theNetwork Configuration screen.
  6. You can manually configure a static IP, gateway, and DNS servers on this screen or leave these fields blank to accept the default values. When you have chosen a configuration, select OK, and press Enter. The network configuration tool takes you back to the Select A Device screen.
  7. Select Save and press Enter. The network configuration tool takes you back to the Select Action screen.
  8. Select Save&Quit and press Enter. The network configuration tool saves your settings and exits.
  9. Run ifup interface, where interface is the network interface that you configured with the network configuration tool. For example, run ifup eth0 to start eth0.
Configuration of dial-up or wireless Internet connections is more complicated and beyond the scope of this guide.

35.3.1.2. Using a Red Hat Enterprise Linux Installation DVD as a Software Repository

To use a Red Hat Enterprise Linux installation DVD as a software repository, either in the form of a physical disc, or in the form of an ISO image file.
  1. If you are using a physical DVD, insert the disc into your computer.
  2. If you are not already root, switch users to the root account:
    su -
  3. Create a mount point for the repository:
    mkdir -p /path/to/repo
    where /path/to/repo is a location for the repository, for example, /mnt/repo
  4. Mount the DVD on the mount point that you just created. If you are using a physical disc, you need to know the device name of your DVD drive. You can find the names of any CD or DVD drives on your system with the command cat /proc/sys/dev/cdrom/info. The first CD or DVD drive on the system is typically named sr0. When you know the device name, mount the DVD:
    mount -r -t iso9660 /dev/device_name /path/to/repo
    For example: mount -r -t iso9660 /dev/sr0 /mnt/repo
    If you are using an ISO image file of a disc, mount the image file like this:
    mount -r -t iso9660 -o loop /path/to/image/file.iso /path/to/repo
    For example: mount -r -o loop /home/root/Downloads/RHEL6.6-Server-i386-DVD.iso /mnt/repo
    Note that you can only mount an image file if the storage device that holds the image file is itself mounted. For example, if the image file is stored on a hard drive that is not mounted automatically when the system boots, you must mount the hard drive before you mount an image file stored on that hard drive. Consider a hard drive named /dev/sdb that is not automatically mounted at boot time and which has an image file stored in a directory named Downloads on its first partition:
    mkdir /mnt/temp
    mount /dev/sdb1 /mnt/temp
    mkdir /mnt/repo
    mount -r -t iso9660 -o loop mount -r -o loop /mnt/temp/Downloads/RHEL6.6-Server-i386-DVD.iso /mnt/repo
    If you are not sure whether a storage device is mounted, run the mount command to obtain a list of current mounts. If you are not sure of the device name or partition number of a storage device, run fdisk -l and try to identify it in the output.
  5. Create a new repo file in the /etc/yum.repos.d/ directory. The name of the file is not important, as long as it ends in .repo. For example, dvd.repo is an obvious choice.
    1. Choose a name for the repo file and open it as a new file with the vi text editor. For example:
      vi /etc/yum.repos.d/dvd.repo
    2. Press the I key to enter insert mode.
    3. Supply the details of the repository. For example:
      [dvd]
      baseurl=file:///mnt/repo/Server
      enabled=1
      gpgcheck=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
      The name of the repository is specified in square brackets — in this example, [dvd]. The name is not important, but you should choose something that is meaningful and recognizable.
      The line that specifies the baseurl should contain the path to the mount point that you created previously, suffixed with /Server for a Red Hat Enterprise Linux server installation DVD, or with /Client for a Red Hat Enterprise Linux client installation DVD.
    4. Press the Esc key to exit insert mode.
    5. Type :wq and press the Enter key to save the file and exit the vi text editor.
    6. After installing or upgrading software from the DVD, delete the repo file that you created.