“This article has participated in the good article call order activity, click to see: back end, big front end double track submission, 20,000 yuan prize pool for you to challenge!”

Author’s brief introduction

  • LuciferLiu is a member of China DBA association (ACDU).
  • Currently, I am working as Oracle DBA and used to be engaged in the development of Oracle database, mainly serving the manufacturing, auto finance and other industries.
  • Now he has Oracle OCP and OceanBase OBCA certifications. He is good at Oracle database operation and maintenance development, backup and recovery, installation and migration, Linux automatic operation and maintenance script writing, etc.

preface

As an IT person, I believe that most of you have used Oracle database, but few of you have ever installed Oracle database, because this kind of work is generally done by DBAs, such as the blogger 😬. So, if you want to install an Oracle database for testing, how do you install it?

  • To successfully install an Oracle database, the following conditions must be met:
  • Understand the basic hardware resource configuration: hard disk, memory, CPU, etc
  • Familiar with how to install the Linux operating system (OS), including how to use multiple VMS
  • Familiar with common Linux commands and system services
  • For details about the installation process of the Oracle database, see the official documentation
  • Specific steps can be referred to:
  • Install the Linux operating system
  • Configure storage and network
  • This section describes how to configure operating system services and parameters
  • Configure Oracle user directories
  • Upload the decompressed installation media
  • Installing the Oracle Software
  • Creating a Database Instance

  • Refer to the following documents:
  • Windows Host How to play virtual Machine Linux installation
  • Here are three steps to installing Linux on MacOS
  • Install the Oracle database on Linux
  • Install Oracle RAC on Linux7

If this article is only so, inevitably too much title party, as the saying goes, throw turn to cite jade, then introduce the protagonist of this article:

  • Oracle one key to install scripts, build a library in just a line of commands, a cup of tea, typing code at the same time do not forget health.

Introduce a,

As the saying goes, “lazy people” drive the world. If you can use a script to solve things, why bother, just do it.

1 Functions

  • What are the features of this script? Which versions are supported? What are the parameters? No hurry, too many functions, wait for me to slowly explain:
  • Oracle 11GR2, 12C, 18C, and 19C are supported
  • Supports Linux versions (X86_64) : 6, 7, and 8
  • Supported installation modes: single machine, single machine cluster, and RAC
  • Help command to view parameters
  • Installation Log Recording
  • Configuring the OPERATING System
  • Installing the Grid Software
  • Installing the Oracle Software
  • Install the PSU&&RU patch
  • Creating a database

2 Parameter Description

  • The script uses parameters to preconfigure script commands. You can use the help command to view the parameters:

Run./OracleShellInstall –help to view the parameters:

