Oracle 19C RPM安装及创建非容器数据库

简介: Oracle 19c rpm安装及创建非容器数据库

1 安装oracle-database-preinstall包

    使用rpm安装Oracle 19c 之前需要安装oracle-database-preinstall包,这个包完成了以前安装时需要手动执行的准备工作,包括以下几项:

    自动下载安装grid和数据库安装需要的软件包。

    创建oracle用户和oinstall、dba组

    设置sysctl.conf、系统启动参数和驱动器参数

    设置软硬资源限制

    根据内核版本设置其它参数

    Linux x86_64 机器上再核心中设置numa=off

   在安装这个preinstall包时,遇到了依赖错误。

[root@localhost ~]# rpm -ivh  oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpmwarning: oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
        compat-libcap1 is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        glibc-devel is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        ksh is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        libaio-devel is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        libstdc++-devel is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        nfs-utils is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        psmisc is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        xorg-x11-utils is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        xorg-x11-xauth is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64

 安装以下上面列出的依赖包

[root@localhost ~]# yum install compat-libcap1 glibc-devel libaio-devel libstdc++-devel nfs-utils psmisc xorg-x11-utils  xorg-x11-xauthInstalled:
  compat-libcap1.x86_64 0:1.10-7.el7      glibc-devel.x86_64 0:2.17-326.el7_9   libaio-devel.x86_64 0:0.3.109-13.el7
  libstdc++-devel.x86_64 0:4.8.5-44.el7   nfs-utils.x86_64 1:1.3.0-0.68.el7.2   psmisc.x86_64 0:22.20-17.el7
  xorg-x11-utils.x86_64 0:7.5-23.el7      xorg-x11-xauth.x86_64 1:1.0.9-1.el7
Dependency Installed:
  glibc-headers.x86_64 0:2.17-326.el7_9                         gssproxy.x86_64 0:0.7.0-30.el7_9
  kernel-headers.x86_64 0:3.10.0-1160.83.1.el7                  keyutils.x86_64 0:1.5.8-3.el7
  libICE.x86_64 0:1.0.9-9.el7                                   libSM.x86_64 0:1.2.2-2.el7
  libX11.x86_64 0:1.6.7-4.el7_9                                 libX11-common.noarch 0:1.6.7-4.el7_9
  libXau.x86_64 0:1.0.8-2.1.el7                                 libXext.x86_64 0:1.3.3-3.el7
  libXi.x86_64 0:1.7.9-1.el7                                    libXinerama.x86_64 0:1.1.3-2.1.el7
  libXmu.x86_64 0:1.1.2-2.el7                                   libXrandr.x86_64 0:1.5.1-2.el7
  libXrender.x86_64 0:0.9.10-1.el7                              libXt.x86_64 0:1.1.5-3.el7
  libXtst.x86_64 0:1.2.3-1.el7                                  libXv.x86_64 0:1.0.11-1.el7
  libXxf86dga.x86_64 0:1.1.4-2.1.el7                            libXxf86misc.x86_64 0:1.0.3-7.1.el7
  libXxf86vm.x86_64 0:1.1.4-1.el7                               libbasicobjects.x86_64 0:0.1.1-32.el7
  libcollection.x86_64 0:0.7.0-32.el7                           libdmx.x86_64 0:1.1.3-3.el7
  libevent.x86_64 0:2.0.21-4.el7                                libini_config.x86_64 0:1.3.1-32.el7
  libnfsidmap.x86_64 0:0.25-19.el7                              libpath_utils.x86_64 0:0.2.1-32.el7
  libref_array.x86_64 0:0.1.5-32.el7                            libverto-libevent.x86_64 0:0.2.5-4.el7
  libxcb.x86_64 0:1.13-1.el7
Dependency Updated:
  glibc.x86_64 0:2.17-326.el7_9                           glibc-common.x86_64 0:2.17-326.el7_9
Complete!

再次安装preinstall包

[root@localhost ~]# rpm -ivh  oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpm                                       warning: oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEYerror: Failed dependencies:
        ksh is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64

ksh这个依赖包可以不装的,装一下也可以

[root@localhost ~]# yum install kshInstalled:
  ksh.x86_64 0:20120801-144.el7_9
Complete!

再次安装

