1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

RHEL8へOracle DatabaseをRPMパッケージでインストール

Last updated at Posted at 2022-02-02

##目標

  • Oracle Databaseをrpmでインストールする

参考)
RPMパッケージの実行によるOracle Databaseのインストール
Oracle Database Preinstallation RPMによるOracle Linuxの自動構成
##環境

  • RHEL8.5
  • Oracle Database 19c(19.3.0.0.0)

##準備するもの

  • Oracle Database 19c(oracle-database-ee-19c-1.0-1.x86_64.rpm)
  • Oracle Database Preinstallation(oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm)

 Oracle Database 19cはOracleのサイトよりダウンロード(OTNアカウントが必要)
 Oracle Database Preinstallationはcurlでダウンロード可能

※ OSのパッケージが必要となるため、yum installができること
RHEL8で必要なパッケージ

##kernel Parameterを設定

# vi /etc/sysctl.conf

以下の内容を設定

### Oracle Parameter
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
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 = 9000 65500
### Oracle Parameter

##RHEL8に対応したPreinstallationをダウンロード+インストール

# curl -o oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm
# yum install oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm
# cat /etc/security/limits.d/oracle-database-preinstall-19c.conf

oracle-database-preinstall-19c.confにlimitなどの情報があることを確認

##Oracle Databaseをインストール

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

インストールは時間がかかるのでエラーがでなければ気長に待つ

Last metadata expiration check: 1:09:14 ago on Wed 02 Feb 2022 04:52:55 PM JST.
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
Total size: 2.5 G
Installed size: 6.9 G
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
~~~~~~~~~~~~~~~~~~~~~~~~~~ 省略
[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 products updated.

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

Complete!
# 

コンフィグ設定を行う(上のスクリプト結果に表示されているコマンドを実行)

# /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.

Oracleの環境parameterを設定

# vi /etc/profile.d/oracle.sh

以下の内容を設定

export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export ORACLE_SID=ORCLCDB
export NLS_LANG=Japanese_Japan.AL32UTF8
export PATH=$ORACLE_HOME/bin:$PATH

##Oracle Database 19cが起動することを確認

# su - oracle
$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on 水 2月 2 20:57:52 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle.  All rights reserved.
アイドル・インスタンスに接続しました。
SQL> exit
切断しました。
#
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?