-i, --PUBLICIP PUBLICIP NETWORK ADDRESS -n, --HOSTNAME HOSTNAME(orcl) -o, --ORACLE_SID ORACLE_SID(orcl) -c, --ISCDB IS CDB OR NOT(TRUE|FALSE) -pb, --PDBNAME PDBNAME -op, --ORAPASSWD ORACLE USER PASSWORD(oracle) -b, --ENV_BASE_DIR ORACLE BASE DIR(/u01/app) -s, --CHARACTERSET ORACLE CHARACTERSET(ZHS16GBK|AL32UTF8) -rs, --ROOTPASSWD ROOT USER PASSWORD -gp, --GRIDPASSWD GRID USER PASSWORD(oracle) -pb1, --RAC1PUBLICIP RAC NODE ONE PUBLIC IP -pb2, --RAC2PUBLICIP RAC NODE SECONED PUBLIC IP -vi1, --RAC1VIP RAC NODE ONE VIRTUAL IP -vi2, --RAC2VIP RAC NODE SECOND VIRTUAL IP -pi1, --RAC1PRIVIP RAC NODE ONE PRIVATE IP -pi2, --RAC2PRIVIP RAC NODE SECOND PRIVATE IP -pi3, --RAC1PRIVIP1 RAC NODE ONE PRIVATE IP -pi4, --RAC2PRIVIP1 RAC NODE SECOND PRIVATE IP -puf, --RACPUBLICFCNAME RAC PUBLIC FC NAME -prf, --RACPRIVFCNAME RAC PRIVATE FC NAME -prf1, --RACPRIVFCNAME1 RAC PRIVATE FC NAME -si, --RACSCANIP RAC SCAN IP -dn, --ASMDATANAME RAC ASM DATADISKGROUP NAME(DATA) -on, --ASMOCRNAME RAC ASM OCRDISKGROUP NAME(OCR) -dd, --DATA_BASEDISK RAC DATADISK DISKNAME -od, --OCRP_BASEDISK RAC OCRDISK DISKNAME -or, --OCRREDUN RAC OCR REDUNDANCY(EXTERNAL|NORMAL|HIGH) -dr, --DATAREDUN RAC DATA REDUNDANCY(EXTERNAL|NORMAL|HIGH) -tsi, --TIMESERVERIP RAC TIME SERVER IP -txh --TuXingHua Tu Xing Hua Install -udev --UDEV Whether Auto Set UDEV -dns --DNS RAC  CONFIGURE DNS(Y|N) -dnss --DNSSERVER RAC CONFIGURE DNSSERVER LOCAL(Y|N) -dnsn --DNSNAME RAC DNSNAME(orcl.com) -dnsi --DNSIP RAC DNS IP -m, --ONLYCONFIGOS ONLY CONFIG SYSTEM PARAMETER(Y|N) -g, --ONLYINSTALLGRID ONLY INSTALL GRID SOFTWARE(Y|N) -w, --ONLYINSTALLORACLE ONLY INSTALL ORACLE SOFTWARE(Y|N) -ocd, --ONLYCREATEDB ONLY CREATE DATABASE(Y|N) -gpa, --GRID RELEASE UPDATE GRID RELEASE UPDATE(32072711) -opa, --ORACLE RELEASE UPDATE ORACLE RELEASE UPDATE(32072711)Copy the code

Look at the above parameters, do you feel that there are too many parameters, but these parameters are useful, let me slowly explain one by one:

  • -iFull name PUBLICIP: Specifies the IP address used for accessing the host. This parameter is mandatory.

Usage: -i 10.211.55.100

  • -nFull name HOSTNAME: indicates the HOSTNAME of the current host. The default value is orcl.

Usage:-n orcl

If the RAC mode is selected, the host names of nodes 1 and 2 are automatically orCL01 and ORCL02.

  • -oFull ORACLE_SID: Indicates the Oracle instance name. The default value is ORCL.

Usage: -o orcl

  • -cFull ISCDB: check whether the CDB mode is used. 11GR2 does not support this parameter. The default value is FALSE.

Usage: -c TRUE

  • -pbFull name PDBNAME: specifies the name for creating the PDB. This parameter is not supported by 11GR2.

Usage: -pb pdb01

  • -opFull name ORAPASSWD: indicates the password of the Oracle user. The default value is oracle.

Usage: -op oracle

  • -bFull name ENV_BASE_DIR: Oracle basic installation directory. The default value is /u01/app.

Usage: -b /u01/app

  • -sFull name CHARACTERSET: Oracle database CHARACTERSET. The default value is AL32UTF8.

Usage: -s AL32UTF8

The following are the parameters for an RAC mode installation:

  • -rsFull name ROOTPASSWD: indicates the password of user root. The default value is oracle.

Usage: -rs oracle

  • -gpFull name GRIDPASSWD: password of the grid user. The default value is oracle.

Usage: -gp oracle

  • -pb1Full name RAC1PUBLICIP: Specifies the host access IP address of node 1. This parameter is mandatory.

Usage: -PB1 10.211.55.100

  • -pb2Full name RAC2PUBLICIP: Specifies the host access IP address of node 2. This parameter is mandatory.

Usage: -PB2 10.211.55.101

  • -vi1Full name RAC1VIP: specifies the virtual IP address of node 1. This parameter is mandatory and must be the same as the host access IP address segment.

