7
9

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 5 years have passed since last update.

rpmパッケージ版でOracle19cをインストール&データベース作成

Last updated at Posted at 2019-04-28

はじめに

rpmパッケージを使用して、シングルインスタンスOracle Databaseをインストールできます。

rpmパッケージではソフトウェアのみインストールが行われます。その後DBCAなどでデータベースを作成します。

また、/etc/init.d/oracledb_ORCLCDB-19cサービス構成スクリプトを使用して、デフォルト設定でデータベースを作成することができます。

マニュアルをベースにインストールとデータベースの作成をしてみます。

  • Database Installation Guide for Linux
    • Installing Oracle Database Using RPM Packages

https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/installing-oracle-database-using-rpm-packages.html

制限事項

  • Standard Edition 2としては使用不可

  • rpmベースのバージョンアップ(rpm -Uvh)は使用できないので、OPatchにて通常のパッチ適用が必要

準備

OSの準備

ここではOracle Linux 7.6に導入します。

# cat /etc/oracle-release
Oracle Linux Server release 7.6

また、/etc/hostsで自サーバの名前解決を実施しておきます。

インストールrpmのダウンロード

Oracle Database 19c (19.3) for Linux x86-64 (RPM)をダウンロードします。

​ oracle-database-ee-19c-1.0-1.x86_64.rpm

または以下でもダウンロードできるようです。

rpmファイルの配置

ダウンロードしたrpmファイルをOS上の任意の場所に置きます。

ここでは/tmpに配置します。

# cd /tmp
# ll oracle-database-ee-19c-1.0-1.x86_64.rpm
-rw-r--r--. 1 root root 2694664264 Apr 27 01:08 oracle-database-ee-19c-1.0-1.x86_64.rpm

インストール

Preinstallation RPMのインストール

前提条件を満たすため、yumを使用して、oracle-database-preinstall-19cをインストールします。

# yum -y install oracle-database-preinstall-19c

rpmベースのOracle Databaseインストール

yumを使用して、oracle-database-ee-19cをインストールします。

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

以下のような出力があり、インストールが成功します。

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
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!

rpmとしてインストールされています。

# rpm -qa oracle-database-ee-19c
oracle-database-ee-19c-1.0-1.x86_64

環境確認

$ cat /etc/oraInst.loc
inventory_loc=/opt/oracle/oraInventory
inst_group=oinstall

$ ll -d /opt/oracle/product/19c/dbhome_1
drwxr-xr-x. 69 oracle oinstall 4096 Apr 27 14:03 /opt/oracle/product/19c/dbhome_1

データベースの作成

サービス構成スクリプトによるデータベース作成

事前設定

設定ファイル/etc/sysconfig/oracledb_ORCLCDB-19c.confで最低限の設定ができるようです。

# cat /etc/sysconfig/oracledb_ORCLCDB-19c.conf
#This is a configuration file to setup the Oracle Database.
#It is used when running '/etc/init.d/oracledb_ORCLCDB configure'.
#Please use this file to modify the default listener port and the
#Oracle data location.

# LISTENER_PORT: Database listener
LISTENER_PORT=1521

# ORACLE_DATA_LOCATION: Database oradata location
ORACLE_DATA_LOCATION=/opt/oracle/oradata

# EM_EXPRESS_PORT: Oracle EM Express listener
EM_EXPRESS_PORT=5500

データベース作成

データベース用の作成スクリプト/etc/init.d/oracledb_ORCLCDB-19cにてデータベースを作成します。

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

環境確認

できたデータベースに実際に接続してみます。

$ export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
$ export ORACLE_SID=ORCLCDB
$ export PATH=$PATH:$ORACLE_HOME/bin
$ sql / as sysdba

SQLcl: Release 19.1 Production on Sun Apr 28 00:52:44 2019

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> select BANNER_FULL from v$version;
BANNER_FULL
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0


SQL> select instance_name from v$instance;
INSTANCE_NAME
ORCLCDB

SQL> show pdbs
  CON_ID CON_NAME   OPEN MODE    RESTRICTED
       2 PDB$SEED   READ ONLY    NO
       3 ORCLPDB1   READ WRITE   NO


リスナーはこんな感じ

$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 28-APR-2019 00:54:06

Copyright (c) 1991, 2019, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                27-APR-2019 14:37:27
Uptime                    0 days 10 hr. 16 min. 39 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/hostname/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hostname)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=hostname)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/ORCLCDB/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "xxxxxxxxxxxxxxxxxxxxxxxx" has 1 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "ORCLCDB" has 1 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "ORCLCDBXDB" has 1 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "orclpdb1" has 1 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
The command completed successfully
7
9
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
7
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?