Tuesday 30 March 2021

Oracle Operating System Pre Requestories OEL 6.7


Hi all this is self OS troubleshooting tutorial for me .

  • Create oracle user and grid user

groupadd -g 54321 oinstall

groupadd -g 54322 dba
groupadd -g 54323 oper

useradd -u 54321 -g oinstall -G dba,oper oracle

passwd oracle

groupadd asmadmin

groupadd asmdba

useradd -u 54323 -g oinstall -G asmadmin,asmdba grid




passwd oracle
passwd grid


usermod -a -G asmdba oracle

  • Make sure that all the required libraries are installed.

/usr/bin/oracle-rdbms-server-12cR1-preinstall-verify
# if the command above reported any missing library, issue the following command:
yum install oracle-rdbms-server-12cR1-preinstall


Install Oracle ASMLib package

yum install oracleasm-support
# the following command will take a few minutes to finish:
yum install kmod-oracleasm



  • Configure and load the ASM kernel module

oracleasm configure -i


  • Open a terminal window and edit the udev rule for network devices in the file

/etc/udev/rules.d/70-persistent-net.rules


  • Create Directory:

mkdir -p /u01/app/oracle/product
chown -R oracle:oinstall /u01
chmod -R 775 /u01
mkdir -p /u01/app/grid
mkdir -p /u01/app/12.1.0/grid
chown -R grid:oinstall /u01/app/grid
chown -R grid:oinstall /u01/app/12.1.0/grid
chmod -R 775 /u01


  • Grid bash_profile
/home/grid

[grid@srv1 ~]$ cat .bash_profile
# .bash_profile #
OS User: grid

if [ -f ~/.bashrc ]; then
.~/.bashrc
fi
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
# it must not be under the ORACLE_BASE
ORACLE_HOME=/u01/app/12.1.0/grid; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
PATH=.:${PATH}:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/local/bin
export PATH
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
[grid@srv1 ~]$


  • Oracle bash_profile
/home/oracle

[oracle@srv1 ~]$ cat .bash_profile
# .bash_profile
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

ORACLE_SID=rac1; export ORACLE_SID
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
PATH=.:${PATH}:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/local/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
export EDITOR=vi
umask 022

[oracle@srv1 ~]$

  • Useful links :






  • Disable NTP

service ntpd status
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.orig
rm /var/run/ntpd.pid



rpm -iv cvuqdisk-1.0.9-1.rpm

  • Disable firewall

chkconfig iptables off
chkconfig ip6tables off
service iptables stop
service ip6tables stop
vi /etc/selinux/config
change SELinux=enforcing to SELinux=disabled

If oel 7
systemctl stop firewalld
systemctl disable firewalld


  • Change hostname:

[root@srv3 Desktop]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=srv4.example.com
# oracle-rdbms-server-12cR1-preinstall : Add NOZEROCONF=yes
NOZEROCONF=yes
[root@srv3 Desktop]# 



  • Change MAC address

[root@srv3 rules.d]# pwd
/etc/udev/rules.d
[root@srv3 rules.d]# 

[root@srv3 rules.d]# cat 70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:9e:7e:3e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:58:55:fa", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
[root@srv3 rules.d]# 


  • Change IP address by adding MAC address:

root@srv3 network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@srv3 network-scripts]# 

[root@srv3 network-scripts]# vi ifcfg-eth0

DEVICE=eth0
TYPE=Ethernet
UUID=5f79efb6-0c82-42b6-a1aa-16631b453e11
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=08:00:27:58:55:fa
IPADDR=192.168.56.74
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth0

  • ADD SWAP SIZE