[root@localhost ~]# rpm -ivh  oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpmwarning: oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]Updating / installing...
1:oracle-database-preinstall-19c-1.################################# [100%]

检查以下包安装以后的效果

[root@localhost ~]# sysctl -p   fs.file-max =6815744   kernel.sem =25032000100128   kernel.shmmni =4096   kernel.shmall =1073741824   kernel.shmmax =4398046511104   kernel.panic_on_oops =1   net.core.rmem_default =262144   net.core.rmem_max =4194304   net.core.wmem_default =262144   net.core.wmem_max =1048576   net.ipv4.conf.all.rp_filter =2   net.ipv4.conf.default.rp_filter =2   fs.aio-max-nr =1048576   net.ipv4.ip_local_port_range =900065500

sysctl参数已经更改并且生效,看一下sysctl.conf文件的内容

[root@localhost etc]# cat sysctl.conf# sysctl settings are defined through files in# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.## Vendors settings live in /usr/lib/sysctl.d/.# To override a whole file, create a new file with the same in# /etc/sysctl.d/ and put new settings there. To override# only specific settings, add a file with a lexically later# name in /etc/sysctl.d/ and put new settings there.## For more information, see sysctl.conf(5) and sysctl.d(5).# oracle-database-preinstall-19c setting for fs.file-max is 6815744   fs.file-max =6815744# oracle-database-preinstall-19c setting for kernel.sem is '250 32000 100 128'   kernel.sem =25032000100128# oracle-database-preinstall-19c setting for kernel.shmmni is 4096   kernel.shmmni =4096# oracle-database-preinstall-19c setting for kernel.shmall is 1073741824 on x86_64   kernel.shmall =1073741824# oracle-database-preinstall-19c setting for kernel.shmmax is 4398046511104 on x86_64   kernel.shmmax =4398046511104# oracle-database-preinstall-19c setting for kernel.panic_on_oops is 1 per Orabug 19212317   kernel.panic_on_oops =1# oracle-database-preinstall-19c setting for net.core.rmem_default is 262144   net.core.rmem_default =262144# oracle-database-preinstall-19c setting for net.core.rmem_max is 4194304   net.core.rmem_max =4194304# oracle-database-preinstall-19c setting for net.core.wmem_default is 262144   net.core.wmem_default =262144# oracle-database-preinstall-19c setting for net.core.wmem_max is 1048576   net.core.wmem_max =1048576# oracle-database-preinstall-19c setting for net.ipv4.conf.all.rp_filter is 2   net.ipv4.conf.all.rp_filter =2# oracle-database-preinstall-19c setting for net.ipv4.conf.default.rp_filter is 2   net.ipv4.conf.default.rp_filter =2# oracle-database-preinstall-19c setting for fs.aio-max-nr is 1048576   fs.aio-max-nr =1048576# oracle-database-preinstall-19c setting for net.ipv4.ip_local_port_range is 9000 65500   net.ipv4.ip_local_port_range =900065500

oracle-database-preinstall-19c设置的值都有注释

2 使用rpm包安装数据库

[root@localhost ~]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm    warning: oracle-database-ee-19c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
    Preparing...                          ################################# [100%]    Updating / installing...
1:oracle-database-ee-19c-1.0-1     ################################# [100%]    [INFO] Executing post installation scripts...
    [INFO] Oracle home installed successfully and ready to be configured.
    To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure

安装后提示创建实例数据库的命令,运行这条命令可以创建一个示例数据库

[root@localhost init.d]# pwd/etc/init.d
[root@localhost init.d]# ./oracledb_ORCLCDB-19c configureConfiguring Oracle Database ORCLCDB.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log"for further details.
Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user.

3 登录创建的示例数据库

登陆前需要设置以下oracle的环境变量,主要是下面三个

[oracle@localhost ~]$ exportORACLE_SID=ORCLCDB
[oracle@localhost ~]$ exportORACLE_HOME=/opt/oracle/product/19c/dbhome_1  ##这里不能加反斜线[oracle@localhost ~]$ exportPATH=$PATH:$ORACLE_HOME/bin

设置完之后就可以登录数据库了

[oracle@localhost dbhome_1]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jan 2722:06:13 2023Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
------------------------------------------------------------2 PDB$SEED                       READ ONLY  NO
3 ORCLPDB1                       READ WRITE NO

可以看出,这个示例数据库是容器数据库。

