Como simplificar a instalação do oracle database no oracle linux (11g only)

Para muitos Consultores (EU inclusive) odeio instalar os packages necessários para o oracle funcionar.

Vamos aprender a fazer isso da melhor forma, alem disso já alterar os semaforos e o arquivo de limites.

Após instalar o Linux existem vários passos a ser feito para poder começar a instalação do linux.

São conhecidos como “oracle pré install”. Docs.oracle

Ali são perdidos alguns preciosos minutos para configurar limit.conf, semaforos, e instalar os malditos RPM (64 bits é o hell).

Que tal fazer tudo isso via YUM?

Vamos a pratica.


[root@fuscabala ~]# cd /etc/yum.repos.d
[root@fuscabala yum.repos.d]# wget http://public-yum.oracle.com/public-yum-ol6.repo
--2012-09-14 06:16:47-- http://public-yum.oracle.com/public-yum-ol6.repo
Resolving public-yum.oracle.com... 141.146.44.34
Connecting to public-yum.oracle.com|141.146.44.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1707 (1.7K) 
Saving to: âpublic-yum-ol6.repoâ

100%[==============================================================================================================================>] 1,707 --.-K/s in 0s

2012-09-14 06:16:48 (9.01 MB/s) - âpublic-yum-ol6.repoâ

[root@fuscabala yum.repos.d]# vi public-yum-ol6.repo
[root@fuscabala yum.repos.d]# ls
public-yum-ol6.repo
[root@fuscabala yum.repos.d]# yum list
Loaded plugins: rhnplugin
This system is not registered with ULN.
ULN support will be disabled.
ol6_UEK_latest | 1.2 kB 00:00
ol6_UEK_latest/primary | 2.6 MB 00:00
ol6_UEK_latest 71/71
ol6_latest | 1.4 kB 00:00
ol6_latest/primary | 22 MB 00:00
ol6_latest 14352/14352
Installed Packages
ConsoleKit.i686 0.4.1-3.el6 @anaconda-OracleLinuxServer-201102031415.i386/6.0
ConsoleKit-libs.i686 0.4.1-3.el6 @anaconda-OracleLinuxServer-201102031415.i386/6.0
MAKEDEV.i686 3.24-6.el6 @anaconda-OracleLinuxServer-201102031415.i386/6.0
...

Parei com a execução do yum, pois o intuito acima era mostrar o repositório da Oracle funcionando.

Agora vamos instalar todos os pacotes da Oracle via YUM.

PS1: Este é um SO recem instalado.

PS2: No Oracle linux 5 o nome do pacote era chamado de Oracle-validated hoje no Oracle 6 esta como oracle-rdbms-server-11gR2-preinstall

