SELinuxの無効化
- /etc/selinux/config
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. # SELINUX=enforcing SELINUX=disabled # SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
Systemd に Oracle Database (CDB) の自動起動設定
- /etc/systemd/system/dbora.service
[Unit] Description=OracleDatabase19c After=network.target [Service] Type=forking User=oracle Group=oinstall EnvironmentFile=/etc/sysconfig/ora19c ExecStart=/u01/app/oracle/product/19.3.0/dbhome_1/bin/dbstart /u01/app/oracle/product/19.3.0/dbhome_1 ExecStop=/u01/app/oracle/product/19.3.0/dbhome_1/bin/dbshut /u01/app/oracle/product/19.3.0/dbhome_1 [Install] WantedBy=graphical.target
- /etc/sysconfig/ora19c
ORACLE_BASE = /u01/app/oracle ORACLE_HOME = /u01/app/oracle/product/19.3.0/dbhome_1 LANG = ja_JP.UTF-8 NLS_LANG = Japanese_Japan.AL32UTF8 ORACLE_SID = orcl
- /etc/oratab (デフォルト設定のN を Yにする)
orcl:/u01/app/oracle/product/19.3.0/dbhome_1:Y
PDBの自動起動設定
[oracle@localhost ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on 金 9月 6 02:53:43 2024 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. アイドル・インスタンスに接続しました。 SQL> startup ORACLEインスタンスが起動しました。 Total System Global Area 2415918608 bytes Fixed Size 9137680 bytes Variable Size 520093696 bytes Database Buffers 1879048192 bytes Redo Buffers 7639040 bytes データベースがマウントされました。 データベースがオープンされました。 SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 OPEPDB MOUNTED SQL> alter pluggable database opepdb open; プラガブル・データベースが変更されました。 SQL> alter pluggable database opepdb save state; プラガブル・データベースが変更されました。 SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 OPEPDB READ WRITE NO SQL>
サービスの有効化
# systemctl daemon-reload # systemctl enable dbora.service Created symlink /etc/systemd/system/multi-user.target.wants/dbora.service → /etc/systemd/system/dbora.service.
再起動して CDB と PDB が起動していることを確認する。