Вы находитесь на странице: 1из 9

IInstalling and Configuring Oracle 12c in RHEL 7.

2
1. Verify that your system has correct hostname, static IP address and distribution version,
using following commands.

[root@teslarh ~]$ hostname


[root@teslarh ~]$ ifconfig | grep inet
[root@teslarh ~]$ lsb_release -a

2. Hostname & DNS Setup


Verify IP Address and Hostname and add an entry in the /etc/hosts.
echo "192.168.229.50 dbserver.test.local dbserver" >> /etc/hosts

[root@teslarh ~]$ vim /etc/hosts


127.0.0.1 localhost localhost.localdomain
192.168.0.58 teslarh

3. Now change the SELinux mode to permissive and restart the system to make Permanent
changes for selinux.
[root@teslarh ~]$ vim /etc/sysconfig/selinux
[root@teslarh ~]$ init 6

4. Oracle Installation Prerequisites


4.1. Open a Shell sesin or terminal emulator
4.2. Install the Oracle YUM Repo GPG Key
[root@teslarh ~]$ su
[root@teslarh ~]$ wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O
/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
4.3. Download the Needed Oracle Repo
[root@teslarh ~]$ cd /etc/yum.repos.d/
[root@teslarh ~]$ wget http://public-yum.oracle.com/public-yum-ol7.repo

4.4. Install the Oracle Pre-Install RPM


[root@teslarh ~]$ yum install oracle-rdbms-server-12cR1-preinstall

4.5. Update the System


[root@teslarh ~]$ yum update

5. Add the following lines to the "/etc/security/limits.conf" file.


[root@teslarh ~]$ vim /etc/security/limits.conf

oracle soft nofile 1024


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

6. Configuring System for Oracle Installation

6.1. Create the new groups Oracle inventory, OSDBA and OSOPER for Oracle installation.
[root@teslarh ~]$ groupadd -g 54321 oracle
[root@teslarh ~]$ groupadd -g 54322 dba
[root@teslarh ~]$ groupadd -g 54323 oper

Create Oracle Groups


6.2. Create the new user oracle and add the user to already created groups.
[root@teslarh ~]$ useradd -u 54321 -g oracle -G dba,oper oracle
[root@teslarh ~]$ usermod -a -G wheel oracle
[root@teslarh ~]$ passwd oracle
Create Oracle User

7. If you have the Linux firewall enabled, you will need to disable or configure it, as
shown here or here. To disable it, do the following.
[root@teslarh ~]$ systemctl stop firewalld
[root@teslarh ~]$ systemctl disable firewalld

8. Create the following directory for installing Oracle and change the ownership and grand
permission to the newly created directory using recursive.
[root@teslarh ~]$ mkdir p /u01/app/oracle/product/12.1.0.2/dbhome_1
[root@teslarh ~]$ chown -R oracle:oinstall /u01
[root@teslarh ~]$ chmod -R 775 /u01
[root@teslarh ~]$ ls l /u01

Create Oracle Directory


9. Switch to root user to create environment for oracle user. You can skip this step, if youre
already using root login.
[root@teslarh ~]$ su root
10. Next, we need to add the environmental variable for oracle user. Open and edit the profile
file of oracle user and append the oracle environment entries. Here we dont need to
use sudo command, as we are already logged in as root user.
[root@teslarh ~]$ vim /home/oracle/.bash_profile

Append the below Environment Entry. Save and exit the vi editor using wq!.
## Oracle Env Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=teslarh
export ORACLE_UNQNAME=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0.2/dbhome_1
export ORACLE_SID=orcl
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/jlib

Add Environment Variables

Now exit from root user and login again as teslarh user and switch to oracle user. Again, this
step is not required, if you are already using root account, just switch to oracle user for further
instructions.
[root@teslarh ~]$ exit
[root@teslarh ~]$ su - oracle

11. Downloading Oracle Packages

I have already downloaded the zip package and extracted the contents of oracle installer.

[root@teslarh ~]$ cd ~
[root@teslarh ~]$ ls
[root@teslarh ~]$ unzip linuxamd64_12c_database_1of2.zip
[root@teslarh ~]$ unzip linuxamd64_12c_database_2of2.zip

12. Installing Oracle 12c Database in Red Hat Enterprise Linux 7.2

12.1 After extracting, we will get database directory which has 2.6GB in size. So, next we can
go-head and install the oracle. Let us start the installation by running runInstaller.
Navigate the installer Directory and run the Installer.
12.2 Ingresar con Usuario Oracle
[root@teslarh ~]$ su - oracle
[oracle@teslarh ~]$ cd database/