[root@fuscabala yum.repos.d]# yum install oracle-rdbms-server-11gR2-preinstall.i686
Loaded plugins: rhnplugin
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-11gR2-preinstall.i686 0:1.0-6.el6 set to be updated
--> Processing Dependency: kernel-uek for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Processing Dependency: xorg-x11-utils for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Processing Dependency: gcc for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Processing Dependency: glibc-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Processing Dependency: xorg-x11-xauth for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686
--> Running transaction check
---> Package compat-libcap1.i686 0:1.10-1 set to be updated
---> Package compat-libstdc++-33.i686 0:3.2.3-69.el6 set to be updated
---> Package gcc.i686 0:4.4.6-4.el6 set to be updated
--> Processing Dependency: cpp = 4.4.6-4.el6 for package: gcc-4.4.6-4.el6.i686
--> Processing Dependency: libgomp = 4.4.6-4.el6 for package: gcc-4.4.6-4.el6.i686
--> Processing Dependency: libgcc >= 4.4.6-4.el6 for package: gcc-4.4.6-4.el6.i686
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.6-4.el6.i686
---> Package gcc-c++.i686 0:4.4.6-4.el6 set to be updated
--> Processing Dependency: libstdc++ = 4.4.6-4.el6 for package: gcc-c++-4.4.6-4.el6.i686
--> Processing Dependency: libmpfr.so.1 for package: gcc-c++-4.4.6-4.el6.i686
---> Package glibc-devel.i686 0:2.12-1.80.el6_3.5 set to be updated
--> Processing Dependency: glibc-headers = 2.12-1.80.el6_3.5 for package: glibc-devel-2.12-1.80.el6_3.5.i686
--> Processing Dependency: glibc = 2.12-1.80.el6_3.5 for package: glibc-devel-2.12-1.80.el6_3.5.i686
--> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.80.el6_3.5.i686
---> Package kernel-uek.i686 0:2.6.39-200.29.3.el6uek set to be updated
--> Processing Dependency: kernel-uek-firmware = 2.6.39-200.29.3.el6uek for package: kernel-uek-2.6.39-200.29.3.el6uek.i686
--> Processing Dependency: dracut-kernel >= 004-242.0.3 for package: kernel-uek-2.6.39-200.29.3.el6uek.i686
---> Package ksh.i686 0:20100621-16.el6 set to be updated
---> Package libaio-devel.i686 0:0.3.107-10.el6 set to be updated
---> Package libstdc++-devel.i686 0:4.4.6-4.el6 set to be updated
---> Package xorg-x11-utils.i686 0:7.4-8.el6 set to be updated
--> Processing Dependency: libXmuu.so.1 for package: xorg-x11-utils-7.4-8.el6.i686
--> Processing Dependency: libdmx.so.1 for package: xorg-x11-utils-7.4-8.el6.i686
--> Processing Dependency: libXv.so.1 for package: xorg-x11-utils-7.4-8.el6.i686
--> Processing Dependency: libXxf86vm.so.1 for package: xorg-x11-utils-7.4-8.el6.i686
--> Processing Dependency: libXxf86misc.so.1 for package: xorg-x11-utils-7.4-8.el6.i686
--> Processing Dependency: libXxf86dga.so.1 for package: xorg-x11-utils-7.4-8.el6.i686
---> Package xorg-x11-xauth.i686 1:1.0.2-7.1.el6 set to be updated
--> Running transaction check
---> Package cloog-ppl.i686 0:0.15.7-1.2.el6 set to be updated
--> Processing Dependency: libppl.so.7 for package: cloog-ppl-0.15.7-1.2.el6.i686
--> Processing Dependency: libppl_c.so.2 for package: cloog-ppl-0.15.7-1.2.el6.i686
---> Package cpp.i686 0:4.4.6-4.el6 set to be updated
---> Package dracut-kernel.noarch 0:004-284.0.1.el6_3 set to be updated
--> Processing Dependency: dracut = 004-284.0.1.el6_3 for package: dracut-kernel-004-284.0.1.el6_3.noarch
--> Processing Dependency: glibc = 2.12-1.7.el6 for package: glibc-common-2.12-1.7.el6.i686
---> Package glibc.i686 0:2.12-1.80.el6_3.5 set to be updated
---> Package glibc-headers.i686 0:2.12-1.80.el6_3.5 set to be updated
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.80.el6_3.5.i686
--> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.80.el6_3.5.i686
---> Package kernel-uek-firmware.noarch 0:2.6.39-200.29.3.el6uek set to be updated
---> Package libXmu.i686 0:1.0.5-1.el6 set to be updated
--> Processing Dependency: libXt.so.6 for package: libXmu-1.0.5-1.el6.i686
---> Package libXv.i686 0:1.0.5-1.el6 set to be updated
---> Package libXxf86dga.i686 0:1.1.1-1.el6 set to be updated
---> Package libXxf86misc.i686 0:1.0.2-1.el6 set to be updated
---> Package libXxf86vm.i686 0:1.1.0-1.el6 set to be updated
---> Package libdmx.i686 0:1.1.0-1.el6 set to be updated
---> Package libgcc.i686 0:4.4.6-4.el6 set to be updated
---> Package libgomp.i686 0:4.4.6-4.el6 set to be updated
---> Package libstdc++.i686 0:4.4.6-4.el6 set to be updated
---> Package mpfr.i686 0:2.4.1-6.el6 set to be updated
--> Running transaction check
---> Package dracut.noarch 0:004-284.0.1.el6_3 set to be updated
---> Package glibc-common.i686 0:2.12-1.80.el6_3.5 set to be updated
---> Package kernel-uek-headers.i686 0:2.6.32-300.32.2.el6uek set to be updated
---> Package libXt.i686 0:1.0.7-1.el6 set to be updated
---> Package ppl.i686 0:0.10.2-11.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
 oracle-rdbms-server-11gR2-preinstall i686 1.0-6.el6 ol6_latest 15 k
