Pages

Sunday, March 1, 2020

Oracle Database 19c Installation Template (#singleInstance #noASM)


Пример установки БД (без ASM).





















@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Virtual Machine info:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Launched on VMware Workstation 11.1.0 build-2496824

OS   = CentOS 7 x64
RAM  = 16 GB
SWAP = 16 GB
HDD  = 75 GB (Linux LVM in use)

#######################################
Storage setup:
#######################################

Notes:
-> In this case I will use 75 GB "/dev/sdb" virtual device devided on several logical volumes using Linux LVM.
-> In real world each mount point should be a separate device(LUN) on your SAN system.
-> Sizes above are just for testing purposes and usually should be much more in real world  production databases.

/u01   = 15 GB = Oracle Home location
/data  = 20 GB = Data files
/redo1 = 10 GB = Redo log files
/redo2 = 10 GB = Redo log files
/arch  = 20 GB = Archive log files

>>> root@srv-example-db

$ yum install -y lvm2
$ ls -ltr /sys/class/scsi_host/host*/scan
$ {
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host2/scan
}

$ lsblk | grep -i sdb
+++++
sdb      8:16   0   75G  0 disk
+++++

$ fdisk /dev/sdb
+++++
n
p
<<<enter>>>
<<<enter>>>
t
8e
p
w
+++++

$  lsblk | grep -i  sdb
+++++
sdb      8:16   0   75G  0 disk
└─sdb1   8:17   0   75G  0 part
+++++

$ pvcreate /dev/sdb1
+++++
  Physical volume "/dev/sdb1" successfully created.
+++++

$ vgcreate oravg /dev/sdb1
+++++
  Volume group "oravg" successfully created
+++++

$ lvcreate --size 15G   --name orahome  oravg
$ lvcreate --size 20G   --name oradata  oravg
$ lvcreate --size 10G    --name oraredo1 oravg
$ lvcreate --size 10G    --name oraredo2 oravg
$ lvcreate --size 20G  --name oraarch  oravg

$ lsblk | grep -i -A5 sdb
+++++
sdb                  8:16   0   75G  0 disk
└─sdb1               8:17   0   75G  0 part
  ├─oravg-orahome  253:0    0   15G  0 lvm
  ├─oravg-oradata  253:1    0   20G  0 lvm
  ├─oravg-oraredo1 253:2    0   10G  0 lvm
  ├─oravg-oraredo2 253:3    0   10G  0 lvm
  └─oravg-oraarch  253:4    0   20G  0 lvm
+++++

$ mkfs.ext4 /dev/oravg/orahome
$ mkfs.ext4 /dev/oravg/oradata
$ mkfs.ext4 /dev/oravg/oraredo1
$ mkfs.ext4 /dev/oravg/oraredo2
$ mkfs.ext4 /dev/oravg/oraarch

$ mkdir -p /u01 /data /redo1 /redo2 /arch

$ mount /dev/oravg/orahome  /u01
$ mount /dev/oravg/oradata  /data
$ mount /dev/oravg/oraredo1 /redo1
$ mount /dev/oravg/oraredo2 /redo2
$ mount /dev/oravg/oraarch  /arch

$ df -hT | grep -i ora
+++++
Filesystem                 Type      Size  Used Avail Use% Mounted on
/dev/mapper/oravg-orahome  ext4       15G   41M   14G   1% /u01
/dev/mapper/oravg-oradata  ext4       20G   45M   19G   1% /data
/dev/mapper/oravg-oraredo1 ext4       10G   20M    9G   1% /redo1
/dev/mapper/oravg-oraredo2 ext4       10G   20M    9G   1% /redo2
/dev/mapper/oravg-oraarch  ext4       20G   20M   19G   1% /arch
+++++

$ cat /etc/fstab | grep -i -A15 "Oracle Software"
+++++
# Oracle Software
#
# device - describes the block special device or remote filesystem to be mounted;
# mountpoint - describes the mount directory;
# fstype - file system type;
# options - file system specific options;
# dump - is checked by dump utility (usually set to 0 value);
# fsck - sets the order for filesystem checks at boot time. For root device should be 1. For others 2, to disable 0.
#
#device                      mountpoint    fstype     options     dump     fsck
/dev/mapper/oravg-orahome    /u01          ext4       defaults    0        2
/dev/mapper/oravg-oradata    /data         ext4       defaults    0        2
/dev/mapper/oravg-oraredo1   /redo1        ext4       defaults    0        2
/dev/mapper/oravg-oraredo2   /redo2        ext4       defaults    0        2
/dev/mapper/oravg-oraarch    /arch         ext4       defaults    0        2
+++++

Note: optionaly you can reboot the server here to ensure everything works (mounted) as expected.

#######################################
Server setup:
#######################################

>>> root@srv-example-db

$ cat /etc/hosts
+++++
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.197.178 srv-example-db.oracle.com srv-example-db

+++++

$ cat /etc/hostname
+++++
srv-example-db.oracle.com
+++++

$ cat /etc/sysconfig/network
+++++
NETWORKING=YES
HOSTNAME=srv-example-db.oracle.com
NOZEROCONF=yes
+++++

//
// Setup kernel parameters / limits / etc by installing 19c preinstall package
//

$ curl -o oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
$ yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
$ yum list installed | grep -i oracle
+++++
oracle-database-preinstall-19c.x86_64   1.0-1.el7                      installed
+++++

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++ If there is no pre-install package then manual setup required +++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-----------------------------
*** BEGIN of manual setup ***
-----------------------------

Note: Run $ sysctl -a |grep -i <parameter name>     to view currently booted kernel parameters.

$ cat /etc/sysctl.d/99-sysctl.conf
+++++
...
...
...
#
# Oracle Pre-Install kernel settings
#
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
+++++

$ /sbin/sysctl -p /etc/sysctl.conf

$ cp /etc/security/limits.conf /etc/security/limits.conf_bkp
$ cat /etc/security/limits.conf
+++++
...
...
...
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
+++++

---------------------------
*** END of manual setup ***
---------------------------

//
// Install required packages
//

{
yum install -y bc
yum install -y binutils
yum install -y compat-libcap1
yum install -y compat-libstdc++-33
yum install -y dtrace-utils
yum install -y elfutils-libelf
yum install -y elfutils-libelf-devel
yum install -y fontconfig-devel
yum install -y glibc
yum install -y glibc-devel
yum install -y ksh
yum install -y libaio
yum install -y libaio-devel
yum install -y libdtrace-ctf-devel
yum install -y libXrender
yum install -y libXrender-devel
yum install -y libX11
yum install -y libXau
yum install -y libXi
yum install -y libXtst
yum install -y libgcc
yum install -y librdmacm-devel
yum install -y libstdc++
yum install -y libstdc++-devel
yum install -y libxcb
yum install -y make
yum install -y net-tools
yum install -y nfs-utils
yum install -y python
yum install -y python-configshell
yum install -y python-rtslib
yum install -y python-six
yum install -y targetcli
yum install -y smartmontools
yum install -y sysstat
yum install -y unixODBC
yum install -y dos2unix
yum install -y telnet
yum install -y make
yum install -y binutils
yum install -y gcc
yum install -y libaio
yum install -y glibc-common
yum install -y libstdc++
yum install -y sysstat
yum install -y glibc
yum install -y glibc-devel.i686
yum install -y glibc-devel
yum install -y libXtst
yum install -y gcc-c++
}

//
// Create user / groups
//

$ groupadd -g 54321 oinstall
$ groupadd -g 54322 dba
$ groupadd -g 54323 oper
$ useradd -u 54321 -g oinstall -G dba,oper oracle
$ passwd oracle

//
// Change SELINUX to permissive
//

$ cp /etc/selinux/config /etc/selinux/config_bkp
$ grep -i "permissive" /etc/selinux/config
+++++
SELINUX=permissive
+++++

$ setenforce Permissive     /// OR ///     $ reboot 
+++++
setenforce: SELinux is disabled
+++++

//
// Disable firewall (if you don't have some special requirements from your Security Team and if you database not in PCI DSS zone)
//

$ systemctl stop firewalld
$ systemctl disable firewalld
+++++
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
+++++

$ systemctl status firewalld
+++++
systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

Mar 01 03:27:59 srv-example-db.oracle.com systemd[1]: Starting firewalld - dynamic firewall daemon...

Mar 01 03:28:07 srv-example-db.oracle.com systemd[1]: Started firewalld - dynamic firewall daemon.
Mar 01 03:43:24 srv-example-db.oracle.com systemd[1]: Stopping firewalld - dynamic firewall daemon...
Mar 01 03:43:25 srv-example-db.oracle.com systemd[1]: Stopped firewalld - dynamic firewall daemon.
+++++

//
// Create directories
//

$ mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
$ mkdir -p /u01/app/oraInventory
$ chown -R oracle:oinstall /u01 /data /redo1 /redo2 /arch
$ chmod -R 775 /u01 /data /redo1 /redo2 /arch

//
// (OPTIONAL) Install rlwrap utility for more comfortable work with SQL Plus: rlwrap
//

$ yum localinstall -y rlwrap-0.42-1.el7.x86_64.rpm
$ yum list installed | grep -i rlwrap
+++++
rlwrap.x86_64                           0.42-1.el7                     installed
+++++

//
// Swap setup
//

$ ls -ltr /sys/class/scsi_host/host*/scan
$ {
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host2/scan
}

$ lsblk | grep -i sdc
+++++
sdc                  8:32   0   18G  0 disk
+++++

$ pvcreate /dev/sdc
$ vgcreate swapvg /dev/sdc
$ lvcreate --size 16G --name oraswap swapvg

// Formatting the device with the SWAP format.
$ mkswap /dev/swapvg/oraswap
+++++
Setting up swapspace version 1, size = 16777212 KiB
no label, UUID=bd1d10a6-5d9e-48cb-a853-ddab777f2ed0
+++++

// Enable the extended logical volume swap.
$ swapon -v /dev/swapvg/oraswap
+++++
swapon /dev/swapvg/oraswap
swapon: /dev/mapper/swapvg-oraswap: found swap signature: version 1, page-size 4, same byte order
swapon: /dev/mapper/swapvg-oraswap: pagesize=4096, swapsize=17179869184, devsize=17179869184
+++++

// Correct "/etc/fstab". Disable default swap and enable new one.
$ cat /etc/fstab | grep -i swap
+++++
#UUID=d8c96236-0ac9-426f-bf83-2c92c4605f89 swap                    swap    defaults        0 0
/dev/mapper/swapvg-oraswap                 swap                    swap    defaults        0 0
+++++

$ reboot

// Check results
$ cat /proc/swaps /// OR /// swapon -s
+++++
Filename                                Type            Size    Used    Priority
/dev/dm-0                               partition       16777212        0       -1
+++++

//
// HugePages Setup
//

13 GB for SGA Huge pages

$ grep Huge /proc/meminfo
+++++
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
+++++

$ grep vm.nr_hugepages /etc/sysctl.conf
+++++
vm.nr_hugepages=6656
vm.swappiness = 1
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
kernel.randomize_va_space=0
+++++

// memlock = 6656 * 2048 kB = 13631488 kB
view /etc/security/limits.conf /// OR /// view /etc/security/limits.d/oracle-database-preinstall-19c.conf
+++++
* soft memlock 13631488
* hard memlock 13631488
+++++

$ sysctl -p
$ grep Huge /proc/meminfo
+++++
AnonHugePages:         0 kB
HugePages_Total:    6656
HugePages_Free:     6656
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
+++++

#######################################
Database Software setup:
#######################################

>>> oracle@srv-example-db

$ cp /home/oracle/.bash_profile /home/oracle/.bash_profile_bkp
$ cat /home/oracle/.bash_profile
+++++
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_SID=ORCL
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1
export ORACLE_HOSTNAME=srv-example-db.oracle.com
export TMP=/tmp
export TMPDIR=$TMP
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export PS1='\[\033[0;32m\]$ORACLE_SID> \[\033[0;33m\]\u@\h\[\033[00m\] [\t] \w]\$ '
##
## Tools
##
alias rman="rlwrap ${ORACLE_HOME}/bin/rman"
alias sp="rlwrap ${ORACLE_HOME}/bin/sqlplus / as sysdba"
+++++

// Copy installation archive to the server
$ unzip /home/oracle/LINUX.X64_193000_db_home.zip -d ${ORACLE_HOME}/
$ cd $ORACLE_HOME

$ ./runInstaller -ignorePrereq -waitforcompletion -silent                        \
    -responseFile ${ORACLE_HOME}/install/response/db_install.rsp               \
    oracle.install.option=INSTALL_DB_SWONLY                                    \
    ORACLE_HOSTNAME=${ORACLE_HOSTNAME}                                         \
    UNIX_GROUP_NAME=oinstall                                                   \
    INVENTORY_LOCATION=/u01/app/oraInventory                                   \
    SELECTED_LANGUAGES=en,en_GB                                                \
    ORACLE_HOME=${ORACLE_HOME}                                                 \
    ORACLE_BASE=${ORACLE_BASE}                                                 \
    oracle.install.db.InstallEdition=EE                                        \
    oracle.install.db.OSDBA_GROUP=dba                                          \
    oracle.install.db.OSBACKUPDBA_GROUP=dba                                    \
    oracle.install.db.OSDGDBA_GROUP=dba                                        \
    oracle.install.db.OSKMDBA_GROUP=dba                                        \
    oracle.install.db.OSRACDBA_GROUP=dba                                       \
    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false                                 \
    DECLINE_SECURITY_UPDATES=true

+++++
The response file for this session can be found at:
 /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_2020-03-01_04-44-18AM.rsp

You can find the log of this install session at:

 /tmp/InstallActions2020-03-01_04-44-18AM/installActions2020-03-01_04-44-18AM.log

As a root user, execute the following script(s):

        1. /u01/app/oraInventory/orainstRoot.sh
        2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh

Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes:

[srv-example-db]
Execute /u01/app/oracle/product/19.0.0/dbhome_1/root.sh on the following nodes:
[srv-example-db]


Successfully Setup Software.

Moved the install session logs to:
 /u01/app/oraInventory/logs/InstallActions2020-03-01_04-44-18AM
+++++

~ 5 min

>>> root@srv-example-db

$ /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.
+++++

$ /u01/app/oracle/product/19.0.0/dbhome_1/root.sh
+++++
Check /u01/app/oracle/product/19.0.0/dbhome_1/install/root_srv-example-db.oracle.com_2020-03-01_04-49-58-514324449.log for the output of root script
+++++

//
// Create listener.ora /tnsnames.ora
//

>>> oracle@srv-example-db

$ cat ${ORACLE_HOME}/network/admin/listener.ora
+++++
LISTENER_ORCL =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = srv-example-db.oracle.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROCLISTENER))
    )
  )

