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

本文涉及的产品
容器镜像服务 ACR,镜像仓库100个 不限时长
简介: 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用户的环境变量就可以登录了。

相关文章
|
24天前
|
存储 Oracle 关系型数据库
数据库数据恢复—ORACLE常见故障的数据恢复方案
Oracle数据库常见故障表现: 1、ORACLE数据库无法启动或无法正常工作。 2、ORACLE ASM存储破坏。 3、ORACLE数据文件丢失。 4、ORACLE数据文件部分损坏。 5、ORACLE DUMP文件损坏。
79 11
|
2月前
|
Oracle 关系型数据库 数据库
Oracle数据恢复—Oracle数据库文件有坏快损坏的数据恢复案例
一台Oracle数据库打开报错,报错信息: “system01.dbf需要更多的恢复来保持一致性,数据库无法打开”。管理员联系我们数据恢复中心寻求帮助,并提供了Oracle_Home目录的所有文件。用户方要求恢复zxfg用户下的数据。 由于数据库没有备份,无法通过备份去恢复数据库。
|
2月前
|
存储 Oracle 关系型数据库
oracle数据恢复—Oracle数据库文件大小变为0kb的数据恢复案例
存储掉盘超过上限,lun无法识别。管理员重组存储的位图信息并导出lun,发现linux操作系统上部署的oracle数据库中有上百个数据文件的大小变为0kb。数据库的大小缩水了80%以上。 取出&并分析oracle数据库的控制文件。重组存储位图信息,重新导出控制文件中记录的数据文件,发现这些文件的大小依然为0kb。
|
30天前
|
存储 Oracle 关系型数据库
服务器数据恢复—华为S5300存储Oracle数据库恢复案例
服务器存储数据恢复环境: 华为S5300存储中有12块FC硬盘,其中11块硬盘作为数据盘组建了一组RAID5阵列,剩下的1块硬盘作为热备盘使用。基于RAID的LUN分配给linux操作系统使用,存放的数据主要是Oracle数据库。 服务器存储故障: RAID5阵列中1块硬盘出现故障离线,热备盘自动激活开始同步数据,在同步数据的过程中又一块硬盘离线,RAID5阵列瘫痪,上层LUN无法使用。
|
存储 Oracle 安全
Oracle开源三个容器工具
本文讲的是Oracle开源三个容器工具【编者的话】随着容器技术盛行,Oracle也开始在云服务中应用容器技术,在准备应用的同时,Oracle也开发了相关工具便于构建和维护容器。现在可以高兴的宣布,Oracle开发的这几款工具已经开源,希望能够帮到大家。
1411 0
|
3月前
|
存储 Oracle 关系型数据库
Oracle数据库的应用场景有哪些?
【10月更文挑战第15天】Oracle数据库的应用场景有哪些?
219 64
|
2月前
|
SQL Oracle 关系型数据库
Oracle数据库优化方法
【10月更文挑战第25天】Oracle数据库优化方法
57 7
|
2月前
|
Oracle 关系型数据库 数据库
oracle数据库技巧
【10月更文挑战第25天】oracle数据库技巧
35 6
|
2月前
|
存储 Oracle 关系型数据库
Oracle数据库优化策略
【10月更文挑战第25天】Oracle数据库优化策略
36 5
|
3月前
|
存储 Oracle 关系型数据库
数据库数据恢复—Oracle ASM磁盘组故障数据恢复案例
Oracle数据库数据恢复环境&故障: Oracle ASM磁盘组由4块磁盘组成。Oracle ASM磁盘组掉线 ,ASM实例不能mount。 Oracle数据库故障分析&恢复方案: 数据库数据恢复工程师对组成ASM磁盘组的磁盘进行分析。对ASM元数据进行分析发现ASM存储元数据损坏,导致磁盘组无法挂载。

推荐镜像

更多