在Oracle Linux 5中我们可以使用Oracle提供的oracle-validated包来简化oracle安装。
Oracle Linux 5默认安装是包含图形化界面的。
[root@db03 ~]# cd /etc/yum.repos.d [root@db03 yum.repos.d]# wget http://public-yum.oracle.com/public-yum-el5.repo --2012-12-14 08:19:33-- http://public-yum.oracle.com/public-yum-el5.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: 3974 (3.9K) [text/plain] Saving to: `public-yum-el5.repo' 100%[=============================================================================================================================>] 3,974 --.-K/s in 0s 2012-12-14 08:19:34 (31.4 MB/s) - `public-yum-el5.repo' saved [3974/3974] [root@db03 yum.repos.d]# yum install oracle-validated Loaded plugins: rhnplugin, security This system is not registered with ULN. ULN support will be disabled. el5_latest | 1.4 kB 00:00 el5_latest/primary | 12 MB 00:35 el5_latest 9835/9835 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package oracle-validated.x86_64 0:1.1.0-15.el5 set to be updated el5_latest/filelists | 19 MB 01:01 --> Processing Dependency: libXp.so.6 for package: oracle-validated --> Processing Dependency: /usr/lib/libodbccr.so for package: oracle-validated --> Processing Dependency: /usr/lib64/libc.so for package: oracle-validated --> Processing Dependency: gcc-c++ for package: oracle-validated --> Processing Dependency: gcc for package: oracle-validated --> Processing Dependency: /usr/lib64/libodbccr.so for package: oracle-validated --> Processing Dependency: unixODBC-devel for package: oracle-validated --> Processing Dependency: libaio-devel for package: oracle-validated --> Processing Dependency: elfutils-libelf-devel for package: oracle-validated --> Processing Dependency: /usr/lib64/libaio.so for package: oracle-validated --> Processing Dependency: glibc-headers for package: oracle-validated --> Processing Dependency: /usr/lib/libodbc.so.1 for package: oracle-validated --> Processing Dependency: sysstat for package: oracle-validated --> Processing Dependency: /usr/lib/libaio.so for package: oracle-validated --> Processing Dependency: /usr/lib/libc.so for package: oracle-validated --> Processing Dependency: /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libstdc++.a for package: oracle-validated --> Processing Dependency: libodbc.so.1()(64bit) for package: oracle-validated --> Running transaction check ---> Package elfutils-libelf-devel.x86_64 0:0.137-3.el5 set to be updated --> Processing Dependency: elfutils-libelf-devel-static-x86_64 = 0.137-3.el5 for package: elfutils-libelf-devel ---> Package gcc.x86_64 0:4.1.2-52.el5_8.1 set to be updated --> Processing Dependency: cpp = 4.1.2-52.el5_8.1 for package: gcc --> Processing Dependency: libgcc >= 4.1.2-52.el5_8.1 for package: gcc ---> Package gcc-c++.x86_64 0:4.1.2-52.el5_8.1 set to be updated --> Processing Dependency: libstdc++ = 4.1.2-52.el5_8.1 for package: gcc-c++ ---> Package glibc-devel.i386 0:2.5-81.el5_8.7 set to be updated --> Processing Dependency: glibc = 2.5-81.el5_8.7 for package: glibc-devel ---> Package glibc-devel.x86_64 0:2.5-81.el5_8.7 set to be updated ---> Package glibc-headers.x86_64 0:2.5-81.el5_8.7 set to be updated --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers --> Processing Dependency: kernel-headers for package: glibc-headers ---> Package libXp.i386 0:1.0.0-8.1.el5 set to be updated ---> Package libaio-devel.i386 0:0.3.106-5 set to be updated ---> Package libaio-devel.x86_64 0:0.3.106-5 set to be updated ---> Package libstdc++-devel.x86_64 0:4.1.2-52.el5_8.1 set to be updated ---> Package sysstat.x86_64 0:7.0.2-11.el5 set to be updated ---> Package unixODBC-devel.i386 0:2.2.11-10.el5 set to be updated --> Processing Dependency: unixODBC = 2.2.11-10.el5 for package: unixODBC-devel ---> Package unixODBC-devel.x86_64 0:2.2.11-10.el5 set to be updated ---> Package unixODBC-libs.i386 0:2.2.11-10.el5 set to be updated ---> Package unixODBC-libs.x86_64 0:2.2.11-10.el5 set to be updated --> Running transaction check ---> Package cpp.x86_64 0:4.1.2-52.el5_8.1 set to be updated ---> Package elfutils-libelf-devel-static.x86_64 0:0.137-3.el5 set to be updated --> Processing Dependency: glibc = 2.5-65 for package: nscd ---> Package glibc.i686 0:2.5-81.el5_8.7 set to be updated --> Processing Dependency: glibc-common = 2.5-81.el5_8.7 for package: glibc ---> Package glibc.x86_64 0:2.5-81.el5_8.7 set to be updated ---> Package kernel-headers.x86_64 0:2.6.18-308.24.1.0.1.el5 set to be updated ---> Package libgcc.i386 0:4.1.2-52.el5_8.1 set to be updated ---> Package libgcc.x86_64 0:4.1.2-52.el5_8.1 set to be updated ---> Package libstdc++.i386 0:4.1.2-52.el5_8.1 set to be updated ---> Package libstdc++.x86_64 0:4.1.2-52.el5_8.1 set to be updated ---> Package unixODBC.x86_64 0:2.2.11-10.el5 set to be updated --> Running transaction check ---> Package glibc-common.x86_64 0:2.5-81.el5_8.7 set to be updated ---> Package nscd.x86_64 0:2.5-81.el5_8.7 set to be updated --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================================================= Package Arch Version Repository Size ======================================================================================================================================================================= Installing: oracle-validated x86_64 1.1.0-15.el5 el5_latest 24 k Installing for dependencies: elfutils-libelf-devel x86_64 0.137-3.el5 el5_latest 24 k elfutils-libelf-devel-static x86_64 0.137-3.el5 el5_latest 64 k gcc x86_64 4.1.2-52.el5_8.1 el5_latest 5.3 M gcc-c++ x86_64 4.1.2-52.el5_8.1 el5_latest 3.8 M glibc-devel i386 2.5-81.el5_8.7 el5_latest 2.1 M glibc-devel x86_64 2.5-81.el5_8.7 el5_latest 2.4 M glibc-headers x86_64 2.5-81.el5_8.7 el5_latest 597 k kernel-headers x86_64 2.6.18-308.24.1.0.1.el5 el5_latest 1.4 M libXp i386 1.0.0-8.1.el5 el5_latest 22 k libaio-devel i386 0.3.106-5 el5_latest 12 k libaio-devel x86_64 0.3.106-5 el5_latest 11 k libstdc++-devel x86_64 4.1.2-52.el5_8.1 el5_latest 2.8 M sysstat x86_64 7.0.2-11.el5 el5_latest 187 k unixODBC x86_64 2.2.11-10.el5 el5_latest 291 k unixODBC-devel i386 2.2.11-10.el5 el5_latest 738 k unixODBC-devel x86_64 2.2.11-10.el5 el5_latest 793 k unixODBC-libs i386 2.2.11-10.el5 el5_latest 551 k unixODBC-libs x86_64 2.2.11-10.el5 el5_latest 554 k Updating for dependencies: cpp x86_64 4.1.2-52.el5_8.1 el5_latest 2.9 M glibc i686 2.5-81.el5_8.7 el5_latest 5.4 M glibc x86_64 2.5-81.el5_8.7 el5_latest 4.8 M glibc-common x86_64 2.5-81.el5_8.7 el5_latest 16 M libgcc i386 4.1.2-52.el5_8.1 el5_latest 97 k libgcc x86_64 4.1.2-52.el5_8.1 el5_latest 99 k libstdc++ i386 4.1.2-52.el5_8.1 el5_latest 363 k libstdc++ x86_64 4.1.2-52.el5_8.1 el5_latest 354 k nscd x86_64 2.5-81.el5_8.7 el5_latest 172 k Transaction Summary ======================================================================================================================================================================= Install 19 Package(s) Upgrade 9 Package(s) Total download size: 52 M Is this ok [y/N]: y Downloading Packages: (1/28): libaio-devel-0.3.106-5.x86_64.rpm | 11 kB 00:00 (2/28): libaio-devel-0.3.106-5.i386.rpm | 12 kB 00:00 (3/28): libXp-1.0.0-8.1.el5.i386.rpm | 22 kB 00:00 (4/28): oracle-validated-1.1.0-15.el5.x86_64.rpm | 24 kB 00:00 (5/28): elfutils-libelf-devel-0.137-3.el5.x86_64.rpm | 24 kB 00:00 (6/28): elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm | 64 kB 00:00 (7/28): libgcc-4.1.2-52.el5_8.1.i386.rpm | 97 kB 00:00 (8/28): libgcc-4.1.2-52.el5_8.1.x86_64.rpm | 99 kB 00:00 (9/28): nscd-2.5-81.el5_8.7.x86_64.rpm | 172 kB 00:00 (10/28): sysstat-7.0.2-11.el5.x86_64.rpm | 187 kB 00:00 (11/28): unixODBC-2.2.11-10.el5.x86_64.rpm | 291 kB 00:01 (12/28): libstdc++-4.1.2-52.el5_8.1.x86_64.rpm | 354 kB 00:01 (13/28): libstdc++-4.1.2-52.el5_8.1.i386.rpm | 363 kB 00:01 (14/28): unixODBC-libs-2.2.11-10.el5.i386.rpm | 551 kB 00:01 (15/28): unixODBC-libs-2.2.11-10.el5.x86_64.rpm | 554 kB 00:01 (16/28): glibc-headers-2.5-81.el5_8.7.x86_64.rpm | 597 kB 00:01 (17/28): unixODBC-devel-2.2.11-10.el5.i386.rpm | 738 kB 00:02 (18/28): unixODBC-devel-2.2.11-10.el5.x86_64.rpm | 793 kB 00:02 (19/28): kernel-headers-2.6.18-308.24.1.0.1.el5.x86_64.rpm | 1.4 MB 00:04 (20/28): glibc-devel-2.5-81.el5_8.7.i386.rpm | 2.1 MB 00:06 (21/28): glibc-devel-2.5-81.el5_8.7.x86_64.rpm | 2.4 MB 00:07 (22/28): libstdc++-devel-4.1.2-52.el5_8.1.x86_64.rpm | 2.8 MB 00:08 (23/28): cpp-4.1.2-52.el5_8.1.x86_64.rpm | 2.9 MB 00:08 (24/28): gcc-c++-4.1.2-52.el5_8.1.x86_64.rpm | 3.8 MB 00:10 (25/28): glibc-2.5-81.el5_8.7.x86_64.rpm | 4.8 MB 00:14 (26/28): gcc-4.1.2-52.el5_8.1.x86_64.rpm | 5.3 MB 00:15 (27/28): glibc-2.5-81.el5_8.7.i686.rpm | 5.4 MB 00:16 (28/28): glibc-common-2.5-81.el5_8.7.x86_64.rpm | 16 MB 00:47 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 318 kB/s | 52 MB 02:47 warning: rpmts_HdrFromFdno: Header V4 DSA signature: NOKEY, key ID 1e5e0159 el5_latest/gpgkey | 1.4 kB 00:00 Importing GPG key 0x1E5E0159 "Oracle OSS group (Open Source Software group) <[email protected]>" from http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5 Is this ok [y/N]: y Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Updating : libgcc 1/37 Updating : glibc-common 2/37 Updating : glibc 3/37 Installing : unixODBC-libs 4/37 Updating : libstdc++ 5/37 Installing : unixODBC 6/37 Updating : cpp 7/37 Installing : sysstat 8/37 Installing : libstdc++-devel 9/37 Installing : unixODBC-devel 10/37 Installing : kernel-headers 11/37 Installing : glibc-headers 12/37 Installing : glibc-devel 13/37 Installing : libaio-devel 14/37 Installing : libaio-devel 15/37 Updating : glibc 16/37 Updating : libgcc 17/37 Updating : nscd 18/37 Updating : libstdc++ 19/37 Installing : unixODBC-libs 20/37 Installing : libXp 21/37 Installing : glibc-devel 22/37 Installing : unixODBC-devel 23/37 Installing : gcc 24/37 Installing : gcc-c++ 25/37 Installing : elfutils-libelf-devel 26/37 Installing : oracle-validated 27/37 Installing : elfutils-libelf-devel-static 28/37 Cleanup : cpp 29/37 Cleanup : nscd 30/37 Cleanup : libgcc 31/37 Cleanup : glibc 32/37 Cleanup : libgcc 33/37 Cleanup : glibc-common 34/37 Cleanup : glibc 35/37 Cleanup : libstdc++ 36/37 Cleanup : libstdc++ 37/37 Installed: oracle-validated.x86_64 0:1.1.0-15.el5 Dependency Installed: elfutils-libelf-devel.x86_64 0:0.137-3.el5 elfutils-libelf-devel-static.x86_64 0:0.137-3.el5 gcc.x86_64 0:4.1.2-52.el5_8.1 gcc-c++.x86_64 0:4.1.2-52.el5_8.1 glibc-devel.i386 0:2.5-81.el5_8.7 glibc-devel.x86_64 0:2.5-81.el5_8.7 glibc-headers.x86_64 0:2.5-81.el5_8.7 kernel-headers.x86_64 0:2.6.18-308.24.1.0.1.el5 libXp.i386 0:1.0.0-8.1.el5 libaio-devel.i386 0:0.3.106-5 libaio-devel.x86_64 0:0.3.106-5 libstdc++-devel.x86_64 0:4.1.2-52.el5_8.1 sysstat.x86_64 0:7.0.2-11.el5 unixODBC.x86_64 0:2.2.11-10.el5 unixODBC-devel.i386 0:2.2.11-10.el5 unixODBC-devel.x86_64 0:2.2.11-10.el5 unixODBC-libs.i386 0:2.2.11-10.el5 unixODBC-libs.x86_64 0:2.2.11-10.el5 Dependency Updated: cpp.x86_64 0:4.1.2-52.el5_8.1 glibc.i686 0:2.5-81.el5_8.7 glibc.x86_64 0:2.5-81.el5_8.7 glibc-common.x86_64 0:2.5-81.el5_8.7 libgcc.i386 0:4.1.2-52.el5_8.1 libgcc.x86_64 0:4.1.2-52.el5_8.1 libstdc++.i386 0:4.1.2-52.el5_8.1 libstdc++.x86_64 0:4.1.2-52.el5_8.1 nscd.x86_64 0:2.5-81.el5_8.7 Complete! [root@db03 yum.repos.d]#
Before installing Oracle Database 10g or 11g on a system, you need to preconfigure the operating environment since the database requires certain software packages, package versions, and tweaks to kernel parameters. (Be sure to review the appropriate Oracle Database installation guide to familiarize yourself with hardware, software, and operating system requirements.) On Oracle Linux, I discovered that there is a remarkably easy way to address these installation prerequisites: First install an RPM package called oracle-validated. This RPM performs a number of preconfiguration steps, including:
Causing the download and installation of various software packages and specific versions needed for database installation, with package dependencies resolved via yum or up2date capabilities
Creating the user oracle and the groups oinstall and dba, which are used during database installation
Modifying kernel parameters in /etc/sysctl.conf to change settings for shared memory, semaphores, the maximum number of file descriptors, and so on
Setting hard and soft shell resource limits in /etc/security/limits.conf, such as the locked-in memory address space, the number of open files, the number of processes, and core file size
Setting numa=off in the kernel for x86_64 machines
[root@db03 yum.repos.d]# cat /etc/sysctl.conf # Kernel sysctl configuration file for Oracle Enterprise Linux # # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and # sysctl.conf(5) for more details. # Controls IP packet forwarding net.ipv4.ip_forward = 0 # Controls source route verification # See /usr/share/doc/kernel-doc-*/Documentation/networking/ip-sysctl.txt net.ipv4.conf.default.rp_filter = 2 # Do not accept source routing net.ipv4.conf.default.accept_source_route = 0 # Controls the System Request debugging functionality of the kernel # Controls whether core dumps will append the PID to the core filename # Useful for debugging multi-threaded applications kernel.core_uses_pid = 1 # Controls the use of TCP syncookies net.ipv4.tcp_syncookies = 1 # Controls the maximum size of a message, in bytes # Controls the default maxmimum size of a mesage queue # Controls the maximum shared segment size, in bytes # Controls the maximum number of shared memory segments, in pages # For 11g, Oracle-Validated setting for fs.file-max is 6815744 # For 10g, uncomment 'fs.file-max = 327679', and comment 'fs.file-max = 6553600' entry and re-run sysctl -p # fs.file-max = 327679 fs.file-max = 6815744 # Oracle-Validated setting for kernel.msgmni is 2878 kernel.msgmni = 2878 # Oracle-Validated setting for kernel.msgmax is 8192 kernel.msgmax = 8192 # Oracle-Validated setting for kernel.msgmnb is 65536 kernel.msgmnb = 65536 # Oracle-Validated setting for kernel.sem is '250 32000 100 142' kernel.sem = 250 32000 100 142 # Oracle-Validated setting for kernel.shmmni is 4096 kernel.shmmni = 4096 # Oracle-Validated setting for kernel.shmall is 1073741824 kernel.shmall = 1073741824 # Oracle-Validated setting for kernel.shmmax is 4398046511104 on x86_64 and 4294967295 on i386 architecture. Refer Note id 567506.1 kernel.shmmax = 4398046511104 # Oracle-Validated setting for kernel.sysrq is 1 kernel.sysrq = 1 # Oracle-Validated setting for net.core.rmem_default is 262144 net.core.rmem_default = 262144 # For 11g, Oracle-Validated setting for net.core.rmem_max is 4194304 # For 10g, uncomment 'net.core.rmem_max = 2097152', comment 'net.core.rmem_max = 4194304' entry and re-run sysctl -p # net.core.rmem_max = 2097152 net.core.rmem_max = 4194304 # Oracle-Validated setting for net.core.wmem_default is 262144 net.core.wmem_default = 262144 # For 11g, Oracle-Validated setting for net.core.wmem_max is 1048576 # For 10g, uncomment 'net.core.wmem_max = 262144', comment 'net.core.wmem_max = 1048576' entry for this parameter and re-run sysctl -p # net.core.wmem_max = 262144 net.core.wmem_max = 1048576 # Oracle-Validated setting for fs.aio-max-nr is 3145728 fs.aio-max-nr = 3145728 # For 11g, Oracle-Validated setting for net.ipv4.ip_local_port_range is 9000 65500 # For 10g, uncomment 'net.ipv4.ip_local_port_range = 1024 65000', comment 'net.ipv4.ip_local_port_range = 9000 65500' entry and re-run sysctl -p # net.ipv4.ip_local_port_range = 1024 65000 net.ipv4.ip_local_port_range = 9000 65500 # Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
[root@db03 yum.repos.d]# tail -24 /etc/security/limits.conf # Oracle-Validated setting for nofile soft limit is 131072 oracle soft nofile 131072 # Oracle-Validated setting for nofile hard limit is 131072 oracle hard nofile 131072 # Oracle-Validated setting for nproc soft limit is 131072 oracle soft nproc 131072 # Oracle-Validated setting for nproc hard limit is 131072 oracle hard nproc 131072 # Oracle-Validated setting for core soft limit is unlimited oracle soft core unlimited # Oracle-Validated setting for core hard limit is unlimited oracle hard core unlimited # Oracle-Validated setting for memlock soft limit is 50000000 oracle soft memlock 50000000 # Oracle-Validated setting for memlock hard limit is 50000000 oracle hard memlock 50000000 [root@db03 yum.repos.d]#