[Oracle18c installation-1] centos7 + oracle18c installation

I always thought that the installation of oracle18c is similar to the previous 11g. Recently, the pit has been stepped on a large scale. This time I summarized it. This article tries to write out all the pits I encountered.

! ! ! ! ! ! ! ! ! ! ! Explanation of some problems! ! ! ! ! ! ! ! ! ! !
1. Here we mainly discuss the silent installation (-silent) method.
2. RPM installation, after testing and data search, it is impossible to modify the default installation path. That is to say, if your default installation path seems to be /opt, you are not sure. If the space is not enough, it is recommended to use the ones described in this article. The way to modify the installation path.
3. If you want to modify the default installation path (install to the specified path), you can only do so by downloading the zip installation package.

The process is roughly as follows:

  1. Determine whether the system meets the requirements
  2. Download the zip installation package of oracle18c
  3. Install dependencies
  4. Configure the oracle installation path and user
  5. Configure environment variables
  6. installation
  7. test

Before starting, let's briefly introduce how to install oracle. There are two common installation methods, one is installed under the graphical interface, and the other is installed on the command line. There are many tutorials for graphical interface installation, mainly to pay attention to the coding method and dependent package issues. This article mainly uses the command line to install silently.

Determine whether the system meets the requirements

Generally the default is to meet the requirements, the specific requirements are as follows:

  • For RHEL 7 system, 18.3C requires operating system version higher than 3.10.0-123.el7.x86_64 or higher.

  • The physical memory and swap partition cannot be less than 8G, otherwise a warning will be reported before the installation.

Install dependencies

Install dependent packages as root

yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc  gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp

#以下,如果是准备默认将oracle安装到opt,可以使用preinstall.rpm,特别是进行RPM安装,需要这一步,就不用自己创建oracle用户和组了,preinstall都提前创建好。单是zip包的同学们还是跳过,手动创建一下比较好。

# 安装依赖包 oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm。curl下载,yum安装
#curl -o oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm

#yum -y localinstall oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
#也有说结束后/opt 下自动生成 oracle目录 并且 系统自动创建oracle user 和oinstall group,理论上是这样,但是没有具体测试 可参考: https://blog.csdn.net/qq_39908296/article/details/84961251?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

# 检查安装是否完整
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 | grep "not installed"

Pay special attention to this package here: pdksh, it may be prompted that it has been installed, but it is not actually pdksh, which will cause the problem of missing packages. It needs to be downloaded separately. It looks like ksh (not sure). After uninstalling, install , At this point, the relevant packages are completely installed.

Configure the oracle installation path and user

New oracle user and user group
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
modify password

passwd oracle

配置本机IP映射

vi /etc/hosts
192.168.154.154 oracledb

Create the oracle installation directory. Install oracle here to the specified directory /home/oracle user space

mkdir  /home/oracle/app/product/18c/dbhome_1
mkdir /home/oracle/data
mkdir /home/oracle/fast_recovery_area

#安装过程的日志空间,没发现怎么修改,只好默认,但是需要自己创建
mkdir /opt/oracle/oraInventory
mkdir /opt/oracle/oraInventory/logs

chown -R oracle:oinstall /opt/oracle/

cd /opt/oracle/oraInventory
#在目录下建立.loc文件
vi oraInst.loc
#输入
inventory_loc=/opt/oracle/oraInventory
inst_group=oinstall

Configure oracle environment variables

vi /etc/profile
# 修改环境变量,在结尾处添加.
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=/home/oracle/app/product/18c/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

Move the zip installation package to the ORACLE_HOME directory, and unzip it in this directory. This is a must. The file must be decompressed here, otherwise it cannot be installed. This is a feature of oracle18.

Here, the directory we use is: /home/oracle/app/product/18c/dbhome_1

Modify the rsp file. There are too many stickers here. For specific instructions, please refer to the following link:
Under the /home/oracle/app/product/18c/dbhome_1/install/respose/ directory
https://blog.csdn.net/yinzhipeng123/ article/details/53141950
Insert picture description hereInsert picture description hereInsert picture description here
Insert picture description hereInsert picture description here

vi /etc/profile
# 修改环境变量,在结尾处添加.
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=/home/oracle/app/product/18c/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

installation

Turn off SElinux and firewall before installation. The specific optimization configuration will be discussed later, otherwise there will be too much content.

vim /etc/selinux/config

SELINUX=disabled 

#关闭防火墙
systemctl stop firewalld.service
sudo systemctl disable firewalld.service

#切换到oracle用户 
su - oracle 

#安装rpm文件 
cd /home/oracle/app/product/18c/dbhome_1
./runInstaller -silent -responseFile install/response/db_install.rsp

You can officially start the installation.

test

The sqlplus command should be available, try to log in to the database, create a user, etc.

I don’t know how to write an operation manual. If you have any questions, please leave a message and discuss together.

Guess you like

Origin blog.csdn.net/u010472858/article/details/104725574