平台测试需要安装 Oracle 19c 高版本,仅支持Centos7.5以上内核,低版本存在缺陷
Table of Contents
Toggle升级
- 升级内核
yum update -y
- 导入公钥
rpm –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
- 安装7.x版本的ELRepo
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
- 安装新版本内核
yum –enablerepo=elrepo-kernel install kernel-lt -y
- 重载内核配置
#vim /etc/default/grub
GRUB_DEFAULT=0
- 重启
reboot
- 运行环境
yum install bc binutils compat-libcap1 compat-libstdc++33 elfutils-libelf elfutils libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make smartmontools sysstat kmod*
安装
- 下载 Oracle 19c 安装包
- yum安装
yum localinstall -y oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
yum localinstall -y oracle-database-ee-19c-1.0-1.x86_64.rpm
- 应用默认配置
/etc/init.d/oracledb_ORCLCDB-19c configure
- 修改环境变量
su – oracle
vim .bash_profile
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin
export ORACLE_SID=ORCLCDB
- 确认服务和监听
lsnrctl start
sqlplus / as sysdba
startup
- 开端口
firewall-cmd –zone=public –list-ports
firewall-cmd –add-port=1521/tcp
- 调整安全组
- 切库
select con_id, dbid, guid, name , open_mode from v$pdbs;
alter pluggable database ORCLPDB1 open;
alter session set container=PDBORCL;
- 创建表空间用户赋权
mkdir -p /opt/oracle_dbs/MY_TEST
chown -R oracle:oinstall /opt/oracle_dbs/
CREATE TABLESPACE MY_TEST LOGGING DATAFILE ‘/opt/oracle_dbs/MY_TEST/MY_TEST.dbf’ SIZE 5000M AUTOEXTEND ON NEXT 500M MAXSIZE unlimited;
CREATE USER MY_TEST IDENTIFIED BY MY_123 DEFAULT TABLESPACE MY_TEST;
grant connect,resource,dba to MY_TEST;
grant create session to MY_TEST;
- Navicat远程连接
卸载
- 清除root下oracle环境变量
- 删除文件
rm -rf /opt/oracle/
rm -rf /usr/local/bin/coraenv
rm -rf /usr/local/bin/dbhome
rm -rf /usr/local/bin/oraenv
rm -f /etc/oratab
rm -f /etc/oraInst.loc
rm -rf /opt/ORCLfmap/
rm -rf /etc/init.d/ora*
- 重启解锁oracle用户
reboot
- 删除用户组
userdel -r oracle
groupdel dba
groupdel oinstall
- yum卸载
yum -y remove oracle-database-ee-19c
rpm -e –noscripts oracle-database-preinstall-19c-1.0-1.el7.x86_64
yum -y remove oracle-database-preinstall-19c
问题解决
shutdown immediate
startup
select name,open_mode from v$pdbs;
alter pluggable database ORCLPDB1 open;