“This is the 11th day of my participation in the Gwen Challenge in November. See details: The Last Gwen Challenge in 2021”

preface

ORACLE 11G/12C/18C/19C

Introduce a,

This script is intended to initialize the installation of Oracle software in an unattended manner.

Github

Function:

  • 1. Configure the operating system
  • 2. Install Grid software
  • 3. Install the Oracle software
  • 4. Install the PSU&&RU patch
  • 5. Create a database
  • 6. Database optimization

Current support:

ORACLE versions: 11GR2, 12CR2, 18C, 19C.
OS versions: Linux6(x86_64), Linux7(x86_64), and Linux8(x86_64).

19C OS requirements

  • Red Hat Enterprise Linux 8: 4.18.0-80.el8.x86_64 or later
  • Red Hat Enterprise Linux 7.5:3.10.0-862.11.6.el7.x86_64 or later
The modes include Single, Oracle Restart, and Oracle Real Cluster.

Currently, only two nodes are supported for RAC installation

Second, the use of

2.1 Installation Preparations

2.1.1 Creating a software directory, for example, /soft

mkdir /soft

2.1.2 Mounting the IMAGE ISO file

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

2.1.3 Uploading the installation media and scripts to the software directory

2.1.4 Setting the Host IP Address (Public&&Private)

#For Example:
##Linux 6Vi /etc/sysconfig/network-scripts/ifcfg-eth0 IPADDR=10.211.55.100 NETMASK=255.255.255.0 GATEWAY=10.211.55.1
##Linux 7Nmcli connection modify eth0 ipv4.addresses 10.211.55.100/24 ipv4.gateway 10.211.55.1 ipv4.method manual autoconnect yesCopy the code

2.1.5 If you need to install an Rac, configure ASM shared disks in advance

##For Example
Configure the shared disk through iscsi
1.StarWind(Windows)
2.Openfiler(Linux)

Assume that the shared storage server has been configured and its IP address is 10.211.55.18.
Configure iscsi connection for shared storage
yum install -y iscsi-initiator-utils*
Output targetname # #Iscsiadm -m discovery -t st -p 10.211.55.18## Connect to shared storageIscsiadm - m node - T iqn.2008-08.com.starwindsoftware:10.211.55.18-lucifer - p 10.211.55.18 - lCopy the code

Shared storage -StarWind Advanced configuration

Shared storage -Openfiler advanced configuration

2.2 Script Parameters

2.2.1 Running./OracleShellInstall --helpYou can view the parameters:
-i,			--PUBLICIP				PUBLICIP NETWORK ADDRESS
-n,			--HOSTNAME				HOSTNAME(orcl)
-rs,		--ROOTPASSWD			ROOT USER PASSWORD(oracle)
-gp,		--GRIDPASSWD			GRID USER PASSWORD(oracle)
-op,		--ORAPASSWD				ORACLE USER PASSWORD(oracle)
-b,			--ENV_BASE_DIR			ORACLE BASE DIR(/u01/app)
-o,			--ORACLE_SID			ORACLE_SID(orcl)
-s,			--CHARACTERSET			ORACLE CHARACTERSET(AL32UTF8)
-c,			--ISCDB					IS CDB OR NOT(FALSE)
-pb,		--PDBNAME				PDBNAME(pdb01)
-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)
-ts,        --TIMESERVER            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

2.3 Script Running

Notes: You must upload the required installation media in advance. Otherwise, the installation fails

CDB supports containers after 12C, just add the following parameters:

-c TRUE `# cdb` \
-pb singlepdb `# pdbname` \
Copy the code

The script must be executed as user Root

chmod +x OracleShellInstall.sh

2.3.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`Copy the code

2.3.2 Oracle Restart Installation Mode

CD /soft./ oracleshellinstall. sh -i 10.211.55.100 '#Public IP' \ -n restart '# hostname' \ -o nocdb '# oraclesid' \ -gp oracle `# grid user password`\ -op oracle `# oracle user password`\ -b /u01/app `# install basedir`\ -s AL32UTF8 `# characterset`\ -dd /dev/sde,/dev/sdf `# asm data disk`\ -dn DATA `# asm data diskgroupname`\ -dr EXTERNAL `# asm data redundancy`\ -gpa 31718723 `# grid psu number`Copy the code

2.3.3 Installing Oracle Rac Mode

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 '# node public IP' \ -vi1 10.211.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

Three. Function introduction

3.1 Configuring Mutual Trust between Nodes

The TRUST between nodes is automatically configured in RAC mode

3.2 Configuring a DNS Server

-dns Y `# DNS` \
-dnss Y `# LOCAL DNSSERVER` \
-dnsn lucifer.com `# DNS SERVER NAME` \- dnsi 10.211.55.200 `# DNS SERVER IP` \
Copy the code

3.3 Recording Installation Logs

Logs are recorded in the software directory in the following format:

oracleAllSilent_$(date +"20%y%m%d%H%M%S").log

3.4 This command can be repeated

The installation cannot be executed multiple times.

3.5 Help Functions

./OracleShellInstall --help

3.6 Automatically Configuring Multipath+UDEV Binding Disks

-dd /dev/sde,/dev/sdf `# asm data disk`\
-od /dev/sdb,/dev/sdc,/dev/sdd `# asm ocr disk`\
Copy the code

3.7 Configuring the Time Synchronization CronTab

-tsi 10.211.55.18 `# timeserver` \
Copy the code

3.8 Automatic Patch Installation (PSU,RU,RUR)

-gpa 32580003 `# Grid PATCH` \
-opa 32580014 `# Oracle PATCH` \
Copy the code

3.9 Database Optimization

  • 1. Automatically optimize database parameters
  • 2. Create backup crontab+scripts
  • 3. Set the database to automatically start upon startup
  • 4. Set the PDB to start with the CDB

3.10 A maximum of two Private IP addresses are supported

-pi1 10.10.1.1 -pi2 10.10.1.2 '# node private IP' \ -prf eth1 -prf1 eth2 '# network fcname' \Copy the code

3.11 A maximum of three Scan IP addresses are supported

You must configure DNS to use multiple scanIP

- si 10.211.55.104, 10.211.55.105, 10.211.55.106 ` # scan IP ` \Copy the code

3.12 Support graphical Installation and VNC

-txh Y `#tuxinghua` \
Copy the code

3.13 Configuring only the host environment is supported

-m Y `#Only Config System` \
Copy the code

If you think the article is helpful to you, please like it, bookmark it, follow it, comment it, and support it four times with one button. Your support is the biggest motivation for my creation. Thank you