4 创建非容器数据库

     Oracle 19c rpm安装后配置的示例数据库是容器数据库,大部分系统中使用的还是以前的非容器数据库。在安装完rpm包后,可以使用dbca根据自己的需要创建数据库了,创建之前,先删除已经创建的示例数据库。

[root@localhost init.d]# ./oracledb_ORCLCDB-19c delete         Detecting existing Listeners...
         Deleting Oracle Listener....
         Detecting existing Oracle Databases...
         Deleting Oracle Database ORCLCDB.
         [WARNING] [DBT-19202] The Database Configuration Assistant will delete the Oracle instances and datafiles for your database. All information in the database will be destroyed.
         Prepare for db operation
32% complete
         Connecting to database
35% complete
39% complete
42% complete
45% complete
48% complete
52% complete
65% complete
         Updating network configuration files
68% complete
         Deleting instance and datafiles
84% complete
100% complete
         Database deletion completed.
         Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB0.log"for further details.

     编辑一个响应文件,响应文件里大部分参数都有默认值,这里使用的响应文件如下

[oracle@dbserver ~]$ cat dbca.rsp
################################################################################                                                                          ####                            DBCA response file                            ####                            ------------------                            #### Copyright(c) Oracle Corporation 1998,2019. All rights reserved.         ####                                                                          #### Specify values for the variables listed below to customize                       #### your installation.                                                               ####                                                                                  #### Each variable is associated with a comment. The comment                          #### can help to populate the variables with the appropriate                          #### values.                                                                          ####                                                                                      #### IMPORTANT NOTE: This file contains plain text passwords and                          #### should be secured to have read permission only by oracle user                        #### or db administrator who owns this installation.                                      #################################################################################-------------------------------------------------------------------------------# Do not change the following system generated value.#-------------------------------------------------------------------------------responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0
#-----------------------------------------------------------------------------# Name          : gdbName# Datatype      : String# Description   : Global database name of the database# Valid values  : <db_name>.<db_domain> - when database domain isn't NULL#                 <db_name>             - when database domain is NULL# Default value : None# Mandatory     : Yes#-----------------------------------------------------------------------------gdbName=ORCL
templateName=/opt/oracle/product/19c/dbhome_1/assistants/dbca/templates/General_Purpose.dbc
sysPassword=system123
systemPassword=system123
datafileDestination=characterSet=UTF8

使用dbca创建数据库

