关闭防火墙
[root@zkdb ~]# systemctl stop firewalld.service
[root@zkdb ~]# systemctl disable firewalld.service
关闭selinux
vi /etc/selinux/config
更改SELINUX=disabled
配置host(否则会产生prvf-0002类型报错)
vim /etc/hosts
添加 192.168.26.62 zkdb
挂载iso文件,确保光盘挂载点有文件
查看是否挂载成功
yum源
创建文件夹,备份原始repo文件
#创建备份文件夹
mkdir repo_bak
#将原始文件转移至备份文件夹
mv CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo CentOS-x86_64-kernel.repo CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo /etc/yum.repos.d/repo_bak/
查询光盘挂载路径
新增一个repo文件,并修改文件内容,将yum源路径更改为本地光盘挂载路径(因文件夹名称中含有空格,在路径地址中需用“”)
清空yum缓存
rpm -q \
binutils \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
expat \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
pdksh \
sysstat \
unixODBC \
unixODBC-devel
安装依赖
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ gcc-c++glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcclibstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaiolibaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp pdksh
修改内核参数
vim /etc/sysctl.conf
修改限制资源参数
vim /etc/pam.d/login
#在末尾添加以下参数
session required /lib64/security/pam_limits.so
session required pam_limits.sooracle hard nofile 65536
[root@zabbix-agent-002 ~]# vim /etc/security/limits.conf #在末尾添加如下参数
group
[root@zabbix-agent-002 ~]# groupadd oinstall
[root@zabbix-agent-002 ~]# groupadd dba
[root@zabbix-agent-002 ~]# useradd oracle -g oinstall -G dba
[root@zabbix-agent-002 ~]# passwd oracle #修改oracle密码,或使用echo 123456 | passwd --stdin oracle修改密码
[root@zkdb pam.d]# mkdir -p /u01/app
[root@zkdb pam.d]# chown -R oracle:oinstall /u01/app
[root@zkdb pam.d]# chmod -R 775 /u01/app
[root@zkdb pam.d]# mkdir -p /u01/soft
[root@zkdb pam.d]# chown -R oracle:oinstall /u01/soft/
[root@zkdb pam.d]# chmod -R 775 /u01/soft
[oracle@zkdb root]$ xhost +
xhost: unable to open display ""
You have mail in /var/spool/mail/root
[oracle@zkdb root]$ DISPLAY=:0.0
[oracle@zkdb root]$ export DISPLAY
[oracle@zkdb root]$ echo $DISPLAY
:0.0
[oracle@zkdb root]$ xhost
access control enabled, only authorized clients can connect
SI:localuser:root
SI:localuser:oracle
[oracle@zkdb root]$ xhost +
access control disabled, clients can connect from any host
[oracle@zkdb root]$ su -l oracle
Password:
Last login: Mon Nov 6 14:30:27 CST 2023 on pts/2
[oracle@zkdb ~]$ export DISPLAY=:0.0
安装数据库
检查先决条件时出现软件包缺失,需补充安装依赖
将rpm文件放入/u01/soft路径,并在对应路径下运行安装。安装时发现依赖冲突,卸载冲突依赖后重新安装
#安装缺失依赖compat
[root@zkdb ~]# cd /u01/soft
[root@zkdb soft]# rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:compat-libstdc++-33-3.2.3-72.el7 ################################# [100%]
#安装缺失依赖pdksh,报错依赖冲突
[root@zkdb soft]# rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
warning: pdksh-5.2.14-37.el5_8.1.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID e8562897: NOKEY
error: Failed dependencies:
pdksh conflicts with (installed) ksh-20120801-142.el7.x86_64
#卸载冲突依赖
[root@zkdb soft]# rpm -e ksh-20120801-142.el7.x86_64
#重新安装
[root@zkdb soft]# rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
warning: pdksh-5.2.14-37.el5_8.1.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID e8562897: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:pdksh-5.2.14-37.el5_8.1 ################################# [100%]
安装时报错,需用root用户运行以下脚本
运行第二条脚本时出现以下提示
需输入:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
出现此结果则表示成功
[root@zkdb ~]# /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@zkdb ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/db_1
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 .../u01/app/oracle/product/11.2.0/db_1/install/utl/rootinstall.sh: line 24: [: too many arguments
/u01/app/oracle/product/11.2.0/db_1/install/utl/rootinstall.sh: line 29: [: too many arguments
/u01/app/oracle/product/11.2.0/db_1/install/utl/rootinstall.sh: line 57: [: too many arguments
Warning: Copying dbhome to /usr/local/bin ... is read only. No files will be copied.
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.
Finished product-specific root actions.
返回安装页面,点击OK,oracle安装成功。
配置监听
创建数据库