Installing for dependencies:
 cloog-ppl i686 0.15.7-1.2.el6 ol6_latest 93 k
 compat-libcap1 i686 1.10-1 ol6_latest 16 k
 compat-libstdc++-33 i686 3.2.3-69.el6 ol6_latest 188 k
 cpp i686 4.4.6-4.el6 ol6_latest 3.4 M
 gcc i686 4.4.6-4.el6 ol6_latest 8.2 M
 gcc-c++ i686 4.4.6-4.el6 ol6_latest 4.3 M
 glibc-devel i686 2.12-1.80.el6_3.5 ol6_latest 970 k
 glibc-headers i686 2.12-1.80.el6_3.5 ol6_latest 609 k
 kernel-uek i686 2.6.39-200.29.3.el6uek ol6_UEK_latest 24 M
 kernel-uek-firmware noarch 2.6.39-200.29.3.el6uek ol6_UEK_latest 2.8 M
 kernel-uek-headers i686 2.6.32-300.32.2.el6uek ol6_latest 714 k
 ksh i686 20100621-16.el6 ol6_latest 680 k
 libXmu i686 1.0.5-1.el6 ol6_latest 58 k
 libXt i686 1.0.7-1.el6 ol6_latest 168 k
 libXv i686 1.0.5-1.el6 ol6_latest 20 k
 libXxf86dga i686 1.1.1-1.el6 ol6_latest 20 k
 libXxf86misc i686 1.0.2-1.el6 ol6_latest 15 k
 libXxf86vm i686 1.1.0-1.el6 ol6_latest 18 k
 libaio-devel i686 0.3.107-10.el6 ol6_latest 13 k
 libdmx i686 1.1.0-1.el6 ol6_latest 16 k
 libstdc++-devel i686 4.4.6-4.el6 ol6_latest 1.5 M
 mpfr i686 2.4.1-6.el6 ol6_latest 153 k
 ppl i686 0.10.2-11.el6 ol6_latest 1.3 M
 xorg-x11-utils i686 7.4-8.el6 ol6_latest 84 k
 xorg-x11-xauth i686 1:1.0.2-7.1.el6 ol6_latest 33 k
Updating for dependencies:
 dracut noarch 004-284.0.1.el6_3 ol6_latest 112 k
 dracut-kernel noarch 004-284.0.1.el6_3 ol6_latest 21 k
 glibc i686 2.12-1.80.el6_3.5 ol6_latest 4.3 M
 glibc-common i686 2.12-1.80.el6_3.5 ol6_latest 14 M
 libgcc i686 4.4.6-4.el6 ol6_latest 110 k
 libgomp i686 4.4.6-4.el6 ol6_latest 119 k
 libstdc++ i686 4.4.6-4.el6 ol6_latest 298 k

Transaction Summary
========================================================================================================================================================================
Install 26 Package(s)
Upgrade 7 Package(s)

