1. Chạy LAB = 2 bước
Copy 6 lệnh dưới → dán trên PowerShell bằng cách click chuột phải
→ không phải gõ gõ từng lệnh mất thời gian
Chạy 6 lệnh sau trên Powershell quyền Administrator → dấu # là giải thích (comment)
# Giả sử có ổ đĩa D:
# Tạo thư mục D:ansible-lab01 + chuyển vào thư mục
mkdir D:ora21c > $null ; cd D:ora21c
# Khai báo biến là link tới file cần download
$URL="https://devsecops.edu.vn/wp-content/uploads/2023/12/ora21c-kzE24mvSOmDbi3qGZH2w3jrsE3fM8g.zip"
# Download file zìa
Invoke-WebRequest -URI $URL -OutFile ora21c.zip
# Giải nén file + đổi tên
Expand-Archive ora21c.zip -DestinationPath .
# Coi trong thư mục đang đứng có gì
dir
# LINUX.X64_213000_db_home.zip
# Cái này bạn phải download = tay về từ
# https://www.oracle.com/database/technologies/oracle21c-linux-downloads.html
# Tạo máy ảo + chạy LAB từ A tới Á
vagrant up
→ phải download file LINUX.X64_213000_db_home.zip về bỏ vào thư mục này
→ phải đúng tên này vì trong scrip giải nén xài tên này
2. Các file nội dung mới nhất ở đây
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.define "ora21c" do |ora21c|
ora21c.vm.box = "oraclelinux/8"
ora21c.vm.box_url = "https://oracle.github.io/vagrant-projects/boxes/oraclelinux/8.json"
ora21c.vm.hostname = 'ol8'
ora21c.vm.synced_folder ".", "/vagrant"
ora21c.vm.network "private_network", ip: "192.168.10.10", virtualbox__intnet: "oranetwork"
ora21c.vm.network :forwarded_port, guest: 22, host: 2223, host_ip: "127.0.0.1", protocol: "tcp", id: "ssh"
ora21c.vm.network :forwarded_port, guest: 1521, host: 1521, host_ip: "127.0.0.1", protocol: "tcp", id: "listener"
ora21c.vm.network :forwarded_port, guest: 5500, host: 5500, host_ip: "127.0.0.1", protocol: "tcp", id: "oraem"
ora21c.vm.provider :virtualbox do |v|
v.gui = true
v.cpus = 2
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 4096]
v.customize ["modifyvm", :id, "--name", "Oracle-DB-21c"]
end
ora21c.vm.provision "shell", path: "prepare.sh"
ora21c.vm.provision "shell", path: "setup/install-software-only.sh"
ora21c.vm.provision "shell", path: "setup/create-listener.sh"
ora21c.vm.provision "shell", path: "setup/create-db.sh"
ora21c.vm.provision "shell", path: "service/ora-service.sh"
end
end
LINUX.X64_213000_db_home.zip
Cái này bạn phải download = tay về từ
https://www.oracle.com/database/technologies/oracle21c-linux-downloads.html
prepare.sh
#!/bin/bash
echo -e "n1. Chuẩn bị môi trường Oracle Linux 8 để cài Oracle Database 21c"
echo -e "n1.1 Tắt SELinuxn"
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
echo -e "n1.2 Thêm hostname vào để đọc được 2 chiều: IP <-> Tênn"
echo '192.168.10.10 ol8 ol8' >> /etc/hosts
echo -e "n1.3 Cài gói tự setup của Oraclen"
dnf install -y -q oracle-database-preinstall-21c
# dnf install -q -y https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm
echo -e "n1.4 Gán password cho user oraclen"
echo "1" | passwd oracle --stdin
# Gói trên k tạo password cho user oracle --> tạo thêm
echo -e "n1.5 Tạo chỗ để cài Oracle 21cn"
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app
chmod -R 755 /u01
echo 'export ORACLE_BASE=/u01/app/oracle' >> /home/oracle/.bash_profile
# END
hugepages_settings.sh
#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
# on Oracle Linux
#
# Note: This script does calculation for all shared memory
# segments available when the script is run, no matter it
# is an Oracle RDBMS shared memory segment or not.
#
# This script is provided by Doc ID 401749.1 from My Oracle Support
# http://support.oracle.com
# Welcome text
echo "
This script is provided by Doc ID 401749.1 from My Oracle Support
(http://support.oracle.com) where it is intended to compute values for
the recommended HugePages/HugeTLB configuration for the current shared
memory segments on Oracle Linux. Before proceeding with the execution please note following:
* For ASM instance, it needs to configure ASMM instead of AMM.
* The 'pga_aggregate_target' is outside the SGA and
you should accommodate this while calculating the overall size.
* In case you changes the DB SGA size,
as the new SGA will not fit in the previous HugePages configuration,
it had better disable the whole HugePages,
start the DB with new SGA size and run the script again.
And make sure that:
* Oracle Database instance(s) are up and running
* Oracle Database 11g Automatic Memory Management (AMM) is not setup
(See Doc ID 749851.1)
* The shared memory segments can be listed by command:
# ipcs -m
Press Enter to proceed..."
# DevSecOps.Edu.VN chỉnh cái này để chạy script tự động khỏi phải nhấn thêm Enter
# read
# END
# Check for the kernel version
KERN=`uname -r | awk -F. '{ printf("%d.%dn",$1,$2); }'`
# Find out the HugePage size
HPG_SZ=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`
if [ -z "$HPG_SZ" ];then
echo "The hugepages may not be supported in the system where the script is being executed."
exit 1
fi
# Initialize the counter
NUM_PG=0
# Cumulative number of pages required to handle the running shared memory segments
for SEG_BYTES in `ipcs -m | cut -c44-300 | awk '{print $1}' | grep "[0-9][0-9]*"`
do
MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q`
if [ $MIN_PG -gt 0 ]; then
NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc -q`
fi
done
RES_BYTES=`echo "$NUM_PG * $HPG_SZ * 1024" | bc -q`
# An SGA less than 100MB does not make sense
# Bail out if that is the case
if [ $RES_BYTES -lt 100000000 ]; then
echo "***********"
echo "** ERROR **"
echo "***********"
echo "Sorry! There are not enough total of shared memory segments allocated for
HugePages configuration. HugePages can only be used for shared memory segments
that you can list by command:
# ipcs -m
of a size that can match an Oracle Database SGA. Please make sure that:
* Oracle Database instance is up and running
* Oracle Database 11g Automatic Memory Management (AMM) is not configured"
exit 1
fi
# Finish with results
case $KERN in
'2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc -q`;
echo "Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;;
'2.6') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'3.8') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'3.10') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'4.1') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'4.14') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'4.18') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'5.4') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
# DevSecOps.Edu.VN thêm vào
'5.14') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'5.15') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
# END
*) echo "Kernel version $KERN is not supported by this script (yet). Exiting." ;;
esac
# End
hugepages_settings-new.sh
#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
# on Oracle Linux
#
# Note: This script does calculation for all shared memory
# segments available when the script is run, no matter it
# is an Oracle RDBMS shared memory segment or not.
#
# This script is provided by Doc ID 401749.1 from My Oracle Support
# http://support.oracle.com
# Welcome text
echo "
This script is provided by Doc ID 401749.1 from My Oracle Support
(http://support.oracle.com) where it is intended to compute values for
the recommended HugePages/HugeTLB configuration for the current shared
memory segments on Oracle Linux. Before proceeding with the execution please note following:
* For ASM instance, it needs to configure ASMM instead of AMM.
* The 'pga_aggregate_target' is outside the SGA and
you should accommodate this while calculating the overall size.
* In case you changes the DB SGA size,
as the new SGA will not fit in the previous HugePages configuration,
it had better disable the whole HugePages,
start the DB with new SGA size and run the script again.
And make sure that:
* Oracle Database instance(s) are up and running
* Oracle Database 11g Automatic Memory Management (AMM) is not setup
(See Doc ID 749851.1)
* The shared memory segments can be listed by command:
# ipcs -m
Press Enter to proceed..."
# read
# Check for the kernel version
# KERN=`uname -r | awk -F. '{ printf("%d.%dn",$1,$2); }'`
KERN=`uname -r | cut -f1,2 -d.`
# Find out the HugePage size
# HPG_SZ=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`
HPG_SZ=`grep Hugepagesize /proc/meminfo | tr -s ' ' | cut -f2 -d' '`
if [ -z "$HPG_SZ" ];then
echo "The hugepages may not be supported in the system where the script is being executed."
exit 1
fi
# Initialize the counter
NUM_PG=0
# Cumulative number of pages required to handle the running shared memory segments
# for SEG_BYTES in `ipcs -m | cut -c44-300 | awk '{print $1}' | grep "[0-9][0-9]*"`
for SEG_BYTES in `ipcs -m | awk '/^[0-9]/ {print $5}'`
do
# MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q`
MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc`
if [ $MIN_PG -gt 0 ]; then
# NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc -q`
NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc`
fi
done
# RES_BYTES=`echo "$NUM_PG * $HPG_SZ * 1024" | bc -q`
RES_BYTES=`echo "$NUM_PG * $HPG_SZ * 1024" | bc`
# An SGA less than 100MB does not make sense
# Bail out if that is the case
if [ $RES_BYTES -lt 100000000 ]; then
echo "***********"
echo "** ERROR **"
echo "***********"
echo "Sorry! There are not enough total of shared memory segments allocated for
HugePages configuration. HugePages can only be used for shared memory segments
that you can list by command:
# ipcs -m
of a size that can match an Oracle Database SGA. Please make sure that:
* Oracle Database instance is up and running
* Oracle Database 11g Automatic Memory Management (AMM) is not configured"
exit 1
fi
# Finish with results
case $KERN in
# '2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc -q`;
'2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc`;
echo "Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;;
'2.6') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'3.8') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'3.10') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'4.1') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'4.14') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'4.18') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'5.4') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
# DevSecOps.Edu.VN thêm vào
'5.14') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
'5.15') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
# END
*) echo "Kernel version $KERN is not supported by this script (yet). Exiting." ;;
esac
# End
#!/bin/bash
echo -e "n2. Cài Oracle Database Software only 21cn"
# Download Oracle 21c chạy trên Linux ở đây
# https://www.oracle.com/database/technologies/oracle21c-linux-downloads.html
su -l oracle -c "mkdir database ;
unzip -q -d ./database /vagrant/LINUX.X64_213000_db_home.zip ;
cp /vagrant/setup/ora21c-sw-only.rsp . ;
./database/runInstaller -silent -ignorePrereqFailure -waitforcompletion -responseFile /home/oracle/ora21c-sw-only.rsp"
# runInstaller hổng hỗ trợ đường dẫn tương đối (relative path) như ./database
# --> chỉ xài được đường dẫn tuyệt đối (absolute path)
echo -e "n2.1 Chạy 2 script của Oracle database với quyền rootn"
/u01/app/oraInventory/orainstRoot.sh
/home/oracle/database/root.sh
echo -e "n2.2 Thêm 2 biến môi trường Oraclen"
echo 'export ORACLE_HOME=/home/oracle/database' >> /home/oracle/.bash_profile
echo 'export PATH=$PATH:$ORACLE_HOME/bin' >> /home/oracle/.bash_profile
# END
####################################################################
## Copyright(c) Oracle Corporation 1998,2021. All rights reserved.##
## ##
## Specify values for the variables listed below to customize ##
## your installation. ##
## ##
## Each variable is associated with a comment. The comment ##
## can help to populate the variables with the appropriate ##
## values. ##
## ##
## IMPORTANT NOTE: This file contains plain text passwords and ##
## should be secured to have read permission only by oracle user ##
## or db administrator who owns this installation. ##
## ##
####################################################################
#------------------------------------------------------------------------------
# Do not change the following system generated value.
#------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v21.0.0
#-------------------------------------------------------------------------------
# Specify the installation option.
# It can be one of the following:
# - INSTALL_DB_SWONLY
# - INSTALL_DB_AND_CONFIG
#-------------------------------------------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY
#-------------------------------------------------------------------------------
# Specify the Unix group to be set for the inventory directory.
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=oinstall
#-------------------------------------------------------------------------------
# Specify the location which holds the inventory files.
# This is an optional parameter if installing on
# Windows based Operating System.
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/u01/app/oraInventory
#-------------------------------------------------------------------------------
# Specify the complete path of the Oracle Base.
#-------------------------------------------------------------------------------
ORACLE_BASE=/u01/app/oracle
#-------------------------------------------------------------------------------
# Specify the installation edition of the component.
#
# The value should contain only one of these choices.
# - EE : Enterprise Edition
# - SE2 : Standard Edition 2
#-------------------------------------------------------------------------------
oracle.install.db.InstallEdition=EE
###############################################################################
# #
# PRIVILEGED OPERATING SYSTEM GROUPS #
# ------------------------------------------ #
# Provide values for the OS groups to which SYSDBA and SYSOPER privileges #
# needs to be granted. If the install is being performed as a member of the #
# group "dba", then that will be used unless specified otherwise below. #
# #
# The value to be specified for OSDBA and OSOPER group is only for UNIX based #
# Operating System. #
# #
###############################################################################
#------------------------------------------------------------------------------
# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges.
#-------------------------------------------------------------------------------
oracle.install.db.OSDBA_GROUP=dba
#------------------------------------------------------------------------------
# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges.
# The value to be specified for OSOPER group is optional.
#------------------------------------------------------------------------------
oracle.install.db.OSOPER_GROUP=oper
#------------------------------------------------------------------------------
# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSBACKUPDBA_GROUP=backupdba
#------------------------------------------------------------------------------
# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSDGDBA_GROUP=dgdba
#------------------------------------------------------------------------------
# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSKMDBA_GROUP=kmdba
#------------------------------------------------------------------------------
# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSRACDBA_GROUP=racdba
################################################################################
# #
# Root script execution configuration #
# #
################################################################################
#-------------------------------------------------------------------------------------------------------
# Specify the root script execution mode.
#
# - true : To execute the root script automatically by using the appropriate configuration methods.
# - false : To execute the root script manually.
#
# If this option is selected, password should be specified on the console.
#-------------------------------------------------------------------------------------------------------
oracle.install.db.rootconfig.executeRootScript=false
#--------------------------------------------------------------------------------------
# Specify the configuration method to be used for automatic root script execution.
#
# Following are the possible choices:
# - ROOT
# - SUDO
#--------------------------------------------------------------------------------------
oracle.install.db.rootconfig.configMethod=
#--------------------------------------------------------------------------------------
# Specify the absolute path of the sudo program.
#
# Applicable only when SUDO configuration method was chosen.
#--------------------------------------------------------------------------------------
oracle.install.db.rootconfig.sudoPath=
#--------------------------------------------------------------------------------------
# Specify the name of the user who is in the sudoers list.
# Applicable only when SUDO configuration method was chosen.
# Note:For Single Instance database installations,the sudo user name must be the username of the user installing the database.
#--------------------------------------------------------------------------------------
oracle.install.db.rootconfig.sudoUserName=
###############################################################################
# #
# Grid Options #
# #
###############################################################################
#------------------------------------------------------------------------------
# Value is required only if the specified install option is INSTALL_DB_SWONLY
#
# Specify the cluster node names selected during the installation.
#
# Example : oracle.install.db.CLUSTER_NODES=node1,node2
#------------------------------------------------------------------------------
oracle.install.db.CLUSTER_NODES=
###############################################################################
# #
# Database Configuration Options #
# #
###############################################################################
#-------------------------------------------------------------------------------
# Specify the type of database to create.
# It can be one of the following:
# - GENERAL_PURPOSE
# - DATA_WAREHOUSE
# GENERAL_PURPOSE: A starter database designed for general purpose use or transaction-heavy applications.
# DATA_WAREHOUSE : A starter database optimized for data warehousing applications.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
#-------------------------------------------------------------------------------
# Specify the Starter Database Global Database Name.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.globalDBName=
#-------------------------------------------------------------------------------
# Specify the Starter Database SID.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.SID=
#-------------------------------------------------------------------------------
# Specify the Pluggable Database name for the pluggable database in Container Database.
#-------------------------------------------------------------------------------
oracle.install.db.config.PDBName=
#-------------------------------------------------------------------------------
# Specify the Starter Database character set.
#
# One of the following
# AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,
# EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,
# BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,
# AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,
# IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,
# KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,
# ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.characterSet=
#------------------------------------------------------------------------------
# This variable should be set to true if Automatic Memory Management
# in Database is desired.
# If Automatic Memory Management is not desired, and memory allocation
# is to be done manually, then set it to false.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryOption=false
#-------------------------------------------------------------------------------
# Specify the total memory allocation for the database. Value(in MB) should be
# at least 256 MB, and should not exceed the total physical memory available
# on the system.
# Example: oracle.install.db.config.starterdb.memoryLimit=512
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryLimit=
###############################################################################
# #
# Passwords can be supplied for the following four schemas in the #
# starter database: #
# SYS #
# SYSTEM #
# DBSNMP (used by Enterprise Manager) #
# #
# Same password can be used for all accounts (not recommended) #
# or different passwords for each account can be provided (recommended) #
# #
###############################################################################
#------------------------------------------------------------------------------
# This variable holds the password that is to be used for all schemas in the
# starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.ALL=
#-------------------------------------------------------------------------------
# Specify the SYS password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYS=
#-------------------------------------------------------------------------------
# Specify the SYSTEM password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSTEM=
#-------------------------------------------------------------------------------
# Specify the DBSNMP password for the starter database.
# Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.DBSNMP=
#-------------------------------------------------------------------------------
# Specify the PDBADMIN password required for creation of Pluggable Database in the Container Database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.PDBADMIN=
#-------------------------------------------------------------------------------
# Specify the management option to use for managing the database.
# Options are:
# 1. CLOUD_CONTROL - If you want to manage your database with Enterprise Manager Cloud Control along with Database Express.
# 2. DEFAULT -If you want to manage your database using the default Database Express option.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.managementOption=DEFAULT
#-------------------------------------------------------------------------------
# Specify the OMS host to connect to Cloud Control.
# Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.omsHost=
#-------------------------------------------------------------------------------
# Specify the OMS port to connect to Cloud Control.
# Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.omsPort=0
#-------------------------------------------------------------------------------
# Specify the EM Admin user name to use to connect to Cloud Control.
# Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.emAdminUser=
#-------------------------------------------------------------------------------
# Specify the EM Admin password to use to connect to Cloud Control.
# Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.emAdminPassword=
###############################################################################
# #
# SPECIFY RECOVERY OPTIONS #
# ------------------------------------ #
# Recovery options for the database can be mentioned using the entries below #
# #
###############################################################################
#------------------------------------------------------------------------------
# This variable is to be set to false if database recovery is not required. Else
# this can be set to true.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.enableRecovery=false
#-------------------------------------------------------------------------------
# Specify the type of storage to use for the database.
# It can be one of the following:
# - FILE_SYSTEM_STORAGE
# - ASM_STORAGE
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.storageType=
#-------------------------------------------------------------------------------
# Specify the database file location which is a directory for datafiles, control
# files, redo logs.
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
#-------------------------------------------------------------------------------
# Specify the recovery location.
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
#-------------------------------------------------------------------------------
# Specify the existing ASM disk groups to be used for storage.
#
# Applicable only when oracle.install.db.config.starterdb.storageType=ASM_STORAGE
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.diskGroup=
#-------------------------------------------------------------------------------
# Specify the password for ASMSNMP user of the ASM instance.
#
# Applicable only when oracle.install.db.config.starterdb.storage=ASM_STORAGE
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.ASMSNMPPassword=
#!/bin/bash
echo -e "n3. Tạo Oracle Listener 21c"
# netca hổng hỗ trợ đường dẫn tương đối (relative path) như ./database
su -l oracle -c "netca -silent -responsefile /home/oracle/database/assistants/netca/netca.rsp ;
lsnrctl start ;
lsnrctl status ;
tnsping ol8 ;
ss -plant | grep 1521"
# END
#!/bin/bash
echo -e "n4. Tạo Oracle Database 21cn"
# dbca hổng hỗ trợ đường dẫn tương đối (relative path) như ./database
su -l oracle -c "cp /vagrant/setup/ora21c-dbca-sga.rsp . ;
dbca -silent -createDatabase -responseFile /home/oracle/ora21c-dbca-sga.rsp ;
ss -plant | grep 5500 ;
echo 'export ORACLE_SID=orcl' >> ~/.bash_profile ;
source ~/.bash_profile ;
echo 'select INSTANCE_NAME,VERSION,STATUS from v$instance;' | sqlplus / as sysdba"
sed -i 's/:N$/:Y/' /etc/oratab
# END
##############################################################################
## ##
## DBCA response file ##
## ------------------ ##
## Copyright(c) Oracle Corporation 1998,2021. All rights reserved. ##
## ##
## Specify values for the variables listed below to customize ##
## your installation. ##
## ##
## Each variable is associated with a comment. The comment ##
## can help to populate the variables with the appropriate ##
## values. ##
## ##
## IMPORTANT NOTE: This file contains plain text passwords and ##
## should be secured to have read permission only by oracle user ##
## or db administrator who owns this installation. ##
##############################################################################
#-------------------------------------------------------------------------------
# Do not change the following system generated value.
#-------------------------------------------------------------------------------
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v21.0.0
#-----------------------------------------------------------------------------
# Name : gdbName
# Datatype : String
# Description : Global database name of the database
# Valid values : <db_name>.<db_domain> - when database domain isn't NULL
# <db_name> - when database domain is NULL
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
gdbName=orcl
#-----------------------------------------------------------------------------
# Name : sid
# Datatype : String
# Description : System identifier (SID) of the database
# Valid values : Check Oracle12c Administrator's Guide
# Default value : <db_name> specified in GDBNAME
# Mandatory : No
#-----------------------------------------------------------------------------
sid=orcl
#-----------------------------------------------------------------------------
# Name : databaseConfigType
# Datatype : String
# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database
# Valid values : SIRACRACONENODE
# Default value : SI
# Mandatory : No
#-----------------------------------------------------------------------------
databaseConfigType=SI
#-----------------------------------------------------------------------------
# Name : RACOneNodeServiceName
# Datatype : String
# Description : Service is required by application to connect to RAC One
# Node Database
# Valid values : Service Name
# Default value : None
# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ]
#-----------------------------------------------------------------------------
RACOneNodeServiceName=
#-----------------------------------------------------------------------------
# Name : policyManaged
# Datatype : Boolean
# Description : Set to true if Database is policy managed and
# set to false if Database is admin managed
# Valid values : TRUEFALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
policyManaged=false
#-----------------------------------------------------------------------------
# Name : managementPolicy
# Datatype : String
# Description : Set to AUTOMATIC or RANK based on management policy.
# Valid values : AUTOMATICRANK
# Default value : AUTOMATIC
# Mandatory : No
#-----------------------------------------------------------------------------
managementPolicy=AUTOMATIC
#-----------------------------------------------------------------------------
# Name : createServerPool
# Datatype : Boolean
# Description : Set to true if new server pool need to be created for database
# if this option is specified then the newly created database
# will use this newly created serverpool.
# Multiple serverpoolname can not be specified for database
# Valid values : TRUEFALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
createServerPool=false
#-----------------------------------------------------------------------------
# Name : serverPoolName
# Datatype : String
# Description : Only one serverpool name need to be specified
# if Create Server Pool option is specified.
# Comma-separated list of Serverpool names if db need to use
# multiple Server pool
# Valid values : ServerPool name
# Default value : None
# Mandatory : No [required in case of RAC service centric database]
#-----------------------------------------------------------------------------
serverPoolName=
#-----------------------------------------------------------------------------
# Name : cardinality
# Datatype : Number
# Description : Specify Cardinality for create server pool operation
# Valid values : any positive Integer value
# Default value : Number of qualified nodes on cluster
# Mandatory : No [Required when a new serverpool need to be created]
#-----------------------------------------------------------------------------
cardinality=
#-----------------------------------------------------------------------------
# Name : force
# Datatype : Boolean
# Description : Set to true if new server pool need to be created by force
# if this option is specified then the newly created serverpool
# will be assigned server even if no free servers are available.
# This may affect already running database.
# This flag can be specified for Admin managed as well as policy managed db.
# Valid values : TRUEFALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
force=false
#-----------------------------------------------------------------------------
# Name : pqPoolName
# Datatype : String
# Description : Only one serverpool name needs to be specified
# if create server pool option is specified.
# Comma-separated list of serverpool names if use
# server pool. This is required to
# create Parallel Query (PQ) database. Applicable to Big Cluster
# Valid values : Parallel Query (PQ) pool name
# Default value : None
# Mandatory : No [required in case of RAC service centric database]
#-----------------------------------------------------------------------------
pqPoolName=
#-----------------------------------------------------------------------------
# Name : pqCardinality
# Datatype : Number
# Description : Specify Cardinality for create server pool operation.
# Applicable to Big Cluster
# Valid values : any positive Integer value
# Default value : Number of qualified nodes on cluster
# Mandatory : No [Required when a new serverpool need to be created]
#-----------------------------------------------------------------------------
pqCardinality=
#-----------------------------------------------------------------------------
# Name : createAsContainerDatabase
# Datatype : boolean
# Description : flag to create database as container database
# Valid values : Check Oracle12c Administrator's Guide
# Default value : false
# Mandatory : No
#-----------------------------------------------------------------------------
createAsContainerDatabase=true
#-----------------------------------------------------------------------------
# Name : numberOfPDBs
# Datatype : Number
# Description : Specify the number of pdb to be created
# Valid values : 0 to 252
# Default value : 0
# Mandatory : No
#-----------------------------------------------------------------------------
numberOfPDBs=1
#-----------------------------------------------------------------------------
# Name : pdbName
# Datatype : String
# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created
# Valid values : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
pdbName=orclpdb1
#-----------------------------------------------------------------------------
# Name : useLocalUndoForPDBs
# Datatype : boolean
# Description : Flag to create local undo tablespace for all PDB's.
# Valid values : TRUEFALSE
# Default value : TRUE
# Mandatory : No
#-----------------------------------------------------------------------------
useLocalUndoForPDBs=true
#-----------------------------------------------------------------------------
# Name : pdbAdminPassword
# Datatype : String
# Description : PDB Administrator user password
# Valid values : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
pdbAdminPassword=Password123
#-----------------------------------------------------------------------------
# Name : nodelist
# Datatype : String
# Description : Comma-separated list of cluster nodes
# Valid values : Cluster node names
# Default value : None
# Mandatory : No (Yes for RAC database-centric database )
#-----------------------------------------------------------------------------
nodelist=
#-----------------------------------------------------------------------------
# Name : templateName
# Datatype : String
# Description : Name of the template
# Valid values : Template file name
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
templateName=/home/oracle/database/assistants/dbca/templates/General_Purpose.dbc
#-----------------------------------------------------------------------------
# Name : sysPassword
# Datatype : String
# Description : Password for SYS user
# Valid values : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
sysPassword=Password123
#-----------------------------------------------------------------------------
# Name : systemPassword
# Datatype : String
# Description : Password for SYSTEM user
# Valid values : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory : Yes
#-----------------------------------------------------------------------------
systemPassword=Password123
#-----------------------------------------------------------------------------
# Name : serviceUserPassword
# Datatype : String
# Description : Password for Windows Service user
# Default value : None
# Mandatory : If Oracle home is installed with windows service user
#-----------------------------------------------------------------------------
serviceUserPassword=
#-----------------------------------------------------------------------------
# Name : emConfiguration
# Datatype : String
# Description : Enterprise Manager Configuration Type
# Valid values : CENTRAL|DBEXPRESS|BOTH|NONE
# Default value : NONE
# Mandatory : No
#-----------------------------------------------------------------------------
emConfiguration=DBEXPRESS
#-----------------------------------------------------------------------------
# Name : emExpressPort
# Datatype : Number
# Description : Enterprise Manager Configuration Type
# Valid values : Check Oracle12c Administrator's Guide
# Default value : NONE
# Mandatory : No, will be picked up from DBEXPRESS_HTTPS_PORT env variable
# or auto generates a free port between 5500 and 5599
#-----------------------------------------------------------------------------
emExpressPort=5500
#-----------------------------------------------------------------------------
# Name : runCVUChecks
# Datatype : Boolean
# Description : Specify whether to run Cluster Verification Utility checks
# periodically in Cluster environment
# Valid values : TRUEFALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
runCVUChecks=FALSE
#-----------------------------------------------------------------------------
# Name : dbsnmpPassword
# Datatype : String
# Description : Password for DBSNMP user
# Valid values : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory : Yes, if emConfiguration is specified or
# the value of runCVUChecks is TRUE
#-----------------------------------------------------------------------------
dbsnmpPassword=
#-----------------------------------------------------------------------------
# Name : omsHost
# Datatype : String
# Description : EM management server host name
# Default value : None
# Mandatory : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
omsHost=
#-----------------------------------------------------------------------------
# Name : omsPort
# Datatype : Number
# Description : EM management server port number
# Default value : None
# Mandatory : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
omsPort=0
#-----------------------------------------------------------------------------
# Name : emUser
# Datatype : String
# Description : EM Admin username to add or modify targets
# Default value : None
# Mandatory : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
emUser=
#-----------------------------------------------------------------------------
# Name : emPassword
# Datatype : String
# Description : EM Admin user password
# Default value : None
# Mandatory : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
emPassword=
#-----------------------------------------------------------------------------
# Name : dvConfiguration
# Datatype : Boolean
# Description : Specify "True" to configure and enable Oracle Database vault
# Valid values : True/False
# Default value : False
# Mandatory : No
#-----------------------------------------------------------------------------
dvConfiguration=false
#-----------------------------------------------------------------------------
# Name : dvUserName
# Datatype : String
# Description : DataVault Owner
# Valid values : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory : Yes, if DataVault option is chosen
#-----------------------------------------------------------------------------
dvUserName=
#-----------------------------------------------------------------------------
# Name : dvUserPassword
# Datatype : String
# Description : Password for DataVault Owner
# Valid values : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory : Yes, if DataVault option is chosen
#-----------------------------------------------------------------------------
dvUserPassword=
#-----------------------------------------------------------------------------
# Name : dvAccountManagerName
# Datatype : String
# Description : DataVault Account Manager
# Valid values : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
dvAccountManagerName=
#-----------------------------------------------------------------------------
# Name : dvAccountManagerPassword
# Datatype : String
# Description : Password for DataVault Account Manager
# Valid values : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
dvAccountManagerPassword=
#-----------------------------------------------------------------------------
# Name : olsConfiguration
# Datatype : Boolean
# Description : Specify "True" to configure and enable Oracle Label Security
# Valid values : True/False
# Default value : False
# Mandatory : No
#-----------------------------------------------------------------------------
olsConfiguration=false
#-----------------------------------------------------------------------------
# Name : datafileJarLocation
# Datatype : String
# Description : Location of the data file jar
# Valid values : Directory containing compressed datafile jar
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/
#-----------------------------------------------------------------------------
# Name : datafileDestination
# Datatype : String
# Description : Location of the data file's
# Valid values : Directory for all the database files
# Default value : $ORACLE_BASE/oradata
# Mandatory : No
#-----------------------------------------------------------------------------
datafileDestination={ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/
#-----------------------------------------------------------------------------
# Name : recoveryAreaDestination
# Datatype : String
# Description : Location of the data file's
# Valid values : Recovery Area location
# Default value : $ORACLE_BASE/flash_recovery_area
# Mandatory : No
#-----------------------------------------------------------------------------
recoveryAreaDestination=
#-----------------------------------------------------------------------------
# Name : recoveryAreaSize
# Datatype : String
# Description : Recovery area size
# Mandatory : No
#-----------------------------------------------------------------------------
recoveryAreaSize=54525952BYTES
#-----------------------------------------------------------------------------
# Name : configureWithOID
# Datatype : Boolean
# Description : To configure with OID or not
# Valid values : TRUE / FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
configureWithOID=
#-----------------------------------------------------------------------------
# Name : pdbOptionMap
# Datatype : String
# Description : Values for DB Options indicating whether they should be included in PDB
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
pdbOptions=ORACLE_TEXT:true,IMEDIA:true,OMS:true,JSERVER:true,SPATIAL:true,SAMPLE_SCHEMA:false,DV:true,CWMLITE:true
#-----------------------------------------------------------------------------
# Name : dbOptionMap
# Datatype : String
# Description : Values DB Options indicating whether they are enabled
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
dbOptions=ORACLE_TEXT:true,IMEDIA:true,OMS:true,JSERVER:true,SPATIAL:true,SAMPLE_SCHEMA:false,DV:true,CWMLITE:true
#-----------------------------------------------------------------------------
# Name : storageType
# Datatype : String
# Description : Specifies the storage on which the database is to be created
# Valid values : FS (CFS for RAC), ASM
# Default value : FS
# Mandatory : No
#-----------------------------------------------------------------------------
storageType=FS
#-----------------------------------------------------------------------------
# Name : diskGroupName
# Datatype : String
# Description : Specifies the disk group name for the storage
# Default value : DATA
# Mandatory : No
#-----------------------------------------------------------------------------
diskGroupName=
#-----------------------------------------------------------------------------
# Name : asmsnmpPassword
# Datatype : String
# Description : Password for ASM Monitoring
# Default value : None
# Mandatory : No
#-----------------------------------------------------------------------------
asmsnmpPassword=
#-----------------------------------------------------------------------------
# Name : recoveryGroupName
# Datatype : String
# Description : Specifies the disk group name for the recovery area
# Default value : RECOVERY
# Mandatory : No
#-----------------------------------------------------------------------------
recoveryGroupName=
#-----------------------------------------------------------------------------
# Name : characterSet
# Datatype : String
# Description : Character set of the database
# Valid values : Check Oracle12c National Language Support Guide
# Default value : "US7ASCII"
# Mandatory : NO
#-----------------------------------------------------------------------------
characterSet=AL32UTF8
#-----------------------------------------------------------------------------
# Name : nationalCharacterSet
# Datatype : String
# Description : National Character set of the database
# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide
# Default value : "AL16UTF16"
# Mandatory : No
#-----------------------------------------------------------------------------
nationalCharacterSet=AL16UTF16
#-----------------------------------------------------------------------------
# Name : registerWithDirService
# Datatype : Boolean
# Description : Specifies whether to register with Directory Service.
# Valid values : TRUE FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
registerWithDirService=false
#-----------------------------------------------------------------------------
# Name : dirServiceUserName
# Datatype : String
# Description : Specifies the name of the directory service user
# Mandatory : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
dirServiceUserName=
#-----------------------------------------------------------------------------
# Name : dirServicePassword
# Datatype : String
# Description : The password of the directory service user.
# You can also specify the password at the command prompt instead of here.
# Mandatory : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
dirServicePassword=
#-----------------------------------------------------------------------------
# Name : walletPassword
# Datatype : String
# Description : The password for wallet to created or modified.
# You can also specify the password at the command prompt instead of here.
# Mandatory : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
walletPassword=
#-----------------------------------------------------------------------------
# Name : listeners
# Datatype : String
# Description : Specifies list of listeners to register the database with.
# By default the database is configured for all the listeners specified in the
# $ORACLE_HOME/network/admin/listener.ora
# Valid values : The list should be comma separated like "listener1,listener2".
# Mandatory : NO
#-----------------------------------------------------------------------------
listeners=LISTENER
#-----------------------------------------------------------------------------
# Name : skipListenerRegistration
# Datatype : Boolean
# Description : FALSE if no listener chosen for registration, else true.
# Valid values : TRUE/FALSE
# Mandatory : NO
#-----------------------------------------------------------------------------
skipListenerRegistration=false
#-----------------------------------------------------------------------------
# Name : variablesFile
# Datatype : String
# Description : Location of the file containing variable value pair
# Valid values : A valid file-system file. The variable value pair format in this file
# is <variable>=<value>. Each pair should be in a new line.
# Default value : None
# Mandatory : NO
#-----------------------------------------------------------------------------
variablesFile=
#-----------------------------------------------------------------------------
# Name : variables
# Datatype : String
# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates
# Default value : None
# Mandatory : NO
#-----------------------------------------------------------------------------
variables=ORACLE_BASE_HOME=/u01/app/oracle/homes/OraDB21Home1,DB_UNIQUE_NAME=orcl,ORACLE_BASE=/u01/app/oracle,PDB_NAME=,DB_NAME=orcl,ORACLE_HOME=/home/oracle/database,SID=orcl
#-----------------------------------------------------------------------------
# Name : initParams
# Datatype : String
# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates
# Default value : None
# Mandatory : NO
#-----------------------------------------------------------------------------
initParams=undo_tablespace=UNDOTBS1,sga_target=1166MB,db_block_size=8192BYTES,nls_language=AMERICAN,dispatchers=(PROTOCOL=TCP) (SERVICE=orclXDB),diagnostic_dest={ORACLE_BASE},control_files=("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control02.ctl"),remote_login_passwordfile=EXCLUSIVE,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,processes=320,pga_aggregate_target=389MB,nls_territory=AMERICA,local_listener=LISTENER_ORCL,open_cursors=300,compatible=21.0.0,db_name=orcl,audit_trail=db
#-----------------------------------------------------------------------------
# Name : enableArchive
# Datatype : Boolean
# Description : Specifies whether to enable archive log.
# Valid values : TRUE FALSE
# Default value : FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
enableArchive=false
#-----------------------------------------------------------------------------
# Name : useOMF
# Datatype : Boolean
# Description : Specifies whether to use OMF or not.
# Valid values : TRUE FALSE
# Mandatory : No
#-----------------------------------------------------------------------------
useOMF=false
#-----------------------------------------------------------------------------
# Name : memoryPercentage
# Datatype : String
# Description : percentage of physical memory for Oracle
# Default value : None
# Mandatory : NO
#-----------------------------------------------------------------------------
memoryPercentage=40
#-----------------------------------------------------------------------------
# Name : databaseType
# Datatype : String
# Description : used for memory distribution when memoryPercentage specified
# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP
# Default value : MULTIPURPOSE
# Mandatory : NO
#-----------------------------------------------------------------------------
databaseType=MULTIPURPOSE
#-----------------------------------------------------------------------------
# Name : automaticMemoryManagement
# Datatype : Boolean
# Description : flag to indicate Automatic Memory Management is used
# Valid values : TRUE/FALSE
# Default value : TRUE
# Mandatory : NO
#-----------------------------------------------------------------------------
automaticMemoryManagement=false
#-----------------------------------------------------------------------------
# Name : totalMemory
# Datatype : String
# Description : total memory in MB to allocate to Oracle
# Valid values :
# Default value :
# Mandatory : NO
#-----------------------------------------------------------------------------
totalMemory=0
#!/bin/bash
echo -e "n5. Cấu hình Oracle Listener + DB 21c chạy bằng systemd servicen"
cp /vagrant/service/ora21c /etc/sysconfig
cp /vagrant/service/{ora21c,listener}.service /usr/lib/systemd/system/
systemctl daemon-reload
systemctl enable listener ora21c
# END
[Unit]
Description=Oracle Database 21c
After=network.target listener.service
[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/ora21c
ExecStart=/home/oracle/database/bin/dbstart $ORACLE_HOME
ExecStop=/home/oracle/database/bin/dbshut $ORACLE_HOME
User=oracle
[Install]
WantedBy=multi-user.target
[Unit]
Description=Oracle Listener 21c
Wants=network-online.target
After=network.target network-online.target
[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/ora21c
ExecStart=/home/oracle/database/bin/lsnrctl start
ExecStop=/home/oracle/database/bin/lsnrctl stop
User=oracle
[Install]
WantedBy=multi-user.target
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/home/oracle/database
ORACLE_SID=orcl