Usage: -vi1 10.211.55.102

  • -vi2Full name RAC2VIP: specifies the virtual IP address of the host of node 2. This parameter is mandatory and must be the same as the host access IP address segment.

Usage: -vi2 10.211.55.103

  • -pi1Full name: RAC1PRIVIP, host private IP address of node 1. This parameter is mandatory and can be customized based on your preference.

Usage: -pi1 10.10.1.1

  • -pi2Full name: RAC2PRIVIP, host private IP address of node 2. This parameter is mandatory and can be customized based on your preference.

Usage: -pi2 10.10.1.2

  • -pi3Full name: RAC1PRIVIP1, the second host private IP address of node 1. This parameter is optional and can be customized according to your preference.

Usage mode: -pi3 1.1.1.1

  • -pi4Full name: RAC2PRIVIP1, the second host private IP address of node 2. This parameter is optional and can be customized according to your preference.

Usage mode: -pi4 1.1.1.2

  • -pufFull name: RACPUBLICFCNAME: specifies the name of the NETWORK interface card (NIC) corresponding to the host access IP address. This parameter is mandatory. Node 1 and Node 2 must have the same name.

Usage: -puf eth0

  • -prfFull name RACPRIVFCNAME: Specifies the name of the nic corresponding to the private IP address of the host. This parameter is mandatory. The name of node 1 and node 2 must be the same.

Usage: -prf eth1

  • -prf1Full name RACPRIVFCNAME1: Indicates the name of the nic corresponding to the second private IP address of the host. This parameter is optional. Node 1 and Node 2 must have the same name.

Usage: -prf1 eth2

  • -siFull name RACSCANIP: SCANIP of the host. This parameter is mandatory and must be in the same network segment as the host access IP address. When configuring DNS resolution, a maximum of three IP addresses can be entered and separated by commas (,).

Method of use: – si 10.211.55.104 10.211.55.105, 10.211.55.106

  • -dnFull name ASMDATANAME: name of the ASMDATA disk. The default value is DATA.

Usage: -dn DATA

  • -onFull name ASMOCRNAME: Name of the ASM ruling disk. The default value is OCR.

Usage: -on OCR

  • -ddFull name DATA_BASEDISK: Specifies the name of the disk corresponding to the data disk. This parameter is mandatory. Multiple disks can be entered and separated by commas (,).

Method of use: – dd/dev/SDB, / dev/SDC, / dev/SDD

  • -odFull name OCR_BASEDISK: specifies the name of the disk that determines the disk. This parameter is mandatory. Multiple disks can be entered and separated by commas (,).

Usage: -od /dev/sde,/dev/sdf

  • -orFull OCRREDUN: Redundancy option for adjudication disks. The default value is EXTERNAL. The minimum number of disks corresponding to EXTERNAL, NORMAL, and HIGH is 1, 3, and 5.

Use mode: -or EXTERNAL

  • -drFull OCRREDUN: Redundancy option for adjudication disks. The default value is EXTERNAL. The minimum number of disks corresponding to EXTERNAL, NORMAL, and HIGH is 1, 2, and 3.

Usage mode: -dr EXTERNAL

  • -tsiTIMESERVERIP: Specifies the IP address of the time synchronization server. This parameter is optional. Set this parameter based on site requirements.

Usage: -TSI 10.211.55.200

  • -txhFull name TuXingHua: GUI installation. The default value is N. Y specifies the graphical user interface (GUI) dependencies to be installed.

Usage: -txh Y

  • -udevFull UDEV: automatically configures multipath+UDEV to bind disks. The default value is Y.

Usage: -udev Y

The following parameters are used to configure DNS resolution:

  • -dnsFull DNS: Configure DNS resolution. The default value is N.

Usage mode: -dns N

  • -dnssFull name DNSSERVER: The current host is configured as a DNS server. The default value is N. The premise is-dns YTo take effect.

Usage: -DNss N

  • -dnsnFull name DNSNAME: indicates the resolved name of the DNS server-dns YTo take effect.

