Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle 12.2 RAC on Linux Best Practice Documentation

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle 12.2 RAC on RedHat 7.3 Best Practice Documentation

# the project requires the construction of multiple sets of RAC. In order to reduce the management cost, a unified 12.2 RAC template is established. I hope my template will work.

# to help the students in the application scenario of Oracle 12.2 RAC on RedHat 7.3, the document has been verified by the business and can be safely used.

# but it is only suitable for our business, if you are not responsible for any risks arising from the production system, please be careful.

# 12.2 the RAC template contains the following contents: install RAC/ upgrade Opatch and patch / optimize after installing RAC

# because the space is too long, attach the catalogue to facilitate the study of the students. Directory Oracle 12cR2 RAC on Linux best practices document 31.Oracle RAC installation planning 3a) RAC physical architecture diagram 3b) software environment planning 3c) user groups and file system planning 3D) network planning 4e) storage planning 42.Oracle RAC all cluster nodes ready 5a) hardware verification 51. Operating system basic environment test 52. Dual network card binding 6b) software verification 7c) operating system configuration and optimization 81. Operating system rpm package requirements 82. 0. Operating system creation software installation group and users (oracle,grid) 113. The operating system creates the software installation directory 124. Operating system kernel parameter optimization 145. Operating system memory optimization 166. Operating system shared memory optimization 177. Operating system software installation user environment variable (oracle,grid) 188. Operating system user (oracle,grid) hard limit optimization 229. The operating system turns off the firewall and selinux2410. Operating system installation software user (oracle,grid) mutual trust configuration 2511. The operating system uses / etc/hosts to parse 3612. Operating system time synchronization configuration NTP383.Oracle RAC shared storage preparation 38a) use udev persistent disk permissions 38b) powerpath multipath software aggregates LUN into one path for system use 40c) set Disk I Scheduler on Linux454.GI installation 46a) cvuqdisk package needs to be installed on all nodes 46b) GI package is directly unzipped to GI under $ORACLE_HOME 46c) GI patch upgrade and GI graphics install 475.RDBMS software Install 66a) DB software using oracle user graphics install 66b) upgrade Opatch73c) DB patch upgrade 746.ASMCA create disk group 757.DBCA create database 798.RAC optimization 90a) security 901. User password policy optimization (can be created according to the security policy) 902. Optimize the low-end version of the client can not log on to 12c high-version database problem (all node configuration) 90b) instance optimization 901.process process optimization 902. Instance local process concurrency optimization 903. Avoid situations where users cannot log in due to a large amount of library cache lock 904.DBLINK uses insert optimization 915.12.2 RAC to avoid a large number of 'Library Cache Lock' (Cycle) 916. Add db_files91c) system optimization 911. Large page usage optimization 919. Schedule 93

1. Oracle RAC installation planning

A) RAC physical architecture diagram

B) Software environmental planning

Software:

GI software: linuxx64_12201_grid_home.zip

DB software: linuxx64_12201_database.zip

GI patch: p29301687_122010_Linux-x86-64.zip

DB patch: p29314339_122010_Linux-x86-64.zip

Opatch patch: p6880880_122010_Linux-x86-64.zip

Rpm package: compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm

Database version:

12.2.0.1.19

Operating system:

64bit Redhat 7.3

C) user groups and file system planning

User groups and file system configuration

Software user primary group secondary group ORACLE_BASE ORACLE_HOME

GI grid oinstall dba,asmadmin,asmdba,asmoper,racdba / oracle/app/grid / oracle/app/12.2.0/grid

DB oracle oinstall dba,oper,asmdba, asmadmin,racdba,backupdba,dgdba,kmdba / oracle/app/oracle $ORACLE_BASE/product/12.2.0/db_1

D) Network planning

1. Priority dual network card binding principle

two。 Principle of giving priority to 10 Gigabit Network Card in Private Network

3. Avoid using 169.254.address. * address principle

/ etc/hosts is listed below

The name corresponds to the purpose of the network card IP

Bmcdb1 bond0 10.151.115.71 public

Bmcdb1-vip 10.151.115.73 VIP

Bmcdb1-priv bond1 192.155.1.171 private

Bmcdb2 bond0 10.151.115.72 public

Bmcdb2-vip 10.151.115.74 VIP

Bmcdb2-priv bond1 192.155.1.172 private

Scan-bmcdb 10.151.115.75 scan-ip

E) Storage planning

1. Set disk I schedulers O schedulers to Deadline

# echo deadline > / sys/block/$ {ASM_DISK} / queue/scheduler

two。 Bind and store the LUN attribute to ensure that the system restart attribute remains unchanged

3. ASM planning table

ASM planning table

Disk group name partition master permissions single LUN size redundant total capacity

OCR emcpowera grid:asmadmin 660 18G

Emcpowerb grid:asmadmin 660 18G Normal 54G

Emcpowerc grid:asmadmin 660 18G

DATA emcpowere grid:asmadmin 660 200G External 200G

FRA emcpowerf grid:asmadmin 660 100G External 100G

OCR disk groups: save CRS information, Voting disk and other information

DATA disk groups: saving data files, control files

FRA disk groups: saving archive files for nodes

2. Prepare all cluster nodes in Oracle RAC

A) hardware inspection

1. Basic environment inspection of operating system

# operating system distribution

Cat / etc/redhat-release

# Kernel version

Uname-a

# Memory total

Grep MemTotal / proc/meminfo

# SWAP Total

Grep SwapTotal / proc/meminfo

# tmp directory size

Df-h / tmp

# current memory and swap usage status

Free-g

# shared memory size

Df-h / dev/shm

# CPU model, physical number, core number, logical number

Cat / proc/cpuinfo | grep name | cut-f2-d: | uniq-c

Cat / proc/cpuinfo | grep "physical id" | sort | uniq | wc-l

Cat / proc/cpuinfo | grep "cpu cores" | uniq

Cat / proc/cpuinfo | grep "processor" | wc-l

# Node information collection omitted

two。 Double network card binding

# dual network cards are bound in active / standby mode, and the two nodes keep the Bond mode in one setting, and continue to ping, pull the physical cable for testing

[oracle@bmcdb1 ~] $cat / etc/sysconfig/network-scripts/ifcfg-bond0_slave_1

HWADDR=E4:43:4B:72:F7:0C

TYPE=Ethernet

NAME= "bond0 slave 1"

UUID=53c72c58-f724-4d50-b27c-71cf218d24ec

DEVICE=em1

>

MASTER=bond0

SLAVE=yes

[oracle@bmcdb1 ~] $cat / etc/sysconfig/network-scripts/ifcfg-bond0_slave_2

HWADDR=E4:43:4B:72:F7:0D

TYPE=Ethernet

NAME= "bond0 slave 2"

UUID=af3db5d3-323c-411f-8070-f5083f8cffbc

DEVICE=em2

>

MASTER=bond0

SLAVE=yes

[oracle@bmcdb1 ~] $cat / etc/sysconfig/network-scripts/ifcfg-Bond_connection_1

DEVICE=bond0

BONDING_OPTS= "miimon=1 updelay=0 downdelay=0 mode=active-backup"

TYPE=Bond

BONDING_MASTER=yes

BOOTPROTO=none

IPADDR=10.151.115.71

PREFIX=24

GATEWAY=10.151.115.1

DNS1=10.156.84.62

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_PEERDNS=yes

IPV6_PEERROUTES=yes

