1. 准备工作
在安装 Oracle 自动存储管理 (ASM) 之前,我们需要准备 Oracle ASM 磁盘:
ASMLib 软件用于将 Linux 上的任何磁盘格式化或配置为 ASM 磁盘。ASMLib 软件由以下 3 个组件组成:
- 开源 (GPL) 核心模块包:kmod-oracleasm
- 开源 (GPL) 实用程序包:oracleasm-support
- 闭源库包:oracleasmlib
通过yum软件包下载和安装它们。
[root@MehmetSalih ~]# yum install oracleasm
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package kernel-uek.x86_64 0:4.14.35-1844.2.5.el7uek will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================
Installing:
kernel-uek x86_64 4.14.35-1844.2.5.el7uek ol7_UEKR5 52 M
Transaction Summary
==========================================================================================================================================================
Install 1 Package
Total download size: 52 M
Installed size: 59 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
kernel-uek-4.14.35-1844.2.5.el7uek.x86_64.rpm | 52 MB 00:00:13
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : kernel-uek-4.14.35-1844.2.5.el7uek.x86_64 1/1
Verifying : kernel-uek-4.14.35-1844.2.5.el7uek.x86_64 1/1
Installed:
kernel-uek.x86_64 0:4.14.35-1844.2.5.el7uek
Complete!
[root@MehmetSalih ~]#
然后安装相关的 yum 包,如下所示:
[ root@MehmetSalih ~]# yum install oracleasm-support.x86_64
[ root@MehmetSalih ~]# yum install kmod-oracleasm
安装 Oracle ASM 库包后,需要进行如下配置。
[root@MehmetSalih ~]# oracleasm configure -i
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 []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
检查 Oracle ASM 状态,如下所示。
[root@MehmetSalih ~]# oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no
[root@MehmetSalih ~]#
[root@MehmetSalih ~]#
像下面这样初始化oracleasm
[root@MehmetSalih ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm
[root@MehmetSalih ~]#
看到Oracleasm软件正常工作后,磁盘创建如下。
[root@MehmetSalih ~]# oracleasm createdisk DATA /dev/sdb2
Writing disk header: done
Instantiating disk: done
[root@MehmetSalih ~]#
我们可以像下面这样列出oracle asmdisk。
[ root@MehmetSalih ~]# oracleasm listdisks
DATA
[ root@MehmetSalih ~]#
Oracle ASM 18c 安装文件从https://support.oracle.com或https://edelivery.oracle.com下载并传输到服务器。
解压对应文件,通过vncserver连接服务器,运行gridSetup.sh文件开始安装,如下图。
选择第二个选项来安装独立 Oracle 自动存储管理安装。
指定 Oracle ASM 磁盘,如下所示。我们的 Oracle ASM 磁盘位于 /dev/oracleasm/disks/ 目录下,因此请按以下方式键入此目录。
选择冗余作为外部,如下所示。
指定 Oracle sys 和系统密码,如下所示。
没有企业管理器云控制,所以没有注册它。
指定操作系统组,如下所示。
类型 Oracle 基础
键入 Oracle 清单目录
点击下一步按钮
验证结果给了一些警告,可以忽略它们。
安装总结如下。
使用 root 用户在服务器中执行 root.sh,如下所示。
[root@MehmetSalih ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@MehmetSalih ~]#
[root@MehmetSalih ~]#
[root@MehmetSalih ~]# /u01/install/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/install
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 script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/install/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/oracle/crsdata/mehmetsalih/crsconfig/roothas_2019-02-18_04-07-24PM.log
2019/02/18 16:07:28 CLSRSC-363: User ignored prerequisites during installation
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node mehmetsalih successfully pinned.
2019/02/18 16:07:46 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'mehmetsalih'
CRS-2673: Attempting to stop 'ora.evmd' on 'mehmetsalih'
CRS-2677: Stop of 'ora.evmd' on 'mehmetsalih' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'mehmetsalih' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
mehmetsalih 2019/02/18 16:09:12 /u01/install/cdata/mehmetsalih/backup_20190218_160912.olr 70732493
2019/02/18 16:09:13 CLSRSC-327: Successfully configured Oracle Restart for a standalone server
[root@MehmetSalih ~]#
Oracle ASM 安装成功完成。