Prerequisites
Before you begin the silent installation of Oracle 19c on RHEL with two PDBs, you will need to ensure that your system meets the following prerequisites:
- Operating System: Red Hat Enterprise Linux (RHEL) 7 or 8
- Memory: At least 16GB of RAM
- Disk Space: At least 40GB of free disk space
- User: A non-root user with sudo privileges
Step 1: Download Oracle 19c Software
- Download the Oracle 19c software from the Oracle Technology Network (OTN) website.
- Extract the downloaded software to a convenient location on your system.
Step 2: Create Installation Directories
- Create the following directories for the Oracle 19c installation:
/u01/app/oracle/product
/u02/oradata
- Set the ownership of the directories to the
oracle
user and group:
chown -R oracle:oinstall /u01/app/oracle/product
chown -R oracle:oinstall /u02/oradata
Step 3: Create Oracle User and Group
- Create the
oracle
user and group:
groupadd oinstall
useradd -g oinstall -M oracle
- Set the password for the
oracle
user:
Step 4: Configure SELinux
- Edit the
/etc/selinux/config
file and set SELINUX=permissive
:
- Save the file and reboot your system:
Step 5: Disable Firewall
- Disable the firewall to allow Oracle to communicate with the outside world:
systemctl stop firewalld
systemctl disable firewalld
Step 6: Set Environment Variables
- Add the following environment variables to your
~/.bashrc
file:
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
ORACLE_SID=c
Step 7: Unzip Oracle Software
- Unzip the Oracle 19c software into the
ORACLE_HOME
directory:
unzip <oracle_software_file_name> -d $ORACLE_HOME
Step 8: Create Database Configuration File
- Create a response file named
db_install.rsp
in the ORACLE_HOME/install/response
directory:
- Add the following parameters to the
db_install.rsp
file:
[GENERAL]
INSTALL_TYPE=EE
DECLINE_AUTO_CONFIG=true
[DATABASE]
SID=orcl
GLOBAL_NAMES=false
CHARACTERSET=AL32UTF8
[MULTI_PDB]
PDB_NAME=PDB1
PDB_CREATE_AS_SYSDBA=true
PDB_MEMORY_SIZE=2048MB
[MULTI_PDB]
PDB_NAME=PDB2
PDB_CREATE_AS_SYSDBA=true
PDB_MEMORY_SIZE=2048MB
- Save and close the
db_install.rsp
file.
Step 9: Run Oracle Universal Installer (OUI)
- Navigate to the
ORACLE_HOME
directory:
- Run the OUI in silent mode using the following command:
./runInstaller -silent -responseFile db_install.rsp -executeConfig
Step 10: Create PDBs Using Commands
- After the installation is complete, you can create the two PDBs using the following commands:
sqlplus / as sysdba << EOF
CREATE PLUGGABLE DATABASE pdb1
TEMPLATE=orcl;
CREATE PLUGGABLE DATABASE pdb2
TEMPLATE=orcl;
EOF
- To mount the PDBs, run the following commands:
sqlplus / as sysdba << EOF
ALTER PLUGGABLE DATABASE pdb1 MOUNT;
ALTER PLUGGABLE DATABASE pdb2 MOUNT;
EOF
- Connect to each PDB as SYSDBA and create the necessary tablespaces and users:
sqlplus / as sysdba << EOF
CONNECT / AS SYSDBA;
CREATE TABLESPACE pdb1_tbs DATAFILE '/u02/oradata/pdb1/pdb1_tbs.dbf' SIZE 10M;
CREATE USER pdb1_user IDENTIFIED BY pdb1_password;
GRANT CONNECT, CREATE SESSION, CREATE TABLE TO pdb1_user;
EOF
sqlplus / as sysdba << EOF
CONNECT / AS SYSDBA;
CREATE TABLESPACE pdb2_tbs DATAFILE '/u02/oradata/pdb2/pdb2_tbs.dbf' SIZE 10M;
CREATE USER pdb2_user IDENTIFIED BY pdb2_password;
GRANT CONNECT, CREATE SESSION, CREATE TABLE TO pdb2_user;
EOF
Congratulations! You have successfully installed Oracle 19c on RHEL with two PDBs and created the necessary tablespaces and users for each PDB.
Looking forward for your suggestions.. please feel free to write to me.. Your help would definitely help to improve our blog. Chetan Yadav
No comments:
Post a Comment