IPV6_FAILURE_FATAL=no

IPV6_PRIVACY=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME= "Bond connection 1"

UUID=3d289bb5-e405-4674-a7b3-5abc21fea392

>

B) Software inspection

GI software: linuxx64_12201_grid_home.zip

DB software: linuxx64_12201_database.zip

GI patch: p29301687_122010_Linux-x86-64.zip

DB patch: p29314339_122010_Linux-x86-64.zip

Opatch patch: p6880880_122010_Linux-x86-64.zip

EMC powerpath software: EMCPower.LINUX-6.3.0.01.00-001.RHEL7.x86_64.rpm

Operating system RPM package: operating system image or CD

C) operating system configuration and optimization

1. Operating system rpm package requirements

# minimum operating system requirements

Bc

Binutils-2.23.52.0.1-12.el7 (x86 / 64)

Compat-libcap1-1.10-3.el7 (x86x64)

Compat-libstdc++-33-3.2.3-71.el7 (i686)

Compat-libstdc++-33-3.2.3-71.el7 (x86x64)

Glibc-2.17-36.el7 (i686)

Glibc-2.17-36.el7 (x86 / 64)

Glibc-devel-2.17-36.el7 (i686)

Glibc-devel-2.17-36.el7 (x86 / 64)

Ksh

Libaio-0.3.109-9.el7 (i686)

Libaio-0.3.109-9.el7 (x86 / 64)

Libaio-devel-0.3.109-9.el7 (i686)

Libaio-devel-0.3.109-9.el7 (x86 / 64)

Libgcc-4.8.2-3.el7 (i686)

Libgcc-4.8.2-3.el7 (x86 / 64)

Libstdc++-4.8.2-3.el7 (i686)

Libstdc++-4.8.2-3.el7 (x86 / 64)

Libstdc++-devel-4.8.2-3.el7 (i686)

Libstdc++-devel-4.8.2-3.el7 (x86 / 64)

Libxcb-1.9-5.el7 (i686)

Libxcb-1.9-5.el7 (x86 / 64)

LibX11-1.6.0-2.1.el7 (i686)

LibX11-1.6.0-2.1.el7 (x86x64)

LibXau-1.0.8-2.1.el7 (i686)

LibXau-1.0.8-2.1.el7 (x86 / 64)

LibXi-1.7.2-1.el7 (i686)

LibXi-1.7.2-1.el7 (x86 / 64)

LibXtst-1.2.2-1.el7 (i686)

LibXtst-1.2.2-1.el7 (x86 / 64)

LibXrender (i686)

LibXrender (x86 / 64)

LibXrender-devel (i686)

LibXrender-devel (x86 / 64)

Make-3.82-19.el7 (x86 / 64)

Net-tools-2.0-0.17.20131004git.el7 (x86 / 64) (for Oracle RAC and Oracle Clusterware)

Nfs-utils-1.3.0-0.21.el7.x86_64 (for Oracle ACFS)

Smartmontools-6.2-4.el7 (x86 / 64)

Sysstat-10.1.5-1.el7 (x86 / 64)

1.1 rpm packet inspection

# check the missing rpm package and print it out

For i in\

Bc binutils compat-libcap1 compat-libstdc++-33 glibc glibc-devel ksh libaio libaio-devel\

Libgcc libstdc++ libstdc++-devel libxcb libX11 libXau libXi libXtst libXrender libXrender-devel gcc-c++\

Make net-tools nfs-utils smartmontools sysstat

Do

Rpm-Q $I & > / dev/null | | F = "$F $I"

Done; echo $Fitterunset F

1.2 yum bulk installation package

# yum installs rpm packages in batches, omitting the installation process

Yum install bc binutils compat-libcap1 compat-libstdc++ glibc glibc-devel ksh libaio libaio-devel\

Libgcc gcc libstdc++ libstdc++-devel libxcb libX11 libXau libXi libXtst libXrender libXrender-devel\

Make net-tools nfs-utils smartmontools sysstat gcc-c++

# yum configuration

# decompress the tar package in the current directory

Tar-xvf media.tar

# rename the original repo

Mv / etc/yum.repos.d/redhat.repo / etc/yum.repos.d/redhat.repo_bk

# create a new local repo

Vi / etc/yum.repos.d/redhat7.repo

[redhat7.repo]

Name=local

Baseurl= file:///soft/media

Gpgcheck=0

Enabled=1

# clear cache, view software library, update metadata cache, view yum package

Yum clean all # Remove cached data

Yum repolist # Display the configured software repositories

Yum makecache # Generate the metadata cache

Yum list # List a package or groups of packages

1.3 rpm package re-inspection

# still use the above script until there is no package output

two。 Operating system creation software installation group and users (oracle,grid)

Groupadd-gid 54321 oinstall

Groupadd-gid 54322 dba

Groupadd-gid 54323 asmdba

Groupadd-gid 54324 asmoper

Groupadd-gid 54325 asmadmin

Groupadd-gid 54326 oper

Groupadd-gid 54327 backupdba

Groupadd-gid 54328 dgdba

Groupadd-gid 54329 kmdba

Groupadd-gid 54330 racdba

Useradd-uid 54321-gid oinstall-groups dba,oper,asmdba,asmadmin,racdba,backupdba,dgdba,kmdba oracle

Passwd oracle

Useradd-uid 54322-gid oinstall-groups dba,asmadmin,asmdba,asmoper,racdba grid

Passwd grid

3. The operating system creates the software installation directory

Vi / etc/oraInst.loc

Inventory_loc=/oracle/app/oraInventory

Inst_group=oinstall

# Create the Oracle Inventory Directory

# To create the Oracle Inventory directory, enter the following commands as the root user:

Mkdir-p / oracle/app/oraInventory

Chown-R grid:oinstall / oracle/app/oraInventory

Chmod-R 775 / oracle/app/oraInventory

# Creating the Grid Infrastructure Base Directory

Mkdir-p / oracle/app/grid

Chown-R grid:oinstall / oracle/app/grid

Chmod-R 775 / oracle/app/grid

# Creating the Oracle Grid Infrastructure Home Directory

Mkdir-p / oracle/app/12.2.0/grid

Chown-R grid:oinstall / oracle/app/12.2.0/grid

Chmod-R 775 / oracle/app/12.2.0/grid

# Creating the Oracle Base Directory

Mkdir-p/oracle / app/oracle

Mkdir-p/oracle/ app/oracle/cfgtoollogs

# needed to ensure that dbca is able to run after the rdbms installation.

Chown-R oracle:oinstall / oracle/app/oracle

Chmod-R 775 / oracle/app/oracle

# Creating the Oracle RDBMS Home Directory

Mkdir-p/oracle/ app/oracle/product/12.2.0/db_1

Chown-R oracle:oinstall / oracle/app/oracle/product/12.2.0/db_1

Chmod-R 775 / oracle/app/oracle/product/12.2.0/db_1

4. Optimization of operating system kernel parameters

# set kernel.shmmax=70G,SGA=50G and PGA=10G to 128 GB of memory

# kernel.shmmni this parameter is the maximum number of shared memory segments in the system

# kernel.shmmax this parameter is the maximum size of a process's shared memory segment

# SHMMAX should be slightly larger than SGA size

# kernel.shmall this parameter is the total shared memory

# kernel.shmall is greater than shmmax/PAGE_SIZE

Cat / etc/sysctl.conf

