前言

rpm安装方式比较简单

文档参考

1 2 3

准备

下载介质oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

下载安装包,并上传服务器 oracle-database-ee-19c-1.0-1.x86_64.rpm

关闭selinux和防火墙

[root@redhat ~]# sed -i  "s/SELINUX=enforcing/SELINUX=disabled/"  /etc/selinux/config
getenforce  getent      
[root@redhat ~]# getenforce 
Enforcing

[root@redhat ~]# systemctl  stop firewalld
[root@redhat ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@redhat oracle]# systemctl is-enabled firewalld.service
disabled

准备用户

groupadd oinstall
groupadd dba
useradd oracle -g oinstall -G dba

安装软件

[root@redhat oracle]# yum localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm 
Loaded plugins: aliases, changelog, langpacks, ovl, product-id, search-disabled-repos,
              : subscription-manager, tmprepo, verify, versionlock
This system is not registered with an entitlement server. You can use subscription-manager to register.
Examining oracle-database-ee-19c-1.0-1.x86_64.rpm: oracle-database-ee-19c-1.0-1.x86_64
Marking oracle-database-ee-19c-1.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-ee-19c.x86_64 0:1.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================
 Package                   Arch      Version    Repository                               Size
==============================================================================================
Installing:
 oracle-database-ee-19c    x86_64    1.0-1      /oracle-database-ee-19c-1.0-1.x86_64    6.9 G

Transaction Summary
==============================================================================================
Install  1 Package

