Shell-InstallOracle
Complete catalog of the entire project:
├── Documents │ ├── packer box │ │ ├── Vagrant Box Mirror preparation: Packer pack Oracle Linux 6.10 system.md │ │ ├── Vagrant Box Mirror preparation: Packer pack Oracle Linux 8.3 system.md │ │ ├── Vagrant Box Mirror preparation: Packer pack Centos 6.10 system.md │ │ ├── Vagrant Box Mirror preparation: Packer pack Centos 7.9 system.md │ │ ├── Vagrant Box Mirror preparation: Packer pack Centos 8.3 system.md │ │ └── Vagrant Box Mirror preparation: Packer pack Oracle Linux 7.9 system.md │ ├── rac_db │ │ ├── <Zero foundation installation Oracle Database RAC Cluster series ❶ Simple two-step quick installation Oracle 11GR2 RAC database.md │ │ ├── <Zero foundation installation Oracle Database RAC Cluster series ❷ Simple two-step quick installation Oracle 12CR2 RAC database.md │ │ ├── <Zero foundation installation Oracle Database RAC Cluster series ❸ Simple two-step quick installation Oracle 18C RAC database.md │ │ ├── <Zero foundation installation Oracle Database RAC Cluster series ❹ Simple two-step quick installation Oracle 19C RAC database.md │ │ └── <Zero foundation installation Oracle Database RAC Cluster series ❺ Simple two-step quick installation Oracle 21C RAC database.md │ ├── single_db │ │ ├── <Zero foundation installation Oracle Database stand alone series ① One click quick installation Oracle 11GR2 database.md │ │ ├── <Zero foundation installation Oracle Database stand alone series ② One click quick installation Oracle 12CR2 database.md │ │ ├── <Zero foundation installation Oracle Database stand alone series ③ One click quick installation Oracle 18C database.md │ │ ├── <Zero foundation installation Oracle Database stand alone series ④ One click quick installation Oracle 19C database.md │ │ └── <Zero foundation installation Oracle Database stand alone series ⑤ One click quick installation Oracle 21C database.md │ └── singleasm_db │ ├── <Zero foundation installation Oracle Database stand alone ASM Series 1️⃣ One click quick installation Oracle 11GR2 database.md │ ├── <Zero foundation installation Oracle Database stand alone ASM Series 2️⃣ One click quick installation Oracle 12CR2 database.md │ ├── <Zero foundation installation Oracle Database stand alone ASM Series 3️⃣ One click quick installation Oracle 18C database.md │ ├── <Zero foundation installation Oracle Database stand alone ASM Series 4️⃣ One click quick installation Oracle 19C database.md │ └── <Zero foundation installation Oracle Database stand alone ASM Series 5️⃣ One click quick installation Oracle 21C database.md ├── LICENSE ├── OracleShellInstall.sh ├── ParameterREADME.md ├── README.md ├── rac_db │ ├── README.md │ ├── Vagrantfile │ ├── config │ │ └── vagrant.yml │ ├── scripts │ │ └── setup.sh │ └── software │ ├── 11204 │ │ └── software.txt │ ├── 12201 │ │ └── software.txt │ ├── 18000 │ │ └── software.txt │ ├── 19300 │ │ └── software.txt │ ├── 21300 │ │ └── software.txt │ ├── OracleShellInstall.sh │ ├── compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm │ └── rlwrap-0.42.tar.gz ├── single_db │ ├── README.md │ ├── Vagrantfile │ ├── config │ │ └── vagrant.yml │ ├── scripts │ │ └── setup.sh │ └── software │ ├── 11204 │ │ └── software.txt │ ├── 12201 │ │ └── software.txt │ ├── 18000 │ │ └── software.txt │ ├── 19300 │ │ └── software.txt │ ├── 21300 │ │ └── software.txt │ ├── OracleShellInstall.sh │ ├── compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm │ └── rlwrap-0.42.tar.gz └── singleasm_db ├── README.md ├── Vagrantfile ├── config │ └── vagrant.yml ├── scripts │ └── setup.sh └── software ├── 11204 │ └── software.txt ├── 12201 │ └── software.txt ├── 18000 │ └── software.txt ├── 19300 │ └── software.txt ├── 21300 │ └── software.txt ├── OracleShellInstall.sh ├── compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm └── rlwrap-0.42.tar.gz 32 directories, 61 files
background
Why write this script?
- First of all, installing Oracle database is an extremely complex and boring task;
- The conventional operation mode is often based on documents, blogs, videos and other tutorials. The installation steps are carried out step by step, which is time-consuming and laborious, and it is very easy to cause various problems due to carelessness;
- Therefore, I thought that I could write a Shell script based on the standard process for installation, because as long as the code has no errors, the machine execution will not make errors;
- After a lot of time coding and running tests, it can now be used for production environment installation and deployment.
Which platforms does the project support?
- This project only supports "Linux64-6/7/8" platforms: Centos, Redhat and OracleLinux.
- Most mainstream ORACLE versions are supported: 11GR2, 12CR2, 18C, 19C and 21C.
- Support database installation modes: single machine, single machine ASM, RAC cluster.
instructions
This script is divided into novice exclusive version and expert advanced version. It is recommended to use novice exclusive version for learning and testing at ordinary times!
Novice exclusive version
Novice exclusive version basically does not need foundation, no installation of operating system, one click Oracle database! But you must use [vagrant] and [virtualbox], please make sure you have installed it locally.
- Step 1: upload the Oracle installation package:
Enter the project directory installoracleshell / single_ Under dB / software, you can see that there are different Oracle version directories, including one software Txt file, which contains the Oracle installation package you need to upload.
├── 11204 │ ├── p13390677_112040_Linux-x86-64_1of7.zip │ └── p13390677_112040_Linux-x86-64_2of7.zip ├── 12201 │ └── LINUX.X64_122010_db_home.zip ├── 18000 │ └── LINUX.X64_180000_db_home.zip ├── 19300 │ └── LINUX.X64_193000_db_home.zip ├── 21300 │ └── LINUX.X64_213000_db_home.zip
Confirm the Oracle version you need to install, copy the Oracle installation package to the corresponding directory, and ensure that the installation package name is the same as the following name, otherwise the installation fails!
- Step 2: edit vagrant YML profile:
Enter the project directory installoracleshell / single_ Under dB / config, open vagrant YML file:
box: luciferliu/centos7.9 vm_name: orcl hostname: orcl mem_size: 2048 cpus: 2 public_ip: 192.168.56.100 non_rotational: 'on' db_version: 11 db_patch: oracle_password: oracle oracle_sid: orcl install_base: /u01/app characterset: AL32UTF8 cdb: true pdb: pdb01
Parameter introduction:
box : Linux Host version, 19 c And 21 c Version not supported linux 6 edition! Optional values: - luciferliu/centos6.10 - luciferliu/centos7.9 - luciferliu/centos8.3 - luciferliu/oraclelinux6.10 - luciferliu/oraclelinux7.9 - luciferliu/oraclelinux8.3 vm_name : Virtual machine name, which can be modified at will. It can be modified by default. hostname : The host name can be modified at will. It can be modified by default. mem_size : Memory size in `MiB`,Modify as needed. Normal default is OK. cpus : cpu Number, which can be modified as needed. Normal default is OK. public_ip : IP Address, which can be modified according to the definition of the network card. It can be normal by default. non_rotational : You don't need to modify the value. It's OK by default. db_version : oracle Database version, fill in according to the actual situation! db_patch : PSU/RU Patch number, which can be filled in as needed. It can not be filled in without patching. oracle_password : oracle User password, default. oracle_sid : oracle Database instance name. It is OK by default. install_base : oracle Install the root directory by default. characterset : The database character set can be filled in according to the actual needs. It can be used by default normally. cdb : CDB Mode needs to be filled in true. pdb : PDB Name, on CDB Mode before it takes effect.
Modify the script according to the actual situation. Oracle 11GR2 database will be installed without modification by default.
- Step 3: execute vagrant up installation:
Back to installoracleshell / single_ In the DB directory, execute vagrant up to start the installation.
Note: InstallOracleshell / single_ Oracleshellinstall. In dB / Software Directory The SH script needs to be kept up-to-date. The latest version of the script is in the upper directory InstallOracleshell.
- Step 4: after the automatic installation is successful, connect the host:
There are three ways to connect the host:
1. Using ssh root@192.168.56.100 To connect. The root user password is oracle. You can also connect using connection tools such as Xshell;
2. Use vagrant ssh to connect. Note that you should install Oracle shell / single_ Execute in the DB directory, connect to the vagrant user, and use su - oracle to switch.
3. Use the Virtualbox virtual machine to open access directly.
- Step 5: turn off the host:
1. In the host, execute shutdown commands such as init 0 to shut down the host.
2. Use the Virtualbox virtual machine right button to close.
3. Enter installoracleshell / single_ Execute vagrant halt shutdown under DB directory.
- last
Used up, do not need to use how to do?
1. Directly open the Virtualbox virtual machine and right-click to delete it.
2. Enter installoracleshell / single_ Execute vagrant destroy in the DB directory to destroy it.
Master advanced version
Normally, it's enough to learn to test and use the novice exclusive version, but if you want to use it in the production environment, you must learn the advanced version of the master! Truly improve productivity~
Since all the instructions here are experts, let's make a long story short. The advanced version only needs this script, oracleshellinstall SH is enough!
How to use the script?

