代码改变世界

Oracle 19c快速安装部署

2020-07-06 23:54  AlfredZhao  阅读(1633)  评论(0编辑  收藏  举报

最近学习开源,发现不止MySQL,很多开源的产品都有个特点:安装简单。
而回过头来看传统的Oracle确实是太重了,在这个用户产品快速更新迭代的时代下,如果数据库这类基础产品的安装部署都需花费很长时间显然是有些跟不上节奏的。
不过Oracle其实也没有固步自封,较新版本中也推出了很多简化的特性,比如在19c中已经引入了rpm的安装方式。最近在给同事准备一套19c单实例的测试环境时,就尝试了下这个rpm的安装方式,整体来说还是很方便的。

环境:OEL 7.6
核心命令就三条:

--1.安装依赖包
[root@db19 ~]# yum install oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

--2.安装数据库软件
[root@db19 ~]# yum install oracle-database-ee-19c-1.0-1.x86_64.rpm

--3.配置数据库实例
[root@db19 ~]# /etc/init.d/oracledb_ORCLCDB-19c configure

记录下实际安装的过程:

1.OEL7.6中没有preinstall-19c,只有18c,认为基本一样,就先安装了18c

[root@db19 ~]# yum install oracle-database-preinstall-19c
Loaded plugins: ulninfo
No package oracle-database-preinstall-19c available.
Error: Nothing to do
[root@db19 ~]# yum install oracle-database-preinstall-*
Loaded plugins: ulninfo
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-preinstall-18c.x86_64 0:1.0-1.el7 will be installed
--> Processing Dependency: xorg-x11-xauth for package: oracle-database-preinstall-18c-1.0-1.el7.x86_64              
...省略...
Complete!

2.安装oracle-database-ee-19c报错有依赖oracle-database-preinstall-19c

[root@db19 ~]# yum install oracle-database-ee-19c-1.0-1.x86_64.rpm 
Loaded plugins: ulninfo
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
--> Processing Dependency: oracle-database-preinstall-19c for package: oracle-database-ee-19c-1.0-1.x86_64
--> Finished Dependency Resolution
Error: Package: oracle-database-ee-19c-1.0-1.x86_64 (/oracle-database-ee-19c-1.0-1.x86_64)
           Requires: oracle-database-preinstall-19c
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[root@db19 ~]#

3.下载oracle-database-preinstall-19c并安装:

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

4.再次尝试安装oracle-database-ee-19c成功,需要6.9G空间

[root@db19 ~]# yum install oracle-database-ee-19c-1.0-1.x86_64.rpm 
Loaded plugins: ulninfo
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
Warning: RPMDB altered outside of yum.
  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!

5.安装配置数据库

[root@db19 ~]# /etc/init.d/oracledb_ORCLCDB-19c configure
Configuring 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.
[root@db19 ~]#

6.检查环境可正常登陆

[oracle@db19 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jul 6 23:46:06 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> select userenv('language') from dual;

USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8

SQL> alter session set container=ORCLPDB1;

Session altered.

SQL> select userenv('language') from dual;

USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8
AlfredZhao©版权所有「从Oracle起航,领略精彩的IT技术。」