仕事でOracleDatabase 12cR2 (12.2.0.1)をRHEL7.3にインストールしたので、その時の作業ログを元にブログの記事を書こうと思います。
インストール手順は12cR1の時と変わりませんが、一部のOSグループが追加されたりと変更点もあります。
本記事ではデータベースの作成は行いません。
そのためデータベースの作成を知りたい方はこちらの記事を参考にしてください。
-
-
OracleDatabase 12.2.0.1のデータベースを作成する方法
今日はRHEL7.3環境にOracleDBをインストールする作業の続きです。 今回はデータベースインスタンスを作成したいと思います!!! これさえできれば 「○○さん、OracleDB作っておいて」、 ...
Contents
メディアの入手先
最新のOracleDatabaseは以下のサイトでダウンロードすることができます。
ただしPSR(Patch Set Release)過去のPSRをダウンロードする場合は、気を付ける必要があります。
過去のPSRをダウンロードをする場合は、「Oracle Software Delivery Cloud」や「My Oracle Support」を利用する必要があります。
Oracle社とのサポート契約が必要になるので中が必要です。
また機会がありました紹介しますね^^
前提条件
ハードウェア条件
- CPU:2CORE(マニュアルに書いてなかったけど)
- メモリ:1GB以上
- temp領域:1.5GB以上(メモリの1.5倍) ※詳細はインストレーションガイド参照
必要なパッケージのインストール
binutils-2.23.52.0.1-12.el7 (x86_64)
compat-libcap1-1.10-3.el7 (x86_64)
compat-libstdc++-33-3.2.3-71.el7 (i686)
compat-libstdc++-33-3.2.3-71.el7 (x86_64)
glibc-2.17-36.el7 (i686)
glibc-2.17-36.el7 (x86_64)
glibc-devel-2.17-36.el7 (i686)
glibc-devel-2.17-36.el7 (x86_64)
ksh
libaio-0.3.109-9.el7 (i686)
libaio-0.3.109-9.el7 (x86_64)
libaio-devel-0.3.109-9.el7 (i686)
libaio-devel-0.3.109-9.el7 (x86_64)
libgcc-4.8.2-3.el7 (i686)
libgcc-4.8.2-3.el7 (x86_64)
libstdc++-4.8.2-3.el7 (i686)
libstdc++-4.8.2-3.el7 (x86_64)
libstdc++-devel-4.8.2-3.el7 (i686)
libstdc++-devel-4.8.2-3.el7 (x86_64)
libxcb-1.9-5.el7 (i686)
libxcb-1.9-5.el7 (x86_64)
libX11-1.6.0-2.1.el7 (i686)
libX11-1.6.0-2.1.el7 (x86_64)
libXau-1.0.8-2.1.el7 (i686)
libXau-1.0.8-2.1.el7 (x86_64)
libXi-1.7.2-1.el7 (i686)
libXi-1.7.2-1.el7 (x86_64)
libXtst-1.2.2-1.el7 (i686)
libXtst-1.2.2-1.el7 (x86_64)
make-3.82-19.el7 (x86_64)
net-tools-2.0-0.17.20131004git.el7 (x86_64) (Oracle RACおよびOracle Clusterware用)
nfs-utils-1.3.0-0.21.el7.x86_64 (Oracle ACFS用)
smartmontools-6.2-4.el7 (x86_64)
sysstat-10.1.5-1.el7 (x86_64)
基本的には、
1 |
yum install <package_name> |
でインストールします。例は以下みたいな感じです。
1 |
yum install binutils-* |
yumのリポジトリがない人はぐぐってくれ。そのうち記事にします。
OS上での設定
OSユーザの作成
oracleユーザを作成する
1 2 3 4 5 6 7 8 9 10 |
useradd oracle passwd oracle groupadd -g 54321 oinstall groupadd -g 1100 dba groupadd -g 1101 oper groupadd -g 1102 backupdba groupadd -g 1103 dgdba groupadd -g 1104 kmdba usermod -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba oracle |
12.2からはOSRACDBAグループが新規に追加されたぞ。注意が必要そうだ。
インストールディレクトリの準備
いつもの構成で作成します。
1 2 3 |
mkdir -p /u01/app/oracle chown -R oracle:oinstall /u01/ chmod -R 775 /u01 |
ネットワーク設定
ファイヤーウォールを無効化させる。
1 |
systemctl stop firewalld |
DNSサーバがないのでホスト名をhostsへ記載する。
1 2 |
vi /etc/hosts 192.168.56.100 rhel73-12201 rhel73-12201.localhost.com |
※ ちゃんと自分の環境と照らし合わせ設定しよう。
インベントリ作成場所を設定
インベントリ作成場所は意外と忘れがちなので注意。しかし設定しなくてもうまくいくよ。
1 2 3 4 |
vi /etc/oraInst.loc inventory_loc=/u01/app/oracle/oraInventory inst_group=oinstall |
カーネルパラメータ設定
カーネルパラメータの設定のために/etc/sysctl.confに以下の内容を追記。
1 2 3 4 5 6 7 8 9 10 11 12 13 |
vi /etc/sysctl.conf fs.file-max = 6815744 kernel.sem = 250 32000 100 128 kernel.shmmni = 4096 kernel.shmall = 1073741824 kernel.shmmax = 4398046511104 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 fs.aio-max-nr = 1048576 net.ipv4.ip_local_port_range = 9000 65500 |
※ この内容はサーバのリソースによって変更する必要があります。12.1からカーネルパラメータ修正スクリプトが提供されるようになったのでそちらを使うのもあり。
シェル制限の設定
シェル制限を行うために「/etc/security/limits.conf」に以下を追記します。
1 2 3 4 5 6 7 8 9 10 |
vi /etc/security/limits.conf oracle soft nproc 2048 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 oracle soft memlock 262144000 oracle hard memlock 262144000 |
「/etc/profile」にも以下の内容を追記します。
1 2 3 4 5 6 7 8 9 10 11 |
vi /etc/profile # 以下の内容を/etc/profileに追記 if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi |
「/etc/pam.d/login」に以下を追記します。
1 2 3 4 |
vi /etc/pam.d/login session required /lib64/security/pam_limits.so session required pam_limits.so |
OracleDBのインストール
基本的には英語でインストールします。
「I wish to receive security updates via My Oracle Support」にチェックを外して「Next」
「Yes」を選択。
「Install database software only」を選択して「Next」
「Single instance database installation」を選択して「Next」
「Enterprise Edition」を選択して「Next」
「Oracle Base」に「/u01/app/oracle」を選択。
「Software location」に「/u01/app/oracle/product/12.2.0.1/dbhome_1」を選択し「Next」
「Inventory Directory」に「/u01/app/oraInventory」を設定。
「oraInventory Group Name」に「oinstall」を設定し「Next」。
以下のように設定して「Next」。
Real Application Cluster Administrative GroupはRAC環境でのみ使用するので「dba」グループでOKです。
おやおや?ここで必要なパラメータやパッケージがないと怒られます。
「Fixable」が「Yes」は「Fix & Check Again」でOUIがいい感じに設定してくれます。
すべての前提チェックが終わったら以下の画面がでますので「Install」。
ひたすら待つ。ディスクの性能にもよるが最近のPCなら30分もあれば終わります。
以下の画面が出たら、OSの「root」ユーザでログインし、
「/u01/app/oraInventory/orainstRoot.sh」
「/u01/app/oracle/product/12.2.0.1/dbhome_1/root.sh 」
を実行
1 2 3 4 5 6 7 |
[root@rhel73-12201 ~]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
[root@rhel73-12201 ~]# /u01/app/oracle/product/12.2.0.1/dbhome_1/root.sh Performing root user operation. The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/12.2.0.1/dbhome_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ... Creating /etc/oratab file... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] : Oracle Trace File Analyzer (TFA - User Mode) is available at : /u01/app/oracle/product/12.2.0.1/dbhome_1/suptools/tfa/release/tfa_home/bin/tfactl OR Oracle Trace File Analyzer (TFA - Daemon Mode) can be installed by running this script : /u01/app/oracle/product/12.2.0.1/dbhome_1/suptools/tfa/release/tfa_home/install/roottfa.sh [root@rhel73-12201 ~]# /u01/app/oracle/product/12.2.0.1/dbhome_1/root.sh Performing root user operation. The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/12.2.0.1/dbhome_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: The contents of "dbhome" have not changed. No need to overwrite. The contents of "oraenv" have not changed. No need to overwrite. The contents of "coraenv" have not changed. No need to overwrite. Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] : yes Installing Oracle Trace File Analyzer (TFA). Log File: /u01/app/oracle/product/12.2.0.1/dbhome_1/install/root_rhel73-12201.local.com_2017-04-18_12-13-04-386476091.log Finished installing Oracle Trace File Analyzer (TFA) [root@rhel73-12201 ~]# |
以下の画面が出たら終了。お疲れ様でした!
参考
- Oracle® Databaseインストレーション・ガイド12cリリース2 (12.2) for Linux
https://docs.oracle.com/cd/E82638_01/LADBI/toc.htm
- Linux OSの要件
http://docs.oracle.com/cd/E82638_01/LADBI/supported-red-hat-enterprise-linux-7-distributions-for-x86-64.htm#GUID-2E11B561-6587-4789-A583-2E33D705E498
- 透過的なHugePagesの無効化
http://docs.oracle.com/cd/E82638_01/LADBI/disabling-transparent-hugepages.htm#GUID-02E9147D-D565-4AF8-B12A-8E6E9F74BEEA
- Oracle InventoryおよびOracle Inventoryグループの存在の確認
http://docs.oracle.com/cd/E82638_01/LADBI/determining-if-an-oracle-inventory-and-oracle-inventory-group-exist.htm#GUID-63920FC2-410E-437D-8897-FB40AD828AD4
- OSグループについて
http://docs.oracle.com/cd/E82638_01/LADBI/oracle-installations-with-standard-and-job-role-separation-groups-and-users.htm#GUID-67A7AC8E-1736-4D53-A529-EB96FCDBA516
- OSグループ作成
http://docs.oracle.com/cd/E82638_01/LADBI/creating-operating-system-privileges-groups.htm#GUID-164A7218-166D-4B58-9A86-88149E8FCB83