DBA operation and maintenance gospel: 10 minutes, Linux one line command to install Oracle database

Preface

With the general application of Oracle database, everyone needs to install Oracle database more or less, such as application online, application testing, recovery drill, version upgrade, and so on. As DBA operation and maintenance personnel who often engage in this kind of work, I believe that everyone has long been tired of these repetitive labor tasks, tedious and boring. Under the trend of national automation, one-click installation scripts have emerged, so how to use scripts?

Script flow chart


Directly on the command: ./OracleShellInstall.sh -i 10.211.55.100

Notes: The simplest single-machine installation, you only need to run the script to keep up with the host IP to install the Oracle database with one click.

See the end of the article for the script download address

One, script introduction

This script is written by shell commands and supports stand-alone and rac cluster installation. Just fill in a short line of commands, you can instantly release your hands and easily install the Oracle database.

Features:

1.配置操作系统
2.安装Grid软件
3.安装Oracle软件
4.安装PSU&&RU补丁
5.创建数据库
6.数据库优化
Currently supports:

ORACLE version: 11GR2, 12CR2, 18C, 19C.

Operating system version: Linux6(x86_64), Linux7(x86_64), Linux8(x86_64).

Including Single, Oracle Real Cluster mode.

Currently RAC only supports two-node installation.

Two, script commands

The script must be executed under Root user:

chmod +x OracleShellInstall.sh

1. Single mode installation
cd /soft
./OracleShellInstall.sh -i 10.211.55.100 `#Public ip`\
-n single `# hostname`\
-o nocdb `# oraclesid`\
-op oracle `# oracle user password`\
-b /oracle/app `# install basedir`\
-s AL32UTF8 `# characterset`\
-opa 31537677 `# oracle psu number`
2. Oracle Rac mode installation
cd /soft
./OracleShellInstall.sh -i 10.211.55.100 `#Public ip`\
-n rac `# hostname`\
-rs oracle `# root password`\
-op oracle `# oracle password`\
-gp oracle `# grid password`\
-b /u01/app `# install basedir`\
-o nocdb `# oraclesid`\
-s AL32UTF8 `# characterset`\
-pb1 10.211.55.100 -pb2 10.211.55.101 `# node public ip`\
-vi1 10.211.55.102 -vi2 10.211.55.103 `# node virtual ip`\
-pi1 10.10.1.1 -pi2 10.10.1.2 `# node private ip`\
-puf eth0 -prf eth1 `# network fcname`\
-si 10.211.55.105 `# scan ip`\
-dd /dev/sde,/dev/sdf `# asm data disk`\
-od /dev/sdb,/dev/sdc,/dev/sdd `# asm ocr disk`\
-or EXTERNAL `# asm ocr redundancy`\
-dr EXTERNAL `# asm data redundancy`\
-on OCR `# asm ocr diskgroupname`\
-dn DATA `# asm data diskgroupname`\
-gpa 32580003 `# GRID PATCH`

Three, script test

For Linux system installation, please refer to the article:

How to play Linux installation of virtual machine on Windows host, just refer to this article

Teach you three steps to install Linux system on MacOS

1. Create a software directory, for example: /soft

mkdir /soft

2. Mount the image ISO
## 1.通过cdrom挂载
mount /dev/cdrom /mnt
## 2.通过安装镜像源挂载
mount -o loop /soft/rhel-server-7.9-x86_64-dvd.iso /mnt
Mirror mount
3. Upload the installation media and scripts to the software directory
## 一键安装shell脚本
140K	OracleShellInstall.sh
## oracle 11GR2官方安装包
1.3G	p13390677_112040_Linux-x86-64_1of7.zip
1.1G	p13390677_112040_Linux-x86-64_2of7.zip
## 授权脚本执行权限
chmod +x OracleShellInstall.sh
Installation media
4. Perform installation:

./OracleShellInstall.sh -i 10.211.55.100

Perform installation


Wait about 5-10 minutes, the installation is successful.

Prompt for successful installation
Database information
5. Use of database connection

Create a connection user:

Create a connected user


plsql connection:

plsql connection


Test Data


more advanced recommendations:

15 minutes! One-click deployment of Oracle 12CR2 stand-alone CDB+PDB in
20 minutes! One-click deployment of Oracle 18C stand-alone CDB+PDB in
25 minutes! One-click deployment of Oracle 11GR2 HA single-machine cluster in
30 minutes! One-click deployment of Oracle 19C stand-alone CDB+PDB in
1.5 hours! One-click deployment of Oracle 11GR2 RAC cluster

Script download address:

1.GitHub

2. SHELL script for one-click installation of oracle database, realizing true unattended installation

about me:

CSDN blog: lucifer think twice
WeChat public account : Lucifer thinks twice before acting

The following is a picture of the QR code of my official account, welcome to pay attention.

Lucifer thinks twice before acting