Shell-InstallOracle
Use ShellScripts script to install Oracle database safely and quickly! Improve productivity and release labor!
background
Why write this project?
- 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 will not make errors;
- After a lot of time of writing and testing, it can now be used for installation and deployment in production environment.
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.
download
Before using this project, you need to download the project from:
$ git clone https://github.com/pc-study/InstallOracleshell.git
instructions
The use of this project is divided into novice exclusive version and expert advanced version. It is recommended to use novice exclusive version for daily learning and testing.
Novice exclusive version
Novice exclusive version basically does not need foundation. At present, it only supports stand-alone mode installation! Must use vagrant and virtualbox , make sure you have them installed 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 a 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 the vagrant.yml configuration file:
Enter the project directory installoracleshell / single_ Under dB / config, open the 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_ The OracleShellInstall.sh script in the db / software directory 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, make a long story short. For this project, you only need to download this script OracleShellInstall.sh!
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`
For parameter interpretation and configuration, click Parameter README Jump.
-
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`
For parameter interpretation and configuration, click Parameter README Jump.
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`
For parameter interpretation and configuration, click Parameter README Jump.
-
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 and wait for the installation to succeed.
Script parameters
For parameter interpretation and configuration, click Parameter README Jump.
badge
If your project follows shell installoracle and the project is located on Github, I hope you can add this badge to your project. It allows more people to access the project and adopts shell install oracle. Adding a badge is not mandatory.
❤️ welcome 👏🏻 Pay attention to the author! ❤️
In order to add the badge to the Markdown text, you can use the following code:
[](https://github.com/pc-study/InstallOracleshell)
Relevant warehouse
- Vagrant Builds — OracleBase Install Oracle By Vagrant.
- Bento — Provide Packer templates for building Vagrant base boxes.
Maintainer
How to contribute
Welcome to join us! Mention an Issue Or submit a Pull Request.
Use license
MIT © Lucifer, think twice
Technology exchange can focus on official account: Lucifer think twice before you act.