A. Install Oracle 19c on RHEL 7
Step 1 Download Software
Download Oracle 19c from
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html
and Unpack Files. You should get on directory named “database”
Step 2 Hosts File
- The “/etc/hosts” file must contain a fully qualified name for the server.
- Use “ifconfig” command to check your IP Address. if no IP address is assigned, specify a static IP address by using following command.
This should give you the static IP address to be used in /etc/hosts file
Step 3 Add or amend the following lines in the “/etc/sysctl.conf” file.
fs.suid_dumpable = 1 fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 1073741824 kernel.shmmax = 4398046511104 kernel.shmmni = 4096 # semaphores: semmsl, semmns, semopm, semmni kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.ipv4.conf.all.rp_filter = 2 net.ipv4.conf.default.rp_filter = 2 kernel.panic_on_oops = 1 net.core.rmem_default=4194304 net.core.rmem_max=4194304 net.core.wmem_default=262144 net.core.wmem_max=1048586Run the following command to change the current kernel parameters.
# sysctl -pStep 4 Add the following lines to the “/etc/security/limits.conf” file.
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 134217728Disable secure linux by editing the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows.
SELINUX=disabledOnce the change is complete, restart the server.
Step 5 Install the following packages if they are not already present.
yum install -y sysstat numactl python glibc gcc ksh glibc-devel targetcli smartmontools \ make bc libgcc libaio libXrender libX11 libXi libXau libXtst libxcb libstdc++ gcc-c++ \ libaio-devel libdtrace-ctf-devel libXrender-devel librdmacm-devel OpenSSL unixODBC \ nfs-utils python-configshell python-rtslib python-six compat-libcap1 fontconfig-devel \ binutils glibc-common libstdc++-devel compat-libstdc++-33 net-tools dtrace-utils \ elfutils-libelf elfutils-libelf-devel compat-libstdc*i686 glibc*i686 libgcc*i686 \ dejavu-serif-fonts numactl-devel motif motif-devel libstdc++*i686Note. This will install all the necessary packages for 12.2. From 11.2.0.2 onwards many of these are unnecessary, but having them present does not cause a problem.
Step 6 Create the new groups and users.
groupadd -g 501 oinstall groupadd -g 502 dba groupadd -g 503 oper groupadd -g 504 asmadmin groupadd -g 505 asmdba groupadd -g 506 asmoperuseradd -u 502 -g oinstall -G dba,asmdba,oper oracle passwd oracle
Step 7 Create the directories in which the Oracle software will be installed.
mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1 chown -R oracle:oinstall /u01 chmod -R 775 /u01Step 8 Login as root and issue the following command.
xhost +oracle.example.comStep 9 Login as the oracle user and Create a “scripts” directory.
mkdir /home/oracle/scriptsCreate an environment file called “setEnv.sh”
# vi /home/oracle/scripts/setEnv.sh export TMP=/tmp export TMPDIR=$TMP export ORACLE_HOSTNAME=oracle.example.com export ORACLE_UNQNAME=cdb1 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1 export ORA_INVENTORY=/u01/app/oraInventory export ORACLE_SID=cdb1 export PDB_NAME=pdb1 export DATA_DIR=/u01/oradata export PATH=/usr/sbin:$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/jlibAdd a reference to the “setEnv.sh” file at the end of the “/home/oracle/.bash_profile” file.
echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profileCreate a “start_all.sh” and “stop_all.sh” script that can be called from a startup/shutdown service. Make sure the ownership and permissions are correct.
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_HOMEvi /home/oracle/scripts/stop_all.sh #!/bin/bash . /home/oracle/scripts/setEnv.sh export ORAENV_ASK=NO . oraenv export ORAENV_ASK=YES dbshut $ORACLE_HOME chown -R oracle:oinstall /home/oracle/scripts chmod u+x /home/oracle/scripts/*.sh
Step 10 Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.
DISPLAY=oracle.example.com:0.0; export DISPLAYStart the Oracle Universal Installer (OUI) by issuing the following command in the database directory.
./runInstallerStep 11 Post Installation : Edit the “/etc/oratab” file setting the restart flag for each instance to ‘Y’.
CDB1:/u01/app/oracle/product/19.3.0/dbhome_1:YNext, create a file called “/etc/init.d/oracledb” as the root user, containing the following.
#!/bin/sh # chkconfig: 345 99 10 # description: Oracle auto start-stop script. # # Set ORA_HOME to be equivalent to the $ORACLE_HOME # from which you wish to execute dbstart and dbshut; # # Set ORA_OWNER to the user id of the owner of the # Oracle database in ORA_HOME. ORA_HOME=/u01/app/oracle/product/19.3.0/dbhome_1 ORA_OWNER=oracle if [ ! -f $ORA_HOME/bin/dbstart ] then echo "Oracle startup: cannot start" exit fi case "$1" in 'start') # Start the Oracle databases: # The following command assumes that the oracle login # will not prompt the user for any values su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME" touch /var/lock/subsys/oracledb ;; 'stop') # Stop the Oracle databases: # The following command assumes that the oracle login # will not prompt the user for any values su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME" rm -f /var/lock/subsys/oracledb ;; esacUse the chmod command to set the privileges to 750.
chmod 750 /etc/init.d/oracledbAssociate the oracledb service with the appropriate run levels and set it to auto-start using the following command.
chkconfig --add oracledb chkconfig oracledb onB. Install and Configure Oracle EM Cloud Control 12c R5 on CentOS 7
https://www.youtube.com/watch?v=Qu2SZ6hfyos
Pre Requisites.
- RAM on Machine: 10GB
- Disk Space Free: 45GB
- Oracle 19c Installed and Running
- Swap Space: 8GB
Sequence 1. Prepare the System for OEM Cloud Control
- Install following packages with yum if not already installed:
- Add or change the following lines in the “/etc/sysctl.conf” file if not added already
- Run the following command to change the current kernel parameters.
- Add the following lines to the “/etc/security/limits.conf” file if not added already
- Generate a Password File and Update Password of sys user (mandatory for authentication by EM Cloud Control).
- System wide parameters settings: These parameters needs to be changed for the installation. If you don’t change them, Installer will complain.
- Repeat same for PDB
- Restart the Instance
- Login as “oracle” user and download and unzip Oracle Enterprise Manager Cloud Control 13c Release 2 from
https://www.oracle.com/enterprise-manager/downloads/linux-x86-64-13c-rel2-downloads.html
- There are Seven files
- em13200_linux64.bin
- em13200_linux64-2.zip
- em13200_linux64-3.zip
- em13200_linux64-4.zip
- em13200_linux64-5.zip
- em13200_linux64-6.zip
- Create a Directory, move the downloaded files in that directory and unzip the files
Sequence 2. Prepare Oracle Database 19c for Installation
- Make Changes in SQLNET.ORA for Compatibility. For this add following lines:
- Set important Parameters for Oracle Instance and CDB
- Set Memory Parameters for PDB
- Verify that parameters are changed
Sequence 3. Install Oracle Enterprise Manager Cloud Control 13c R2
- Create the Installation directory for OEM Cloud Control “middleware” and “agent”. You will be needing these during installation.
- Change to directory where you have extracted the downloaded the files and run the installer.
- Start the Oracle Management Service:
- Login at https://oracle.example.com:7803/em/ using
- User ID : sysman
- Password : you provided during installation
- Privilege Delegation. The host that will perform the scan need to be setup for privilege delegation as the scanning account needs to be configured with sudo to root. Go to Setup/Security/Privilege Delegation and select the host(s) to be used for the scan. Click on the edit icon and select the Sudoradio button and then enter:
- Stop the Oracle Management Service:
- Change directory to the home directory for the Oracle Management Agent and stop the Management Agent:
Sequence 4. Clean up for Reinstallation
- Drop the repository users:
- Drop the synonyms:
- Drop the tablespace objects:
- Drop the registry objects:
- Delete the Directories