zoukankan      html  css  js  c++  java
  • Rhel Linux 5.1 (32 位)上安装 Oracle ASM数据库 11g 第 1 版

    Rhel Linux 5.1 (32 位)上安装 Oracle ASM数据库 11g 第 1 版


    初次安装,花了一天时间。虚拟机也慢,文档整理格式不是很好,将就下。
    目录
    第 1 部分:安装 VMware server ,建立虚拟机
    第 2 部分:安装 Linux
    第 3 部分:针对 Oracle 配置 Linux
    创建目录
    创建 Oracle 组和用户帐户
    配置 Linux 内核参数
    为 oracle 用户设置 Shell 限制
    第 4 部分:安装 Oracle
    安装软件
    第 5 部分:配置存储
    文件系统
    自动存储管理
    结论
    附录

    Rhel 5 (DVD)
    Oracle Database 11g Release 1 (11.1.0.6.0) (1.7G)
    VMware server 1.0.5
    硬件要求
    内存建议1.5G以上,空闲磁盘10G。

    主机名                        操作系 统                                                                                                        处理器        内存
    db.hjh.com        Oracle Enterprise Linux 4(32 位)        1                        1024 MB

    虚拟磁盘布局概况:
    主机操作系统上的虚拟磁盘        客户操作系统上的虚拟磁盘        虚拟设备节点        大小 (MB)        描述
    d:vm
    aclocaldisk.vmdk        /dev/sda1                                                                                SCSI 0:0                        20        “/”挂载点
    /dev/sda2                交换空间
    /dev/sda3                /boot分区

    Oracle 二进制文件
    d:vm
    acasmdisk1.vmdk        /dev/sdb        SCSI 1:0        3072        ASM 磁盘组 1
    d:vm
    acasmdisk2.vmdk        /dev/sdc        SCSI 1:1        3072        ASM 磁盘组 1
    d:vm
    acasmdisk3.vmdk        /dev/sdd        SCSI 1:2        2048        ASM 磁盘组 2
    d:vm
    acasmdisk4.vmdk        /dev/sde        SCSI 1:3        2048        ASM 磁盘组 2
    本指南相关下载:
    Rhel Linux 5
    Oracle 数据库 11g 第 1 版
    ASMLib
    第 1 部分:安装 VMware server ,建立虚拟机
    安装 VMware server,没有什么要注意的,注册码Google一下。
    1.        创建一个新的虚拟机。
    2.        新建虚拟机向导:单击 Next。
    3.        选择适当的配置:
    a.        虚拟机配置:选择 Custom。
    4.        选择客户操作系统:
    a.        客户操作系统:选择 Linux。
    b.        版本:选择 Red Hat Enterprise Linux 5(或者4)。
    5.        命名虚拟机:
    a.        虚拟机名称:。
    b.        位置:。
    6.        处理器配置:
    a.        处理器:选择一个处理器。
    7.        虚拟机内存:
    a.        内存:选择 1024MB。
    8.        网络类型:
    a.        网络连接:选择 Use bridged networking。
    9.        选择 I/O 适配器类型:
    a.        I/O 适配器类型:选择 LSI Logic。
    10.        选择磁盘:
    a.        磁盘:选择 Create a new virtual disk。
    11.        选择磁盘类型:
    a.        虚拟磁盘类型:选择 SCSI (Recommended)。
    12.        指定磁盘容量:
    a.        磁盘容量:输入“10GB”。 (Linux2.5G+11g5.4G,如果拷贝安装+1.7G)
    b.        取消选择 Allocate all disk space now。为了节省空间,您现在不必分配所有磁盘空间。
    13.        指定磁盘文件:
    a.        磁盘文件。
    b.        单击 Finish。

                                            修改虚拟机配置,菜单VM-Settings(Ctrl-D)。
    14.        VMware Server 控制台:单击 Edit virtual machine settings。
    15.        虚拟机设置:单击 Add。
    16.        新增硬件向导:单击 Next。
    17.        硬件类型:
    a.        硬件类型:选择 Hard Disk。
    18.        选择磁盘:
    a.        磁盘:选择 Create a new virtual disk。
    19.        选择磁盘类型:
    a.        虚拟磁盘类型:选择 SCSI (Recommended)。
    20.        指定磁盘容量:
    a.        磁盘容量:输入“2GB”。
    b.        选择 Allocate all disk space now。如果您希望节省空间,则不必分配所有磁盘空间。出于性能方面的考虑,
    您需要为每个虚拟共享磁盘预先分配所有磁盘空间。特别是在 Oracle 数据库创建期间或者当数据库的 DML 活动较频繁时,
    如果共享磁盘的大小增长快速,虚拟机可能会间歇挂起一段较短的时间甚至崩溃(这种情况很少见)。
    21.        指定磁盘文件:
    a.        磁盘文件:输入“d:vm
    acasmdisk1.vmdk”。
    b.        单击 Advanced。
    22.        新增硬件向导:
    a.        虚拟设备节点:选择 SCSI 1:0。
    b.        模式:选择 Independent,针对所有共享磁盘选择 Persistent。
    c.        单击 Finish。

    第 2 部分:安装 Rhel Linux 5

    最低硬件要求:
    32 位 (x86)
    ● x86 兼容 CPU
    ● 1 GB RAM
    ● 10 GB 的可用磁盘空间(3.5 GB 用于 Oracle 软件 + 1.5 GB 用于数据库 + 3 GB 用于 RHEL5 + 2 GB 交换空间)
    注:Linux 和 Oracle 必须安装在同一体系结构上。


    1. 使用第一张 CD 或 DVD 启动服务器。
    您可能需要更改 BIOS 设置,以允许从 CD/DVD 启动。
    2. 启动屏幕出现,并在底部显示 boot:提示符。
    选择 Enter,从控制台上执行图形安装。
    安装程序扫描您的硬件
    3. Oracle Enterprise Linux splash 屏幕
    单击 Next
    4. 语言选择
    接受默认值。
    5. 配置键盘
    接受默认值。
    6. 安装或升级
    选择 Install 并单击 Next
    7. 设置磁盘分区
    挂载点: /boot 文件系统类型:ext3 300M
    文件系统类型:Swap 2048M
    挂载点:     / 文件系统类型:ext3, Fill to maximum allowable size
    8. 网络配置
    通常情况下,最好使用静态 IP 地址配置数据库服务器。为此,单击 Edit。
    出现一个弹出窗口。取消选中 Configure using DHCP 复选框,并输入服务器的 IP 地址和网络掩码。确保选中 Activate on boot,然后单击 OK。
    在 Hostname 框中,选择 manually 并输入主机名。
    在 Miscellaneous Settings 框中,输入其他网络设置。
    9. 选择时区
    选择适合您区域的时间设置。将系统时钟设置为 UTC 对服务器而言通常是一个很好的做法。为此,选择 System clock uses UTC。
    10. 设置 Root 口令
    输入 root 的口令,并再次输入以进行确认。
    11. 软件包安装
    除缺省选择外,建议选择:
    Development
    Development Tools
    Legacy Software Development                                       
    Servers
    Legacy Network Server(为以后配RAC准备),单击 Optional packages。
    1.        选择 rsh-server。
    2.        选择 telnet-server。
    Server Configuration Tools。
    FTP Server
    Windows File Server (访问Windows共享文件)
    Base System
    Legacy Software Support
    System Tools,单击 Optional packages。
    1.        选择 sysstat。
    注意:别忘了左边拉到底,下面选择Languages。另外可以安装你要使用的软件,比如FTP ,SMB等等。
    12. 安装程序包
    软件将被复制到硬盘并被安装。提示更换磁盘。
    13. 软件安装结束后
    取出所有 CD/DVD 启动介质。
    单击 Next。
    15. 许可协议
    阅读许可协议。如果同意其中的条款,选择 Yes, I agree to the License Agreement 并单击 Forward。
    16. 配置防火墙
    出于本演示的需要,将不配置防火墙。选择 Disabled 并单击 Forward。
    当出现“Warning - No Firewall”窗口时,单击 Yes。
    17. SELinux
    从下拉菜单中选择 Disabled 并单击 Forward。
    18. Kdump
    不要启用 Kdump。接受默认设置并单击 Forward。
    19. 日期和时间
    设置日期和时间。
    如果要使用 NTP 服务器(推荐),则选择 Enable Network Time Protocol 并输入 NTP 服务器的名称。
    20. 系统用户
    为自己创建一个帐户。
    此时不要为 oracle 创建帐户。本部分稍后将介绍如何创建 oracle 帐户。
    21. 声卡
    如果有声卡,对其进行配置并单击 Forward。
    22. 其他 CD
    单击 Finish。
    23. 系统将重启
    24. 出现一个图形登录屏幕。
    25. 恭喜!您的 Rhel5 软件现已安装完毕。
    安装必需的软件包
    所需内核版本:2.6.18。该内核或其他更新的内核可用于 Oracle 数据库 11g 第 1 版。
    通过运行以下命令检查内核版本:

    # uname -r
    2.6.18-53.el5xen

    所需程序包版本(或更高):
    ● compat-libstdc++-33-3.2.3-61
    ● elfutils-libelf-0.125-3.el5
    ● elfutils-libelf-devel-0.125-3.el5
    ● glibc-2.5-12
    ● glibc-devel-2.5-12
    ● glibc-common-2.5-12
    ● gcc-4.1.1-52.el5
    ● gcc-c++-4.1.1-52.el5
    ● libgcc-4.1.1-52.el5
    ● libaio-0.3.106-3.2
    ● libaio-devel-0.3.106-3.2
    ● libstdc++-4.1.1-52.el5
    ● libstdc++-devel-4.1.1-52.el5
    ● unixODBC-2.2.11-7.1
    ● unixODBC-devel-2.2.11-7.1
    ● sysstat-7.0.0-3.el5
    ● binutils-2.17.50.0.6-2.el5
    ● make-3.81-1.1
    如果您已经按照 Oracle 的建议执行了“默认 RPM”安装,则还需要安装一些必需的程序包:
    [root@db Server]# rpm -ivh libaio-devel-0.3.106-3.2.i386.rpm
    warning: libaio-devel-0.3.106-3.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
    Preparing...                ########################################### [100%]
    1:libaio-devel           ########################################### [100%]
    [root@db Server]# rpm -ivh unixODBC*
    warning: unixODBC-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
    Preparing...                ########################################### [100%]
    1:unixODBC               ########################################### [ 33%]
    2:unixODBC-devel         ########################################### [ 67%]
    3:unixODBC-kde           ########################################### [100%]
    [root@db Server]#


    第 3 部分:针对 Oracle 配置 Linux
    Linux 软件现已安装完毕,您需要针对 Oracle 对其进行配置。本部分将逐步讲解针对 Oracle 数据库 11g 第 1 版配置 Linux 的过程。
    创建 Oracle 组和用户帐户
    接下来,创建用于安装和维护 Oracle 数据库 11g 第 1 版软件的 Linux 组和用户帐户。用户帐户将称为 oracle,而组将称为 oinstall
    和 dba。以 root 用户身份执行以下命令:
    [root@db Server]# groupadd oinstall
    [root@db Server]# groupadd dba
    [root@db Server]# useradd -m -g oinstall -G dba oracle
    [root@db Server]# id oracle
    uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
    [root@db Server]# passwd oracle
    Changing password for user oracle.
    New UNIX password:
    BAD PASSWORD: it is based on a dictionary word
    Retype new UNIX password:
    passwd: all authentication tokens updated successfully.
    [root@db Server]#
    创建目录
    现在创建目录来存放 Oracle 数据库 11g 第 1 版软件及数据库文件。本指南在创建目录结构时所用的命名惯例符合最佳灵活结构
    (OFA) 规范。有关 OFA 标准的更多信息,请参阅针对 Linux 的 Oracle 数据库安装指南 11g 第 1 版 (11.1) 的附录 D。
    以下假设在根文件系统中创建目录。这样做是为了简便起见,不建议将其作为通用做法。这些目录通常被创建为单独的文件系统。
    以 root 用户身份执行以下命令:
    [root@db Server]# mkdir -p /u01/app/oracle
    [root@db Server]# chown -R oracleinstall /u01/app
    [root@db Server]# chmod -R 775 /u01/app
    [root@db Server]#
    配置 Linux 内核参数
    Oracle 数据库 11g 第 1 版需要以下所示的内核参数设置。给出的值都为最小值,因此如果您的系统使用一个更大的值,则不要进行更
    改。Linux 允许在系统启动并运行时修改大多数内核参数,所以无需在修改内核参数后重启系统。
    kernel.shmall = 2097152
    kernel.shmmax = 536870912
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    fs.file-max = 65536
    net.ipv4.ip_local_port_range = 1024 65000
    net.core.rmem_default=4194304
    net.core.wmem_default=262144
    net.core.rmem_max=4194304
    net.core.wmem_max=262144
    注意,OEL 5 已经为 kernel.shmall 和 kernel.shmmax 定义了值。如果默认值等于或大于要求值,则使用默认值。
    如果您按照以上说明安装了 Linux,且内核参数全部采用默认值,则只需在以 root 用户身份登录后执行下命令。
    [root@db Server]# cat >> /etc/sysctl.conf << EOF
    > kernel.shmmni = 4096
    > kernel.sem = 250 32000 100 128
    > fs.file-max = 65536
    > net.ipv4.ip_local_port_range = 1024 65000
    > net.core.rmem_default=4194304
    > net.core.wmem_default=262144
    > net.core.rmem_max=4194304
    > net.core.wmem_max=262144
    > EOF
    [root@db Server]# /sbin/sysctl -p
    net.ipv4.ip_forward = 0
    net.ipv4.conf.default.rp_filter = 1
    net.ipv4.conf.default.accept_source_route = 0
    kernel.sysrq = 0
    kernel.core_uses_pid = 1
    net.ipv4.tcp_syncookies = 1
    kernel.msgmnb = 65536
    kernel.msgmax = 65536
    kernel.shmmax = 4294967295
    kernel.shmall = 268435456
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    fs.file-max = 65536
    net.ipv4.ip_local_port_range = 1024 65000
    net.core.rmem_default = 4194304
    net.core.wmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_max = 262144
    [root@db Server]#
    以 root 用户身份运行以下命令来验证您的设置:
    /sbin/sysctl -a | grep shm
    /sbin/sysctl -a | grep sem
    /sbin/sysctl -a | grep file-max
    /sbin/sysctl -a | grep ip_local_port_range
    /sbin/sysctl -a | grep rmem_default
    /sbin/sysctl -a | grep rmem_max
    /sbin/sysctl -a | grep wmem_default
    /Esx:b in/sysctl -a | grep wmem_max
    [root@db Server]# /sbin/sysctl -a | grep shm
    kernel.shmmni = 4096
    kernel.shmall = 268435456
    kernel.shmmax = 4294967295
    [root@db Server]# /sbin/sysctl -a | grep sem
    kernel.sem = 250        32000   100     128
    [root@db Server]# /sbin/sysctl -a | grep file-max
    fs.file-max = 65536
    [root@db Server]# /sbin/sysctl -a | grep ip_local_port_range
    net.ipv4.ip_local_port_range = 1024     65000
    [root@db Server]# /sbin/sysctl -a | grep rmem_default
    net.core.rmem_default = 4194304
    [root@db Server]# /sbin/sysctl -a | grep rmem_max
    net.core.rmem_max = 4194304
    [root@db Server]# /sbin/sysctl -a | grep wmem_default
    net.core.wmem_default = 262144
    [root@db Server]# /sbin/sysctl -a | grep wmem_max
    net.core.wmem_max = 262144
    [root@db Server]#
    为 oracle 用户设置 Shell 限制
    Oracle 建议对每个 Linux 帐户可以使用的进程数和打开的文件数设置限制。要进行这些更改,以 root 用户的身份执行下列命令:
    cat >> /etc/security/limits.conf <<EOF
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle soft nofile 1024
    oracle hard nofile 65536
    EOF

    [root@db Server]# cat >> /etc/pam.d/login <<EOF
    > session required /lib/security/pam_limits.so
    > EOF
    修改 bash 和 ksh 的默认配置文件以及 cshell 的默认登录脚本。
    [root@db Server]# cat >> /etc/profile <<EOF
    > if [ $USER = "oracle" ]; then
    > if [ $SHELL = "/bin/ksh" ]; then
    > ulimit -p 16384
    > ulimit -n 65536
    > else
    > ulimit -u 16384 -n 65536
    > fi
    > umask 022
    > fi
    > EOF
    limit descriptors 65536
    umask 022
    endif[root@db Server]# cat >> /etc/csh.login <<EOF
    > if ( $USER == "oracle" ) then
    > limit maxproc 16384
    > limit descriptors 65536
    > umask 022
    > endif
    > EOF

  • 相关阅读:
    qt截取屏幕
    使用XmlTextReader 读取XML
    QQ2010 SP2 美化 皮肤 修改 透明 托盘 图标 RES.RDB 解包 打包 去广告 显IP
    发一个linux串口监视工具
    linux打包压缩命令汇总
    Qt实现遍历文件夹和文件目录(递归)
    linux忘记root密码的恢复方法
    centos x8664位版本 想安装qq for linux
    删除所有的.svn文件夹
    qtsdk1.2.1 静态编译
  • 原文地址:https://www.cnblogs.com/danghuijian/p/4400400.html
Copyright © 2011-2022 走看看