VMware仮想マシン上のCentOS 7環境にOracle 19cを導入する際の手順を以下に示します。
参考資料:http://blog.itpub.net/69975956/viewspace-2706044/
- パッケージ取得コマンド
wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
wget https://download.oracle.com/otn/linux/oracle19c/190000/oracle-database-ee-19c-1.0-1.x86_64.rpm?AuthParam=1618661520_b733840488b27a21d9d23454d0c20a20
セキュリティモジュールの無効化
[root@byh ~]# vi /etc/selinux/config
SELINUX=disabled
システムパラメータ設定
# /etc/pam.d/loginに追加
session required pam_limits.so
# /etc/profileに設定追加
if [ "$USER" = "oracle" ] ; then
if [ "$SHELL" = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
# /etc/security/limits.confに設定追加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
依存関係のインストール
yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm
Oracle環境設定
# /etc/init.d/oracledb_ORCLCDB-19cの設定
export DB_VERSION=19c
export DB_SID=ORCLCDB
export TEMPLATE_NAME=General_Purpose.dbc
export CHAR_SET=AL32UTF8
export PDB_NAME=ORCLPDB1
export LISTENER_NAME=LISTENER
export PDB_COUNT=1
export CREATE_CDB=true
インストール実行
/etc/init.d/oracledb_ORCLCDB-19c configure
環境変数設定
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export DB_SID=ORCLCDB
エラー対応
The install cannot proceed because ORACLE_BASE directory is not owned by "oracle" user.
The install cannot proceed because ORACLE_BASE directory is not owned by "oinstall" group.
→ディレクトリ所有者を変更
chown -R oracle:oinstall ./oracle
リスナー確認
lsnrctl status
lsnrctl start
データベース起動エラー対処
sqlplus / as sysdba
startup
パラメータファイル修正
mv /opt/oracle/product/10.2/db_1/dbs/init.ora /opt/oracle/product/10.2/db_1/dbs/initorcl.ora
ネットワーク接続問題
systemctl stop firewalld
systemctl disable firewalld
システムユーザーのパスワード変更
sqlplus / as sysdba
alter user system identified by 123456;
Oracleユーザーのパスワード変更
passwd oracle
データベースユーザー作成
CREATE TABLESPACE bdc_yc datafile '/u01/app/oracle/my_db/DDATA.dbf' size 500M autoextend on next 5M maxsize unlimited;
CREATE temporary TABLESPACE bdc_yc_tmp tempfile '/opt/oracle/my_db/DDATA_TMP.dbf' size 300M autoextend on next 5M maxsize unlimited;
create user bdc_yc identified by "123456" default tablespace bdc_yc temporary tablespace bdc_yc_tmp;
alter user bdc_yc quota unlimited on bdc_yc;
grant create session to bdc_yc;
grant create table to bdc_yc;
grant create tablespace to bdc_yc;
grant create view to bdc_yc;