跳转到内容

RAC 攻击 - Oracle 集群数据库在家/设置 ASMLIB

来自维基教科书,开放书籍,开放世界


  1. 以 oracle 用户身份登录到 collabn1 并打开终端。切换到 root 用户。
  2. 在两个节点上安装 ASMLib 并初始化磁盘。如果您已从之前的步骤中挂载了 cdrom,mount 命令可能会失败(mount: /dev/cdrom-hda already mounted or /mnt/cdrom busy)。[root@collabn1 ~]# cd /mnt [root@collabn1 mnt]# mount /mnt/cdrom mount: block device /dev/cdrom-hda is write-protected, mounting read-only [root@collabn1 mnt]# mount /mnt/cdrom5 mount: block device /dev/cdrom-hdb is write-protected, mounting read-only # OracleASM rpm -Uvh */*/oracleasm-support* rpm -Uvh */*/oracleasm*el5-2* # (注意 - 这是小写 EL5-2。) # 安装介质中缺少;复制到 RAC 攻击 DVD。 rpm -Uvh */oracleasmlib* [root@collabn1 mnt]# /etc/init.d/oracleasm configure 配置 Oracle ASM 库驱动程序。这将配置 Oracle ASM 库驱动程序的启动时属性。以下问题将确定驱动程序是否在启动时加载以及它将具有哪些权限。当前值将显示在括号 ('[]') 中。按 <ENTER> 而不键入答案将保留该当前值。Ctrl-C 将中止。拥有驱动程序接口的默认用户 []: oracle 拥有驱动程序接口的默认组 []: dba 在启动时启动 Oracle ASM 库驱动程序 (y/n) [n]: y 在启动时修复 Oracle ASM 磁盘的权限 (y/n) [y]: y 正在写入 Oracle ASM 库驱动程序配置: 完成 正在初始化 Oracle ASMLib 驱动程序: [ 确定 ] 正在扫描系统以查找 Oracle ASMLib 磁盘: [ 确定 ]
    [root@collabn1 ~]# /etc/init.d/oracleasm createdisk data /dev/sdb1
    Marking disk "data" as an ASM disk:                        [  OK  ]
    [root@collabn1 ~]# /etc/init.d/oracleasm createdisk backup /dev/sdc1
    Marking disk "backup" as an ASM disk:                      [  OK  ]
    [root@collabn1 ~]# /etc/init.d/oracleasm listdisks
    BACKUP
    DATA
    
    

    现在在第二台虚拟机上重复一些步骤

    [root@collabn1 ~]# ssh collabn2
     
    [root@collabn2 ~]# cd /mnt
     
    # OracleASM
    rpm -Uvh */*/oracleasm-support*
    rpm -Uvh */*/oracleasm*el5-2*
    # Missing from the install media; copied to RAC Attack DVD.
    rpm -Uvh */oracleasmlib*
     
    [root@collabn2 ~]# /etc/init.d/oracleasm configure
    Configuring the Oracle ASM library driver.
     
    This will configure the on-boot properties of the Oracle ASM library
    driver.  The following questions will determine whether the driver is
    loaded on boot and what permissions it will have.  The current values
    will be shown in brackets ('[]').  Hitting <ENTER> without typing an
    answer will keep that current value.  Ctrl-C will abort.
     
    Default user to own the driver interface []: oracle
    Default group to own the driver interface []: dba
    Start Oracle ASM library driver on boot (y/n) [n]: y
    Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
    Writing Oracle ASM library driver configuration: done
    Initializing the Oracle ASMLib driver:                     [  OK  ]
    Scanning the system for Oracle ASMLib disks:               [  OK  ]
     
    [root@collabn2 ~]# /etc/init.d/oracleasm listdisks
    BACKUP
    DATA
    



华夏公益教科书