Kernel.shmmni = 4096

Kernel.shmmax = 75161927680

Kernel.shmall = 18350080

Kernel.sem = 250 32000 100 128

Fs.file-max = 7553600

Net.ipv4.ip_local_port_range = 9000 65500

Net.core.rmem_default = 262144

Net.core.rmem_max = 4194304

Net.core.wmem_default = 262144

Net.core.wmem_max = 1048576

# calculate and add this parameter after installing the database instance

Vm.nr_hugepages = 25026

# effective immediately (root)

/ sbin/sysctl-p

# NOTE: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/ tuning_and_optimizing_red_hat_enterprise_linux_for_oracle_9i_and_10g_databases/index

# NOTE: The latest information on kernel parameter settings for Linux can be found in My Oracle Support ExtNote:169706.1.#

5. Operating system memory optimization

# Oracle has always recommended shutting down Transparent HugePages to optimize memory usage

# so close Transparent HugePages

Grubby-default-kernel

Grubby-args= "transparent_hugepage=never"-update-kernel

Grubby-- info / boot/vmlinuz-3.10.0-514.el7.x86_64 > > / boot/grub2/grub.cfg

Cat / sys/kernel/mm/transparent_hugepage/enabled

Grep AnonHugePages / proc/meminfo

Reboot

# Node 1 executes the display result

[root@bmcdb1] # grubby-- default-kernel

/ boot/vmlinuz-3.10.0-514.el7.x86_64

[root@bmcdb1] # grubby-- args= "transparent_hugepage=never"-- update-kernel / boot/vmlinuz-3.10.0-514.el7.x86_64

# grubby-- info / boot/vmlinuz-3.10.0-514.el7.x86_64 > > / boot/grub2/grub.cfg

Cat / boot/grub2/grub.cfg

Index=0

Kernel=/boot/vmlinuz-3.10.0-514.el7.x86_64

Args= "ro crashkernel=auto rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet.UTF-8 transparent_hugepage=never"

Root=/dev/mapper/rhel-root

Initrd=/boot/initramfs-3.10.0-514.el7.x86_64.img

Title=Red Hat Enterprise Linux Server (3.10.0-514.el7.x86_64) 7.3 (Maipo)

# confirm that Transparent HugePages is closed

[root@bmcdb1 ~] # cat / sys/kernel/mm/transparent_hugepage/enabled

Always madvise [never]

[root@bmcdb1 ~] # grep AnonHugePages / proc/meminfo

AnonHugePages: 0 kB

# ignore the result of reboot presentation

6. Operating system shared memory optimization

New features have been introduced in systemd-logind service since # Redhat 7.2.When users log out, all IPC objects are deleted.

# prevent the system from deleting shared SGA memory when the user is interrupted

# cause ASM and database instance downmachines, so set RemoveIPC=no

Echo "RemoveIPC=no" > > / etc/systemd/logind.conf

Systemctl restart systemd-logind

# ALERT: Setting RemoveIPC=yes on Redhat 7.2and higher Crashes ASM and Database Instances as Well as Any Application That Uses a Shared Memory Segment (SHM) or Semaphores (SEM) (document ID 2081410.1)

# Node 1 executes the display result

[root@bmcdb1 ~] # echo "RemoveIPC=no" > > / etc/systemd/logind.conf

[root@bmcdb1 ~] # cat / etc/systemd/logind.conf

…… The middle show ignores...

# RemoveIPC=no

RemoveIPC=no

# set shared memory

# set shared memory through / etc/fstab

[root@bmcdb1 ~] # cat / etc/fstab

#

# / etc/fstab

# Created by anaconda on Tue Jun 25 01:24:22 2019

#

# Accessible filesystems, by reference, are maintained under'/ dev/disk'

# See man pages fstab (5), findfs (8), mount (8) and/or blkid (8) for more info

#

/ dev/mapper/rhel-root / xfs defaults 0 0

UUID=1d01dfb8-026c-464f-9d8a-7bf9ee5079e5 / boot xfs defaults 0 0

UUID=741B-866B / boot/efi vfat umask=0077,shortname=winnt 00

/ dev/mapper/rhel-swap swap swap defaults 0 0

Shm / dev/shm tmpfs defaults,size=80G 0

[root@bmcdb2 home] # cat / etc/fstab

#

# / etc/fstab

# Created by anaconda on Mon Jul 1 19:01:01 2019

#

# Accessible filesystems, by reference, are maintained under'/ dev/disk'

# See man pages fstab (5), findfs (8), mount (8) and/or blkid (8) for more info

#

/ dev/mapper/rhel-root / xfs defaults 0 0

UUID=39a4f14f-aab6-4e71-9424-c4fe0610c7fb / boot xfs defaults 0 0

UUID=7E8A-CC6A / boot/efi vfat umask=0077,shortname=winnt 00

/ dev/mapper/rhel-swap swap swap defaults 0 0

Shm / dev/shm tmpfs defaults,size=80G 0

7. Operating system software installation user environment variable (oracle,grid)

# grid

[grid@Bmcdb1 ~] $vi .bash _ profile

Export PS1= "[`whoami` @ `hostname`:"'$PWD] $'

Export JAVA_HOME=/usr/local/java; export JAVA_HOME

Export ORACLE_BASE=/oracle/app/grid

Export ORACLE_HOME=/oracle/app/12.2.0/grid

Export ORACLE_SID=+ASM1

Export ORACLE_PATH=/oracle/app/oracle/common/oracle/sql

Export ORACLE_TERM=xterm

Export NLS_DATE_FORMAT= "DD-MON-YYYY HH24:MI:SS"

Export NLS_LANG=american_america.ZHS16GBK

Export TNS_ADMIN=$ORACLE_HOME/network/admin

Export ORA_NLS11=$ORACLE_HOME/nls/data

Export PATH=$ORACLE_HOME/bin:$PATH

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Export TEMP=/tmp

Export TMPDIR=/tmp

Umask=022

# oracle

[oracle@Bmcdb1 ~] $vi .bash _ profile

Export PS1= "[`whoami` @ `hostname`:"'$PWD] $'

Export JAVA_HOME=/usr/local/java

Export ORACLE_BASE=/oracle/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1

Export ORACLE_SID=bmcdb1

Export ORACLE_UNQNAME=bmcdb

Export ORACLE_PATH=/oracle/app/common/oracle/sql

Export ORACLE_TERM=xterm

Export NLS_DATE_FORMAT= "DD-MON-YYYY HH24:MI:SS"

Export NLS_LANG=american_america.ZHS16GBK

Export TNS_ADMIN=$ORACLE_HOME/network/admin

Export ORA_NLS11=$ORACLE_HOME/nls/data

Export PATH=$ORACLE_HOME/bin:$PATH

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Export THREADS_FLAG=native

Export TEMP=/tmp

Export TMPDIR=/tmp

Umask=022

8. Oracle,grid hard limit optimization

# improve the user hard limit (the default hard limit for Oracle and grid users does not meet the GI installation and configuration)

# limits.conf is the PAM template configuration file; therefore, PAM should be configured first, that is, the configuration is as follows:

Echo "session required pam_limits.so" > > / etc/pam.d/login

The vm.nr_hugepages size cannot be actually measured before # RAC is running.

# principle: Number Hugepages * Hugepagesize = minimum Memlock

