• SUSE11装Oracle11G单实例并配置ASM共享磁盘


    1、配置本地zypper源(zypper相当于红帽、centos的yum命令)
    为后边使用方便
    :/etc # zypper ar file:///iso update
    RAC1:/mnt/suse11/suse # cd /etc/zypp/repos.d/
    RAC1:/etc/zypp/repos.d # ls
    SUSE-Linux-Enterprise-Server-11 11-0.repo loacl.repo update.repo
    RAC1:/etc/zypp/repos.d # cat loacl.repo
    [update]
    name=update
    enabled=1
    gpgcheck=1
    autorefresh=0
    baseurl=file:///iso(可以将引导盘介质cp到本地一个目录将路径写在此处)注意:三个/
    type=NONE
    keeppackages=0
    RAC1:/etc/zypp/repos.d #
    :zypper lr(查看源)
    使用命令
    zypper in c++*(自动安装依赖)
    2、安装必要依赖包
    zypper in libXp* xterm* unixODBC* sysstat* make* libstdc++* libgomp* libgcc* libaio* kernel-headers* glibc* gcc* elfutils* binutils* bind bind-devel bind-chroot caching-nameserver compat-libcap1* compat-libstdc++-33* openssh*  xdpyinfo vi unzip

    查看是否有包:
    rpm -qa binutils* compat-libstdc* glibc-2* ksh* libaio* make-3* compat-libcap1* gcc-4* gcc-c* libstdc++-devel* sysstat* glibc-devel* libgcc-4* libstdc++-4* unixODBC-2* unixODBC-devel-2* elfutils-libelf-devel* libXp*

    3.修改系统参数
    1)
    [root@Test_run_CRM soft]# vi /etc/sysctl.conf
    kernel.msgmnb = 65536
    kernel.shmall = 4294967296
    fs.file-max = 6815744
    kernel.msgmni = 2878
    kernel.msgmax = 8192
    kernel.msgmnb = 65536
    kernel.sem = 250 32000 100 142
    kernel.shmmni = 4096
    kernel.shmmax = 329853488333
    net.core.wmem_default = 262144
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_max = 1048576
    fs.aio-max-nr = 3145728
    net.ipv4.ip_local_port_range = 9000 65500
    vm.min_free_kbytes = 51200
    生效:
    [root@Test_run_FOSS u01]# sysctl -p

    2)[root@Test_run_CRM soft]# vi /etc/pam.d/login
    最后一行添加
    session required pam_limits.so
    3)[root@Test_run_CRM soft]# vi /etc/security/limits.conf
    最后添加:
    grid soft nproc 2047
    grid hard nproc 16384
    grid soft nofile 1024
    grid hard nofile 65536
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle soft nofile 1024
    oracle hard nofile 65536
    4)[root@Test_run_CRM soft]# vi /etc/profile
    添加:
    if [ $USER = "oracle" ]||[ $USER = "grid" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
    else
    ulimit -u 16384 -n 65536
    fi
    umask 022
    fi
    3.创建组和用户
    创建组:
    groupadd -g 501 oinstall
    groupadd -g 502 dba
    groupadd -g 503 oper
    groupadd -g 504 asmadmin
    groupadd -g 505 asmdba
    groupadd -g 506 asmoper
    创建用户:
    # useradd -u 501 -g oinstall -G dba,oper,asmadmin,asmdba,asmoper -s
    /bin/bash grid
    # useradd -u 502 -g oinstall -G dba,oper,asmadmin,asmdba,asmoper -s
    /bin/bash oracle
    usermod -u
    修改密码:
    passwd oracle
    passwd grid
    修改路径权限:
    mkdir -p /u01/app/grid

    mkdir -p /u01/app/11.2.4/grid

    chown -R grid:oinstall /u01

    mkdir -p /u01/app/oracle

    chown oracle:oinstall /u01/app/oracle

    chmod -R 775 /u01
    4.修改环境变量 vi .profile
    oracle:

    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_SID=testdb1
    export ORACLE_HOME=/u01/app/oracle/product/11.2.4/dbhome_1
    export PATH=$PATH:$ORACLE_HOME/bin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export ORACLE_TERM=xterm
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/lib64:/usr/lib64
    export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
    export TNS_ADMIN=$ORACLE_HOME/network/admin


    grid:

    export ORACLE_BASE=/u01/app/grid
    export ORACLE_HOME=/u01/app/11.2.4/grid
    export ORACLE_SID=+ASM
    export PATH=$PATH:$ORACLE_HOME/bin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/lib64:/usr/lib64
    export ORACLE_TERM=xterm
    export
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    export TNS_ADMIN=$ORACLE_HOME/network/admin


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    关机 添加两块磁盘 在此同时VM虚拟机需要在源文件的.vmx格式的文件中增加一行disk.EnableUUID = "TRUE"
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    5.使用udev 绑定磁盘(******)


    suse系统的udev命令绝对路径是/lib/udev/scsi_id
    查询磁盘uuid
    RAC1:~ # /lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sda1
    36000c290ceb8604609a09bd72c04d5b2
    RAC001:~ # /lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sdc
    36000c29853c7cfabe972547f196360e8

    新增udev绑定文件
    vi /etc/udev/rules.d/12-dm-permissions.rules

    KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29f7b99f7eace3b0ab196aa4328", NAME="asm-disk1", OWNER="grid", GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2957a521ec362d6a4400d7ce92a", NAME="asm-disk2", OWNER="grid", GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29e531f810f4d220bcd118df58b", NAME="asm-disk3", OWNER="grid", GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29853c7cfabe972547f196360e8", NAME="asm-disk4", OWNER="grid", GROUP="asmadmin", MODE="0660"

    启动udev服务

    /etc/init.d/boot.udev status查看udev服务状态

    /etc/init.d/boot.udev start 启动udev服务
    # ll /dev/ | grep grid 查看如果有asm-disk 则表示asm硬件磁盘配置成功

    6、装grid软件
    将前两个包放到oracle家目录下解压待用 将权限给oracle:oinstall
    第三个包放到grid家目录下待用 权限给grid:oinstall
    切换到grid用户./安装包
    --注:安装中选择一个asm,不要把全部的asm都选上,后边asmca还需要asm存储。若全选了,后边asmca无法再次添加asm共享存储,只能再次添加磁盘,重新asmca。

    7、asmca添加共享存储asm

    grid> asmca


    8、安装oracle软件
    ./runinstall
    dbca
    选择共享存储asm
    9、查看asm状态

    [grid@rac01 ~]$ crsctl status res -t

    grid@RAC001:~> crsctl status res -t
    --------------------------------------------------------------------------------
    NAME TARGET STATE SERVER STATE_DETAILS
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.DATA.dg
    ONLINE ONLINE rac001
    ora.DATE2.dg
    ONLINE ONLINE rac001
    ora.asm
    ONLINE ONLINE rac001 Started
    ora.ons
    OFFLINE OFFLINE rac001
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.cssd
    1 ONLINE ONLINE rac001
    ora.diskmon
    1 OFFLINE OFFLINE
    ora.evmd
    1 ONLINE ONLINE rac001

    打完补丁包库崩了告警日志
    Thu Jan 03 17:15:45 2019
    ALTER DATABASE MOUNT
    NOTE: Loaded library: System
    ORA-15025: ?????? "/dev/asm-disk4"
    ORA-27041: ??????
    Linux-x86_64 Error: 13: Permission denied
    Additional information: 9
    SUCCESS: diskgroup DATE2 was dismounted
    ERROR: diskgroup DATE2 was not mounted
    ORA-00210: ???????????
    ORA-00202: ????: ''+DATE2/testdb1/controlfile/current.262.996591397''
    ORA-17503: ksfdopn: 2 ?????? +DATE2/testdb1/controlfile/current.262.996591397
    ORA-15001: ??? "DATE2" ????????
    ORA-15040: ??????
    ORA-205 signalled during: ALTER DATABASE MOUNT...
    ORA-15025: ?????? "/dev/asm-disk4"
    ORA-27041: ??????
    Linux-x86_64 Error: 13: Permission denied
    Additional information: 9
    Thu Jan 03 17:15:49 2019
    SUCCESS: diskgroup DATE2 was dismounted
    ERROR: diskgroup DATE2 was not mounted
    ORA-15025: ?????? "/dev/asm-disk4"
    ORA-27041: ??????
    Linux-x86_64 Error: 13: Permission denied
    Additional information: 9
    SUCCESS: diskgroup DATE2 was dismounted
    ERROR: diskgroup DATE2 was not mounted
    ORA-15025: ?????? "/dev/asm-disk4"
    ORA-27041: ??????
    Linux-x86_64 Error: 13: Permission denied
    Additional information: 9
    SUCCESS: diskgroup DATE2 was dismounted
    ERROR: diskgroup DATE2 was not mounted

    解决:

    补丁包改变了oracle 的权限

    id oracle id grid 查看丢失那个用户组,增加用户组成员即可

    需要关注的是$ORACLE_HOME/bin/oracle该文件的权限

    如果上述办法解决不了,dbca删库重建吧!!

    正确的打补丁步骤为先打补丁然后再执行dbca建库。

  • 相关阅读:
    配置hive的元数据到Mysql中
    对部分spi控制的外设芯片需要断电再上电处理
    驱动芯片L9945的odd parity的计算方法
    bit field不具备可移植性
    multiple storage classes in declaration specifiers报错解决
    C编译器中对h文件的重重包含导致的预处理不同的问题
    linker file链接文件
    eclipse编辑器中的TODO和FIXME的使用
    解决hightec的链接文件的路径问题
    LIN开发
  • 原文地址:https://www.cnblogs.com/Wardenking/p/10231450.html
Copyright © 2020-2023  润新知