全部博文(1015)
分类: Oracle
2013-01-26 23:18:14
作者:Ginny Henningsen
2011 年 9 月
|
由于数据库需要某些软件包、软件包版本以及内核参数微调,在系统上安装 Oracle Database 10g 或 11g 之前,需要预先配置操作环境。(一定要阅读相应的 Oracle Database 安装指南以便熟悉硬件、软件和操作系统要求。)在 Oracle Linux 上,我发现有一种非常轻松的办法可以让系统满足这些安装先决条件:首先安装一个名为 oracle-validated 的 RPM 软件包。此 RPM 执行一些预配置步骤,包括:
请注意,oracle-validated 只是根据数据库安装的需要来分析现有的 /etc/sysctl.conf 和 /etc/security/limits.conf 文件并更新值。所有与数据库安装无关的预自定义设置保持不变。
oracle-validated RPM 软件包可通过 (ULN,它需要支持合同)、Oracle Linux 发行介质或 获取。因此,无论系统是否在 ULN 注册访问 Oracle 补丁和支持,您均可使用 oracle-validated 来简化 Oracle Linux 上的数据库安装。不过要记住,Oracle 公共 yum 信息库不会更新安全更新和错误修补,因此保持最新和安全的系统的最佳方式是使用 ULN 订阅。
本文其余部分将逐步介绍我通过 Oracle 公共 yum 信息库在 Oracle Linux 上安装 oracle-validated 的过程。我首先从一个运行适用于 x86_64 的 Oracle Linux 第 5 版 Update 7 的系统开始,这个 64 位版本的 Oracle Linux 是我从 (需要注册或登录)下载的。首先,设置一个 yum 配置文件,让其指向正确的信息库,然后从该信息库安装 oracle-validated RPM。
以下是针对 Oracle Database 安装使用 oracle-validated 对系统进行预配置的步骤:
# cd /etc/yum.repos.d # wget
下面是 public-yum-el5.repo 的部分内容,以粗体显示更改过的行。
. . . [ol5_u7_base] name=Oracle Linux $releasever - U7 - $basearch - base baseurl= gpgkey= gpgcheck=1 enabled=1 [el5_addons] name=Enterprise Linux $releasever - $basearch - addons baseurl= gpgkey= gpgcheck=1 enabled=0 . . .
因为目标系统运行的是适用于 x86_64 的 Oracle Linux 第 5 版 Update 7,所以要启用 [ol5_u7_base] 这个信息库。对于包括 Oracle Unbreakable Enterprise Kernel 的某些发行版本(特别是 Oracle Linux 5.5 和 5.6),还需要信息库 [el5_addons] 来解析 kernel-uek-headers 的依赖项。
清单 1 中的输出显示了安装过程如何检查依赖项,然后下载和安装所需软件包。
清单 1:安装 oracle-validated RPM# yum install oracle-validated Loaded plugins: rhnplugin, security This system is not registered with ULN. ULN support will be disabled. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package oracle-validated.x86_64 0:1.1.0-14.el5 set to be updated --> Processing Dependency: libXp.so.6 for package: oracle-validated --> Processing Dependency: gdb 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: sysstat for package: oracle-validated --> Processing Dependency: kernel-headers 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: /usr/lib/libaio.so for package: oracle-validated --> Processing Dependency: /usr/lib/libc.so for package: oracle-validated --> Processing Dependency: compat-gcc-34-c++ for package: oracle-validated --> Processing Dependency: compat-gcc-34 for package: oracle-validated --> Processing Dependency: /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libstdc++.a for package: oracle-validated --> Processing Dependency: libdb-4.2.so()(64bit) for package: oracle-validated --> Processing Dependency: libodbc.so.1()(64bit) for package: oracle-validated --> Running transaction check ---> Package compat-db.x86_64 0:4.2.52-5.1 set to be updated ---> Package compat-gcc-34.x86_64 0:3.4.6-4.1 set to be updated ---> Package compat-gcc-34-c++.x86_64 0:3.4.6-4.1 set to be updated ---> 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-51.el5 set to be updated ---> Package gcc-c++.x86_64 0:4.1.2-51.el5 set to be updated ---> Package gdb.x86_64 0:7.0.1-37.el5 set to be updated ---> Package glibc-devel.i386 0:2.5-65 set to be updated ---> Package glibc-devel.x86_64 0:2.5-65 set to be updated ---> Package glibc-headers.x86_64 0:2.5-65 set to be updated ---> Package kernel-headers.x86_64 0:2.6.18-274.el5 set to be updated ---> 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-51.el5 set to be updated ---> Package sysstat.x86_64 0:7.0.2-11.el5 set to be updated ---> Package unixODBC.i386 0:2.2.11-7.1 set to be updated ---> Package unixODBC.x86_64 0:2.2.11-7.1 set to be updated ---> Package unixODBC-devel.i386 0:2.2.11-7.1 set to be updated ---> Package unixODBC-devel.x86_64 0:2.2.11-7.1 set to be updated --> Running transaction check ---> Package elfutils-libelf-devel-static.x86_64 0:0.137-3.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: oracle-validated x86_64 1.1.0-14.el5 ol5_u7_base 24 k Installing for dependencies: compat-db x86_64 4.2.52-5.1 ol5_u7_base 1.6 M compat-gcc-34 x86_64 3.4.6-4.1 ol5_u7_base 4.3 M compat-gcc-34-c++ x86_64 3.4.6-4.1 ol5_u7_base 13 M elfutils-libelf-devel x86_64 0.137-3.el5 ol5_u7_base 24 k elfutils-libelf-devel-static x86_64 0.137-3.el5 ol5_u7_base 64 k gcc x86_64 4.1.2-51.el5 ol5_u7_base 5.3 M gcc-c++ x86_64 4.1.2-51.el5 ol5_u7_base 3.8 M gdb x86_64 7.0.1-37.el5 ol5_u7_base 2.4 M glibc-devel i386 2.5-65 ol5_u7_base 2.0 M glibc-devel x86_64 2.5-65 ol5_u7_base 2.4 M glibc-headers x86_64 2.5-65 ol5_u7_base 594 k kernel-headers x86_64 2.6.18-274.el5 ol5_u7_base 1.3 M libXp i386 1.0.0-8.1.el5 ol5_u7_base 22 k libaio-devel i386 0.3.106-5 ol5_u7_base 12 k libaio-devel x86_64 0.3.106-5 ol5_u7_base 11 k libstdc++-devel x86_64 4.1.2-51.el5 ol5_u7_base 2.8 M sysstat x86_64 7.0.2-11.el5 ol5_u7_base 187 k unixODBC i386 2.2.11-7.1 ol5_u7_base 830 k unixODBC x86_64 2.2.11-7.1 ol5_u7_base 835 k unixODBC-devel i386 2.2.11-7.1 ol5_u7_base 743 k unixODBC-devel x86_64 2.2.11-7.1 ol5_u7_base 799 k Transaction Summary ================================================================================ Install 22 Package(s) Upgrade 0 Package(s) Total size: 42 M Total download size: 594 k Is this ok [y/N]: y Downloading Packages: glibc-headers-2.5-65.x86_64.rpm | 594 kB 00:00 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 1e5e0159 ol5_u7_base/gpgkey | 1.4 kB 00:00 Importing GPG key 0x1E5E0159 "Oracle OSS group (Open Source Software group)" from Is this ok [y/N]: y Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : unixODBC 1/22 Installing : libstdc++-devel 2/22 Installing : kernel-headers 3/22 Installing : gdb 4/22 Installing : compat-db 5/22 Installing : sysstat 6/22 Installing : glibc-headers 7/22 Installing : glibc-devel 8/22 Installing : compat-gcc-34 9/22 Installing : glibc-devel 10/22 Installing : unixODBC-devel 11/22 Installing : libaio-devel 12/22 Installing : libaio-devel 13/22 Installing : unixODBC 14/22 Installing : libXp 15/22 Installing : gcc 16/22 Installing : gcc-c++ 17/22 Installing : compat-gcc-34-c++ 18/22 Installing : unixODBC-devel 19/22 Installing : elfutils-libelf-devel 20/22 Installing : oracle-validated 21/22 Installing : elfutils-libelf-devel-static 22/22 Installed: oracle-validated.x86_64 0:1.1.0-14.el5 Dependency Installed: compat-db.x86_64 0:4.2.52-5.1 compat-gcc-34.x86_64 0:3.4.6-4.1 compat-gcc-34-c++.x86_64 0:3.4.6-4.1 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-51.el5 gcc-c++.x86_64 0:4.1.2-51.el5 gdb.x86_64 0:7.0.1-37.el5 glibc-devel.i386 0:2.5-65 glibc-devel.x86_64 0:2.5-65 glibc-headers.x86_64 0:2.5-65 kernel-headers.x86_64 0:2.6.18-274.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-51.el5 sysstat.x86_64 0:7.0.2-11.el5 unixODBC.i386 0:2.2.11-7.1 unixODBC.x86_64 0:2.2.11-7.1 unixODBC-devel.i386 0:2.2.11-7.1 unixODBC-devel.x86_64 0:2.2.11-7.1 Complete!
yum 安装过程在 /var/log/oracle-validated/results/orakernel.log 文件中记录有关内核更改的消息,并在/var/log/oracle-validated/backup 目录中备份当前系统设置。
该说明将指示您执行以下操作:
# mkdir /home/OraDB11g # cd /home/OraDB11g
该文件系统中所需的磁盘空间量随具体的安装类型而变化,但大概 zip 文件大小两倍的空间(即 5 GB)就足以容纳相应软件和数据文件。
# unzip linux.x64_11gR2_database_1of2.zip # unzip linux.x64_11gR2_database_2of2.zip
$ cd /home/OraDB11g/database $ ./runInstaller
Oracle Universal Installer 执行一些检查,验证是否已经安装必要的操作系统软件包和版本。此外,它还检查通过 oracle-validated 安装设置的内核参数。在内核设置检查期间,安装程序可能将一些设置标志为“failed”,您应对这些失败进行分析。在有些情况下,您仍可以继续数据库安装。如果您检查 /etc/sysctl.conf 中的内核设置,将发现 oracle-validated 为 Oracle Database 10g 推荐的设置不同于 Oracle Database 11g。如果需要,您可以(以 root 身份)编辑 /etc/sysctl.conf 文件来手动指定设置,例如:
# vi /etc/sysctl.conf # /sbin/sysctl -p
Oracle Universal Installer 还会执行其他检查,如验证 glibc 版本、磁盘空间是否足够、环境变量和路径设置,以及物理内存和交换空间是否足够。一般来说,安装 oracle-validated 可解决先决条件,因此您可以直接继续安装数据库。
安装 oracle-validated RPM 可以节省在 Oracle Linux 上安装 Oracle Database 10g 或 11g 的时间。RPM 能让系统满足 Oracle Database 安装的大多数先决条件,从而极大地简化了安装过程。
以下是本文前面所引用的资源:
以下是 Oracle Database 文档库中的一些其他资源:。适用于 Linux 的 Oracle Database 安装指南 11g 第 2 版 (11.2) () 中相关部分内容的当前有效 URL 如下:
另请参阅以下相关博客条目:
修订版 1.0,2011 年 9 月 13 日 |