Oracle その他

RPM で Oracle をインストールする方法|19c, Linux8, Redhat8

Preinstallation RPM の実施

ダウンロード

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

実行例
[root@myhost ~]# curl -o oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 18204  100 18204    0     0   102k      0 --:--:-- --:--:-- --:--:--  102k

インストール

yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

実行例
[root@myhost ~]#  yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
Updating Subscription Management repositories.
Last metadata expiration check: 3:11:48 ago on Wed 09 Mar 2022 08:36:10 AM CST.
Dependencies resolved.
=====================================================================================================================================================================
 Package                                     Architecture        Version                                         Repository                                     Size
=====================================================================================================================================================================
Installing:
 oracle-database-preinstall-19c              x86_64              1.0-1.el7                                       @commandline                                   18 k
Installing dependencies:
 glibc-devel                                 x86_64              2.28-164.el8                                    rhel-8-for-x86_64-baseos-rpms                 1.0 M
:
Installed:
  glibc-devel-2.28-164.el8.x86_64                      glibc-headers-2.28-164.el8.x86_64                           kernel-headers-4.18.0-348.12.2.el8_5.x86_64     
  ksh-20120801-254.el8.x86_64                          libaio-devel-0.3.112-1.el8.x86_64                           libstdc++-devel-8.5.0-4.el8_5.x86_64            
  libxcrypt-devel-4.1.1-6.el8.x86_64                   lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64      make-1:4.2.1-10.el8.x86_64                      
  oracle-database-preinstall-19c-1.0-1.el7.x86_64      sysstat-11.7.3-6.el8.x86_64                                

Complete!

補足

compat-libcap1、compat-libstdc++-33が不足しているとエラーが発生する

以下のようなエラーが発生した場合はこちらの記事を参考にして対処

 Problem: conflicting requests
  - nothing provides compat-libcap1 needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
  - nothing provides compat-libstdc++-33 needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64

インストールが終わったらファイルを削除してもよい

rm oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

Installation RPM の実施

ダウンロード

Oracle Technology Network からダウンロードし、/tmp に配置しておく

https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html

インストール

/tmp に移動し、インストールを実行

yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm

実行例

[root@myhost ~]# cd /tmp
[root@myhost tmp]# yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm
Updating Subscription Management repositories.
Last metadata expiration check: 3:14:57 ago on Wed 09 Mar 2022 08:36:10 AM CST.
Dependencies resolved.
=====================================================================================================================================================================
 Package                                           Architecture                      Version                           Repository                               Size
=====================================================================================================================================================================
Installing:
 oracle-database-ee-19c                            x86_64                            1.0-1                             @commandline                            2.5 G

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

:
Exception in thread "main" java.lang.NullPointerException
        at oracle.sysman.oii.oiic.OiicBaseInventoryApp.main_helper(OiicBaseInventoryApp.java:706)
        at oracle.sysman.oii.oiic.OiicAttachHome.main(OiicAttachHome.java:696)
[SEVERE] An error occurred while registering the Oracle home. Verify logs in /var/log/oracle-database-ee-19c/results/oraInstall.log and /opt/oracle/oraInventory for more details and try again.
warning: %post(oracle-database-ee-19c-1.0-1.x86_64) scriptlet failed, exit status 1

Error in POSTIN scriptlet in rpm package oracle-database-ee-19c
  Verifying        : oracle-database-ee-19c-1.0-1.x86_64                                                                                                         1/1 
Installed products updated.

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

エラーが発生しているけどここでは無視しても問題なく進んだが、後々にエラーが発生する可能性がある問題についての記事を後述しておく

インストール先の確認

以下のように /opt 配下にインストールされていた

[root@myhost opt]# ll
total 0
drwxr-xr-x. 4 oracle oinstall 41 Mar  9 11:57 oracle

[oracle@myhost dbhome_1]$ pwd
/opt/oracle/product/19c/dbhome_1

[oracle@myhost dbhome_1]$ ls
addnode     clone  cv      deinstall    drdaas   hs             javavm  ldap  network  OPatch   ords  perl     R         root.sh        slax          sqlplus   usm
apex        crs    data    demo         dv       install        jdbc    lib   nls      opmn     oss   plsql    racg      runInstaller   sqldeveloper  srvm      utl
assistants  css    dbjava  diagnostics  env.ora  instantclient  jdk     md    odbc     oracore  oui   precomp  rdbms     schagent.conf  sqlj          suptools  wwg
bin         ctx    dbs     dmu          has      inventory      jlib    mgw   olap     ord      owm   QOpatch  relnotes  sdk            sqlpatch      ucp       xdk

この後は通常通り、oracleユーザに切り替えて DBCA を実行しデータベースを作成すればよい

その際に関連して発生するであろうエラーに関する記事はこちら

この記事が役に立ったという方は
ボタンをポチッとしてくれたら喜びます

Running RPM Packages to Install Oracle Database
Running RPM Packages to Install Oracle Database

docs.oracle.com

-Oracle, その他
-, , , ,