Shell script one click installation, Oracle 21C stand-alone edition preemptive experience

catalogue

🌲 preface

On August 13, 2021, Oracle 21C officially released the local installation package of Linux 64.

In order to experience and improve my Oracle one click installation script, I downloaded and installed a wave. Let's share the installation process.

❤️ At the same time, the latest Oracle shell script is released to support 21C stand-alone and RAC one click deployment.

The Oracle one click installation script written by the blogger can be used to install the test environment, and the stand-alone and RAC cluster modes are supported at the same time!

Open source project: Install Oracle Database By Scripts!

For more detailed script usage, you can subscribe to the column: Oracle one click installation script.

🌛 Environmental preparation

This time, Vagrant is still used for one click deployment of OS environment, which is relatively convenient and fast. Friends who need to know can pay attention to the collection collection:

❤️ Play with Vagrant series column ❤️

Sin, I'm lazy, so I use Vagrant. Unfamiliar friends should install the host environment manually, and then run the script directly.

Environmental information:

Host version

Oracle version

IP address

Memory

Oracle Linux 7.9

Oracle 21C

10.211.55.100

8G

Vagrant host image source (7, 8):

generic/oracle7 generic/oracle8

Oracle 21C installation package download address:

Database Grid

☀️ 21C stand alone deployment

Vagrant deployment host environment

📢 Note: friends who manually install the operating system can skip this section and directly enter the Oracle installation section.

1. Vagrant mirror source add

Here, download my image source to / Users/lpc/Downloads / directory and rename it oel7_pd, box named oel7.

vagrant box add /Users/lpc/Downloads/oel7_pd --name oel7
vagrant box list

2. Configure VagrantFile

📢 Note: for the following actual information, please fill in the configuration according to your own environment!!!

Enter the custom directory and execute the following script to create VagrantFile:

cat <<EOF>VagrantFile
Vagrant.configure("2") do |config|
  config.vm.box = "oel7"
  config.vm.provision :shell, path: "/Volumes/DBA/vagrant/ora21c/scripts/ora_preinstall.sh"
  config.vm.synced_folder "/Volumes/DBA/vagrant/software", "/vagrant"
  config.vm.network :forwarded_port, guest: 1521, host: 1521
  config.vm.network :forwarded_port, guest: 22, host: 22
  config.vm.network "public_network", ip: "10.211.55.100"
  config.vm.provider "parallels" do |pd|
  pd.name = "ora21c"
  pd.memory = 8192
  pd.cpus = 2
  end
end
EOF

⚠️ Note: how to configure VagrantFile is not explained here. Please refer to the column. Here, I use parallels virtual machine software. If a friend who uses virtualbox virtual machine software needs to modify the parallels in the script to virtualbox.

3. Preparing installation media and scripts

It mainly configures these two lines in VagrantFile:

config.vm.provision :shell, path: "/Volumes/DBA/vagrant/ora21c/scripts/ora_preinstall.sh"
config.vm.synced_folder "/Volumes/DBA/vagrant/software", "/vagrant"

The first line refers to the script that automatically configures the operating system after the Vagrant host is installed. The second line refers to the automatic mapping directory after the Vagrant host is installed.

ora_preinstall.sh script content:

cat <<EOF>ora_preinstall.sh
#change root password
echo oracle | passwd --stdin root
#change sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
systemctl reload sshd.service
#mkdir software dir
mkdir /soft
#cp software to softdir
cp /vagrant/* /soft
#chmod shell script
chmod +x /soft/OracleShellInstall.sh
EOF

Installation media content:

LINUX.X64_213000_db_home.zip
OracleShellInstall.sh

Just upload the Oracle one click installation script and Oracle 21C Database installation package.

4. Initialize host environment

After confirming the above preparations, if you use Virtualbox virtual machine software, directly execute vagrant up; Friends who use parallels virtual machine software need to execute vagrant up --provider=parallels.

vagrant up --provider=parallels

After a short wait, the host has been initialized successfully:

Oracle 21C stand alone script installation

After the environment is ready, the installation is very simple. It only needs a short line of commands.

Use XSHELL or other tools to connect to the host and execute the script:

./OracleShellInstall.sh -i 10.211.55.100 -iso N

Explain that since the environment initialized by Vagrant is configured with yum source, there is no need to mount the image source manually. Therefore, I added the parameter - iso N. friends who install the operating system manually still need to mount manually.

The whole installation process takes less than 30 minutes. If you need to create a PDB, you only need to add the parameter -pb PDB name to automatically create it.

Added by spider_man on Sat, 08 Jan 2022 06:54:40 +0200