Premise: install the Linux system in advance, upload the installation media, and mount the ISO image.
stand-alone
- The first step is to manually install the Linux system, configure the network, and mount the ISO image;
- Step 2: create the / soft directory and upload the installation media;
- Step 3: edit the script installation command and fill in the key information:
Example of the simplest installation script:
./OracleShellInstall.sh -i 192.168.56.155
Example of stand-alone custom script command:
./OracleShellInstall.sh -i 192.168.56.155 `#Public ip`\ -n topdbdev `# hostname`\ -o topstd `# oraclesid`\ -c TRUE `# ISCDB`\ -pb pdb01 `# PDBNAME`\ -rs oracle `# root password`\ -op oracle `# oracle password`\ -gp oracle `# grid password`\ -b /u01/app `# install basedir`\ -s AL32UTF8 `# characterset`\ -ns UTF8 `# national characterset`
- Step 4: enter the / soft directory under the root user to execute the script installation command;
- Step 5: while waiting for the installation process, you can enter the / soft directory to view the installation deployment log, and restart the host after the installation;
- Step 6: check the database operation.
All operations in the script are executed silently and continuously. After knocking down the command, no operation is required and wait for the installation to succeed.
Stand alone ASM
Example of stand-alone ASM script command:
./OracleShellInstall.sh -i 192.168.56.155 `#Public ip`\ -n topdbdev `# hostname`\ -o topstd `# oraclesid`\ -rs oracle `# root password`\ -op oracle `# oracle password`\ -gp oracle `# grid password`\ -b /u01/app `# install basedir`\ -s AL32UTF8 `# characterset`\ -ns UTF8 `# national characterset`\ -dd /dev/sde `# asm data disk`\ -dn DATA `# asm data diskgroupname`\ -dr EXTERNAL `# asm data redundancy`\ -gpa 31718723 `# Grid PSU NUMBER`
RAC
Here, I will briefly describe the general steps of deploying RAC using scripts in the production environment:
- The first step is to manually install two Linux hosts;
- The second step is to configure the network respectively, mount the iso image source and mount the shared storage;
- Step 3: node 1 creates the / soft directory and uploads the installation media;
- Step 4: edit the script installation command and fill in the key information of the two hosts;
RAC script command example:
./OracleShellInstall.sh -i 192.168.56.151 `# node1 Public ip`\ -n topdb `# rac hostname`\ -o TOPDB `# oraclesid`\ -rs oracle `# root password`\ -op oracle `# oracle password`\ -gp oracle `# grid password`\ -b /u01/app `# install basedir`\ -s AL32UTF8 `# characterset`\ -ns UTF8 `# national characterset`\ -pb1 192.168.56.151 -pb2 192.168.56.153 `# node public ip`\ -vi1 192.168.56.152 -vi2 192.168.56.154 `# node virtual ip`\ -pi1 10.10.10.11 -pi2 10.10.10.12 `# node private ip`\ -pi3 10.10.11.11 -pi4 10.10.11.12 `# node private1 ip`\ -si 192.168.56.150 `# scan ip`\ -od /dev/sdb,/dev/sdc,/dev/sdd `# asm ocr disk`\ -dd /dev/sde `# asm data disk`\ -on OCR `# asm ocr diskgroupname`\ -dn DATA `# asm data diskgroupname`\ -or NORMAL `# asm ocr redundancy`\ -dr EXTERNAL `# asm data redundancy`\ -puf team0 -prf em3 -prf1 em4 `# network fcname`\ -tsi 192.168.56.252 `# timeserver`\ -gpa 31718723 `# Grid PSU NUMBER`
- Step 5: under the root user of node 1, enter the / soft directory to execute the script installation command;
- Step 6: while waiting for the installation process, you can enter the / soft directory to view the installation deployment log, and restart the two hosts after the installation;
- Step 7: check the database operation of the two hosts.
All operations in the script are executed silently and continuously. After knocking down the command, no operation is required. Wait for the installation to succeed!
Use license
MIT © Lucifer, think twice