[root@srv1 ~]# swapon -s
Filename                                Type            Size    Used    Priority
[root@srv1 ~]# mkswap /dev/sde1
Setting up swapspace version 1, size = 4192928 KiB
no label, UUID=06564f18-2637-4de8-bb95-0f6ea1b88c84
[root@srv1 ~]# swapon -s
Filename                                Type            Size    Used    Priority
[root@srv1 ~]# swapon -a
[root@srv1 ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/sde1                               partition       4192928 0       -1
[root@srv1 ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue Feb  2 13:28:55 2021
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=ea2f6384-7a15-4150-9891-c554f9c7c339 /                       ext4    defaults        1 1
UUID=0d4ffc14-d2a0-4373-94d9-1646bbc2effa /boot                   ext4    defaults        1 2
UUID=0e485d97-fcbc-42aa-b21d-316ed75dc3f5 /tmp                    ext4    defaults        1 2
#tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
tmpfs                    /dev/shm                tmpfs   defaults,size=4G       0 0
/dev/sde1 swap swap 0 0
[root@srv1 ~]#

Issues:
==============================================================
/etc/fstab

none                    /dev/shm                tmpfs   defaults,size=3G       0 0

==============================================================
fix swap issue with file

from root user:
swapon -s
dd if=/dev/zero of=/home/swapfile1 bs=1024 count=2097152
mkswap /home/swapfile1
swapon /home/swapfile1
swapon -a
swapon -s


==============================================================

Edit the "/etc/oratab"

End.




[root@zabbix ~]# df -h /dev/shm
Filesystem      Size  Used Avail Use% Mounted on
shmfs           4.0G     0  4.0G   0% /dev/shm
[root@zabbix ~]# mount -t tmpfs shmfs -o size=3072m /dev/shm
[root@zabbix ~]# mount -t tmpfs shmfs -o size=4096m /dev/shm
[root@zabbix ~]# df -h /dev/shm
Filesystem      Size  Used Avail Use% Mounted on
shmfs           4.0G     0  4.0G   0% /dev/shm


  • RPM Package:

rpm -Uvh binutils*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libstdc++-33.i686*
rpm -Uvh gcc*
rpm -Uvh gcc-c++*
rpm -Uvh glibc*
rpm -Uvh glibc.i686*
rpm -Uvh glibc-devel*
rpm -Uvh glibc-devel.i686*
rpm -Uvh ksh*
rpm -Uvh libgcc*
rpm -Uvh libgcc.i686*
rpm -Uvh libstdc++*
rpm -Uvh libstdc++.i686*
rpm -Uvh libstdc++-devel*
rpm -Uvh libstdc++-devel.i686*
rpm -Uvh libaio*
rpm -Uvh libaio.i686*
rpm -Uvh libaio-devel*
rpm -Uvh libaio-devel.i686*
rpm -Uvh libXext*
rpm -Uvh libXext.i686*
rpm -Uvh libXtst*
rpm -Uvh libXtst.i686*
rpm -Uvh libX11*
rpm -Uvh libX11.i686*
rpm -Uvh libXau*
rpm -Uvh libXau.i686*
rpm -Uvh libxcb*
rpm -Uvh libxcb.i686*
rpm -Uvh libXi*
rpm -Uvh libXi.i686*
rpm -Uvh make*
rpm -Uvh sysstat*
rpm -Uvh unixODBC*
rpm -Uvh unixODBC-devel*
rpm -Uvh zlib-devel*
rpm -Uvh zlib-devel.i686*
rpm -Uvh compat-libstdc++-33-3.2.3-71.el7.x86_64.rpm 
rpm -Uvh libstdc++-devel-4.8.2-16.el7.x86_64.rpm 
rpm -Uvh gcc-c++-4.8.2-16.el7.x86_64.rpm 
rpm -Uvh libaio-devel-0.3.109-12.el7.x86_64.rpm 


  • /etc/sysctl.conf

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

Run:
sysctl -p

etc/security/limits.con

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    2047
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768

# oracle-rdbms-server-12cR1-preinstall setting for nofile soft limit is 1024 
oracle soft nofile 1024 
grid soft nofile 1024 
 
# oracle-rdbms-server-12cR1-preinstall setting for nofile hard limit is 65536 
oracle hard nofile 65536 
grid hard nofile 65536 
 
# oracle-rdbms-server-12cR1-preinstall setting for nproc soft limit is 16384 # refer orabug15971421 for more info. 
oracle soft nproc 16384 
grid soft nproc 16384 
 
# oracle-rdbms-server-12cR1-preinstall setting for nproc hard limit is 16384 
oracle hard nproc 16384 
grid hard nproc 16384 
 
# oracle-rdbms-server-12cR1-preinstall setting for stack soft limit is 10240KB 
oracle soft stack 10240 
grid soft stack 10240 
 
# oracle-rdbms-server-12cR1-preinstall setting for stack hard limit is 32768KB 
oracle hard stack 32768 
grid hard stack 32768 
 
# oracle-rdbms-server-11gR2-preinstall setting for memlock hard limit is maximum of {128GB (x86_64) / 3GB (x86) or 90 % of RAM} 
oracle hard memlock 134217728 
grid hard memlock 134217728 
 
# oracle-rdbms-server-11gR2-preinstall setting for memlock soft limit is maximum of {128GB (x86_64) / 3GB (x86) or 90% of RAM} 
oracle soft memlock 134217728 
grid soft memlock 134217728 


  • /etc/hosts Entry:

#127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

127.0.0.1   localhost.localdomain localhost
# Public
192.168.56.71   srv1.example.com        srv1
192.168.56.72   srv2.example.com        srv2

# Private
192.168.10.1    srv1-priv.example.com   srv1-priv
192.168.10.2    srv2-priv.example.com   srv2-priv

# Virtual
192.168.56.81   srv1-vip.example.com    srv1-vip
192.168.56.82   srv2-vip.example.com    srv2-vip

# SCAN (in production this should be configured in DNS)
192.168.56.91   srv-scan.example.com    srv-scan
192.168.56.92   srv-scan.example.com    srv-scan
192.168.56.93   srv-scan.example.com    srv-scan

No comments:

Post a Comment