今日はRHEL7.3環境にOracleDBをインストールする作業の続きです。

今回はデータベースインスタンスを作成したいと思います!!!
これさえできれば 「○○さん、OracleDB作っておいて」、「最新の12.2.0.1でいいっすか?」 が
できるわけだ。
※今回も英語表記での手順になります。
リスナーの作成
まずはnetcaコマンドでOracle Net Configuration Assistantを起動しよう。
$ netca
まずはnetcaコマンドでOracle Net Configuration Assistantを起動しよう。
※環境変数が設定されてないとnetcaコマンドでは起動できないぞ。先にデータベース作成後作業をやってもよい。
「Listener configuration」を選択してNext。

「Add」を選択してNext。

「Linstener name」に「LISTENER」と入力してNext。

「Selected Protocols」を「TCP」を選択してNext。

「Use the standard port number 1521」を選択してNext。
のポート番号を入力しよう。

「No」を選択してNext。

「Linstener configuration complete!」が出力されたらNext。これでリスナーの作成は終了しました。

ちゃんとリスナーが作成され、起動されているか確認しよう。
以下の内容が出力されればOKです。
Oracle Net Services Configuration:
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/u01/app/oracle/product/12.2.0.1/dbhome_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Oracle Net Services configuration successful. The exit code is 0
データベースの作成
ここからはデータベースを作成していきます。
今回はシングルインスタンスのnon-PDB構成で作成します。
「create a database」を選択してNext。

「Advanced configuration」を選択してNext。

「Custom Database」を選択してNext。
※下の図ではGeneral Purpose or Trasaction procesingとなっているので注意。

「Global database name」に「orcl」、「SID」に「orcl」を入力してNext。

「Use following for the database storage attributes」を選択。
「Database files storage type」を「File System」、「Database files location」を任意の場所に設定してNext。

「Specify Fast Recovery Area」と「Enable archive」のチェックを外してにNext。
ただし構成によっては必要なので注意が必要がです。

先ほど作成した「LISTENER」を選択してNext。

「Configure Oracle Label Security」と「Configure Oracle Database Vault」のチェックを外してにNext。

「Use AutomaticAutomatic Shared Memory Managerment」で任意のSGAとPGAを設定。
DBを初めて作成する人は「Use Automatic Memory Management」を選択してもよいぞ!

「processes」を「300」に設定。

- 「Use Unicode」を選択。
- 「Natinal Character set」を「AL16UTF16」を選択。
- 「Default language」を「Japanese」を選択
- 「Default territory」を「Japan」を選択

「Dedicated Sever mode(専用サーバモード)」を選択。

「Add sample scehmas to the database」にチェックを入れずにNext。

「Configure Enterprise Manager (EM) database express」と「Register with Enterprise with Enterprise Manager(EM) cloud control」にチェックを入れずにNext。

「Use the sama administrative password for all accounts」に任意のパスワードを入力してNext。

下の画面が出ても無視してYesを選択。

「Create database」にのみチェックを入れてNext。

作成するデータベースのサマリーを確認してFinish。


頑張ってインストールしているので待ちましょう。

以下の画面が表示されたらインストール完了です。

データベース作成後作業
OSのoracleユーザにログインしてsqlplus で直ぐに接続できるようにしておくと便利。
ということで.bash_profileに環境変数を設定しておく。
Oracle Net Services Configuration:
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/u01/app/oracle/product/12.2.0.1/dbhome_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Oracle Net Services configuration successful. The exit code is 0
sqlplusでヘビーに使用するならばglogin.sqlに以下の設定を入れておくと便利
$ vi ${ORACLE_HOME}/sqlplus/admin/glogin.sql
内容は以下になります。
set time on
set timing on
set trimspool on
set serveroutput on size 1000000
set SQLPROMPT "_USER'@'_CONNECT_IDENTIFIER > "
ALTER SESSION SET nls_date_format = 'yyyy-mm-dd hh24:mi:ss';