Simplification partielle de l'installation d'Oracle Database

A partir de la version Oracle 10g, Oracle fournit un package pour simplifier l’installation d’un serveur de base de données.
On pourrait croire qu’après l’installation de ce package le serveur soit prêt pour l’installation des binaires… mais Oracle aime la complexité et préfère ne pas être directif sur l’installation de ces produits. Cela conduit souvent à une non-standardisation des environnements.

Oracle a automatisé la configuration initiale des serveurs sous Linux à l’aide d’un package « oracle-validated » en 10g, « oracle-rdbms-<release>_server-preinstall » à partir de la 11g.
Ces packages permettent d’installer les packages nécessaires à l’installation de la Grid Infrastructure et de la Database et de la configuration système (Kernel parameters, OS User limits, …) ainsi que la création des groupes et du user oracle.
Une bonne pratique d’installation est de séparer les rôles entre la Grid Infrastructure et la Database et à partir de la version Oracle 11g, l’utilisation d’ASM devient la norme – mais Oracle préfère effectuer la moitié du travail pour ne pas trop simplifier l’installation.

[root@test ~]# yum install oracle-rdbms-server-11gR2-preinstall.x86_64
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-7.el6 will be installed
--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: gcc for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: glibc-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Running transaction check
---> Package compat-libcap1.x86_64 0:1.10-1 will be installed
---> Package compat-libstdc++-33.x86_64 0:3.2.3-69.el6 will be installed
---> Package gcc.x86_64 0:4.4.7-3.el6 will be installed
--> Processing Dependency: cpp = 4.4.7-3.el6 for package: gcc-4.4.7-3.el6.x86_64
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-3.el6.x86_64
---> Package gcc-c++.x86_64 0:4.4.7-3.el6 will be installed
--> Processing Dependency: libmpfr.so.1()(64bit) for package: gcc-c++-4.4.7-3.el6.x86_64
---> Package glibc-devel.x86_64 0:2.12-1.107.el6 will be installed
--> Processing Dependency: glibc-headers = 2.12-1.107.el6 for package: glibc-devel-2.12-1.107.el6.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.107.el6.x86_64
---> Package ksh.x86_64 0:20100621-19.el6 will be installed
---> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed
---> Package libstdc++-devel.x86_64 0:4.4.7-3.el6 will be installed
--> Running transaction check
---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed
--> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
--> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
---> Package cpp.x86_64 0:4.4.7-3.el6 will be installed
---> Package glibc-headers.x86_64 0:2.12-1.107.el6 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.107.el6.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.107.el6.x86_64
---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed
--> Running transaction check
---> Package kernel-headers.x86_64 0:2.6.32-358.el6 will be installed
---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================
Package                               Arch              Version            Repository      Size
=================================================================================================
Installing:
oracle-rdbms-server-11gR2-preinstall  x86_64            1.0-7.el6          ol6_u4_base     15 k
Installing for dependencies:
cloog-ppl                             x86_64            0.15.7-1.2.el6     ol6_u4_base     93 k
compat-libcap1                        x86_64            1.10-1             ol6_u4_base     17 k
compat-libstdc++-33                   x86_64            3.2.3-69.el6       ol6_u4_base    183 k
cpp                                   x86_64            4.4.7-3.el6        ol6_u4_base    3.7 M
gcc                                   x86_64            4.4.7-3.el6        ol6_u4_base     10 M
gcc-c++                               x86_64            4.4.7-3.el6        ol6_u4_base    4.7 M
glibc-devel                           x86_64            2.12-1.107.el6     ol6_u4_base    973 k
glibc-headers                         x86_64            2.12-1.107.el6     ol6_u4_base    604 k
kernel-headers                        x86_64            2.6.32-358.el6     ol6_u4_base    2.3 M
ksh                                   x86_64            20100621-19.el6    ol6_u4_base    686 k
libaio-devel                          x86_64            0.3.107-10.el6     ol6_u4_base     13 k
libstdc++-devel                       x86_64            4.4.7-3.el6        ol6_u4_base    1.6 M
mpfr                                  x86_64            2.4.1-6.el6        ol6_u4_base    156 k
ppl                                   x86_64            0.10.2-11.el6      ol6_u4_base    1.3 M
Transaction Summary
=================================================================================================
Install      15 Package(s)
Total download size: 26 M
Installed size: 61 M
Is this ok [y/N]: y
Downloading Packages:
(1/15): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm                           |  93 kB     00:00
(2/15): compat-libcap1-1.10-1.x86_64.rpm                              |  17 kB     00:00
(3/15): compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm                   | 183 kB     00:00
(4/15): cpp-4.4.7-3.el6.x86_64.rpm                                    | 3.7 MB     00:02
(5/15): gcc-4.4.7-3.el6.x86_64.rpm                                    |  10 MB     00:07
(6/15): gcc-c++-4.4.7-3.el6.x86_64.rpm                                | 4.7 MB     00:03
(7/15): glibc-devel-2.12-1.107.el6.x86_64.rpm                         | 973 kB     00:00
(8/15): glibc-headers-2.12-1.107.el6.x86_64.rpm                       | 604 kB     00:00
(9/15): kernel-headers-2.6.32-358.el6.x86_64.rpm                      | 2.3 MB     00:01
(10/15): ksh-20100621-19.el6.x86_64.rpm                               | 686 kB     00:00
(11/15): libaio-devel-0.3.107-10.el6.x86_64.rpm                       |  13 kB     00:00
(12/15): libstdc++-devel-4.4.7-3.el6.x86_64.rpm                       | 1.6 MB     00:01
(13/15): mpfr-2.4.1-6.el6.x86_64.rpm                                  | 156 kB     00:00
(14/15): oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64.rpm    |  15 kB     00:00
(15/15): ppl-0.10.2-11.el6.x86_64.rpm                                 | 1.3 MB     00:00
---------------------------------------------------------------------------------------------
Total                                                        1.1 MB/s |  26 MB     00:24
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libstdc++-devel-4.4.7-3.el6.x86_64                       1/15
Installing : mpfr-2.4.1-6.el6.x86_64                                  2/15
Installing : cpp-4.4.7-3.el6.x86_64                                   3/15
Installing : ppl-0.10.2-11.el6.x86_64                                 4/15
Installing : cloog-ppl-0.15.7-1.2.el6.x86_64                          5/15
Installing : ksh-20100621-19.el6.x86_64                               6/15
Installing : compat-libstdc++-33-3.2.3-69.el6.x86_64                  7/15
Installing : libaio-devel-0.3.107-10.el6.x86_64                       8/15
Installing : kernel-headers-2.6.32-358.el6.x86_64                     9/15
Installing : glibc-headers-2.12-1.107.el6.x86_64                     10/15
Installing : glibc-devel-2.12-1.107.el6.x86_64                       11/15
Installing : gcc-4.4.7-3.el6.x86_64                                  12/15
Installing : gcc-c++-4.4.7-3.el6.x86_64                              13/15
Installing : compat-libcap1-1.10-1.x86_64                            14/15
Installing : oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64   15/15
Verifying  : compat-libcap1-1.10-1.x86_64                             1/15
Verifying  : kernel-headers-2.6.32-358.el6.x86_64                     2/15
Verifying  : gcc-c++-4.4.7-3.el6.x86_64                               3/15
Verifying  : gcc-4.4.7-3.el6.x86_64                                   4/15
Verifying  : libaio-devel-0.3.107-10.el6.x86_64                       5/15
Verifying  : mpfr-2.4.1-6.el6.x86_64                                  6/15
Verifying  : oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64    7/15
Verifying  : glibc-devel-2.12-1.107.el6.x86_64                        8/15
Verifying  : compat-libstdc++-33-3.2.3-69.el6.x86_64                  9/15
Verifying  : cpp-4.4.7-3.el6.x86_64                                  10/15
Verifying  : libstdc++-devel-4.4.7-3.el6.x86_64                      11/15
Verifying  : ksh-20100621-19.el6.x86_64                              12/15
Verifying  : ppl-0.10.2-11.el6.x86_64                                13/15
Verifying  : cloog-ppl-0.15.7-1.2.el6.x86_64                         14/15
Verifying  : glibc-headers-2.12-1.107.el6.x86_64                     15/15
Installed:
oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-7.el6
Dependency Installed:
cloog-ppl.x86_64 0:0.15.7-1.2.el6     compat-libcap1.x86_64 0:1.10-1
compat-libstdc++-33.x86_64 0:3.2.3-69.el6
cpp.x86_64 0:4.4.7-3.el6              gcc.x86_64 0:4.4.7-3.el6
gcc-c++.x86_64 0:4.4.7-3.el6
glibc-devel.x86_64 0:2.12-1.107.el6   glibc-headers.x86_64 0:2.12-1.107.el6
kernel-headers.x86_64 0:2.6.32-358.el6
ksh.x86_64 0:20100621-19.el6          libaio-devel.x86_64 0:0.3.107-10.el6
libstdc++-devel.x86_64 0:4.4.7-3.el6
mpfr.x86_64 0:2.4.1-6.el6             ppl.x86_64 0:0.10.2-11.el6
Complete!