[oracle@teslarh ~]$ ./runInstaller

Our Installer has been launched here. For every steps we need to move forward by
Clicking Next or OK.

13. Post Installation


After completing the Database installation, now move ahead to do some Post installation
configuration. Open file oratab using vi editor.
[root@teslarh ~]$ vim /etc/oratab

After opening file, search for the the following line.


orcl:/u01/app/oracle/product/12.1.0/db_1:N
And change the parameter N to Y as shown.
orcl:/u01/app/oracle/product/12.1.0/db_1:Y
Restart the machine to take new changes.

14. Automating Database Startup and Shutdown on Other Operating Systems

14.1. Directory to one of the following, depending on the operating system:


[root@teslarh ~]$ cd /etc/init.d
14.2. Create a file called dbora, and copy the following lines into this file:
[root@teslarh ~]$ touch dbora
[root@teslarh ~]$ vim touch dbora
#! /bin/sh
#
# Change the value of ORACLE_HOME to specify the correct Oracle home
# directory for your installation.
ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
#
# Change the value of ORACLE to the login name of the
# oracle owner at your site.
#
ORACLE=oracle
PATH=${PATH}:$ORACLE_HOME/bin
HOST=`hostname`
PLATFORM=`uname`
export ORACLE_HOME PATH
#
if [ ! "$2" = "ORA_DB" ] ; then
runuser -l $ORACLE $0 $1 ORA_DB
if [ "$PLATFORM" = "Linux" ] && [ "$1" = "start" ] ; then
touch /var/lock/subsys/dbora
elif [ "$PLATFORM" = "Linux" ] && [ "$1" = "stop" ] ; then
rm -f /var/lock/subsys/dbora
fi
exit
fi
#
case $1 in
'start')
$ORACLE_HOME/bin/dbstart $ORACLE_HOME &
;;
'stop')
$ORACLE_HOME/bin/dbshut $ORACLE_HOME &
rm -f /var/lock/subsys/dbora
;;
*)
echo "usage: $0 {start|stop}"
exit
;;
esac
#
Exit
14.3. Change the group of the dbora file to the OSDBA group (typically dba), and set the
permissions to 750:
[root@teslarh ~]$ chgrp dba dbora
[root@teslarh ~]$ chmod 750 dbora
14.4. Create symbolic links to the dbora script in the appropriate run-level script directories,
as follows:
[root@teslarh ~]$ ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora
[root@teslarh ~]$ ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
[root@teslarh ~]$ ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
14.5. Startup and Shutdown Container Databases (CDB) and Pluggable Databases (PDB)
CREATE OR REPLACE TRIGGER open_pdbs
AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';
END open_pdbs;
/

15. Installing Adobe Repository

15.1. First add the following Adobe repositories for Flash Player based on your Linux
systems.
For 64-bit x86_64 Systems
[root@teslarh ~]$ rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-
release-x86_64-1.0-1.noarch.rpm
[root@teslarh ~]$ rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

15.2. Updating Adobe Repository


Next, we need to run the following command to update the Adobes own YUM
repository to install Adobe Flash Player latest version.
[root@teslarh ~]$ yum update
15.3. Installing Adobe Flash Player 11.3
Now run the following command to install latest version of Flash Plugin on your Linux
systems.
[root@teslarh ~]$ yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio
libcurl
[root@teslarh ~]$ yum install flash-plugin nspluginwrapper curl

15.4. Verifying Flash Plugin


Verify, the newly installed Flash Plugin on your favorite web browser and enjoy watching
streaming multimedia files.
Thats all for now, enjoy playing games and watching streaming videos on your browser
using Flash Player on systems.
Aadir / Quitar servicios al inicio del sistema Red-Hat, CentOS

chkconfig --list

cat /etc/inittab

Entrando al tema, podemos aadir o quitar servicios del siguiente modo:

chkconfig --level <runlevel> <servicio> on


chkconfig --level <runlevel> <servicio> off

Ejemplo:
Queremos el servicio web httpd al inicio del sistema en los runlevels 3,4 y 5:

chkconfig --level 345 httpd on

Y de un modo estandar si especificarle el runlevel:

chkconfig --add mysql


chkconfig --del mysql

sudo systemctl stop sshd.socket


sudo systemctl stop sshd.service
sudo /usr/bin/sshd -d

Вам также может понравиться