Total size: 69 M
Total download size: 25 M
Is this ok [y/N]: y
Downloading Packages:
(1/23): glibc-2.12-1.80.el6_3.5.i686.rpm | 4.3 MB 00:30
(2/23): glibc-common-2.12-1.80.el6_3.5.i686.rpm | 14 MB 01:31
(3/23): glibc-devel-2.12-1.80.el6_3.5.i686.rpm | 970 kB 00:05
(4/23): glibc-headers-2.12-1.80.el6_3.5.i686.rpm | 609 kB 00:05
(5/23): kernel-uek-headers-2.6.32-300.32.2.el6uek.i686.rpm | 714 kB 00:05
(6/23): ksh-20100621-16.el6.i686.rpm | 680 kB 00:03
(7/23): libXmu-1.0.5-1.el6.i686.rpm | 58 kB 00:00
(8/23): libXt-1.0.7-1.el6.i686.rpm | 168 kB 00:01
(9/23): libXv-1.0.5-1.el6.i686.rpm | 20 kB 00:00
(10/23): libXxf86dga-1.1.1-1.el6.i686.rpm | 20 kB 00:00
(11/23): libXxf86misc-1.0.2-1.el6.i686.rpm | 15 kB 00:00
(12/23): libXxf86vm-1.1.0-1.el6.i686.rpm | 18 kB 00:00
(13/23): libaio-devel-0.3.107-10.el6.i686.rpm | 13 kB 00:00
(14/23): libdmx-1.1.0-1.el6.i686.rpm | 16 kB 00:00
(15/23): libgcc-4.4.6-4.el6.i686.rpm | 110 kB 00:00
(16/23): libgomp-4.4.6-4.el6.i686.rpm | 119 kB 00:00
(17/23): libstdc++-4.4.6-4.el6.i686.rpm | 298 kB 00:02
(18/23): libstdc++-devel-4.4.6-4.el6.i686.rpm | 1.5 MB 00:06
(19/23): mpfr-2.4.1-6.el6.i686.rpm | 153 kB 00:01
(20/23): oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686.rpm | 15 kB 00:00
(21/23): ppl-0.10.2-11.el6.i686.rpm | 1.3 MB 00:07
(22/23): xorg-x11-utils-7.4-8.el6.i686.rpm | 84 kB 00:00
(23/23): xorg-x11-xauth-1.0.2-7.1.el6.i686.rpm | 33 kB 00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 140 kB/s | 25 MB 03:04
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
ol6_latest/gpgkey | 2.0 kB 00:00 ...
Importing GPG key 0xEC551F03 "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>" from http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
 Updating : libgcc-4.4.6-4.el6.i686 1/40
 Installing : kernel-uek-headers-2.6.32-300.32.2.el6uek.i686 2/40
 Updating : dracut-004-284.0.1.el6_3.noarch 3/40
 Updating : dracut-kernel-004-284.0.1.el6_3.noarch 4/40
 Installing : libaio-devel-0.3.107-10.el6.i686 5/40
 Installing : kernel-uek-firmware-2.6.39-200.29.3.el6uek.noarch 6/40
 Updating : glibc-common-2.12-1.80.el6_3.5.i686 7/40
 Updating : glibc-2.12-1.80.el6_3.5.i686 8/40
 Installing : glibc-headers-2.12-1.80.el6_3.5.i686 9/40
 Installing : glibc-devel-2.12-1.80.el6_3.5.i686 10/40
 Installing : kernel-uek-2.6.39-200.29.3.el6uek.i686 11/40
 Updating : libstdc++-4.4.6-4.el6.i686 12/40
 Installing : mpfr-2.4.1-6.el6.i686 13/40
 Installing : cpp-4.4.6-4.el6.i686 14/40
 Installing : ppl-0.10.2-11.el6.i686 15/40
 Installing : cloog-ppl-0.15.7-1.2.el6.i686 16/40
 Installing : libXxf86dga-1.1.1-1.el6.i686 17/40
 Installing : libXxf86misc-1.0.2-1.el6.i686 18/40
 Installing : compat-libcap1-1.10-1.i686 19/40
 Updating : libgomp-4.4.6-4.el6.i686 20/40
 Installing : gcc-4.4.6-4.el6.i686 21/40
 Installing : ksh-20100621-16.el6.i686 22/40
 Installing : libdmx-1.1.0-1.el6.i686 23/40
 Installing : compat-libstdc++-33-3.2.3-69.el6.i686 24/40
 Installing : libXv-1.0.5-1.el6.i686 25/40
 Installing : libXt-1.0.7-1.el6.i686 26/40
 Installing : libXmu-1.0.5-1.el6.i686 27/40
 Installing : 1:xorg-x11-xauth-1.0.2-7.1.el6.i686 28/40
 Installing : libXxf86vm-1.1.0-1.el6.i686 29/40
 Installing : libstdc++-devel-4.4.6-4.el6.i686 30/40
 Installing : gcc-c++-4.4.6-4.el6.i686 31/40
 Installing : xorg-x11-utils-7.4-8.el6.i686 32/40
 Installing : oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.i686 33/40
 Cleanup : dracut-kernel-004-32.el6.noarch 34/40
 Cleanup : libstdc++-4.4.4-13.el6.i686 35/40
 Cleanup : libgomp-4.4.4-13.el6.i686 36/40
 Cleanup : dracut-004-32.el6.noarch 37/40
 Cleanup : glibc-common-2.12-1.7.el6.i686 38/40
 Cleanup : glibc-2.12-1.7.el6.i686 39/40
 Cleanup : libgcc-4.4.4-13.el6.i686 40/40

Installed:
 oracle-rdbms-server-11gR2-preinstall.i686 0:1.0-6.el6

Dependency Installed:
 cloog-ppl.i686 0:0.15.7-1.2.el6 compat-libcap1.i686 0:1.10-1 compat-libstdc++-33.i686 0:3.2.3-69.el6
 cpp.i686 0:4.4.6-4.el6 gcc.i686 0:4.4.6-4.el6 gcc-c++.i686 0:4.4.6-4.el6
 glibc-devel.i686 0:2.12-1.80.el6_3.5 glibc-headers.i686 0:2.12-1.80.el6_3.5 kernel-uek.i686 0:2.6.39-200.29.3.el6uek
 kernel-uek-firmware.noarch 0:2.6.39-200.29.3.el6uek kernel-uek-headers.i686 0:2.6.32-300.32.2.el6uek ksh.i686 0:20100621-16.el6
 libXmu.i686 0:1.0.5-1.el6 libXt.i686 0:1.0.7-1.el6 libXv.i686 0:1.0.5-1.el6
 libXxf86dga.i686 0:1.1.1-1.el6 libXxf86misc.i686 0:1.0.2-1.el6 libXxf86vm.i686 0:1.1.0-1.el6
 libaio-devel.i686 0:0.3.107-10.el6 libdmx.i686 0:1.1.0-1.el6 libstdc++-devel.i686 0:4.4.6-4.el6
 mpfr.i686 0:2.4.1-6.el6 ppl.i686 0:0.10.2-11.el6 xorg-x11-utils.i686 0:7.4-8.el6
 xorg-x11-xauth.i686 1:1.0.2-7.1.el6