[oracle@dbserver ~]$ dbca-silent-createDatabase-responseFile /home/oracle/dbca.rsp
      [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
         CAUSE:
      a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
      b.The password entered is a keyword that Oracle does not recommend to be used as password
         ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
      [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
         CAUSE:
      a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
      b.The password entered is a keyword that Oracle does not recommend to be used as password
         ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
      Prepare for db operation
10% complete
      Copying database files
40% complete
      Creating and starting Oracle instance
42% complete
46% complete
50% complete
54% complete
60% complete
      Completing Database Creation
66% complete
69% complete
70% complete
      Executing Post Configuration Actions
100% complete
      Database creation complete. For details check the logfiles at:
       /opt/oracle/cfgtoollogs/dbca/ORCL.
      Database Information:
      Global Database Name:ORCL
      System Identifier(SID):ORCL
      Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCL/ORCL.log"for further details.

数据库创建成功后,设置以下oracle用户的环境变量就可以登录了。

相关文章
|
5月前
|
Oracle 关系型数据库 Linux
【赵渝强老师】Oracle数据库配置助手:DBCA
Oracle数据库配置助手(DBCA)是用于创建和配置Oracle数据库的工具,支持图形界面和静默执行模式。本文介绍了使用DBCA在Linux环境下创建数据库的完整步骤,包括选择数据库操作类型、配置存储与网络选项、设置管理密码等,并提供了界面截图与视频讲解,帮助用户快速掌握数据库创建流程。
492 93
|
4月前
|
Oracle 关系型数据库 Linux
【赵渝强老师】使用NetManager创建Oracle数据库的监听器
Oracle NetManager是数据库网络配置工具,用于创建监听器、配置服务命名与网络连接,支持多数据库共享监听,确保客户端与服务器通信顺畅。
291 0
|
7月前
|
存储 Oracle 关系型数据库
服务器数据恢复—光纤存储上oracle数据库数据恢复案例
一台光纤服务器存储上有16块FC硬盘,上层部署了Oracle数据库。服务器存储前面板2个硬盘指示灯显示异常,存储映射到linux操作系统上的卷挂载不上,业务中断。 通过storage manager查看存储状态,发现逻辑卷状态失败。再查看物理磁盘状态,发现其中一块盘报告“警告”,硬盘指示灯显示异常的2块盘报告“失败”。 将当前存储的完整日志状态备份下来,解析备份出来的存储日志并获得了关于逻辑卷结构的部分信息。
|
5月前
|
Ubuntu 安全 关系型数据库
安装与配置MySQL 8 on Ubuntu,包括权限授予、数据库备份及远程连接指南
以上步骤提供了在Ubuntu上从头开始设置、配置、授权、备份及恢复一个基础但完整的MySQL环境所需知识点。
582 7
|
5月前
|
SQL Oracle 关系型数据库
Oracle数据库创建表空间和索引的SQL语法示例
以上SQL语法提供了一种标准方式去组织Oracle数据库内部结构,并且通过合理使用可以显著改善查询速度及整体性能。需要注意,在实际应用过程当中应该根据具体业务需求、系统资源状况以及预期目标去合理规划并调整参数设置以达到最佳效果。
407 8
|
7月前
|
SQL Oracle 关系型数据库
比较MySQL和Oracle数据库系统,特别是在进行分页查询的方法上的不同
两者的性能差异将取决于数据量大小、索引优化、查询设计以及具体版本的数据库服务器。考虑硬件资源、数据库设计和具体需求对于实现优化的分页查询至关重要。开发者和数据库管理员需要根据自身使用的具体数据库系统版本和环境,选择最合适的分页机制,并进行必要的性能调优来满足应用需求。
383 11
|
10月前
|
Ubuntu 关系型数据库 Linux
Linux数据库安装
本文介绍了在CentOS 8.0和Ubuntu 22.04系统上安装、配置和启动MariaDB数据库服务器的详细步骤。包括通过`yum`和`apt`包管理器安装MariaDB服务,启动并检查服务运行状态,设置root用户密码以及连接数据库的基本操作。此外,还展示了如何在Ubuntu上更新软件包列表、安装依赖项,并验证MariaDB的版本和运行状态。通过这些步骤,用户可以成功部署并初始化MariaDB环境,为后续数据库管理与应用开发奠定基础。
516 61
|
9月前
|
SQL 关系型数据库 MySQL
MySQL下载安装全攻略!小白也能轻松上手,从此数据库不再难搞!
这是一份详细的MySQL安装与配置教程,适合初学者快速上手。内容涵盖从下载到安装的每一步操作,包括选择版本、设置路径、配置端口及密码等。同时提供基础操作指南,如数据库管理、数据表增删改查、用户权限设置等。还介绍了备份恢复、图形化工具使用和性能优化技巧,帮助用户全面掌握MySQL的使用方法。附带常见问题解决方法,保姆级教学让你无忧入门!
1198 21
MySQL下载安装全攻略!小白也能轻松上手,从此数据库不再难搞!
|
7月前
|
Oracle 关系型数据库 数据库
数据库数据恢复—服务器异常断电导致Oracle数据库报错的数据恢复案例
Oracle数据库故障: 某公司一台服务器上部署Oracle数据库。服务器意外断电导致数据库报错,报错内容为“system01.dbf需要更多的恢复来保持一致性”。该Oracle数据库没有备份,仅有一些断断续续的归档日志。 Oracle数据库恢复流程: 1、检测数据库故障情况; 2、尝试挂起并修复数据库; 3、解析数据库文件; 4、导出并验证恢复的数据库文件。
|
7月前
|
存储 Oracle 关系型数据库
【赵渝强老师】Oracle RMAN的目录数据库
Oracle RMAN默认将备份元信息存储在控制文件中,但控制文件损坏或丢失会导致恢复失败,且备份增多会使控制文件无限增长。为解决这些问题,Oracle引入了RMAN目录数据库(Catalog Database),专门用于存储RMAN备份的元信息。使用目录数据库可提升备份管理效率,支持多数据库共享、长期备份历史记录存储,并可保存RMAN脚本。本文详细介绍了如何创建目录数据库、注册目标数据库及其操作步骤。
229 0

推荐镜像

更多