SID_LIST_LISTENER_ORCL =

  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = ORCL)
      (ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)
      (SID_NAME = ORCL)
    )
   )

VALID_NODE_CHECKING_REGISTRATION_LISTENER_ORCL=ON

+++++

$ cat ${ORACLE_HOME}/network/admin/tnsnames.ora
+++++
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = srv-example-db.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCL)
    )
  )
+++++

$ lsnrctl start LISTENER_ORCL
$ tnsping ORCL
+++++
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 01-MAR-2020 04:53:09

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


Used parameter files:


Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = srv-example-db.oracle.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL)))
OK (0 msec)
+++++

#######################################
Create database:
#######################################

>>> oracle@srv-example-db

$ cp $ORACLE_HOME/assistants/dbca/templates/General_Purpose.dbc $ORACLE_HOME/assistants/dbca/templates/General_Purpose.dbc_orig
$ cat $ORACLE_HOME/assistants/dbca/templates/General_Purpose.dbc
++++++++++
<?xml version = '1.0'?>
<DatabaseTemplate name="General Purpose" description=" " version="19.0.0.0.0">
   <CommonAttributes>
      <option name="OMS" value="true" includeInPDBs="true"/>
      <option name="JSERVER" value="true" includeInPDBs="true"/>
      <option name="SPATIAL" value="true" includeInPDBs="true"/>
      <option name="IMEDIA" value="true" includeInPDBs="true"/>
      <option name="ORACLE_TEXT" value="true" includeInPDBs="true">
         <tablespace id="SYSAUX"/>
      </option>
      <option name="SAMPLE_SCHEMA" value="false" includeInPDBs="false"/>
      <option name="CWMLITE" value="true" includeInPDBs="true">
         <tablespace id="SYSAUX"/>
      </option>
      <option name="APEX" value="false" includeInPDBs="false"/>
      <option name="DV" value="true" includeInPDBs="true"/>
   </CommonAttributes>
   <Variables/>
   <CustomScripts Execute="false"/>
   <InitParamAttributes>
      <InitParams>
         <initParam name="db_name" value=""/>
         <initParam name="dispatchers" value="(PROTOCOL=TCP) (SERVICE={SID}XDB)"/>
         <initParam name="audit_file_dest" value="{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump"/>
         <initParam name="compatible" value="19.0.0"/>
         <initParam name="remote_login_passwordfile" value="EXCLUSIVE"/>
         <initParam name="undo_tablespace" value="UNDOTBS1"/>
         <initParam name="diagnostic_dest" value="{ORACLE_BASE}"/>
         <initParam name="audit_trail" value="db"/>
         <initParam name="db_block_size" value="8" unit="KB"/>
         <initParam name="open_cursors" value="300"/>
         <initParam name="control_files" value="(&quot;/data/{DB_UNIQUE_NAME}/control01.ctl&quot;, &quot;/redo1/{DB_UNIQUE_NAME}/control02.ctl&quot;, &quot;/redo2/{DB_UNIQUE_NAME}/control03.ctl&quot;)"/>
      </InitParams>
      <MiscParams>
         <databaseType>MULTIPURPOSE</databaseType>
         <maxUserConn>20</maxUserConn>
         <percentageMemTOSGA>40</percentageMemTOSGA>
         <customSGA>false</customSGA>
         <dataVaultEnabled>false</dataVaultEnabled>
         <archiveLogMode>false</archiveLogMode>
         <initParamFileName>{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/pfile/init.ora</initParamFileName>
      </MiscParams>
      <SPfile useSPFile="true">{ORACLE_HOME}/dbs/spfile{SID}.ora</SPfile>
   </InitParamAttributes>
   <StorageAttributes>
      <DataFiles>
         <Location>{ORACLE_HOME}/assistants/dbca/templates/Seed_Database.dfb</Location>
         <SourceDBName cdb="true">seeddata</SourceDBName>
         <Name id="3" Tablespace="SYSAUX" Contents="PERMANENT" Size="400" autoextend="true" blocksize="8192" con_id="1">/data/{DB_UNIQUE_NAME}/sysaux01.dbf</Name>
         <Name id="1" Tablespace="SYSTEM" Contents="PERMANENT" Size="880" autoextend="true" blocksize="8192" con_id="1">/data/{DB_UNIQUE_NAME}/system01.dbf</Name>
         <Name id="4" Tablespace="UNDOTBS1" Contents="UNDO" Size="25" autoextend="true" blocksize="8192" con_id="1">/data/{DB_UNIQUE_NAME}/undotbs01.dbf</Name>
         <Name id="7" Tablespace="USERS" Contents="PERMANENT" Size="5" autoextend="true" blocksize="8192" con_id="1">/data/{DB_UNIQUE_NAME}/users01.dbf</Name>
      </DataFiles>
      <TempFiles>
         <Name id="1" Tablespace="TEMP" Contents="TEMPORARY" Size="20" con_id="1">/data/{DB_UNIQUE_NAME}/temp01.dbf</Name>
      </TempFiles>
      <RedoLogGroupAttributes id="1">
         <reuse>false</reuse>
         <fileSize unit="MB">512</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo01a.log" filepath="/redo1/{DB_UNIQUE_NAME}/"/>
         <member ordinal="1" memberName="redo01b.log" filepath="/redo2/{DB_UNIQUE_NAME}/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="2">
         <reuse>false</reuse>
         <fileSize unit="MB">512</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo02a.log" filepath="/redo1/{DB_UNIQUE_NAME}/"/>
         <member ordinal="1" memberName="redo02b.log" filepath="/redo2/{DB_UNIQUE_NAME}/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="3">
         <reuse>false</reuse>
         <fileSize unit="MB">512</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo03a.log" filepath="/redo1/{DB_UNIQUE_NAME}/"/>
         <member ordinal="1" memberName="redo03b.log" filepath="/redo2/{DB_UNIQUE_NAME}/"/>
      </RedoLogGroupAttributes>
   </StorageAttributes>
</DatabaseTemplate>
++++++++++

$ dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbname ORCL \
-characterSet AL32UTF8 \
-sysPassword sysorcl \
-systemPassword sysorcl \
-createAsContainerDatabase false \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement false \
-totalMemory 16000 \
-emConfiguration NONE \
-enableArchive true \
-archiveLogDest "/arch" \
-ignorePreReqs

++++++++++
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ORCL.
Database Information:
Global Database Name:ORCL
System Identifier(SID):ORCL
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCL/ORCL.log" for further details.
++++++++++

#######################################
Post-steps / checks:
#######################################

>>> oracle@srv-example-db

$ sqlplus / as sysdba

SQL> alter system set "_use_single_log_writer"=true scope=spfile;
SQL> alter system set LOG_ARCHIVE_FORMAT = 'log%t_%s_%r.arc' scope=spfile;
SQL> shu immediate;
SQL> startup;
SQL> alter system switch logfile;
SQL> /
SQL> /
SQL> /
SQL> /
SQL> archive log list;
+++++
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /arch
Oldest online log sequence     2
Next log sequence to archive   6
Current log sequence           6
+++++

$ cat /etc/oratab
+++++
...
...
...
ORCL:/u01/app/oracle/product/19.0.0/dbhome_1:N
+++++

#######################################
Crontab backup/cleanup scripts:
#######################################

@@@@@@@@@@@@@@@@@@@@@@@@@@@
NON-PROD Version:
@@@@@@@@@@@@@@@@@@@@@@@@@@@

##
## Cleanup
##

05 00 * * * /home/oracle/dba/scripts/cleanup.sh      > /home/oracle/dba/logs/cleanup.log       2>&1 &
05  * * * * /home/oracle/dba/scripts/cleanup_arch.sh > /home/oracle/dba/logs/cleanup_arch.log  2>&1 &

@@@@@@@@@@@@@@@@@@@@@@@@@@@
PROD Version:
@@@@@@@@@@@@@@@@@@@@@@@@@@@

##
## Cleanup
##

05 00 * * * /home/oracle/dba/scripts/cleanup.sh    > /home/oracle/dba/logs/cleanup.log       2>&1 &

##
## Backups
##

15 00 * * 0   /home/oracle/dba/scripts/rman_lvl0.sh  > /home/oracle/dba/logs/rman_lvl0.log      2>&1 &
15 00 * * 1-5 /home/oracle/dba/scripts/rman_lvl1.sh  > /home/oracle/dba/logs/rman_lvl1.log      2>&1 &
01 * * * *    /home/oracle/dba/scripts/rman_arch.sh  > /home/oracle/dba/logs/rman_arch.log      2>&1 &