Oracle Database Express 18.4版本:敏捷的二步安装法

  • 2020 年 3 月 27 日
  • 筆記

可能有些朋友还不知道,Oracle 推出了完全免费的 Express 版本,虽然存在一些功能限制,但是这个版本是完全免费的,只要你需要,可以随意适用。

可能有些朋友还不知道,Oracle 推出了完全免费的 Express 版本,虽然存在一些功能限制,但是这个版本是完全免费的,只要你需要,可以随意适用。

现在,Oracle 也将这个版本的安装简化到了极致。 安装这个版本,你只需要两个步骤:

  1. 第一:安装preinstall安装包
  2. 第二:安装数据库软件包

两者都简约到极致,第一步,下载安装预需求包:

curl -o oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm  yum -y localinstall oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm

第二步,安装数据库软件包,从 OTN 直接抓取软件,你不需要帐号,不需要登录:

yum -y install https://download.oracle.com/otn-pub/otn_software/db-express/oracle-database-xe-18c-1.0-1.x86_64.rpm

一些基本的输出如下:

[root@enmodb1 ~]# cat /etc/redhat-release  CentOS Linux release 7.2.1511 (Core)  [root@enmodb1 ~]# curl -o oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                   Dload  Upload   Total   Spent    Left  Speed  100 18244  100 18244    0     0   6888      0  0:00:02  0:00:02 --:--:--  6889  [root@enmodb1 ~]# yum -y localinstall oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm  Loaded plugins: fastestmirror  Examining oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm: oracle-database-preinstall-18c-1.0-1.el7.x86_64  Marking oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm to be installed  Resolving Dependencies  --> Running transaction check  ---> Package oracle-database-preinstall-18c.x86_64 0:1.0-1.el7 will be installed  --> Processing Dependency: compat-libcap1 for package: oracle-database-preinstall-18c-1.0-1.el7.x86_64  Loading mirror speeds from cached hostfile   * base: mirrors.cqu.edu.cn   * epel: mirrors.yun-idc.com   * extras: mirrors.cqu.edu.cn   * updates: mirrors.cqu.edu.cn  --> Processing Dependency: compat-libstdc++-33 for package: oracle-database-preinstall-18c-1.0-1.el7.x86_64  --> Processing Dependency: ksh for package: oracle-database-preinstall-18c-1.0-1.el7.x86_64  --> Processing Dependency: xorg-x11-utils for package: oracle-database-preinstall-18c-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 ksh.x86_64 0:20120801-139.el7 will be installed  ---> Package xorg-x11-utils.x86_64 0:7.5-23.el7 will be installed  --> Processing Dependency: libdmx.so.1()(64bit) for package: xorg-x11-utils-7.5-23.el7.x86_64  --> Processing Dependency: libXxf86dga.so.1()(64bit) for package: xorg-x11-utils-7.5-23.el7.x86_64  --> Processing Dependency: libXv.so.1()(64bit) for package: xorg-x11-utils-7.5-23.el7.x86_64  --> Running transaction check  ---> Package libXv.x86_64 0:1.0.11-1.el7 will be installed  ---> Package libXxf86dga.x86_64 0:1.1.4-2.1.el7 will be installed  ---> Package libdmx.x86_64 0:1.1.3-3.el7 will be installed  --> Finished Dependency Resolution    Dependencies Resolved    ======================================================================================================================================================   Package                                 Arch            Version                      Repository                                                 Size  ======================================================================================================================================================  Installing:   oracle-database-preinstall-18c          x86_64          1.0-1.el7                    /oracle-database-preinstall-18c-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   ksh                                     x86_64          20120801-139.el7             base                                                      885 k   libXv                                   x86_64          1.0.11-1.el7                 base                                                       18 k   libXxf86dga                             x86_64          1.1.4-2.1.el7                base                                                       19 k   libdmx                                  x86_64          1.1.3-3.el7                  base                                                       16 k   xorg-x11-utils                          x86_64          7.5-23.el7                   base                                                      114 k    Transaction Summary  ======================================================================================================================================================  Install  1 Package (+7 Dependent packages)    Total size: 1.3 M  Total download size: 1.2 M  Installed size: 4.3 M  Downloading packages:  (1/7): compat-libcap1-1.10-7.el7.x86_64.rpm                                                                                    |  19 kB  00:00:00  (2/7): compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm                                                                             | 191 kB  00:00:00  (3/7): libXv-1.0.11-1.el7.x86_64.rpm                                                                                           |  18 kB  00:00:00  (4/7): libXxf86dga-1.1.4-2.1.el7.x86_64.rpm                                                                                    |  19 kB  00:00:00  (5/7): ksh-20120801-139.el7.x86_64.rpm                                                                                         | 885 kB  00:00:00  (6/7): libdmx-1.1.3-3.el7.x86_64.rpm                                                                                           |  16 kB  00:00:00  (7/7): xorg-x11-utils-7.5-23.el7.x86_64.rpm                                                                                    | 114 kB  00:00:00  ------------------------------------------------------------------------------------------------------------------------------------------------------  Total                                                                                                                 1.5 MB/s | 1.2 MB  00:00:00  Running transaction check  Running transaction test  Transaction test succeeded  Running transaction    Installing : compat-libcap1-1.10-7.el7.x86_64                                                                                                   1/8    Installing : compat-libstdc++-33-3.2.3-72.el7.x86_64                                                                                            2/8    Installing : libXxf86dga-1.1.4-2.1.el7.x86_64                                                                                                   3/8    Installing : libXv-1.0.11-1.el7.x86_64                                                                                                          4/8    Installing : ksh-20120801-139.el7.x86_64                                                                                                        5/8    Installing : libdmx-1.1.3-3.el7.x86_64                                                                                                          6/8    Installing : xorg-x11-utils-7.5-23.el7.x86_64                                                                                                   7/8    Installing : oracle-database-preinstall-18c-1.0-1.el7.x86_64                                                                                    8/8    Verifying  : libdmx-1.1.3-3.el7.x86_64                                                                                                          1/8    Verifying  : ksh-20120801-139.el7.x86_64                                                                                                        2/8    Verifying  : libXv-1.0.11-1.el7.x86_64                                                                                                          3/8    Verifying  : oracle-database-preinstall-18c-1.0-1.el7.x86_64                                                                                    4/8    Verifying  : libXxf86dga-1.1.4-2.1.el7.x86_64                                                                                                   5/8    Verifying  : compat-libstdc++-33-3.2.3-72.el7.x86_64                                                                                            6/8    Verifying  : xorg-x11-utils-7.5-23.el7.x86_64                                                                                                   7/8    Verifying  : compat-libcap1-1.10-7.el7.x86_64                                                                                                   8/8    Installed:    oracle-database-preinstall-18c.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   ksh.x86_64 0:20120801-139.el7        libXv.x86_64 0:1.0.11-1.el7    libXxf86dga.x86_64 0:1.1.4-2.1.el7   libdmx.x86_64 0:1.1.3-3.el7                 xorg-x11-utils.x86_64 0:7.5-23.el7    Complete!