Les packages dépendants sont bien installés, les paramètres Kernel également :

[root@test ~]# tail -40 /etc/sysctl.conf
# Controls the maximum shared segment size, in bytes
# Controls the maximum number of shared memory segments, in pages
# 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 = 1073741824
# 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 = 4398046511104
# 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
[root@test ~]# cat /etc/passwd | egrep "oracle|grid"
oracle:x:54321:54321::/home/oracle:/bin/bash
[root@test ~]# cat /etc/group | egrep "oinstall|dba|oper"
oinstall:x:54321:
dba:x:54322:oracle
[root@test ~]# cat /etc/security/limits.conf
...
# End of file
# 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

Mais on peut constater que le groupe oper a été oublié et que la séparation des rôles n’est pas gérée – le user grid les groupes associés à ASM n’existent pas.
Pour terminer la configuration initiale, un petit effort est nécessaire :

GID Groupe Description Priviliège
54321 oinstall Oracle Inventory Group
54322 dba OSDBA group SYSDBA privilege
54323 oper OSOPER group for Oracle Database SYSOPER privilege
54324 backupdba OSBACKUPDBA group for Oracle Database (12c) SYSBACKUP privilege
54325 dgdba OSDGDBA group for Oracle Data Guard (12c) SYSDG privilege
54326 kmdba OSKMDBA group for encyption key management (12c) SYSKM privilege
54327 asmdba OSDBA group for Oracle ASM SYSDBA for ASM privilege
54328 asmoper OSOPER group for Oracle ASM SYSOPER for ASM privilege
54329 asmadmin OSASM group for Oracle ASM Administration SYSASM privilege
[root@test ~]# groupadd -g 54323 oper
[root@test ~]# groupadd -g 54324 backupdba
[root@test ~]# groupadd -g 54325 dgdba
[root@test ~]# groupadd -g 54326 kmdba
[root@test ~]# groupadd -g 54327 asmdba
[root@test ~]# groupadd -g 54328 asmoper
[root@test ~]# groupadd -g 54329 asmadmin
[root@test ~]# useradd -u 54322 -g oinstall -G dba,asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "Grid Infrastructure Owner" grid
[root@test ~]# usermod -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,asmadmin -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
[root@test ~]# egrep '^oracle|^# oracle' /etc/security/limits.conf | sed 's/^oracle/grid  /g' >> /etc/security/limits.conf

Vous être prêt à lancer le runInstaller.

[root@test ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54327(asmdba),54329(asmadmin)
[root@test ~]# id grid
uid=54322(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54327(asmdba),54328(asmoper),54329(asmadmin)
[root@test ~]# cat /etc/security/limits.conf
...
# End of file
# 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
# oracle-rdbms-server-11gR2-preinstall setting for nofile soft limit is 1024
grid     soft   nofile    1024
# oracle-rdbms-server-11gR2-preinstall setting for nofile hard limit is 65536
grid     hard   nofile    65536
# oracle-rdbms-server-11gR2-preinstall setting for nproc soft limit is 2047
grid     soft   nproc    2047
# oracle-rdbms-server-11gR2-preinstall setting for nproc hard limit is 16384
grid     hard   nproc    16384
# oracle-rdbms-server-11gR2-preinstall setting for stack soft limit is 10240KB
grid     soft   stack    10240
# oracle-rdbms-server-11gR2-preinstall setting for stack hard limit is 32768KB
grid     hard   stack    32768