< RAM cat /etc/security/limits.conf oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 oracle soft memlock 134144000 oracle hard memlock 134144000 grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 grid hard stack 32768 #NOTE:What is Memlock and How to Calculate the Values for Memlock (文档 ID 2511230.1) # shell开始文件限制提升 cat /etc/profile if [ $USER = "oracle" ] || [ $USER = "grid" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi umask 022 fi 9. 操作系统关闭防火墙和selinux # 关闭防火墙 systemctl status firewalld systemctl start firewalld.service systemctl stop firewalld.service systemctl disable firewalld.service systemctl status firewalld # 永久关闭selinux cat /etc/sysconfig/selinux SELINUX=disabled 10. 操作系统安装软件用户(oracle,grid)互信配置 # 在节点1配置ssh互信,步骤如下: # 使用root将数据库软件拷贝至/home/oracle/下: # 此脚本适合多节点安装优先使用 # chown oracle:oinstall linuxx64_12201_database.zip # su - oracle $ unzip linuxx64_12201_database.zip $ cd database/sshsetup/ $ ./sshUserSetup.sh -user oracle -hosts "node1 node2" -advanced -noPromptPassphrase $ ./sshUserSetup.sh -user grid -hosts "node1 node2" -advanced -noPromptPassphrase # 检验互信 # 节点1, bmcdb1上执行检验操作 $ ssh bmcdb1 date;ssh bmcdb2 date;ssh bmcdb1priv date;ssh bmcdb2priv date # 节点2, bmcdb2上执行检验操作 $ ssh bmcdb1 date;ssh bmcdb2 date;ssh bmcdb1priv date;ssh bmcdb2priv date 11. 操作系统使用/etc/hosts解析 # /etc/hosts解析地址如下 [oracle@bmcdb1 ~]$ cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 # PUBLIC-IP 10.151.115.61 bmcdb1 10.151.115.62 bmcdb2 # VIP-IP 10.151.115.63 bmcdb1vip 10.151.115.64 bmcdb2vip # PRIVATE-IP 192.155.1.161 bmcdb1priv 192.155.1.162 bmcdb2priv # SCAN-IP 10.151.115.65 scanbmcdb # 优先使用/etc/hosts,故files在dns前 [root@bmcdb1 ~]# cat /etc/nsswitch.conf | grep hosts # hosts: db files nisplus nis dns hosts: files dns myhostname 12. 操作系统时间同步配置NTP # 每十分钟同步一次时间服务器,使用crontab定时任务调用ntpdate命令同步 检查系统时间 # date # 公司内部时间服务器 [root@bmcdb1 soft]# crontab -l */10 * * * * /usr/sbin/ntpdate 10.151.113.73 [root@bmcdb2 ~]# crontab -l */10 * * * * /usr/sbin/ntpdate 10.151.113.73 3. Oracle RAC 共享存储准备 a) powerpath多路径软件聚合LUN成一条路径供系统使用 # powerpath安装及存储磁盘分配等工作请安排专业的存储工程师完成 # 节点1执行展示结果 [root@bmcdb1 ~]# powermt display dev=all Pseudo name=emcpowera VPLEX ID=CKM00182201323 Logical device ID=6000144000000010F0127E4709356BC6 [device_Unity0004_New_BmcDB_ocr3_1_vol] state=alive; policy=ADaptive; queued-IOs=0 ============================================================================== --------------- Host --------------- - Stor - -- I/O Path -- -- Stats --- ### HW Path I/O Paths Interf. Mode State Q-IOs Errors ============================================================================== 16 lpfc sdaw CL1-0B active alive 0 0 16 lpfc sdaq CL1-0A active alive 0 0 16 lpfc sdak CL1-08 active alive 0 0 16 lpfc sdae CL1-09 active alive 0 0 15 lpfc sdy CL1-0F active alive 0 0 15 lpfc sds CL1-0E active alive 0 0 15 lpfc sdm CL1-0D active alive 0 0 15 lpfc sdg CL1-0C active alive 0 0 Pseudo name=emcpowerb VPLEX ID=CKM00182201323 Logical device ID=6000144000000010F0127E4709356BC4 [device_Unity0004_New_BmcDB_ocr2_1_vol] state=alive; policy=ADaptive; queued-IOs=0 ============================================================================== --------------- Host --------------- - Stor - -- I/O Path -- -- Stats --- ### HW Path I/O Paths Interf. Mode State Q-IOs Errors ============================================================================== 16 lpfc sdav CL1-0B active alive 0 0 16 lpfc sdap CL1-0A active alive 0 0 16 lpfc sdaj CL1-08 active alive 0 0 16 lpfc sdad CL1-09 active alive 0 0 15 lpfc sdx CL1-0F active alive 0 0 15 lpfc sdr CL1-0E active alive 0 0 15 lpfc sdl CL1-0D active alive 0 0 15 lpfc sdf CL1-0C active alive 0 0 Pseudo name=emcpowerc VPLEX ID=CKM00182201323 Logical device ID=6000144000000010F0127E4709356BC2 [device_Unity0004_New_BmcDB_ocr1_1_vol] state=alive; policy=ADaptive; queued-IOs=0 ============================================================================== --------------- Host --------------- - Stor - -- I/O Path -- -- Stats --- ### HW Path I/O Paths Interf. Mode State Q-IOs Errors ============================================================================== 16 lpfc sdau CL1-0B active alive 0 0 16 lpfc sdai CL1-08 active alive 0 0 16 lpfc sdao CL1-0A active alive 0 0 16 lpfc sdac CL1-09 active alive 0 0 15 lpfc sdw CL1-0F active alive 0 0 15 lpfc sdq CL1-0E active alive 0 0 15 lpfc sdk CL1-0D active alive 0 0 15 lpfc sde CL1-0C active alive 0 0 Pseudo name=emcpowerd VPLEX ID=CKM00182201323 Logical device ID=6000144000000010F0127E4709356BC3 [device_Unity0004_New_BmcDB_dsg_1_vol] state=alive; policy=ADaptive; queued-IOs=0 ============================================================================== --------------- Host --------------- - Stor - -- I/O Path -- -- Stats --- ### HW Path I/O Paths Interf. Mode State Q-IOs Errors ============================================================================== 16 lpfc sdat CL1-0B active alive 0 0 16 lpfc sdan CL1-0A active alive 0 0 16 lpfc sdah CL1-08 active alive 0 0 16 lpfc sdab CL1-09 active alive 0 0 15 lpfc sdv CL1-0F active alive 0 0 15 lpfc sdp CL1-0E active alive 0 0 15 lpfc sdj CL1-0D active alive 0 0 15 lpfc sdd CL1-0C active alive 0 0 Pseudo name=emcpowere VPLEX ID=CKM00182201323 Logical device ID=6000144000000010F0127E4709356BC7 [device_Unity0004_New_BmcDB_data1_1_vol] state=alive; policy=ADaptive; queued-IOs=0 ============================================================================== --------------- Host --------------- - Stor - -- I/O Path -- -- Stats --- ### HW Path I/O Paths Interf. Mode State Q-IOs Errors ============================================================================== 16 lpfc sdas CL1-0B active alive 0 0 16 lpfc sdam CL1-0A active alive 0 0 16 lpfc sdag CL1-08 active alive 0 0 16 lpfc sdaa CL1-09 active alive 0 0 15 lpfc sdu CL1-0F active alive 0 0 15 lpfc sdo CL1-0E active alive 0 0 15 lpfc sdi CL1-0D active alive 0 0 15 lpfc sdc CL1-0C active alive 0 0 Pseudo name=emcpowerf VPLEX ID=CKM00182201323 Logical device ID=6000144000000010F0127E4709356BC5 [device_Unity0004_New_BmcDB_arch2_1_vol] state=alive; policy=ADaptive; queued-IOs=0 ============================================================================== --------------- Host --------------- - Stor - -- I/O Path -- -- Stats --- ### HW Path I/O Paths Interf. Mode State Q-IOs Errors ============================================================================== 16 lpfc sdaf CL1-08 active alive 0 0 16 lpfc sdar CL1-0B active alive 0 0 16 lpfc sdal CL1-0A active alive 0 0 16 lpfc sdz CL1-09 active alive 0 0 15 lpfc sdt CL1-0F active alive 0 0 15 lpfc sdn CL1-0E active alive 0 0 15 lpfc sdh CL1-0D active alive 0 0 15 lpfc sdb CL1-0C active alive 0 0 b) 使用udev持久化磁盘权限 # NOTE:How To Set Device Name Using UDEV on OL 7.X (文档 ID 2056427.1) # 编辑rules规则文件 # 注意:rules文件中uuid区别大小写, # 故要注意scsi_id -g -u -d $devnode 的输出结果。 KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000144000000010f0127e4709356bc5", RUN+="/bin/sh -c 'mknod /dev/asmarchdisk1 b $major $minor; chown grid:asmadmin /dev/asmarchdisk1; chmod 0660 /dev/asmarchdisk1'"KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000144000000010f0127e4709356bc7", RUN+="/bin/sh -c 'mknod /dev/asmdatadisk1 b $major $minor; chown grid:asmadmin /dev/asmdatadisk1; chmod 0660 /dev/asmdatadisk1'"KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000144000000010f0127e4709356bc2", RUN+="/bin/sh -c 'mknod /dev/asmocrdisk1 b $major $minor; chown grid:asmadmin /dev/asmocrdisk1; chmod 0660 /dev/asmocrdisk1'"KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000144000000010f0127e4709356bc4", RUN+="/bin/sh -c 'mknod /dev/asmocrdisk2 b $major $minor; chown grid:asmadmin /dev/asmocrdisk2; chmod 0660 /dev/asmocrdisk2'"KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000144000000010f0127e4709356bc6", RUN+="/bin/sh -c 'mknod /dev/asmocrdisk3 b $major $minor; chown grid:asmadmin /dev/asmocrdisk3; chmod 0660 /dev/asmocrdisk3'" # 启动Udev /sbin/udevadm trigger --type=devices --action=change # 查看磁盘 [root@pcmdb1 rpm]# /sbin/udevadm trigger --type=devices --action=change [root@pcmdb1 rpm]# ls -l /dev/asm* brw-rw---- 1 grid asmadmin 8, 16 Nov 24 15:19 /dev/asmarchdisk brw-rw---- 1 grid asmadmin 8, 32 Nov 24 15:19 /dev/asmdatadisk brw-rw---- 1 grid asmadmin 8, 48 Nov 24 15:19 /dev/asmocrdisk1 brw-rw---- 1 grid asmadmin 8, 64 Nov 24 15:19 /dev/asmocrdisk2 brw-rw---- 1 grid asmadmin 8, 80 Nov 24 15:19 /dev/asmocrdisk3 c) 设置Disk I/O Scheduler on Linux # 设置I/0 scheduler为[deadline]状态,共享使用 echo deadline >

