Skip to content

Commit 8be5b54

Browse files
committed
Merge branch 'master' of https://github.com/oraclebase/vagrant
2 parents 3deadc1 + cff9958 commit 8be5b54

31 files changed

+1152
-0
lines changed

database/f42_19/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Oracle 19c on Fedora 42
2+
3+
A simple Vagrant build for Oracle Database 19c on Fedora 42.
4+
5+
## Required Software
6+
7+
* [Vagrant](https://www.vagrantup.com/downloads.html)
8+
* [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
9+
* [Oracle Database](https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle19c-linux-5462157.html)
10+
11+
Place the Oracle database software in the "software" directory before calling the `vagrant up` command.

database/f42_19/Vagrantfile

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Variables
5+
var_box = 'oraclebase/fedora-42'
6+
var_vm_name = 'f42_19'
7+
var_mem_size = 6144 # More would be better.
8+
var_cpus = 2
9+
var_non_rotational = 'on' # SSD
10+
var_disk1_name = './f42_19_u01.vdi'
11+
var_disk2_name = './f42_19_u02.vdi'
12+
var_disk_size = 100
13+
var_public_ip = '192.168.56.140'
14+
15+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
16+
# configures the configuration version (we support older styles for
17+
# backwards compatibility). Please don't change it unless you know what
18+
# you're doing.
19+
Vagrant.configure("2") do |config|
20+
# The most common configuration options are documented and commented below.
21+
# For a complete reference, please see the online documentation at
22+
# https://docs.vagrantup.com.
23+
24+
# Every Vagrant development environment requires a box. You can search for
25+
# boxes at https://vagrantcloud.com/search.
26+
config.vm.box = var_box
27+
28+
# Disable automatic box update checking. If you disable this, then
29+
# boxes will only be checked for updates when the user runs
30+
# `vagrant box outdated`. This is not recommended.
31+
# config.vm.box_check_update = false
32+
33+
# Create a forwarded port mapping which allows access to a specific port
34+
# within the machine from a port on the host machine. In the example below,
35+
# accessing "localhost:8080" will access port 80 on the guest machine.
36+
# NOTE: This will enable public access to the opened port
37+
# config.vm.network "forwarded_port", guest: 80, host: 8080
38+
config.vm.network "forwarded_port", guest: 1521, host: 1521
39+
config.vm.network "forwarded_port", guest: 5500, host: 5500
40+
41+
# Create a forwarded port mapping which allows access to a specific port
42+
# within the machine from a port on the host machine and only allow access
43+
# via 127.0.0.1 to disable public access
44+
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
45+
46+
# Create a private network, which allows host-only access to the machine
47+
# using a specific IP.
48+
config.vm.network "private_network", ip: var_public_ip
49+
50+
# Create a public network, which generally matched to bridged network.
51+
# Bridged networks make the machine appear as another physical device on
52+
# your network.
53+
# config.vm.network "public_network"
54+
55+
# Share an additional folder to the guest VM. The first argument is
56+
# the path on the host to the actual folder. The second argument is
57+
# the path on the guest to mount the folder. And the optional third
58+
# argument is a set of non-required options.
59+
# config.vm.synced_folder "../data", "/vagrant_data"
60+
61+
# Provider-specific configuration so you can fine-tune various
62+
# backing providers for Vagrant. These expose provider-specific options.
63+
# Example for VirtualBox:
64+
#
65+
config.vm.provider "virtualbox" do |vb|
66+
vb.memory = var_mem_size
67+
vb.cpus = var_cpus
68+
vb.name = var_vm_name
69+
70+
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', '0', '--nonrotational', var_non_rotational]
71+
72+
unless File.exist?(var_disk1_name)
73+
vb.customize ['createhd', '--filename', var_disk1_name, '--size', var_disk_size * 1024]
74+
end
75+
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--nonrotational', var_non_rotational, '--medium', var_disk1_name]
76+
77+
unless File.exist?(var_disk2_name)
78+
vb.customize ['createhd', '--filename', var_disk2_name, '--size', var_disk_size * 1024]
79+
end
80+
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 2, '--device', 0, '--type', 'hdd', '--nonrotational', var_non_rotational, '--medium', var_disk2_name]
81+
end
82+
83+
# Enable provisioning with a shell script. Additional provisioners such as
84+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
85+
# documentation for more information about their specific syntax and use.
86+
config.vm.provision "shell", inline: <<-SHELL
87+
sh /vagrant/scripts/setup.sh
88+
SHELL
89+
end

database/f42_19/config/install.env

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export ORACLE_BASE=/u01/app/oracle
2+
export ORA_INVENTORY=/u01/app/oraInventory
3+
export ORACLE_HOME_EXT=product/19.0.0/dbhome_1
4+
export ORACLE_HOME=${ORACLE_BASE}/${ORACLE_HOME_EXT}
5+
6+
export SOFTWARE_DIR=/u01/software
7+
export SCRIPTS_DIR=/home/oracle/scripts
8+
export DATA_DIR=/u02/oradata
9+
10+
export ORACLE_SID=cdb1
11+
export PDB_NAME=pdb1
12+
export ORACLE_UNQNAME=${ORACLE_SID}
13+
14+
export DB_SOFTWARE="LINUX.X64_193000_db_home.zip"
15+
export ORACLE_PASSWORD="oracle"
16+
export SYS_PASSWORD="SysPassword1"
17+
export PDB_PASSWORD="PdbPassword1"
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
#!/bin/bash
2+
echo "******************************************************************************"
3+
echo "Install OS Packages." `date`
4+
echo "******************************************************************************"
5+
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
6+
7+
dnf install -y dnf-utils zip unzip
8+
9+
#dnf groupinstall "GNOME Desktop" -y
10+
#dnf groupinstall "Development Tools" -y
11+
#dnf groupinstall "Administration Tools" -y
12+
#dnf groupinstall "System Tools" -y
13+
dnf install -y bc
14+
dnf install -y binutils
15+
#dnf install -y compat-libcap1
16+
dnf install -y compat-libstdc++-33
17+
#dnf install -y dtrace-modules
18+
#dnf install -y dtrace-modules-headers
19+
#dnf install -y dtrace-modules-provider-headers
20+
#dnf install -y dtrace-utils
21+
dnf install -y elfutils-libelf
22+
dnf install -y elfutils-libelf-devel
23+
dnf install -y fontconfig-devel
24+
dnf install -y glibc
25+
dnf install -y glibc-devel
26+
dnf install -y ksh
27+
dnf install -y libaio
28+
dnf install -y libaio-devel
29+
#dnf install -y libdtrace-ctf-devel
30+
dnf install -y libXrender
31+
dnf install -y libXrender-devel
32+
dnf install -y libX11
33+
dnf install -y libXau
34+
dnf install -y libXi
35+
dnf install -y libXtst
36+
dnf install -y libgcc
37+
dnf install -y librdmacm-devel
38+
dnf install -y libstdc++
39+
dnf install -y libstdc++-devel
40+
dnf install -y libxcb
41+
dnf install -y make
42+
dnf install -y net-tools # Clusterware
43+
dnf install -y nfs-utils # ACFS
44+
dnf install -y python # ACFS
45+
dnf install -y python-configshell # ACFS
46+
dnf install -y python-rtslib # ACFS
47+
dnf install -y python-six # ACFS
48+
dnf install -y targetcli # ACFS
49+
dnf install -y smartmontools
50+
dnf install -y sysstat
51+
52+
# Added by me.
53+
yum install -y unixODBC
54+
55+
# compat-libpthread-nonshared.
56+
dnf install -y libnsl2
57+
dnf install -y libnsl2.i686
58+
dnf install -y libxcrypt-compat
59+
dnf install -y https://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/c/compat-libpthread-nonshared-2.41.9000-11.fc43.x86_64.rpm
60+
61+
62+
echo "******************************************************************************"
63+
echo "Kernel parameters." `date`
64+
echo "******************************************************************************"
65+
cat > /etc/sysctl.d/98-oracle.conf <<EOF
66+
fs.file-max = 6815744
67+
kernel.sem = 250 32000 100 128
68+
kernel.shmmni = 4096
69+
kernel.shmall = 1073741824
70+
kernel.shmmax = 4398046511104
71+
kernel.panic_on_oops = 1
72+
net.core.rmem_default = 262144
73+
net.core.rmem_max = 4194304
74+
net.core.wmem_default = 262144
75+
net.core.wmem_max = 1048576
76+
net.ipv4.conf.all.rp_filter = 2
77+
net.ipv4.conf.default.rp_filter = 2
78+
fs.aio-max-nr = 1048576
79+
net.ipv4.ip_local_port_range = 9000 65500
80+
EOF
81+
82+
/sbin/sysctl -p /etc/sysctl.d/98-oracle.conf
83+
84+
85+
echo "******************************************************************************"
86+
echo "Limits." `date`
87+
echo "******************************************************************************"
88+
cat > /etc/security/limits.d/oracle-database-server-19c-preinstall.conf <<EOF
89+
oracle soft nofile 1024
90+
oracle hard nofile 65536
91+
oracle soft nproc 16384
92+
oracle hard nproc 16384
93+
oracle soft stack 10240
94+
oracle hard stack 32868
95+
oracle hard memlock 134217728
96+
oracle soft memlock 134217728
97+
EOF
98+
99+
100+
echo "******************************************************************************"
101+
echo "Firewall." `date`
102+
echo "******************************************************************************"
103+
systemctl stop firewalld
104+
systemctl disable firewalld
105+
106+
107+
echo "******************************************************************************"
108+
echo "SELinux." `date`
109+
echo "******************************************************************************"
110+
sed -i -e "s|SELINUX=enabled|SELINUX=permissive|g" /etc/selinux/config
111+
setenforce permissive
112+
113+
114+
echo "******************************************************************************"
115+
echo "User setup." `date`
116+
echo "******************************************************************************"
117+
groupadd -g 54321 oinstall
118+
groupadd -g 54322 dba
119+
groupadd -g 54323 oper
120+
121+
useradd -u 54321 -g oinstall -G dba,oper oracle
122+
123+
124+
echo "******************************************************************************"
125+
echo "Fix for Oracle on Fedora." `date`
126+
echo "******************************************************************************"
127+
rm -f /usr/lib64/libnsl.so.1
128+
rm -f /usr/lib/libnsl.so.1
129+
ln -s /usr/lib64/libnsl.so.3.0.0 /usr/lib64/libnsl.so.1
130+
ln -s /usr/lib/libnsl.so.3.0.0 /usr/lib/libnsl.so.1
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
. /vagrant/config/install.env
2+
3+
echo "******************************************************************************"
4+
echo "Create a listener.ora file if it doesn't already exist." `date`
5+
echo "******************************************************************************"
6+
if [ ! -f ${ORACLE_HOME}/network/admin/listener.ora ]; then
7+
echo "LISTENER =
8+
(DESCRIPTION_LIST =
9+
(DESCRIPTION =
10+
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
11+
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
12+
)
13+
)
14+
USE_SID_AS_SERVICE_listener=on
15+
" > ${ORACLE_HOME}/network/admin/listener.ora
16+
fi
17+
18+
19+
echo "******************************************************************************"
20+
echo "Check if database already exists." `date`
21+
echo "******************************************************************************"
22+
if [ ! -d ${DATA_DIR}/${ORACLE_SID} ]; then
23+
24+
echo "******************************************************************************"
25+
echo "The database files don't exist, so create a new database." `date`
26+
echo "******************************************************************************"
27+
lsnrctl start
28+
29+
dbca -silent -createDatabase \
30+
-templateName General_Purpose.dbc \
31+
-gdbname ${ORACLE_SID} -sid ${ORACLE_SID} -responseFile NO_VALUE \
32+
-characterSet AL32UTF8 \
33+
-sysPassword ${SYS_PASSWORD} \
34+
-systemPassword ${SYS_PASSWORD} \
35+
-createAsContainerDatabase true \
36+
-numberOfPDBs 1 \
37+
-pdbName ${PDB_NAME} \
38+
-pdbAdminPassword ${PDB_PASSWORD} \
39+
-databaseType MULTIPURPOSE \
40+
-memoryMgmtType auto_sga \
41+
-totalMemory 1536 \
42+
-storageType FS \
43+
-datafileDestination "${DATA_DIR}" \
44+
-redoLogFileSize 50 \
45+
-emConfiguration NONE \
46+
-ignorePreReqs
47+
48+
echo "******************************************************************************"
49+
echo "Set the PDB to auto-start." `date`
50+
echo "******************************************************************************"
51+
sqlplus / as sysdba <<EOF
52+
alter system set db_create_file_dest='${DATA_DIR}';
53+
alter pluggable database ${PDB_NAME} save state;
54+
alter system set local_listener='localhost';
55+
exit;
56+
EOF
57+
58+
59+
echo "******************************************************************************"
60+
echo "Flip the auto-start flag." `date`
61+
echo "******************************************************************************"
62+
cp /etc/oratab /tmp
63+
sed -i -e "s|${ORACLE_SID}:${ORACLE_HOME}:N|${ORACLE_SID}:${ORACLE_HOME}:Y|g" /tmp/oratab
64+
cp -f /tmp/oratab /etc/oratab
65+
66+
fi
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
. /vagrant/config/install.env
2+
3+
echo "******************************************************************************"
4+
echo "Unzip software." `date`
5+
echo "******************************************************************************"
6+
mkdir -p ${ORACLE_HOME}
7+
cd ${ORACLE_HOME}
8+
unzip -oq /vagrant/software/${DB_SOFTWARE}
9+
10+
# Fix suggested by Steven Kennedy.
11+
cd $ORACLE_HOME/lib/stubs
12+
mv libc.so libc.so.hide
13+
mv libc.so.6 libc.so.6.hide
14+
15+
echo "******************************************************************************"
16+
echo "Do software-only installation." `date`
17+
echo "******************************************************************************"
18+
# Fake OS.
19+
export CV_ASSUME_DISTID=OEL7.8
20+
21+
${ORACLE_HOME}/runInstaller -ignorePrereq -waitforcompletion -silent \
22+
-responseFile ${ORACLE_HOME}/install/response/db_install.rsp \
23+
oracle.install.option=INSTALL_DB_SWONLY \
24+
ORACLE_HOSTNAME=${ORACLE_HOSTNAME} \
25+
UNIX_GROUP_NAME=oinstall \
26+
INVENTORY_LOCATION=${ORA_INVENTORY} \
27+
SELECTED_LANGUAGES=en,en_GB \
28+
ORACLE_HOME=${ORACLE_HOME} \
29+
ORACLE_BASE=${ORACLE_BASE} \
30+
oracle.install.db.InstallEdition=EE \
31+
oracle.install.db.OSDBA_GROUP=dba \
32+
oracle.install.db.OSBACKUPDBA_GROUP=dba \
33+
oracle.install.db.OSDGDBA_GROUP=dba \
34+
oracle.install.db.OSKMDBA_GROUP=dba \
35+
oracle.install.db.OSRACDBA_GROUP=dba \
36+
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
37+
DECLINE_SECURITY_UPDATES=true

0 commit comments

Comments
 (0)