Total size: 6.9 G
Installed size: 6.9 G
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : oracle-database-ee-19c-1.0-1.x86_64                                        1/1 
[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
  Verifying  : oracle-database-ee-19c-1.0-1.x86_64                                        1/1 

Installed:
  oracle-database-ee-19c.x86_64 0:1.0-1                                                       

Complete!

[root@redhat oracle]# yum localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm 
Loaded plugins: aliases, changelog, langpacks, ovl, product-id, search-disabled-repos,
              : subscription-manager, tmprepo, verify, versionlock
This system is not registered with an entitlement server. You can use subscription-manager to register.
Examining oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: oracle-database-preinstall-19c-1.0-1.el7.x86_64
Marking oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-preinstall-19c.x86_64 0:1.0-1.el7 will be installed
--> Processing Dependency: compat-libcap1 for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
--> Processing Dependency: compat-libstdc++-33 for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
--> Processing Dependency: glibc-devel for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
--> Processing Dependency: ksh for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
--> Processing Dependency: libaio-devel for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
--> Processing Dependency: libstdc++-devel for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
--> Running transaction check
---> Package compat-libcap1.x86_64 0:1.10-7.el7 will be installed
---> Package compat-libstdc++-33.x86_64 0:3.2.3-72.el7 will be installed
---> Package glibc-devel.x86_64 0:2.17-292.el7 will be installed
--> Processing Dependency: glibc-headers = 2.17-292.el7 for package: glibc-devel-2.17-292.el7.x86_64
--> Processing Dependency: glibc = 2.17-292.el7 for package: glibc-devel-2.17-292.el7.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-292.el7.x86_64
---> Package ksh.x86_64 0:20120801-140.el7_7 will be installed
---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
---> Package libstdc++-devel.x86_64 0:4.8.5-39.el7 will be installed
--> Processing Dependency: libstdc++(x86-64) = 4.8.5-39.el7 for package: libstdc++-devel-4.8.5-39.el7.x86_64
--> Running transaction check
---> Package glibc.x86_64 0:2.17-196.el7 will be updated
--> Processing Dependency: glibc = 2.17-196.el7 for package: glibc-common-2.17-196.el7.x86_64
---> Package glibc.x86_64 0:2.17-292.el7 will be an update
---> Package glibc-headers.x86_64 0:2.17-292.el7 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-292.el7.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-292.el7.x86_64
---> Package libstdc++.x86_64 0:4.8.5-16.el7 will be updated
---> Package libstdc++.x86_64 0:4.8.5-39.el7 will be an update
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-196.el7 will be updated
---> Package glibc-common.x86_64 0:2.17-292.el7 will be an update
---> Package kernel-headers.x86_64 0:3.10.0-1062.18.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================
 Package                        Arch   Version              Repository                   Size
==============================================================================================
Installing:
 oracle-database-preinstall-19c x86_64 1.0-1.el7            /oracle-database-preinstall-19c-1.0-1.el7.x86_64
                                                                                         55 k
Installing for dependencies:
 compat-libcap1                 x86_64 1.10-7.el7           base                         19 k
 compat-libstdc++-33            x86_64 3.2.3-72.el7         base                        191 k
 glibc-devel                    x86_64 2.17-292.el7         base                        1.1 M
 glibc-headers                  x86_64 2.17-292.el7         base                        687 k
 kernel-headers                 x86_64 3.10.0-1062.18.1.el7 updates                     8.8 M
 ksh                            x86_64 20120801-140.el7_7   updates                     884 k
 libaio-devel                   x86_64 0.3.109-13.el7       base                         13 k
 libstdc++-devel                x86_64 4.8.5-39.el7         base                        1.5 M
Updating for dependencies:
 glibc                          x86_64 2.17-292.el7         base                        3.6 M
 glibc-common                   x86_64 2.17-292.el7         base                         11 M
 libstdc++                      x86_64 4.8.5-39.el7         base                        305 k

Transaction Summary
==============================================================================================
Install  1 Package  (+8 Dependent packages)
Upgrade             ( 3 Dependent packages)

Total size: 29 M
Total download size: 29 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for base
warning: /var/cache/yum/x86_64/7Server/base/packages/compat-libcap1-1.10-7.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for compat-libcap1-1.10-7.el7.x86_64.rpm is not installed
(1/11): compat-libcap1-1.10-7.el7.x86_64.rpm                           |  19 kB  00:00:00     
(2/11): compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm                    | 191 kB  00:00:00     
(3/11): glibc-2.17-292.el7.x86_64.rpm                                  | 3.6 MB  00:00:00     
(4/11): glibc-devel-2.17-292.el7.x86_64.rpm                            | 1.1 MB  00:00:00     
(5/11): glibc-headers-2.17-292.el7.x86_64.rpm                          | 687 kB  00:00:00     
(6/11): glibc-common-2.17-292.el7.x86_64.rpm                           |  11 MB  00:00:00     
(7/11): libaio-devel-0.3.109-13.el7.x86_64.rpm                         |  13 kB  00:00:00     
(8/11): libstdc++-4.8.5-39.el7.x86_64.rpm                              | 305 kB  00:00:00     
(9/11): libstdc++-devel-4.8.5-39.el7.x86_64.rpm                        | 1.5 MB  00:00:00     
Public key for kernel-headers-3.10.0-1062.18.1.el7.x86_64.rpm is not installed
(10/11): kernel-headers-3.10.0-1062.18.1.el7.x86_64.rpm                | 8.8 MB  00:00:00     
(11/11): ksh-20120801-140.el7_7.x86_64.rpm                             | 884 kB  00:00:00     
----------------------------------------------------------------------------------------------
Total                                                          38 MB/s |  29 MB  00:00:00     
Retrieving key from http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 From       : http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
PackageKit-1.1.5-1.el7.x86_64 has missing requires of PackageKit-backend
  Updating   : glibc-common-2.17-292.el7.x86_64                                          1/15 
  Updating   : glibc-2.17-292.el7.x86_64                                                 2/15 
warning: /etc/nsswitch.conf created as /etc/nsswitch.conf.rpmnew
  Updating   : libstdc++-4.8.5-39.el7.x86_64                                             3/15 
  Installing : libstdc++-devel-4.8.5-39.el7.x86_64                                       4/15 
  Installing : compat-libstdc++-33-3.2.3-72.el7.x86_64                                   5/15 
  Installing : compat-libcap1-1.10-7.el7.x86_64                                          6/15 
  Installing : ksh-20120801-140.el7_7.x86_64                                             7/15 
  Installing : kernel-headers-3.10.0-1062.18.1.el7.x86_64                                8/15 
  Installing : glibc-headers-2.17-292.el7.x86_64                                         9/15 
  Installing : glibc-devel-2.17-292.el7.x86_64                                          10/15 
  Installing : libaio-devel-0.3.109-13.el7.x86_64                                       11/15 
  Installing : oracle-database-preinstall-19c-1.0-1.el7.x86_64                          12/15 
  Cleanup    : libstdc++-4.8.5-16.el7.x86_64                                            13/15 
  Cleanup    : glibc-common-2.17-196.el7.x86_64                                         14/15 
  Cleanup    : glibc-2.17-196.el7.x86_64                                                15/15 
  Verifying  : glibc-devel-2.17-292.el7.x86_64                                           1/15 
  Verifying  : compat-libstdc++-33-3.2.3-72.el7.x86_64                                   2/15 
  Verifying  : compat-libcap1-1.10-7.el7.x86_64                                          3/15 
  Verifying  : oracle-database-preinstall-19c-1.0-1.el7.x86_64                           4/15 
  Verifying  : glibc-2.17-292.el7.x86_64                                                 5/15 
  Verifying  : ksh-20120801-140.el7_7.x86_64                                             6/15 
  Verifying  : libaio-devel-0.3.109-13.el7.x86_64                                        7/15 
  Verifying  : glibc-common-2.17-292.el7.x86_64                                          8/15 
  Verifying  : kernel-headers-3.10.0-1062.18.1.el7.x86_64                                9/15 
  Verifying  : libstdc++-devel-4.8.5-39.el7.x86_64                                      10/15 
  Verifying  : glibc-headers-2.17-292.el7.x86_64                                        11/15 
  Verifying  : libstdc++-4.8.5-39.el7.x86_64                                            12/15 
  Verifying  : glibc-2.17-196.el7.x86_64                                                13/15 
  Verifying  : libstdc++-4.8.5-16.el7.x86_64                                            14/15 
  Verifying  : glibc-common-2.17-196.el7.x86_64                                         15/15 

Installed:
  oracle-database-preinstall-19c.x86_64 0:1.0-1.el7                                           

Dependency Installed:
  compat-libcap1.x86_64 0:1.10-7.el7              compat-libstdc++-33.x86_64 0:3.2.3-72.el7   
  glibc-devel.x86_64 0:2.17-292.el7               glibc-headers.x86_64 0:2.17-292.el7         
  kernel-headers.x86_64 0:3.10.0-1062.18.1.el7    ksh.x86_64 0:20120801-140.el7_7             
  libaio-devel.x86_64 0:0.3.109-13.el7            libstdc++-devel.x86_64 0:4.8.5-39.el7       

Dependency Updated:
  glibc.x86_64 0:2.17-292.el7                  glibc-common.x86_64 0:2.17-292.el7             
  libstdc++.x86_64 0:4.8.5-39.el7             

Complete!
[root@redhat oracle]# 

创建数据库

[root@redhat sysconfig]# /etc/init.d/oracledb_ORCLCDB-19c configure
Configuring Oracle Database ORCLCDB.
Prepare for db operation
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.

配置环境变量

[root@redhat ~]# su - oracle
Last login: Sun Mar 22 08:19:03 CST 2020 on pts/0     
[oracle@redhat ~]$ 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
[oracle@redhat ~]$ source .bash_profile

验证

[oracle@redhat ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sun Mar 22 08:31:33 2020
Version 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
SQL> 

更改密码

SQL> alter user system identified by 123456;

User altered.

SQL> 

使用sqldeveloper连接

20096-gevxiguuqxp.png
98284-lhhragbbs1.png

后续

1.关于一些自定义的配置文件项没搞明白