• 售前

  • 售后

热门帖子
入门百科

CentOS7下Oracle19c rpm安装过程

[复制链接]
尘埃416 显示全部楼层 发表于 2021-8-14 14:41:28 |阅读模式 打印 上一主题 下一主题
            软件            下载地点                                    CentOS-7-x86_64-Minimal-2009.iso            http://mirrors.163.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso                            oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm            https://www.aliyundrive.com/s/F9ziMB6nPbp                            oracle-database-ee-19c-1.0-1.x86_64.rpm            https://www.aliyundrive.com/s/E6m5e8CCGq2        
一. 情况设置

​假造机安装发起分2G内存,30G硬盘。
关闭防火墙(或放行相干端口)
  1. systemctl stop firewalld
  2. systemctl disable firewalld
复制代码
关闭selinux
修改
  1. SELINUX=disabled
复制代码
  1. vi /etc/selinux/config
复制代码
  1. # This file controls the state of SELinux on the system.
  2. # SELINUX= can take one of these three values:
  3. #     enforcing - SELinux security policy is enforced.
  4. #     permissive - SELinux prints warnings instead of enforcing.
  5. #     disabled - No SELinux policy is loaded.
  6. SELINUX=disabled
  7. # SELINUXTYPE= can take one of three values:
  8. #     targeted - Targeted processes are protected,
  9. #     minimum - Modification of targeted policy. Only selected processes are protected.
  10. #     mls - Multi Level Security protection.
  11. SELINUXTYPE=targeted
复制代码
重启
  1. reboot
复制代码
  1. oracle-database-ee-19c-1.0-1.x86_64.rpm
复制代码
  1. oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
复制代码
上传到
  1. /opt
复制代码

二. 依靠安装

安装
  1. oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
复制代码
  1. yum -y localinstall /opt/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
复制代码

三. 安装设置Oracle 19c

安装Oracle 19c
  1. yum -y localinstall /opt/oracle-database-ee-19c-1.0-1.x86_64.rpm
复制代码
初始化Oracle数据库(时间较长)
  1. /etc/init.d/oracledb_ORCLCDB-19c configure
复制代码
设置情况变量
却换到
  1. oracle
复制代码
用户
  1. su - oracle
复制代码
添加情况变量
  1. vi /home/oracle/.bash_profile
复制代码
  1. # .bash_profile
  2. # Get the aliases and functions
  3. if [ -f ~/.bashrc ]; then
  4.         . ~/.bashrc
  5. fi
  6. # User specific environment and startup programs
  7. PATH=$PATH:$HOME/.local/bin:$HOME/bin
  8. export PATH
  9. export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
  10. export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin
  11. export ORACLE_SID=ORCLCDB
复制代码
使情况变量见效
  1. source /home/oracle/.bash_profile
复制代码
登岸数据库
  1. sqlplus / as sysdba
复制代码
修改
  1. system
复制代码
密码为
  1. 123456
复制代码
  1. alter user system identified by 123456;
复制代码
退出数据库
  1. exit;
复制代码
四. 设置数据库监听自启动

修改
  1. /etc/oratab
复制代码
文件
  1. N
复制代码
  1. Y
复制代码
  1. vi /etc/oratab
复制代码
  1. # This file is used by ORACLE utilities.  It is created by root.sh
  2. # and updated by either Database Configuration Assistant while creating
  3. # a database or ASM Configuration Assistant while creating ASM instance.
  4. # A colon, ':', is used as the field terminator.  A new line terminates
  5. # the entry.  Lines beginning with a pound sign, '#', are comments.
  6. #
  7. # Entries are of the form:
  8. #   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
  9. #
  10. # The first and second fields are the system identifier and home
  11. # directory of the database respectively.  The third field indicates
  12. # to the dbstart utility that the database should , "Y", or should not,
  13. # "N", be brought up at system boot time.
  14. #
  15. # Multiple entries with the same $ORACLE_SID are not allowed.
  16. #
  17. #
  18. ORCLCDB:/opt/oracle/product/19c/dbhome_1:Y
复制代码
  1. /etc/rc.local
复制代码
中添加需执行的下令
  1. su root # 却换为root用户
  2. vi /etc/rc.local
复制代码
  1. #!/bin/bash
  2. # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
  3. #
  4. # It is highly advisable to create own systemd services or udev rules
  5. # to run scripts during boot instead of using this file.
  6. #
  7. # In contrast to previous versions due to parallel execution during boot
  8. # this script will NOT be run after all other services.
  9. #
  10. # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
  11. # that this script will be executed during boot.
  12. touch /var/lock/subsys/local
  13. su - oracle -c 'lsnrctl start'
  14. su - oracle -c 'dbstart'
复制代码
修改
  1. $ORACLE_HOME/bin/dbstart
复制代码
文件,修改
  1. ORACLE_HOME_LISTNER=$ORACLE_HOME
复制代码
  1. vi $ORACLE_HOME/bin/dbstart
复制代码
$ORACLE_HOME/bin/dbstart 文件局部
  1. ...
  2. #####################################
  3. LOGMSG="logger -puser.alert -s "
  4. trap 'exit' 1 2 3
  5. # for script tracing
  6. case $ORACLE_TRACE in
  7.   T) set -x ;;
  8. esac
  9. # Set path if path not set (if called from /etc/rc)
  10. SAVE_PATH=/bin:/usr/bin:/etc:${PATH} ; export PATH
  11. SAVE_LLP=$LD_LIBRARY_PATH
  12. # First argument is used to bring up Oracle Net Listener
  13. ORACLE_HOME_LISTNER=$ORACLE_HOME
  14. if [ ! $ORACLE_HOME_LISTNER ]; then
  15.   echo "Since ORACLE_HOME is not set, cannot auto-start Oracle Net Listener."
  16.   echo "Usage: $0 ORACLE_HOME"
  17. else
  18. ...
复制代码
设置CentOS7,8开机执行
  1. /etc/rc.local
复制代码
文件(CentOS7,8开机不执行
  1. /etc/rc.local
复制代码
文件)
  1. /etc/rc.d/rc.local
复制代码
添加 可执行权限
  1. chmod a+x /etc/rc.d/rc.local
复制代码
将 rc-local 服务设置成开机启动(默认状态是 static,会被其他service服务调用执行。不外还是修改一下,以防那个服务被停用就牵连了)
  1. systemctl enable rc-local
复制代码
重启,用
  1. sqldeveloper
复制代码
链接,验证是否成功
  1. reboot
复制代码

删除
  1. /opt
复制代码
  1. oracle-database-ee-19c-1.0-1.x86_64.rpm
复制代码
  1. oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
复制代码
  1. rm /opt/oracle-database-ee-19c-1.0-1.x86_64.rpm /opt/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
复制代码
到此这篇关于CentOS7下Oracle19c rpm安装过程的文章就先容到这了,更多相干Oracle19c rpm安装内容请搜刮脚本之家从前的文章或继承浏览下面的相干文章盼望大家以后多多支持脚本之家!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

帖子地址: 

回复

使用道具 举报

分享
推广
火星云矿 | 预约S19Pro,享500抵1000!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

草根技术分享(草根吧)是全球知名中文IT技术交流平台,创建于2021年,包含原创博客、精品问答、职业培训、技术社区、资源下载等产品服务,提供原创、优质、完整内容的专业IT技术开发社区。
  • 官方手机版

  • 微信公众号

  • 商务合作