2020-12-20 乐帮网
oracle
在虚拟机上指定的CRS主机上安装好Oracle Linux7后,需要对系统环境做一系列准备以安装oracle grid相关组件。主要有以下部分
1、public-yum-ol7.repo
此文件是安装oracle rac的相关yum依赖文件,所有的public-yum-ol.repo相关依赖官方网址:http://public-yum.oracle.com/
在官网中我们可以找到系统对应的文件,例如我们系统是Oracle Linux7的,那么对应的文件路径是:http://public-yum.oracle.com/public-yum-ol7.repo;
如果你的系统不是Oracle Linux系列的,或者是需要在离线状态下安装数据库环境,则需要访问:http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/ 来手动下载相关依赖包。其实在我们安装的系统里已经默认携带相关软件环境,但是为了确保最新安全和稳定配置我们还是需要手动从网上安装一遍。
注意,如果是在离线的生产服务器上安装,可挂载Oracle Linux的ISO做为yum源,并适当修改的配置文件。以下是在能连接外网的条件下进行的。
为了确保最新,从网上再下载一次,(这里是针对oracle linux6的地址 )命令行如下:
[root@oragrid ~]# cd /etc/yum.repos.d
[root@oragrid yum.repos.d]# ls
public-yum-ol7.repo
[root@oragrid yum.repos.d]# wget http://public-yum.oracle.com/public-yum-ol7.repo
查看public-yum-ol6.repo 文件内容
[root@localhost yum.repos.d]# cat public-yum-ol7.repo
[ol7_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
[ol7_u0_base]
name=Oracle Linux $releasever GA installation media copy ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/0/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
[ol7_UEKR3]
name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/UEKR3/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
[ol7_optional_latest]
name=Oracle Linux $releasever Optional Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/optional/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
[ol7_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
[ol7_MySQL56]
name=MySQL 5.6 for Oracle Linux 7 ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/MySQL56/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
[ol7_MySQL55]
name=MySQL 5.5 for Oracle Linux 7 ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/MySQL55/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
可以看到默认用的是last的Url。通过以下命令查看系统的版本(此处是旧系统中截图实际是7.0)
[root@oragrid yum.repos.d]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: OracleServer
Description: Oracle Linux Server release 6.5
Release: 6.5
Codename: n/a
这里查看到的版本和上面的url是对应的,在默认配置里用的是最新的(last)。
2、安装依赖包
使用 yum install 命令安装 oracle-validated RPM。
[root@oragrid yum.repos.d]# yum install oracle-validated
静待完成。
然后输入如下命令:
[root@oragrid yum.repos.d]# yum install oracle-rdbms-server-11gR2-preinstall
遇到如下提示选择y回车
Is this ok [y/N]: y
静待完成。
不出意外输出窗口如下:
[root@localhost yum.repos.d]# yum install oracle-validated
Loaded plugins: langpacks
Existing lock /var/run/yum.pid: another copy is running as pid 12688.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 136 M RSS (537 MB VSZ)
Started: Wed Dec 13 20:01:22 2017 - 27:19 ago
State : Sleeping, pid: 12688
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 136 M RSS (537 MB VSZ)
Started: Wed Dec 13 20:01:22 2017 - 27:21 ago
State : Sleeping, pid: 12688
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 136 M RSS (537 MB VSZ)
Started: Wed Dec 13 20:01:22 2017 - 27:23 ago
State : Sleeping, pid: 12688
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 136 M RSS (537 MB VSZ)
Started: Wed Dec 13 20:01:22 2017 - 27:25 ago
State : Sleeping, pid: 12688
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 136 M RSS (537 MB VSZ)
Started: Wed Dec 13 20:01:22 2017 - 27:27 ago
State : Sleeping, pid: 12688
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 136 M RSS (537 MB VSZ)
Started: Wed Dec 13 20:01:22 2017 - 27:29 ago
State : Sleeping, pid: 12688
^C
Exiting on user cancel.
[root@localhost yum.repos.d]# rm -f /var/run/yum.pid
[root@localhost yum.repos.d]# yum install oracle-validated
Loaded plugins: langpacks
No package oracle-validated available.
Error: Nothing to do
[root@localhost yum.repos.d]# yum install oracle-rdbms-server-11gR2-preinstall
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-5.el7 will be installed
--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64
--> Running transaction check
---> Package compat-libcap1.x86_64 0:1.10-7.el7 will be installed
---> Package compat-libstdc++-33.x86_64 0:3.2.3-72.el7 will be installed
---> Package ksh.x86_64 0:20120801-34.el7 will be installed
---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
--> Processing Dependency: libaio(x86-64) = 0.3.109-13.el7 for package: libaio-devel-0.3.109-13.el7.x86_64
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-12.el7 will be updated
---> Package libaio.x86_64 0:0.3.109-13.el7 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================
Package Arch Version Repository Size
===================================================================================================================
Installing:
oracle-rdbms-server-11gR2-preinstall x86_64 1.0-5.el7 ol7_latest 21 k
Installing for dependencies:
compat-libcap1 x86_64 1.10-7.el7 ol7_latest 17 k
compat-libstdc++-33 x86_64 3.2.3-72.el7 ol7_latest 190 k
ksh x86_64 20120801-34.el7 ol7_latest 883 k
libaio-devel x86_64 0.3.109-13.el7 ol7_latest 12 k
Updating for dependencies:
libaio x86_64 0.3.109-13.el7 ol7_latest 24 k
Transaction Summary
===================================================================================================================
Install 1 Package (+4 Dependent packages)
Upgrade ( 1 Dependent package)
Total download size: 1.1 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for ol7_latest
warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/compat-libcap1-1.10-7.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Public key for compat-libcap1-1.10-7.el7.x86_64.rpm is not installed
(1/6): compat-libcap1-1.10-7.el7.x86_64.rpm | 17 kB 00:00:00
(2/6): compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm | 190 kB 00:00:01
(3/6): libaio-0.3.109-13.el7.x86_64.rpm | 24 kB 00:00:00
(4/6): libaio-devel-0.3.109-13.el7.x86_64.rpm | 12 kB 00:00:00
(5/6): oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64.rpm | 21 kB 00:00:00
(6/6): ksh-20120801-34.el7.x86_64.rpm | 883 kB 00:00:01
-------------------------------------------------------------------------------------------------------------------
Total 393 kB/s | 1.1 MB 00:00:02
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
Userid : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03
Package : 7:oraclelinux-release-7.0-1.0.3.el7.x86_64 (@anaconda/7.0)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : libaio-0.3.109-13.el7.x86_64 1/7
Installing : libaio-devel-0.3.109-13.el7.x86_64 2/7
Installing : ksh-20120801-34.el7.x86_64 3/7
Installing : compat-libcap1-1.10-7.el7.x86_64 4/7
Installing : compat-libstdc++-33-3.2.3-72.el7.x86_64 5/7
Installing : oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64 6/7
Cleanup : libaio-0.3.109-12.el7.x86_64 7/7
Verifying : oracle-rdbms-server-11gR2-preinstall-1.0-5.el7.x86_64 1/7
Verifying : compat-libstdc++-33-3.2.3-72.el7.x86_64 2/7
Verifying : compat-libcap1-1.10-7.el7.x86_64 3/7
Verifying : libaio-devel-0.3.109-13.el7.x86_64 4/7
Verifying : libaio-0.3.109-13.el7.x86_64 5/7
Verifying : ksh-20120801-34.el7.x86_64 6/7
Verifying : libaio-0.3.109-12.el7.x86_64 7/7
Installed:
oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-5.el7
Dependency Installed:
compat-libcap1.x86_64 0:1.10-7.el7 compat-libstdc++-33.x86_64 0:3.2.3-72.el7 ksh.x86_64 0:20120801-34.el7
libaio-devel.x86_64 0:0.3.109-13.el7
Dependency Updated:
libaio.x86_64 0:0.3.109-13.el7
Complete!
3、格式化硬盘
在服务器上执行如下脚本进行硬盘格式化。共三个盘需要格式化sdb,sdc,sdd
[root@localhost dev]# ls sd*
sda sda1 sda2 sdb sdc sdd
[root@localhost dev]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x5314c0fc.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p):
Using default response p
Partition number (1-4, default 1): 1
First sector (2048-209715199, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199):
Using default value 209715199
Partition 1 of type Linux and of size 100 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
4、准备软件安装包
Oracle RAC需要提前下载好安装好,共三个文件
linux.x64_11gR2_grid.zip
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
下载完成后分别上传至服务器。
原创作品禁止转载!
Oracle RAC 搭建系列目录:
Oracle RAC 集群搭建 Oracle Linux crs主机(二)
Oracle RAC 集群搭建 安装Oracle Grid前配置(四)
Oracle RAC 集群搭建 安装oracleasm(五)
关注我的微信公众号
在公众号里留言交流
投稿邮箱:1052839972@qq.com
庭院深深深几许?杨柳堆烟,帘幕无重数。
玉勒雕鞍游冶处,楼高不见章台路。
雨横风狂三月暮。门掩黄昏,无计留春住。
泪眼问花花不语,乱红飞过秋千去。
如果感觉对您有帮助
欢迎向作者提供捐赠
这将是创作的最大动力