安装数据库:

[root@enmodb1 ~]# yum -y install https://download.oracle.com/otn-pub/otn_software/db-express/oracle-database-xe-18c-1.0-1.x86_64.rpm  Loaded plugins: fastestmirror  oracle-database-xe-18c-1.0-1.x86_64.rpm                                                                                        | 2.3 GB  00:33:09  Examining /var/tmp/yum-root-EsjN01/oracle-database-xe-18c-1.0-1.x86_64.rpm: oracle-database-xe-18c-1.0-1.x86_64  Marking /var/tmp/yum-root-EsjN01/oracle-database-xe-18c-1.0-1.x86_64.rpm to be installed  Resolving Dependencies  --> Running transaction check  ---> Package oracle-database-xe-18c.x86_64 0:1.0-1 will be installed  --> Finished Dependency Resolution    Dependencies Resolved    ======================================================================================================================================================   Package                                 Arch                    Version                  Repository                                             Size  ======================================================================================================================================================  Installing:   oracle-database-xe-18c                  x86_64                  1.0-1                    /oracle-database-xe-18c-1.0-1.x86_64                  5.2 G    Transaction Summary  ======================================================================================================================================================  Install  1 Package    Total size: 5.2 G  Installed size: 5.2 G  Downloading packages:  Running transaction check  Running transaction test  Transaction test succeeded  Running transaction    Installing : oracle-database-xe-18c-1.0-1.x86_64                                                                                                1/1  [INFO] Executing post installation scripts...  [INFO] Oracle home installed successfully and ready to be configured.  To configure Oracle Database XE, optionally modify the parameters in '/etc/sysconfig/oracle-xe-18c.conf' and then execute '/etc/init.d/oracle-xe-18c configure' as root.    Verifying  : oracle-database-xe-18c-1.0-1.x86_64                                                                                                1/1    Installed:    oracle-database-xe-18c.x86_64 0:1.0-1    Complete!