Dependency Updated:
 dracut.noarch 0:004-284.0.1.el6_3 dracut-kernel.noarch 0:004-284.0.1.el6_3 glibc.i686 0:2.12-1.80.el6_3.5 glibc-common.i686 0:2.12-1.80.el6_3.5
 libgcc.i686 0:4.4.6-4.el6 libgomp.i686 0:4.4.6-4.el6 libstdc++.i686 0:4.4.6-4.el6

Complete!
[root@fuscabala yum.repos.d]#

Observe o sysctl

[root@fuscabala yum.repos.d]# cat /etc/sysctl.conf
...
# oracle-rdbms-server-11gR2-preinstall setting for fs.file-max is 6815744
fs.file-max = 6815744

# oracle-rdbms-server-11gR2-preinstall setting for kernel.sem is '250 32000 100 128'
kernel.sem = 250 32000 100 128

# oracle-rdbms-server-11gR2-preinstall setting for kernel.shmmni is 4096
kernel.shmmni = 4096

# oracle-rdbms-server-11gR2-preinstall setting for kernel.shmall is 1073741824 on x86_64
# oracle-rdbms-server-11gR2-preinstall setting for kernel.shmall is 2097152 on i386
kernel.shmall = 2097152

# oracle-rdbms-server-11gR2-preinstall setting for kernel.shmmax is 4398046511104 on x86_64
# oracle-rdbms-server-11gR2-preinstall setting for kernel.shmmax is 4294967295 on i386
kernel.shmmax = 4294967295

# oracle-rdbms-server-11gR2-preinstall setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144

# oracle-rdbms-server-11gR2-preinstall setting for net.core.rmem_max is 4194304
net.core.rmem_max = 4194304

# oracle-rdbms-server-11gR2-preinstall setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144

# oracle-rdbms-server-11gR2-preinstall setting for net.core.wmem_max is 1048576
net.core.wmem_max = 1048576

# oracle-rdbms-server-11gR2-preinstall setting for fs.aio-max-nr is 1048576
fs.aio-max-nr = 1048576

# oracle-rdbms-server-11gR2-preinstall setting for net.ipv4.ip_local_port_range is 9000 65500
net.ipv4.ip_local_port_range = 9000 65500

Observe os limites…

[root@fuscabala yum.repos.d]# cat /etc/security/limits.conf
...
# oracle-rdbms-server-11gR2-preinstall setting for nofile soft limit is 1024
oracle soft nofile 1024

# oracle-rdbms-server-11gR2-preinstall setting for nofile hard limit is 65536
oracle hard nofile 65536

# oracle-rdbms-server-11gR2-preinstall setting for nproc soft limit is 2047
oracle soft nproc 2047

# oracle-rdbms-server-11gR2-preinstall setting for nproc hard limit is 16384
oracle hard nproc 16384

# oracle-rdbms-server-11gR2-preinstall setting for stack soft limit is 10240KB
oracle soft stack 10240

# oracle-rdbms-server-11gR2-preinstall setting for stack hard limit is 32768KB
oracle hard stack 32768

Depois disso é só instalar o oracle.

Referencias: http://www.oracle.com/technetwork/articles/servers-storage-admin/ginnydbinstallonlinux-488779.html

http://public-yum.oracle.com/

https://blogs.oracle.com/linux/entry/oracle_rdbms_server_11gr2_pre

%name Como  simplificar a instalação do oracle database no oracle linux (11g only)

Autor: Leandro Lana

Trabalho com banco de dados Oracle desde 2006, já trabalhei com as plataformas 9i, 10G, 11G e 12C.

Trabalhando atualmente como consultor Oracle na MigraTI Soluções em TI como administrador de banco de dados Oracle, SQL-Server e DB2.

Contato: leandro.lana@migrati.com.br

Fone: (47) 9191-6052 / (47) 3328 0996

Certificações:

OCA 10G.

OCP 10G.

OCE Linux.

OCE RAC/Cluster.

MCP SQL-Server 2008.

MCITP SQL-Server 2008.

DB2 Fundamentals.