/ sys/block/$ {ASM_DISK} / queue/scheduler

# Node 1 executes the display result to check whether the current scheduler status is [deadline]

[root@bmcdb1 ~] # cat / sys/block/emcpowera/queue/scheduler

Noop [deadline] cfq

[root@bmcdb1 ~] # cat / sys/block/emcpowerb/queue/scheduler

Noop [deadline] cfq

[root@bmcdb1 ~] # cat / sys/block/emcpowerc/queue/scheduler

Noop [deadline] cfq

[root@bmcdb1 ~] # cat / sys/block/emcpowerd/queue/scheduler

Noop [deadline] cfq

[root@bmcdb1 ~] # cat / sys/block/emcpowere/queue/scheduler

Noop [deadline] cfq

[root@bmcdb1 ~] # cat / sys/block/emcpowerf/queue/scheduler

Noop [deadline] cfq

4. GI installation

A) the cvuqdisk package requires all nodes to be installed

[root@bmcdb1 rpm] # ls

Cvuqdisk-1.0.10-1.rpm

[root@bmcdb1 rpm] # pwd

/ home/oracle/database/rpm

[root@bmcdb1 rpm] # rpm-ivh cvuqdisk-1.0.10-1.rpm

Preparing... # # [100%]

Updating / installing...

1:cvuqdisk-1.0.10-1 # #

[root@bmcdb1 rpm] # scp cvuqdisk-1.0.10-1.rpm root@bmcdb2:/home/oracle

The authenticity of host 'bmcdb2 (10.151.115.72)' can't be established.

ECDSA key fingerprint is e5:25:bb:51:c6:da:76:25:1d:4a:59:a8:e4:6d:92:ef.

Are you sure you want to continue connecting (yes/no) yes

Warning: Permanently added 'bmcdb2' (ECDSA) to the list of known hosts.

Root@bmcdb2's password:

Cvuqdisk-1.0.10-1.rpm

[root@bmcdb2 rules.d] # cd / home/oracle

You have new mail in / var/spool/mail/root

[root@bmcdb2 oracle] # ls

Cvuqdisk-1.0.10-1.rpm

[root@bmcdb2 oracle] # pwd

/ home/oracle

[root@bmcdb2 oracle] # rpm-ivh cvuqdisk-1.0.10-1.rpm

Preparing... # # [100%]

Updating / installing...

1:cvuqdisk-1.0.10-1 # #

B) the GI package is extracted directly to GI under $ORACLE_HOME

Su-grid

Unzip-d $ORACLE_HOME / soft/linuxx64_12201_grid_home.zip

# the installation process is omitted

# runcluvfy.sh verifies the system environment (decompress the GI package before the runcluvfy.sh script is available)

. / runcluvfy.sh stage-pre crsinst-n bmcdb1,bmcdb2-verbose

# process omission

C) upgrade Opatch

# directly overwrite the old Opatch with the new Opatch

# modify execution permissions

[root@bmcdb1 soft] # chmod 775 p6880880_122010_Linux-x86-64.zip

[grid@bmcdb1:/home/grid] $unzip-d / oracle/app/12.2.0/grid/ / soft/p6880880_122010_Linux-x86-64.zip

Archive: / soft/p6880880_122010_Linux-x86-64.zip

Inflating: / oracle/app/12.2.0/grid/OPatch/emdpatch.pl

Replace / oracle/app/12.2.0/grid/OPatch/oplan/oplan [y] es, [n] o, [A] ll, [N] one, [r] ename: A

# process omission

D) GI patch upgrade and GI graphics installation

# modify patch execution permission

[root@bmcdb1 12.2.0.1_grid_2019aprpatch] # chmod aquix p29301687_122010_Linux-x86-64.zip

[root@bmcdb1 12.2.0.1_grid_2019aprpatch] # ls-l p29301687_122010_Linux-x86-64.zip

-rwxr-xr-x 1 root root 1736326653 Jul 18 15:02 p29301687_122010_Linux-x86-64.zip

