zoukankan      html  css  js  c++  java
  • oracle 10g R2数据库的安装部署

      操作系统准备工作

    1.OS版本限制
    2.磁盘空间限制
    3.软件包依赖
    4.主机名和解析地址
    5.用户和资源限制(PAM)
    6.系统资源限制(内核参数)



    支持的版本:
    oracle10G的版本只支持到RHEL4,生产中建议安装官方认可的操作系统版本

    如果是RHEL5需要修改一下系统中的版本识别文件
    因为oracle安装包中的代码有检测操作系统的脚本

    [root@dba mnt]# grep ^Linux install/oraparam.ini
    Linux=redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2
    [root@dba mnt]#
    --该版本检测只在10g安装文件中存在。

    解决方法
    root@dba mnt]# cat /etc/redhat-release
    Red Hat Enterprise Linux Server release 5.5 (Tikanga)
    [root@dba mnt]# vim /etc/redhat-release
    [root@dba mnt]# cat /etc/redhat-release
    Red Hat Enterprise Linux Server release 4.5 (Tikanga)
    [root@dba mnt]#

    空间需求
    内存至少512M 交换分区至少1G
    oracle软件安装位置1.3G
    数据库安装位置至少1G
    /tmp要有足够400M的剩余
    如果这些目录都是隶属于根文件系统 那根需要有3G空闲才能安装 (1.3+1+0.4)
    上述都属于最小要求 这是远远不够后期运行添加数据使用的.
    并且随着后期运行oracle自身产生的文件会逐渐增大 请保留足够的空间需求

    检查方法
    [root@dba ~]# df -h
    文件系统 类型 容量 已用 可用 已用% 挂载点
    /dev/sda2 ext3 15G 2.3G 12G 17% /
    /dev/sda1 ext3 99M 12M 83M 12% /boot
    tmpfs tmpfs 506M 0 506M 0% /dev/shm
    [root@dba ~]#
    [root@dba ~]# grep -E 'MemTotal|SwapTotal' /proc/meminfo
    MemTotal: 1035108 kB
    SwapTotal: 1076344 kB
    [root@dba ~]#

    软件包检查
    for i in binutils compat-gcc-34 compat-libstdc++-296 control-center
    gcc gcc-c++ glibc glibc-common glibc-devel libaio libgcc
    libstdc++ libstdc++-devel libXp make openmotif22 setarch
    do
    rpm -q $i &>/dev/null || F="$F $i"
    done ;echo $F;unset F

    如果这个命令执行后有输出包名字 请向系统中补充
    如果没有输出信息 则说明所需要的软件包已经都在系统中了



    主机名和解析地址
    [root@dba ~]# hostname
    dba.up.com
    [root@dba ~]#
    [root@dba ~]# ifconfig eth0 | head -n 2
    eth0 Link encap:Ethernet HWaddr 00:0C:29:9F:DF:4A
    inet addr:10.10.10.10 Bcast:10.10.10.255 Mask:255.255.255.0
    [root@dba ~]#

    [root@dba ~]# grep -v '^#' /etc/hosts
    127.0.0.1 localhost.localdomain localhost
    10.10.10.10 dba.up.com dba
    [root@dba ~]#

    操作系统资源限制(单节点与RAC环境均需设置)
    添加到
    vim /etc/sysctl.conf 文件底端
    kernel.shmall = 2097152
    kernel.shmmax = 2147483648
    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 = 1048576
    net.core.rmem_max = 1048576
    net.core.wmem_default = 262144
    net.core.wmem_max = 262144

    加载参数 sysctl -p

    kernel.shmall
    Total amount of shared memory available (bytes or pages)
    kernel.shmmax
    Maximum size of shared memory segment (bytes)
    建议大于等于SGA
    kernel.shmmni
    Maximum number of shared memory segments system-wide

    kernel.shmall*kernel.shmmni = 能够分配的内存大小

    kernel.sem = SEMMSL SEMMNS SEMOPM SEMMNI
    SEMMSL Maximum number of semaphores per set
    每个信号对象集的最大信号对象数;
    SEMMNS Maximum number of semaphores system-wide
    系统范围内最大信号对象数;
    SEMOPM
    每个信号对象支持的最大操作数;
    SEMMNI Maximum number of semaphore identifiers
    系统范围内最大信号对象集数。
    其中 SEMMNS的值等于 SEMMSL*SEMMNI

    fs.file-max
    系统中所允许的文件句柄最大数目。
    net.ipv4.ip_local_port_range
    应用程序可使用的IPv4端口范围。
    net.core.rmem_default
    套接字接收缓冲区大小的缺省值
    net.core.rmem_max
    套接字接收缓冲区大小的最大值
    net.core.wmem_default
    套接字发送缓冲区大小的缺省值
    net.core.wmem_max
    套接字发送缓冲区大小的最大值



    用户资源限制
    建立oracle用户和组
    建议指定GID和UID方式(尤其集群环境)
    [root@dba ~]# groupadd -g 1000 oinstall
    [root@dba ~]# groupadd -g 1001 dba
    [root@dba ~]# useradd -u 1000 -g oinstall -G dba oracle
    [root@dba ~]# passwd oracle
    建立oracle软件安装文件目录
    [root@dba ~]# mkdir -p /u01/oracle
    [root@dba ~]# chown -R oracle:oinstall /u01/
    [root@dba ~]#

    设置oracle环境变量
    vi ~oracle/.bash_profile
    export ORACLE_BASE=/u01/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
    export ORACLE_SID=ora10g
    export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    加载配置
    oracle用户注销重新登录 或 source .bash_profile 或. .bash_profile

    ORACLE_BASE oracle产品基目录
    ORACLE_HOME 数据库产品目录
    通常情况下HOME目录是BASE的子目录
    ORACLE_HOME=$ORACLE_BASE/product/10.2.0

    ORACLE_SID 操作系统和oracle实例关联的纽带
    PATH 将安装后的oracle命令追加到执行搜索路径
    LD_LIBRARY_PATH 动态库的位置

    shell限制
    [root@dba ~]# grep -v '^#' /etc/security/limits.conf
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle soft nofile 1024
    oracle hard nofile 65536
    [root@dba ~]#
    [root@dba ~]# grep 'limit' /etc/pam.d/system-auth
    session required pam_limits.so
    [root@dba ~]#



    运行安装命令
    若想支持中文界面 以后的EM或DBCA界面显示中文
    则需要安装 rpm -ivh ttfonts-zh_CN-2.14-6.noarch.rpm
    然后export LANG=zh_CN.utf-8
    安装界面使用英文则 export LANG=C


    注销root使用oracle用户登录X-window执行安装命令 runInstaller
    如果安装包在光盘介质上 挂载后要离开光盘挂在位置绝对路径执行
    因为安装程序会创建临时文件 光盘是只读的 不能创建临时文件

    若当前桌面是root 用su - oracle切换用户 需要在切换前root执行
    # xhost + 否则oracle用户不能连接root的桌面





























    [root@dba ~]# /u01/oracle/oraInventory/orainstRoot.sh
    更改权限/u01/oracle/oraInventory 到 770.
    更改组名/u01/oracle/oraInventory 到 oinstall.
    脚本的执行已完成
    [root@dba ~]# /u01/oracle/product/10.2.0/root.sh
    Running Oracle10 root.sh script...

    The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME= /u01/oracle/product/10.2.0

    Enter the full pathname of the local bin directory: [/usr/local/bin]:
    Copying dbhome to /usr/local/bin ...
    Copying oraenv to /usr/local/bin ...
    Copying coraenv to /usr/local/bin ...


    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    [root@dba ~]#






    安装结束后 数据库处于启动状态

    也可以通过查看进程状态来查看数据库是否启动
    [root@dba ~]# ps -ef | grep ora_
    oracle 1213 1 2 04:44 ? 00:00:00 ora_j000_ora10g
    root 1228 3315 0 04:45 pts/3 00:00:00 grep ora_
    oracle 6635 1 0 04:00 ? 00:00:00 ora_pmon_ora10g
    oracle 6637 1 0 04:00 ? 00:00:00 ora_psp0_ora10g
    oracle 6639 1 0 04:00 ? 00:00:00 ora_mman_ora10g
    oracle 6641 1 0 04:00 ? 00:00:00 ora_dbw0_ora10g
    oracle 6643 1 0 04:00 ? 00:00:01 ora_lgwr_ora10g
    oracle 6645 1 0 04:00 ? 00:00:02 ora_ckpt_ora10g
    oracle 6647 1 0 04:00 ? 00:00:01 ora_smon_ora10g
    oracle 6649 1 0 04:00 ? 00:00:00 ora_reco_ora10g
    oracle 6651 1 0 04:00 ? 00:00:00 ora_cjq0_ora10g
    oracle 6653 1 0 04:00 ? 00:00:01 ora_mmon_ora10g
    oracle 6655 1 0 04:00 ? 00:00:00 ora_mmnl_ora10g
    oracle 6657 1 0 04:00 ? 00:00:00 ora_d000_ora10g
    oracle 6659 1 0 04:00 ? 00:00:00 ora_s000_ora10g
    oracle 6666 1 0 04:01 ? 00:00:00 ora_qmnc_ora10g
    oracle 6726 1 0 04:01 ? 00:00:00 ora_q000_ora10g
    oracle 6730 1 0 04:01 ? 00:00:00 ora_q002_ora10g


    注:
    10201_database_linux_x86_64.cpio.gz 如何解压
    zcat 10201_database_linux_x86_64.cpio.gz |cpio -dmv
    或者
    1,gunzip 10201_database_linux_x86_64.cpio.gz
    2,cpio -idmv <10201_database_linux_x86_64.cpio.gz

  • 相关阅读:
    SSM框架搭建
    UML——类图
    javascript中的闭包(Closure)的学习
    JS和jQuery中ul li遍历获取对应的下角标
    jquery中防止冒泡事件
    chouTi
    DjangoForm 之创建FORM模板进行验证
    django学习日记-cookie
    同步锁
    进程线程
  • 原文地址:https://www.cnblogs.com/Oman/p/9223092.html
Copyright © 2011-2022 走看看