loading...

24/07/2023

Install Oracle 12c in AlmaLinux

========Configure SELinux==========

# vi /etc/selinux/config

SELINUX=disabled

#reboot

# hostnamectl set-hostname DevOps
# logout

# hostname

# nmtui
# nmcli connection down enp0s3
# nmcli connection up enp0s3
# ifconfig

# vi /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
103.110.59.150 DevOps

# hostname

======================================END========================================================
==================================================================================================
Install Essential Softwares
# yum -y install vim tar wget nano epel-release
//# yum install vim ; yum install tar yum install wget ; yum install nano; yum install epel-release


Install apt-get
# curl https://raw.githubusercontent.com/dvershinin/apt-get-centos/master/apt-get.sh -o /usr/local/bin/apt-get
# chmod 0755 /usr/local/bin/apt-get

 

================================================Add the swap to server================================================

# sudo fallocate -l 1G /swapfile
# sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576
# sudo chmod 600 /swapfile
# sudo mkswap /swapfile
# sudo swapon /swapfile
# echo ‘/swapfile swap swap defaults 0 0’ | sudo tee -a /etc/fstab

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

# systemctl status firewalld
# systemctl stop firewalld
# systemctl disable firewalld

======================================================= Install Oracle 12c ===================================================

# firewall-cmd –state
# yum update -y
# yum -y groupinstall “Development Tools”

=============================== RPM install for installing oracle software.===========================
yum install -y libnsl
yum install -y ksh
yum install -y libaio-devel
yum install -y libaio
yum install -y numactl-libs
yum install -y numactl-devel
yum install -y redhat-lsb-core
yum install -y motif
yum install -y libXp
yum install -y xorg-x11-xbitmaps
yum install -y mod_ssl
yum install -y zlib-devel
yum install -y xorg-x11-server-Xvfb
yum install -y xorg-x11-server-common
yum install -y xorg-x11-server-Xorg

Note Download: https://rpmfind.net/linux/rpm2html/search.php?query=compat-libstdc%2B%2B-33

====================================== Install rpm ==============
# cd /home/software/
# cd /home
# chmod -R 777 software/
# cd software/
# ll
# rpm -Uvh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

======================================== Step 2 =========================

Add the following kernel parameters to below:

# vi /etc/sysctl.conf


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


Then run the following command to take the change effect
# /sbin/sysctl -p
# /sbin/sysctl -a

============================= Set limits for Oracle =========================================

# vi /etc/security/limits.conf

oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 8192
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768

============================ Create the following OS groups.================


groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 backupdba
groupadd -g 505 dgdba
groupadd -g 506 kmdba
groupadd -g 507 asmdba
groupadd -g 508 asmoper
groupadd -g 509 asmadmin

# useradd -g oinstall -g dba -g oper -g backupdba -g dgdba -g kmdba -g asmoper -g asmadmin oracle

–> Changing oracle user password
# passwd oracle

–> Modify oracle user (the owner of Oracle Software)
# usermod -g oinstall -G dba,oper,backupdba,dgdba,asmdba,asmoper,asmadmin,kmdba oracle

=================== Create directory for installing Oracle Software ===========================

# cd /
# mkdir app
# chmod -R 777 app
# cd /app
# mkdir -p ./oracle/product/12.2.0.1/db_1
# chown -R oracle:oinstall ./oracle

=================== Add environment variables in oracle user profile ========================

vi /home/oracle/.bash_profile

*******************************
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=YOUR_HOSTNAME; export ORACLE_HOSTNAME
ORACLE_UNQNAME=MYDB; export ORACLE_UNQNAME
ORACLE_BASE=/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1; export ORACLE_HOME
ORACLE_SID=YOUR_SID; export ORACLE_SID

PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

========================================edit======================================================
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=BPDB; export ORACLE_HOSTNAME
ORACLE_UNQNAME=WZPDCL; export ORACLE_UNQNAME
ORACLE_BASE=/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1; export ORACLE_HOME
ORACLE_SID=WZPDCL; export ORACLE_SID

PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
========================================================================================================================

================= Unzip and run the installer.=================
# cd /home/software/
# ll
# unzip linux64_12201_database.zip
(Optional )# rm linux64_12201_database.zip

# chmod -R 777 software/database/

# cd database/
# cd
# ./runInstaller

# ssh -Y oracle@192.168.193.131

# su – oracle

# cd /home/software/database/

# ./runInstaller
========================================== Install Graphical Mode ==========================================================


-> Create as Container database : Checkoff

-> I wish recieve mail… : Checkoff
-> You have not provide email : Yes

-> Create and Configure Database : Check
-> Next

-> Server Class : Check
-> Next

-> Single Instance Database : Check
-> Next

-> Advanced install : Check
-> Next

-> Enterprise Edition : Check
-> Next

-> Next
-> Next

-> Gentral Purpose : Check
-> Next

-> Global database name : orcl
-> Oracle system identifier (SID): ifdr
-> Create as Container database : Checkoff

[Tab 1]
-> Allocate memory : 2048
-> Next
[Tab 2]
-> Use Unicode : Check
-> Next

-> Next
-> Next
-> Next

-> Use the same password for all accounts : Ideal$13579
-> Next

-> Next

==> Run the script after install the installation

====================== Check listener status and ping to the oracle database.============ https://ifdr:5500/em

Ctrl + C

[oracle@ifdr database]$ . oraenv

ORACLE_SID = [ifdr] ? ifdr
[oracle@ifdr database]$ sqlplus / as sysdba

SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
SQL> select name, open_mode from v$database;

================================== Finish================================

 


Check listener status and ping to the oracle database.
lsnrctl status
tnsping YOUR_SID    i.e. # tnsping ifdr


====================== Troubleshoot Idle Instance ===============
# export ORACLE_SID=ifdr

[oracle@bpdb] # ps -ef | grep pmon
[oracle@bpdb] # more /etc/oratab
[oracle@bpdb] # clear

[oracle@bpdb] # echo $ORACLE_SID
[oracle@bpdb] # uptime
[oracle@bpdb] # cd /app/oracle/diag/rdbms/ifdr/ifdr/trace
[oracle@bpdb trace] # tail -100f alert_ifdr.log
[oracle@bpdb trace] #

Posted in OracleTaggs: