Oracle12C安装配置

这篇博客详细介绍了如何在RHEL7或CentOS7系统上安装配置Oracle12C数据库。首先,将安装包放在/tmp目录下,然后在图形界面下运行安装脚本。通过切换到oracle用户并执行安装程序,按照默认设置完成数据库的安装过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

系统使用rhel7/centos7/Oracle Linux Server release 7

数据库安装包上传到/tmp目录

  1. cd /tmp

  2. unzip Oracle_122010_Linux-x86-64.zip

需在图形界面下执行脚本和安装程序 

执行初始化

  1. #http://public-yum.oracle.com/getting-started.html#checking-yum-configuration

  2. echo -n "正在配置iptables防火墙……"

  3. systemctl stop firewalld > /dev/null 2>&1

  4. systemctl disable firewalld > /dev/null 2>&1

  5. if [ $? -eq 0 ];then

  6. echo -n "Iptables防火墙初始化完毕!"

  7. fi

  8.  
  9. echo -n "正在关闭SELinux……"

  10. setenforce 0 > /dev/null 2>&1

  11. sed -i '/^SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

  12. if [ $? -eq 0 ];then

  13. echo -n "SELinux初始化完毕!"

  14. fi

  15.  
  16.  
  17.  
  18. echo "进入yum配置文件夹,添加oracle的yum信息库"

  19.  
  20. wget http://public-yum.oracle.com/public-yum-ol7.repo -O /etc/yum.repos.d/public-yum-ol7.repo

  21.  
  22. echo "使用yum安装oracle预安装文件"

  23.  
  24. yum install -y oracle-rdbms-server-12cR1-preinstall.x86_64 --nogpgcheck

  25. sysctl -p

  26. sed -i 's@SELINUX=enforcing@SELINUX=disabled@g' /etc/selinux/config

  27. setenforce 0

  28.  
  29. mkdir -p /u01/app/oracle

  30. chown -R oracle:oinstall /u01/app/oracle

  31. chmod -R 775 /u01/app/oracle

  32. xhost +

  33.  
  34. chown -R oracle:oinstall /tmp/database

  35.  
  36.  
  37. cat <<EOF >/home/oracle/.bash_profile

  38. # .bash_profile

  39.  
  40. # Get the aliases and functions

  41. if [ -f ~/.bashrc ]; then

  42. . ~/.bashrc

  43. fi

  44.  
  45. # User specific environment and startup programs

  46. export ORACLE_SID=orcl

  47. export ORACLE_BASE=/u01/app/oracle

  48. export ORACLE_HOME=\$ORACLE_BASE/product/12.2.0/dbhome_1

  49. export PATH=\$PATH:\$ORACLE_HOME/bin

  50. export DISPLAY=:0

  51. export UMASK=022

  52.  
  53. export PATH

  54. EOF

  55.  
  56.  
  57.  
  58. chown -R 644 /home/oracle/.bash_profile

切换到oracle用户,su - oracle 开始安装数据库

  1. cd /tmp/database/

  2. ./runInstaller

下面的步骤按默认即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值