# create a patch installation directory

[grid@bmcdb1:/oracle/app/12.2.0/grid] $mkdir-p / oracle/app/12.2.0/grid/gridpsu

# unzip the patch

[grid@bmcdb1:/oracle/app/12.2.0/grid] $unzip-d / oracle/app/12.2.0/grid/gridpsu / soft/12.2.0.1_grid_2019aprpatch/p29301687_122010_Linux-x86-64.zip

# apply the patch and install GI

/ usr/bin/xauth: file / home/grid/.Xauthority does not exist

[grid@bmcdb1:/home/grid] $export DISPLAY=10.156.84.215:0.0

[grid@bmcdb1:/home/grid] $xclock

Warning: Missing charsets in String to FontSet conversion

# install using grid user patches and GI graphics

[grid@bmcdb1:/oracle/app/12.2.0/grid] $. / gridSetup.sh-applyPSU / oracle/app/12.2.0/grid/gridpsu/29301687

... Graphical interface installation omitted.

Root executes root.sh script

# Node 1 executes root.sh script recording (total 19 steps)

... Both nodes need to be executed successfully, the specific steps should be omitted.

GI installed successfully

# after GI is installed successfully, the service status is as follows:

[grid@bmcdb1:/home/grid] $crsctl stat res-t

Name Target State Server State details

Local Resources

Ora.ASMNET1LSNR_ASM.lsnr

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.OCR.dg

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.LISTENER.lsnr

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.net1.network

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.ons

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.proxy_advm

OFFLINE OFFLINE bmcdb1 STABLE

OFFLINE OFFLINE bmcdb2 STABLE

Cluster Resources

Ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE bmcdb1 STABLE

Ora.MGMTLSNR

1 OFFLINE OFFLINE STABLE

Ora.asm

1 ONLINE ONLINE bmcdb1 Started,STABLE

2 ONLINE ONLINE bmcdb2 Started,STABLE

3 OFFLINE OFFLINE STABLE

Ora.cvu

1 ONLINE ONLINE bmcdb1 STABLE

Ora.bmcdb1.vip

1 ONLINE ONLINE bmcdb1 STABLE

Ora.bmcdb2.vip

1 ONLINE ONLINE bmcdb2 STABLE

Ora.qosmserver

1 ONLINE ONLINE bmcdb1 STABLE

Ora.scan1.vip

1 ONLINE ONLINE bmcdb1 STABLE

Check for patches

# Node 1 performs opatch verification patches, while Node 2 ignores the results. The result of two nodes is the same.

[grid@bmcdb1:/oracle/app/12.2.0/grid/OPatch] $. / opatch lsinventory

Oracle Interim Patch Installer version 12.2.0.1.17

Copyright (c) 2019, Oracle Corporation. All rights reserved.

Oracle Home: / oracle/app/12.2.0/grid

Central Inventory: / oracle/app/oraInventory

From: / oracle/app/12.2.0/grid/oraInst.loc

OPatch version: 12.2.0.1.17

OUI version: 12.2.0.1.4

Log file location: / oracle/app/12.2.0/grid/cfgtoollogs/opatch/opatch3019-08-05 16-56-31PM_1.log

Lsinventory Output file location: / oracle/app/12.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2019-08-05 16-56-31PM.txt

Local Machine Information::

Hostname: bmcdb1

ARU platform id: 226

ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Grid Infrastructure 12c 12.2.0.1.0

There are 1 products installed in this Oracle Home.

Interim patches (5):

Patch 26839277: applied on Mon Aug 05 13:48:23 CST 2019

Unique Patch ID: 21578760

Patch description: "DBWLM RELEASE UPDATE 12.2.0.1.0 (ID:170913) (26839277)"

Created on 21 Sep 2017, 03:13:10 hrs PST8PDT

Bugs fixed:

26584906

Patch 29314339: applied on Mon Aug 05 13:48:16 CST 2019

Unique Patch ID: 22821655

Patch description: "Database Apr 2019 Release Update: 12.2.0.1.190416 (29314339)"

Created on 24 Mar 2019, 03:28:52 hrs PST8PDT

Bugs fixed:

26362155, 28023399, 25741955, 25873336, 26966616, 27097854, 28617631

…… The modified bug number is omitted in the middle.

28951382, 28960211, 28987439, 28991884, 28993590, 29027694, 29189889

29250230

Patch 28566910: applied on Mon Aug 05 13:47:53 CST 2019

Unique Patch ID: 22413436

Patch description: "TOMCAT RELEASE UPDATE 12.2.0.1.0 (ID:180802.1448.S) (28566910)"

Created on 28 Aug 2018, 23:01:25 hrs PST8PDT

Bugs fixed:

25728967, 26934551, 28402313

Patch 29314424: applied on Mon Aug 05 13:47:47 CST 2019

Unique Patch ID: 22724570

Patch description: "OCW APR 2019 RELEASE UPDATE 12.2.0.1.190416 (29314424)"

Created on 7 Mar 2019, 02:44:34 hrs PST8PDT

Bugs fixed:

12816839, 13250991, 18701017, 20559126, 20674742, 21477269, 21679331

…… The modified bug number is omitted in the middle.

28747282, 28805158, 28871945, 28887933, 28901519, 28915251, 28969877

28973538, 29400176

Patch 29301676: applied on Mon Aug 05 13:47:12 CST 2019

Unique Patch ID: 22720406

Patch description: "ACFS APR 2019 RELEASE UPDATE 12.2.0.1.190416 (29301676)"

Created on 3 Feb 2019, 15:55:16 hrs PST8PDT

Bugs fixed:

21129279, 22591010, 23152694, 23181299, 23625427, 24285969, 24346777

…… The modified bug number is omitted in the middle. 29031452, 29054666

OPatch succeeded.

5. RDBMS software installation

A) DB software is installed using oracle user graphics

# invoke the graphical interface using xmanger and test using xclock

[oracle@bmcdb1:/home/oracle] $export DISPLAY=10.156.84.72:0.0

[oracle@bmcdb1:/home/oracle] $xclock

[oracle@bmcdb1:/home/oracle/database] $. / runInstaller

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB. Actual 1035804 MB Passed

Checking swap space: must be greater than 150 MB. Actual 65535 MB Passed

Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed

Preparing to launch Oracle Universal Installer from / tmp/OraInstall2019-08-06. 09-30-49AM. Please wait... [oracle@bmcdb1:/home/oracle/database] $

... Graphical interface installation omitted.

Root executes root.sh script (both nodes need to execute successfully)

Db software installed successfully

B) upgrade Opatch

# decompress Opatch to $ORACLE_HOME to directly overwrite the old Opatch

[oracle@bmcdb1:/oracle/app/oracle/product/12.2.0/db_1] $unzip-d / oracle/app/oracle/product/12.2.0/db_1/ / soft/p6880880_122010_Linux-x86-64.zip

. Process omission

[oracle@bmcdb2:/oracle/app/oracle/product/12.2.0/db_1] $unzip-d / oracle/app/oracle/product/12.2.0/db_1/ / home/oracle/p6880880_122010_Linux-x86-64.zip

Archive: / home/oracle/p6880880_122010_Linux-x86-64.zip

Inflating: / oracle/app/oracle/product/12.2.0/db_1/OPatch/emdpatch.pl