Usage: -dnsn orcl.com

  • -dnsiFull name DNSIP: IP address of the DNS server-dns YTo take effect.

Usage: -dnsi 10.211.55.200

  • -mFull name ONLYCONFIGOS: configure only OS parameters. The default value is N. When the value is Y, the script is executed until the operating system configuration is complete, and the installation is not performed. The script is usually used for initialization of graphical installation.

Usage: -m Y

  • -gFull name ONLYINSTALLGRID: Installs only the Grid software. The default value is N.

Usage: -g Y

  • -wFull name ONLYINSTALLORACLE: Only Oracle software is installed. The default value is N.

Usage: -w Y

  • -ocdFull name ONLYCREATEDB: only an Oracle database instance is created. The default value is N.

Usage: -ocd Y

  • -gpaFull Name GRID RELEASE UPDATE: Patch number of PSU or RU patch of GRID software.

Usage: -GPA 32072711

  • -opaORACLE RELEASE UPDATE: Specifies the PSU or RU patch number of the ORACLE software.

Usage: -OPA 32072711

Through the above parameter introduction, I believe you have a glance at the function of the script, can be said to be very powerful. Have you already moved as action, want to try to install it? Next, I’ll show you how to use scripts.

Second, the use of

Now that you understand the functions and parameters of the script, it’s time to learn how to use it.



Direct orders: . / OracleShellInstall. Sh -i 10.211.55.100

Notes: The easiest way to install the Oracle database. The default parameters are not set. You only need to add the host IP address to install the Oracle database.

Note: The script download address is at the end of this article

1 Create a software directory, for example, /soft

mkdir /soft
Copy the code

2 Mount the Linux installation image

## 1. Mount via cDROm
mount /dev/cdrom /mnt
## 2. Mount by installing the image sourceMount -o loop /soft/ RHEL-server-7.9-x86_64-DVD. iso/MNTCopy the code

3 Upload the installation media and scripts to the software directory

Install shell scripts with one click
140K	OracleShellInstall.sh
## Oracle 11GR2 official installation package1.3 G p13390677_112040_Linux - x86-64 _1of7.zip 1.1 G p13390677_112040_Linux - x86-64 _2of7. Zip## Authorize script execution permission
chmod +x OracleShellInstall.sh
Copy the code

4 Perform the installation:

. / OracleShellInstall. Sh -i 10.211.55.100Copy the code



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

5 Database connection usage

Do not know how to install PLSQL students, can refer to: zero foundation how to play PL/SQL DEVELOPER?

  • Create a connection user:

  • PLSQL connections:



With this simple tutorial, you can easily install an Oracle database, greatly reducing labor and time costs.

Third, the sample

1 Single-instance installation

. / OracleShellInstall. Sh -i 10.211.55.100 `#Public ip`\
-n orcl `# hostname`\
-o orcl `# oraclesid`\
-op oracle `# oracle user password`\
-b /u01/app `# install basedir`\
-s AL32UTF8 `# characterset`\
-opa 31537677 `# oracle psu number`
Copy the code

2 the RAC installation

. / 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 orcl `# 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`
Copy the code

If you can reasonably use the script, you can easily install Oracle database in Linux system, free hands, health knocking code is not a dream!!

For more details on how to use scripts, subscribe to this column:Oracle one-click installation script.

  • 15 minutes! One-click Oracle 12CR2 single-node CDB+PDB deployment
  • 20 minutes! One-click Oracle 18C single-node CDB+PDB deployment
  • 25 minutes! Deploy an Oracle 11GR2 HA single-node cluster
  • 30 minutes! One-click Oracle 19C single-node CDB+PDB deployment
  • 1.5 hours! One-click deployment of an Oracle 11GR2 RAC cluster

Script obtaining method:

  • GitHub Keep updating 🔥
  • Gitee Keep updating 🔥

That’s the end of this sharing

If you think the article is helpful to you, like, collect, follow, comment, one key four support, your support is the biggest motivation for my creation.