Search This Blog

Wednesday, July 8, 2015

Step by step Oracle installation on Linux ( Centos )

1.First login as root user

# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-ol6.repo --no-check-certificate

2. Just copy and paste following lines one after another

# yum install oracle-rdbms-server-11gR2-preinstall
#yum install binutils glibc compat-libstdc++-33 glibc-common \
glibc-devel glibc-headers elfutils-libelf elfutils-libelf-devel \
elfutils gcc gcc-c++ ksh libaio libaio-devel libgcc libstdc++-devel \
make numactl-devel sysstat mksh

3.
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle --no-check-certificate
4.
# vi /etc/sysconfig/network

HOSTNAME=oracle.tecmint.com

5.
# vi /etc/hosts
  192.168.246.128 oracle.tecmint.com oracle
6.
# /etc/init.d/network restart

7.
**** Edit /etc/sysctl.conf file.
# nano /etc/sysctl.conf
   Add or amend the following lines

#### Oracle 11g Kernel Parameters ####
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096

# semaphores: semmsl, semmns, semopm, semmni

kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

Comment out these lines below that Gives an Error

#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0

** Edit /etc/security/limits.conf file.
       #nano /etc/security/limits.conf

      Add the following lines

#### oracle User Settings 4 Oracle 11g ####
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
oracle              soft    stack   10240

** Disable SELINUX
nano /etc/selinux/config

**Disable Secure Linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows.

SELINUX=disabled

** Load the New Kernel Parameters.
/sbin/sysctl -p


# vi /etc/security/limits.d/90-nproc.conf

       # Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     1024
# To this
* - nproc 16384

8.

 # vi /etc/selinux/config
        ELINUX=disabled

9. Add Groups and User

#groupadd -g 502 oinstall
#groupadd -g 503 dba
#groupadd -g 504 oper
#groupadd -g 505 asmadmin
#useradd -u 502 -g oinstall -G dba,asmadmin,oper oracle
#passwd oracle

10. Make Target Directories
#mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
#chown -R oracle:oinstall /u01
#chmod -R 775 /u01

11.
# su oracle
# nano /home/oracle/.bashrc

    # Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=<b><HOSTNAME></b>; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=<b><DBSID></b>; 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/lib64; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

12.

    Last and Optional to Add Full Env-Integration edit also oracle’s .bash_profile
nano ~/.bash_profile

if [ -f ~/.bashrc ]; then
        source ~/.bashrc
fi


13.
    cd /tmp/database
     ./runInstaller


----------------PECL INSTALL------------------------
1. yum -y install php-devel

2. pecl install oci8


3. On CentOS

Open php.ini file and add the following extension:

extension=oci8.so

4. Checking the libraries installed
echo /u01/app/oracle/product/11.2.0/dbhome_1/lib/ >> /etc/ld.so.conf
ldconfig

-----------------------
alter system set SEC_CASE_SENSITIVE_LOGON=FALSE scope=both;
ALTER SYSTEM SET DEFERRED_SEGMENT_CREATION=FALSE scope=both;




CREATE TABLESPACE PLATFORM DATAFILE
  '/u01/app/oracle/oradata/orcl/PLATFORM01.DBF' SIZE 2048M AUTOEXTEND
ON NEXT 16M MAXSIZE 6144M
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT MANUAL
FLASHBACK ON;



SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
    )
    (SID_DESC=
      (SID_NAME=dg4odbc)
      (ORACLE_HOME=D:\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM=dg4odbc)
      (ENVS=LD_LIBRARY_PATH = D:\app\Administrator\product\11.2.0\dbhome_1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME=ORCL)
      (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_1)
      (SID_NAME = ORCL)
    )
  )

No comments:

Post a Comment