OpenEuler2203使用rpm方式安装Oracle19c的过程
安装介质
oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
oracle-database-ee-19c-1.0-1.x86_64.rpm
compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
compat-libcap1-1.10-7.el7.x86_64.rpm
处理过程
1. 首先从一个centos上面复制一个 redhat-release文件过来.
2. 安装必须要的一些组件, 除了上面说的. compat-libcap1,compat-libstdc++
还需要安装 yum install ksh* -y
yum install libnsl* -y
因为OpenEuler我安装的是非图形版还需要安装
yum localinstall xorg-x11-* -y
3. 安装preinstall
rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm --nodeps --force
修改参数配置文件以及脚本
vim /etc/init.d/oracledb_ORCLCDB-19c
# 修改部分内容如下:
export ORACLE_VERSION=19C
export ORACLE_SID=ORA19C
export TEMPLATE_NAME=General_Purpose.dbc
export CHARSET=ZHS16GBK
export PDB_NAME=ORA19CPDB
export LISTENER_NAME=LISTENER
export NUMBER_OF_PDBS=1
export CREATE_AS_CDB=true
修改默认值后的配置文件处理
cd /etc/sysconfig/
scp oracledb_ORCLCDB-19c.conf oracledb_ORA19C-19C.conf
需要手工创建部分配置内容
chown -R oracle:oinstall /opt/oracle
mkdir -p /opt/oracle/product/19c/dbhome_1
mkdir -p /opt/app/oracle/oradata/
mkdir /opt/oracle/oraInventory
touch /etc/oratab
chown oracle:oinstall /etc/oratab
Study From:
https://blog.csdn.net/lq2003/article/details/121339410
初始化数据库
/etc/init.d/oracledb_ORCLCDB-18c configure
时间可能比较漫长.
比如我这边的时间就如下:
real 16m35.316s
user 0m19.465s
sys 0m1.957s
增加环境变量
cat >/etc/profile.d/oracle.sh <<EOF
export ORACLE_SID=ORA19C
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin
export NLS_LANG="AMERICAN_AMERICA.UTF8"
EOF
设置system密码
su - oracle
sqlplus / as sysdba
alter user system identified by "Testxxxxxxxx" ;
设置开启CDB时自动打开PDB
CREATE TRIGGER open_all_pdbs
AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'alter pluggable database all open';
END open_all_pdbs;
/
设置开机自动启动
vim /etc/oratab
将里面 最后一句话设置从N 修改为Y 允许启动
ORA19C:/opt/oracle/product/19c/dbhome_1:Y
创建启动脚本
cat > /usr/bin/oracle.sh <<EOF
#! /bin/bash
# script For oracle19c.service
/opt/oracle/product/19c/dbhome_1/bin/lsnrctl start
/opt/oracle/product/19c/dbhome_1/bin/dbstart /opt/oracle/product/19c/dbhome_1
EOF
增加一个启动权限
chmod 777 /usr/bin/oracle.sh
创建oracle用户脚本,并且设置开机启动
cat > /deploy/startoracle.sh << EOF
su - oracle -c "/usr/bin/oracle.sh"
EOF
增加启动脚本
crontab -e
输入
@reboot /deploy/startoracle