配置数据库:

[root@enmodb1 ~]# /etc/init.d/oracle-xe-18c configure  Specify a password to be used for database accounts. 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]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:  Confirm the password:  Configuring Oracle Listener.  Listener configuration succeeded.  Configuring Oracle Database XE.  Enter SYS user password:  ***********  Enter SYSTEM user password:  ************  Enter PDBADMIN User Password:  **********  Prepare for db operation  7% complete  Copying database files  29% complete  Creating and starting Oracle instance  30% complete  31% complete  34% complete    38% complete  41% complete  43% complete  Completing Database Creation  47% complete  50% complete  Creating Pluggable Databases  54% complete  71% complete  Executing Post Configuration Actions  93% complete  Running Custom Scripts  100% complete  Database creation complete. For details check the logfiles at:   /opt/oracle/cfgtoollogs/dbca/XE.  Database Information:  Global Database Name:XE  System Identifier(SID):XE  Look at the log file "/opt/oracle/cfgtoollogs/dbca/XE/XE.log" for further details.    Connect to Oracle Database using one of the connect strings:       Pluggable database: enmodb1/XEPDB1       Multitenant container database: enmodb1  Use https://localhost:5500/em to access Oracle Enterprise Manager for Oracle Database XE

连接数据库:

[oracle@enmodb1 ~]$ export ORACLE_SID=XE  [oracle@enmodb1 ~]$ export ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE  [oracle@enmodb1 ~]$ export PATH=$PATH:$ORACLE_HOME/bin  [oracle@enmodb1 ~]$ sqlplus / as sysdba    SQL*Plus: Release 18.0.0.0.0 - Production on Sat Feb 22 10:28:08 2020  Version 18.4.0.0.0    Copyright (c) 1982, 2018, Oracle.  All rights reserved.      Connected to:  Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production  Version 18.4.0.0.0  SQL> select banner from v$version;    BANNER  --------------------------------------------------------------------------------  Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production    SQL> select name from v$datafile;    NAME  --------------------------------------------------------------------------------  /opt/oracle/oradata/XE/system01.dbf  /opt/oracle/oradata/XE/sysaux01.dbf  /opt/oracle/oradata/XE/undotbs01.dbf  /opt/oracle/oradata/XE/pdbseed/system01.dbf  /opt/oracle/oradata/XE/pdbseed/sysaux01.dbf  /opt/oracle/oradata/XE/users01.dbf  /opt/oracle/oradata/XE/pdbseed/undotbs01.dbf  /opt/oracle/oradata/XE/XEPDB1/system01.dbf  /opt/oracle/oradata/XE/XEPDB1/sysaux01.dbf  /opt/oracle/oradata/XE/XEPDB1/undotbs01.dbf  /opt/oracle/oradata/XE/XEPDB1/users01.dbf    11 rows selected.

现在学习和接触 Oracle 数据库变得很简单!