Replace / oracle/app/oracle/product/12.2.0/db_1/OPatch/oplan/oplan [y] es, [n] o, [A] ll, [N] one, [r] ename: A

. Process omission

C) DB patch upgrade

# create a patch directory and decompress the software and application software. Datapatch-verbose loads the modified SQL file into the database (after dbca builds the database)

# after the Node 1 upgrade, the software cp continues to upgrade to Node 2

# Node 1 executes the display result

[oracle@bmcdb1:/oracle/app/oracle/product/12.2.0/db_1] $mkdir-p/oracle/ app/oracle/product/12.2.0/db_1/dbpsu

[oracle@bmcdb1:/oracle/app/oracle/product/12.2.0/db_1] $unzip-d / oracle/app/oracle/product/12.2.0/db_1/dbpsu / soft/12.2.0.1_db_2019aprpatch/p29314339_122010_Linux-x86-64.zip

[oracle@bmcdb1:/oracle/app/oracle/product/12.2.0/db_1/OPatch] $. / opatch apply / oracle/app/oracle/product/12.2.0/db_1/dbpsu/29314339/

[oracle@bmcdb1:/oracle/app/oracle/product/12.2.0/db_1/OPatch] $. / opatch lsinventory

Oracle Interim Patch Installer version 12.2.0.1.17

Copyright (c) 2019, Oracle Corporation. All rights reserved.

Oracle Home: / oracle/app/oracle/product/12.2.0/db_1

Central Inventory: / oracle/app/oraInventory

From: / oracle/app/oracle/product/12.2.0/db_1/oraInst.loc

OPatch version: 12.2.0.1.17

OUI version: 12.2.0.1.4

Log file location: / oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/opatch3019-08-06 10-33-46AM_1.log

Lsinventory Output file location: / oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2019-08-06 10-33-46AM.txt

Local Machine Information::

Hostname: bmcdb1

ARU platform id: 226

ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 12c 12.2.0.1.0

There are 1 products installed in this Oracle Home.

Interim patches (1):

Patch 29314339: applied on Tue Aug 06 10:32:10 CST 2019

Unique Patch ID: 22821655

Patch description: "Database Apr 2019 Release Update: 12.2.0.1.190416 (29314339)"

Created on 24 Mar 2019, 03:28:52 hrs PST8PDT

Bugs fixed:

26362155, 28023399, 25741955, 25873336, 26966616, 27097854, 28617631

. The BUG number in the middle restoration is omitted.

29250230

OPatch succeeded.

# Node 2 executes the display result

[oracle@bmcdb2:/oracle/app/oracle/product/12.2.0/db_1] $mkdir-p/oracle/ app/oracle/product/12.2.0/db_1/dbpsu

[oracle@bmcdb2:/oracle/app/oracle/product/12.2.0/db_1] $unzip-d / oracle/app/oracle/product/12.2.0/db_1/dbpsu / home/oracle/p29314339_122010_Linux-x86-64.zip

[oracle@bmcdb2:/oracle/app/oracle/product/12.2.0/db_1/OPatch] $. / opatch apply / oracle/app/oracle/product/12.2.0/db_1/dbpsu/29314339/

[oracle@bmcdb2:/oracle/app/oracle/product/12.2.0/db_1/OPatch] $. / opatch lsinventory

Oracle Interim Patch Installer version 12.2.0.1.17

Copyright (c) 2019, Oracle Corporation. All rights reserved.

Oracle Home: / oracle/app/oracle/product/12.2.0/db_1

Central Inventory: / oracle/app/oraInventory

From: / oracle/app/oracle/product/12.2.0/db_1/oraInst.loc

OPatch version: 12.2.0.1.17

OUI version: 12.2.0.1.4

Log file location: / oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/opatch3019-08-06 10-45-39AM_1.log

Lsinventory Output file location: / oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2019-08-06 10-45-39AM.txt

Local Machine Information::

Hostname: bmcdb2

ARU platform id: 226

ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 12c 12.2.0.1.0

There are 1 products installed in this Oracle Home.

Interim patches (1):

Patch 29314339: applied on Tue Aug 06 10:45:07 CST 2019

Unique Patch ID: 22821655

Patch description: "Database Apr 2019 Release Update: 12.2.0.1.190416 (29314339)"

Created on 24 Mar 2019, 03:28:52 hrs PST8PDT

Bugs fixed:

26362155, 28023399, 25741955, 25873336, 26966616, 27097854, 28617631

. The BUG number in the middle restoration is omitted.

29250230

OPatch succeeded.

6. ASMCA creates a disk group

[grid@bmcdb1:/home/grid] $export DISPLAY=10.156.84.72:0.0

[grid@bmcdb1:/home/grid] $xclock

[grid@bmcdb1:/home/grid] $asmca

... Graphical interface installation omitted.

# disk group inspection

[grid@bmcdb1:/home/grid] $asmcmd

ASMCMD > lsdg

State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name

MOUNTED EXTERN N 512 512 4096 4194304 204800 204668 0 204668 0 N DATA/

MOUNTED EXTERN N 512 512 4096 4194304 51200 51068 0 51068 0 N FRA/

MOUNTED NORMAL N 512 512 4096 4194304 92160 91244 30720 30262 0 Y OCR/

[grid@bmcdb2:/home/grid] $asmcmd lsdg

State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name

MOUNTED EXTERN N 512 512 4096 4194304 204800 204668 0 204668 0 N DATA/

MOUNTED EXTERN N 512 512 4096 4194304 51200 51068 0 51068 0 N FRA/

MOUNTED NORMAL N 512 512 4096 4194304 92160 91244 30720 30262 0 Y OCR/

7. DBCA creates a database

[oracle@bmcdb1:/home/oracle/database] $export DISPLAY=10.156.84.72:0.0

[oracle@bmcdb1:/home/oracle/database] $xclock

Warning: Missing charsets in String to FontSet conversion

[oracle@bmcdb1:/home/oracle/database] $dbca

... Graphical interface installation omitted.

The service status after database installation is shown as follows:

[grid@bmcdb1:/home/grid] $crsctl stat res-t

Name Target State Server State details

Local Resources

Ora.ASMNET1LSNR_ASM.lsnr

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.DATA.dg

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.FRA.dg

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.LISTENER.lsnr

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.OCR.dg

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.net1.network

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.ons

ONLINE ONLINE bmcdb1 STABLE

ONLINE ONLINE bmcdb2 STABLE

Ora.proxy_advm

OFFLINE OFFLINE bmcdb1 STABLE

OFFLINE OFFLINE bmcdb2 STABLE

Cluster Resources

Ora.LISTENER_SCAN1.lsnr

1 ONLINE ONLINE bmcdb1 STABLE

Ora.MGMTLSNR

1 OFFLINE OFFLINE STABLE

Ora.asm

1 ONLINE ONLINE bmcdb1 Started,STABLE

2 ONLINE ONLINE bmcdb2 Started,STABLE

3 OFFLINE OFFLINE STABLE

Ora.cvu

1 ONLINE ONLINE bmcdb1 STABLE

Ora.bmcdb.db

1 ONLINE ONLINE bmcdb1 Open,HOME=/oracle/ap

P/oracle/product/12.

2.0/db_1,STABLE

2 ONLINE ONLINE bmcdb2 Open,HOME=/oracle/ap

P/oracle/product/12.

2.0/db_1,STABLE

Ora.bmcdb1.vip

1 ONLINE ONLINE bmcdb1 STABLE

