127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
201.141.25.101 oraclelinux.alpha ora21c-89
For manual setup we have to make the following entries in /etc/sysctl.conf file
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
Run the following command to change the kernel parameters
#/sbin/sysctl -p
vi /etc/security/limits.d/oracle-database-preinstall-21c.conf and add the following lines
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
oracle soft data unlimited
oracle hard data unlimited
Install the following packages.
To install with yum create a local repository of the oracle linux 8.9 iso image from the link
To create a local yum repository from oracle linux 8.9 iso image
Once the repository is created you can install as follows.
yum install bc
yum install binutils
yum install compat-openssl10
yum install elfutils-libelf
yum install glibc
yum install glibc-devel
yum install ksh
yum install libaio
yum install libXrender
yum install libX11
yum install libXau
yum install libXi
yum install libXtst
yum install libgcc
yum install libnsl
yum install libstdc++
yum install libxcb
yum install libibverbs
yum install make
yum install policycoreutils
yum install policycoreutils-python-utils
yum install smartmontools
yum install sysstat
yum install unixODBC
If yun repository is created properly, a sample install is as below.
[root@oraclelinux ~]# yum install policycoreutils
Last metadata expiration check: 0:19:08 ago on Sat 08 Jun 2024 11:31:03 AM IST.
Package policycoreutils-2.9-24.0.1.el8.x86_64 is already installed.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Upgrading:
policycoreutils x86_64 2.9-25.0.1.el8 ol8_baseos_latest 376 k
policycoreutils-python-utils noarch 2.9-25.0.1.el8 ol8_baseos_latest 253 k
python3-policycoreutils noarch 2.9-25.0.1.el8 ol8_baseos_latest 2.2 M
Transaction Summary
================================================================================
Upgrade 3 Packages
Total download size: 2.9 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): policycoreutils-2.9-25.0.1.el8.x86_64.rp 1.2 MB/s | 376 kB 00:00
(2/3): policycoreutils-python-utils-2.9-25.0.1. 772 kB/s | 253 kB 00:00
(3/3): python3-policycoreutils-2.9-25.0.1.el8.n 2.2 MB/s | 2.2 MB 00:01
--------------------------------------------------------------------------------
Total 2.8 MB/s | 2.9 MB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: policycoreutils-2.9-25.0.1.el8.x86_64 1/1
Upgrading : policycoreutils-2.9-25.0.1.el8.x86_64 1/6
Running scriptlet: policycoreutils-2.9-25.0.1.el8.x86_64 1/6
Upgrading : python3-policycoreutils-2.9-25.0.1.el8.noarch 2/6
Upgrading : policycoreutils-python-utils-2.9-25.0.1.el8.noarch 3/6
Cleanup : policycoreutils-python-utils-2.9-24.0.1.el8.noarch 4/6
Cleanup : python3-policycoreutils-2.9-24.0.1.el8.noarch 5/6
Running scriptlet: policycoreutils-2.9-24.0.1.el8.x86_64 6/6
Cleanup : policycoreutils-2.9-24.0.1.el8.x86_64 6/6
Running scriptlet: policycoreutils-2.9-24.0.1.el8.x86_64 6/6
Verifying : policycoreutils-2.9-25.0.1.el8.x86_64 1/6
Verifying : policycoreutils-2.9-24.0.1.el8.x86_64 2/6
Verifying : policycoreutils-python-utils-2.9-25.0.1.el8.noarch 3/6
Verifying : policycoreutils-python-utils-2.9-24.0.1.el8.noarch 4/6
Verifying : python3-policycoreutils-2.9-25.0.1.el8.noarch 5/6
Verifying : python3-policycoreutils-2.9-24.0.1.el8.noarch 6/6
Upgraded:
policycoreutils-2.9-25.0.1.el8.x86_64
policycoreutils-python-utils-2.9-25.0.1.el8.noarch
python3-policycoreutils-2.9-25.0.1.el8.noarch
Complete!
As a root user create new groups and users
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
useradd -u 54321 -g oinstall -G dba,oper oracle
Additional setups
set a password for the oracle user
#passwd oracle
Set secure Linux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.
vi /etc/selinux/config
SELINUX=permissive
Once the change is completed restart the server of run the following command.
#setenforce Permissive
Run the following commands to disable linux firewall
# systemctl stop firewalld
# systemctl disable firewalld
You will get following output
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Create the directories in which the linux software is to be installed
mkdir -p /u01/app/oracle/product/21.0.0/dbhome_1 mkdir -p /u02/oradata chown -R oracle:oinstall /u01 /u02 chmod -R 775 /u01 /u02
It is not a good practice to put mount points under root without mounting separate disks for them.
In this installation it is done for simplicity.
Create a scripts directory in ORACLE_HOME
mkdir /home/oracle/scripts
Create the environment file /home/oracle/script/setEnv.sh
#Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=oraclelinux.alpha
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/21.0.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=cdb1
export PDB_NAME=pdb1
export DATA_DIR=/u02/oradata
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Add a reference of setEnv.sh in your .bash_profile
vi .bash_profile and make an entry as below
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
. /home/oracle/scripts/setEnv.sh
vi /home/oracle/scripts/start_all.sh
#!/bin/bash
. /home/oracle/scripts/setEnv.sh
export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES
dbstart $ORACLE_HOME
vi /home/oracle/scripts/stop_all.sh
. /home/oracle/scripts/setEnv.sh
export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES
dbshut $ORACLE_HOME
Change the ownership and rights of /home/oracle/scripts directory as below
#chown -R oracle:oinstall /home/oracle/scripts
#chmod u+x /home/oracle/scripts/*.sh
Download LINUX.X64_213000_db_home.zip from below site
https://www.oracle.com/database/technologies/oracle21c-linux-downloads.html
Copy this zip file to the $ORACLE_HOME path that has been set in setEnv.sh script.
unzip the file as oracle user and run .runInstaller and click on radio button
* Setup software only
. ./runInstaller
Run the root scripts when prompted.
# /u01/app/oraInventory/orainstRoot.sh
# /u01/app/oracle/product/21.0.0/dbhome_1/root.sh
Steps to reinstall
Clean up /u01/app/oracle with the following command directory
#\rm -Rf /u01/app/oracle/*
When installing/reinstalling, If you get the below error
"Error invoking target irman ioracle of makefile”
you will need to copy libjavavm.a file from $ORACLE_HOME/javavm/jdk/jdk8/lib to $ORACLE_HOME/lib folder, do a folder cleamup of /u01/app/oracle and restart the installation.cp $ORACLE_HOME/javavm/jdk/jdk8/lib/libjavavm.a $ORACLE_HOME/lib
when reinstalling oracle software if you get below error
SEVERE: [Jun 10, 2024 4:32:04 AM] [FATAL] [INS-35955] The Database software home
(/u01/app/oracle/product/21.0.0/dhhome_1) is already registered in the central inventory. This tool can only be
used in a non-registered Database home.
ACTION: Choose a different location as Oracle home.
try the following
move the oracle home directory to another directory and start the installation from the new directory
mv /u01/app/oracle/product/21.0.0/dhhome_1 /u01/app/oracle/product/21.0.0/dhhome_2
Install sqldeveloper
download sqldeveloper from the below site
https://www.oracle.com/database/sqldeveloper/technologies/download/
after unzipping to a folder say /home/oracle/sqldeveloper run
. ./sqldeveloper.sh
If you get below error, Error during the initialization of boot layer.
java.lang.module.FindException: Module javafx.base not found
means the java version installed on your OS is not compatible with your sqldeveloper version.
Download sqldeveloper rpm from the following url
https://www.oracle.com/database/sqldeveloper/technologies/download/
For this, java 11 version is required to be installed. You can download from any of below sites for your linux OS.
https://www.oracle.com/in/java/technologies/javase/jdk11-archive-downloads.html
https://rpmfind.net/linux/rpm2html/search.php?query=java-11-openjdk(x86-64)
Install jdk11 as follows
rpm -ivh jdk-11.0.22_linux-x64_bin.rpm
--OR after adding the rpm to your yum repository of rpms
yum install jdk-11.0.22_linux-x64_bin.rpm
In /home/oracle/scripts/setEnv.sh add JAVA_HOME and java to you PATH env variable
export JAVA_HOME=/usr/java/latest
export PATH=$PATH:/usr/java/latest/bin
Install sqldeveloper rpm as follows
rpm -ivh sqldeveloper-23.1.1-345.2114.noarch.rpm
or
yum install sqldeveloper-23.1.1-345.2114.noarch.rpm
which sqldeveloper
/usr/local/bin/sqldeveloper
As root user execute . sqldeveloper
Your database is now up and running and you can use sqldeveloper as a UI for all your database queries and programs.
References
https://oracle-base.com/articles/21c/oracle-db-21c-installation-on-oracle-linux-8#manual_setup
https://oracledbwr.com/step-by-step-oracle-21c-installation-on-linux/
For db install
For SSH setup
http://jhenningerdba.blogspot.com/2015/07/
Thought for the day
All wisdom is from the Lord and with him it remains forever.
The sand of the sea, the drops of rain, and the days of eternity, who can count them?
Sirach 1:1-3
We can only do small things, with great Love - Mother Theresa
No comments:
Post a Comment