Ora.bmcdb2.vip

1 ONLINE ONLINE bmcdb2 STABLE

Ora.qosmserver

1 ONLINE ONLINE bmcdb1 STABLE

Ora.scan1.vip

1 ONLINE ONLINE bmcdb1 STABLE

# load the modified SQL file into the database

[oracle@bmcdb2:/oracle/app/oracle/product/12.2.0/db_1/OPatch] $. / datapatch-verbose

SQL Patching tool version 12.2.0.1.0 Production on Tue Aug 6 16:00:02 2019

Copyright (c) 2012, 2019, Oracle. All rights reserved.

Log file for this invocation: / oracle/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_106582_2019_08_06_16_00_02/sqlpatch_invocation.log

Connecting to database...OK

Bootstrapping registry and package to current versions...done

Determining current state...done

Current state of SQL patches:

Bundle series DBRU:

ID 190416 in the binary registry and ID 190416 in the SQL registry

Adding patches to installation queue and performing prereq checks...

Installation queue:

Nothing to roll back

Nothing to apply

SQL Patching tool complete on Tue Aug 6 16:00:36 2019

SQL > set lines 500 pages 500

SQL > col description for A75

SQL > col action_time for A35

SQL > col action for A10

SQL > col comments for A50

SQL > col VERSION for A25

SQL > col NAMESPACE for A20

SQL > col BUNDLE_SERIES for A20

SQL > select * from registry$history

ACTION_TIME ACTION NAMESPACE VERSION ID COMMENTS BUNDLE_SERIES

BOOTSTRAP DATAPATCH 12.2.0.1 RDBMS_12.2.0.1.0DBAPR2019RU_LINUX.X64_190227

SQL > select patch_id,version,action,status,action_time,description from dba_registry_sqlpatch

PATCH_ID VERSION ACTION STATUS ACTION_TIME DESCRIPTION

-

29314339 12.2.0.1 APPLY SUCCESS 06-AUG-19 01.29.26.913398 PM DATABASE APR 2019 RELEASE UPDATE 12.2.0.1.190416

8. RAC optimization

1. Safety

1.1 user password policy optimization (can be created according to security policy)

# FAILED_LOGIN_ATTEMPTS= > limit the number of login errors

# PASSWORD_LIFE_TIME = > password validity limit

ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS 30

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED

1.2 optimize the low-end version of the client unable to log on to the 12c high-version database (all node configurations)

[grid@bmcdb1:/oracle/app/12.2.0/grid/network/admin] $cat sqlnet.ora

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

SQLNET.ALLOWED_LOGON_VERSION=8

# MOS documentation ID 2296947.1

two。 Case optimization

2.1 Optimization of the number of process processes

# the maximum number of operating system user processes and all background processes.

# for example: locks\ job queue processes\ parallel execution processes

Alter system set processes=2000 sid='*' scope=spfile

2.2 concurrency optimization of local processes in instances

# implement process-level localized concurrent processing to optimize the problem of high overnight cost load between nodes.

# PARALLEL_FORCE_LOCAL this parameter defaults to False.

Alter system set parallel_force_local=true sid='*'

2.3 avoid situations in which users cannot log in due to a large number of library cache lock

# shutting down the database results in a large number of library cache lock caused by users continuously entering incorrect passwords

Alter system set event = "28401 TRACE NAME CONTEXT FOREVER, LEVEL 1" sid='*' scope=spfile

2.4 DBLINK optimized using insert

# when the high version database dblink is inserted into the lower version database, and the last bind in insert syntax is not varchar2, # error ORA-01483 or ORA-01461 is reported

# reference: OCI Application Fails With ORA-01483/ORA-01461 When Inserting VARCHAR2 Field From 12.2 Compact 18c Database Using Database Link To Lower Database Version. (document ID 2309285.1)

Alter system set "_ qkslvc_extended_bind_sz" = 0 sid='*'

2.5 12.2 RAC avoids a large number of 'Library Cache Lock' (Cycle)' in DataPump imports

During # datapump, parallel > 1 may trigger BUG, causing a large number of 'Library Cache Lock' (Cycle) problems.

Parallel = 1 runs the metadata import (default).

2.6 add db_files

# How to change the DB_FILES parameter in RAC (document ID 1636681.1)

Alter system set db_files=500 sid='*' scope=spfile

Srvctl stop database-d bmcdb

Srvctl start database-d bmcdb

# MAXDATAFILES is automatically extended, after oracle 8 version

3. System optimization

3.1 large page usage optimization

All instances use the hugepages_settings.sh script to calculate the vm.nr_ hugepages value. After all instances are stopped, add the calculated vm.nr_hugepages = 25026 to / etc/sysctl.conf and set sysctl-p to take effect immediately.

# reference: Oracle Linux: Shell Script to Calculate Values Recommended Linux HugePages / HugeTLB Configuration (document ID 401749.1)

[root@bmcdb1 ~] # sh hugepages_settings.sh

This script is provided by Doc ID 401749.1 from My Oracle Support

(http://support.oracle.com) where it is intended to compute values for

The recommended HugePages/HugeTLB configuration for the current shared

Memory segments on Oracle Linux. Before proceeding with the execution please note following:

* For ASM instance, it needs to configure ASMM instead of AMM.

* The 'pga_aggregate_target' is outside the SGA and

You should accommodate this while calculating SGA size.

* In case you changes the DB SGA size

As the new SGA will not fit in the previous HugePages configuration

It had better disable the whole HugePages

Start the DB with new SGA size and run the script again.

And make sure that:

* Oracle Database instance (s) are up and running

* Oracle Database 11g Automatic Memory Management (AMM) is not setup

(See Doc ID 749851.1)

* The shared memory segments can be listed by command:

# ipcs-m

Press Enter to proceed...

Recommended setting: vm.nr_hugepages = 25026

[root@bmcdb1 ~] # grep HugePages / proc/meminfo

AnonHugePages: 0 kB

HugePages_Total: 0

HugePages_Free: 0

HugePages_Rsvd: 0

HugePages_Surp: 0

[root@bmcdb1] # sysctl-p

……

Vm.nr_hugepages = 25026

[root@bmcdb1 ~] # grep HugePages / proc/meminfo

AnonHugePages: 0 kB

HugePages_Total: 25026

HugePages_Free: 25026

HugePages_Rsvd: 0

HugePages_Surp: 0

# the big page has come into effect

9. Schedule

1.NOTE:Deploying Oracle RAC Database 12c Release 2 on Red Hat Enterprise Linux 7

Http://cncc.bingj.com/cache.aspxq=oracle+12cr2+rac+best+practices&d=4930942179672428&mkt=en-US&setlang=en-US&w=GPjgb_mxllDCVRHE8gQPlCRV_qtaWfjG

two。 Manually delete GI completely

How to completely remove 11.2 and 12.1 Grid Infrastructure, CRS and/or Oracle Restart-IBM: Linux on System z (document ID 1413787.1)

3. How to (Deconfigure) unconfigure / (Reconfigure) reconfigure (rebuild OCR) or uninstall GI (document ID 2016852.1)

#

All rights reserved, the article is allowed to be reprinted, but the source address must be indicated by link, otherwise legal liability will be investigated! [QQ Exchange Group: 53993419]

QQ:14040928 E-mail:dbadoudou@163.com

Link to this article: http://blog.itpub.net/26442936/viewspace-2654393/

#

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report