squeeze the last ounce of your linux server · 2019-03-22 · • oracle ace director • founder...

124
Squeeze the Last Ounce Of Your Linux Server SharePlex Platinum Partner Charles Kim, CEO Oracle ACE Director & VMware vExpert Email: [email protected] UTOUG, March 2019

Upload: others

Post on 04-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Squeeze the Last Ounce Of Your Linux Server

SharePlex Platinum Partner

Charles Kim, CEO

Oracle ACE Director & VMware vExpertEmail: [email protected]

UTOUG, March 2019

Page 2: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

• Oracle ACE Director

• Founder and CEO of Viscosity

• Over 27 years of Oracle Expertise: Mission Critical Databases,

RAC, Data Guard, ASM, RMAN, Shareplex/GoldenGate

• Specialize in “Complex Data Replication & Integration” with Shareplex & GG

• President - IOUG Cloud Computing SIG

• Blog Sites: http://DBAExpert.com/blog

• Oracle Exadata Certified Implementation Specialist, (2014, 2016)

• Oracle Management Cloud Certified

• Oracle Certified RAC Expert

Charles Kim  @racdba

Page 3: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

My Core Expertise:

Oracle Exadata Implementation Specialist, 2014, 2016Oracle RAC Certified ExpertOracle Cloud Certified

Love LinuxAutomation – I am the Autonomous DBA ☺

Page 4: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

http://viscosityna.com/resources/dba-resources/twelve-days-12-2/

Page 5: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

We wrote the books

5

Page 6: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Evolution of the DBA

6

Kind of DBA Timeline

CLI DBA Early 90’s DBAs

GUI DBA Late 90’s and Dot Com

Google DBA Dot Com and 2000’s

iDBA Dot Com, IOUG iDBA Master Curriculum

RAC DBAs 2000+ after 9.2 (but major spike with 10.2)

DMA 2010+ Database Machine Administrator

vDBA / vRAC DBA 2010+ Evolving role of a DBA in the virtual world

Cloud DBA 2011+ Database Consolidation with Private Database CloudOracle Database 12c Launches June 2013

Public Cloud DBA 2015+ Oracle Public Cloud with Database Cloud Service, Database Backup Cloud Service, Storage Cloud Service, IaaS Cloud Service

PDBAs 2017+ Multi-Tenant with Oracle Database 12c Release 2 GA – March 15, 2017

“It is not the strongest or the most intelligent who will survive but those who can best

manage [adapt to] change.”

Page 7: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!7

Audience Poll• Get a show of hands of people running RH 6 or 7, OEL 6 or 7,

SUSE?

• Get a show hands of people running RAC on Linux?

• Show of people running 11g R2 or 12cR1 or 12cR2 or 18c ?

• Show of hands of who are running VM for databases …VMWARE?  OVM?  RAC on VM?

• Show of hands who are DBAs?  SAs?  Developers?

• Show of hands who are running VM on laptops or personal desktops?

Page 8: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!8

`

OEL: http://edelivery.oracle.com/linux

30 day evaluation from Red Hat: https://www.redhat.com/rhel/details/eval/

Oracle Database (RDBMS) on Unix AIX,HP-UX,Linux,Solaris and MS Windows Operating Systems Installation and Configuration Requirements Quick Reference (12.1/12.2) (Doc ID 1587357.1)

• Oracle Database on Unix AIX,HP-UX,Linux,Mac OS X,Solaris,Tru64 Unix Operating Systems Installation and Configuration Requirements Quick Reference (8.0.5 to 11.2) [ID 169706.1]

Benefits of OEL? Oracle validated install —> Now PreInstall RPMs Single Vendor (no one to point blame to) Comprehensive Support

Page 9: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Oracle Cloud Pocket Solutions GuideReal-Life Cloud Solutions

Kindle version was created in Q4 2016

The Oracle Cloud Pocket Solutions Guide will evolve with Oracle Cloud with new features and

changes will be reflected in the Kindle version

Stop by our booth to receive a free copy of the Kindle version

Page 10: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Agenda• RHEL History • RPM Requirements —> History and Future

• Setting up a YUM Repository • Build RPM out of Oracle’s Source RPM for Red Hat

• ASMLIB vs ASM Filter Driver

• OSWatcher • Network

• HugePages and THP • Storage • NTP & Chrony • CPU Management • Centralized Syslog • Firewall Management

• Kernel

• ASM • ACFS

• DEMO • If Time Permitting

Page 11: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

RHEL HISTORY

Page 12: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

State of the Penguin

12

RHEL 7.6 – 2018-10-30 RHEL 7.5 – 2018-04-10 RHEL 7.4 - 2017-07-31 RHEL 7.3 - 2016-11-03 RHEL 7.2 - 2015-11-19 RHEL 7.1 - 2015-03-05

RHEL 6.10 - 2018-06-19 Extended Life Support starts:

11/30/2020 RHEL 6.9 - 2017-03-21 RHEL 6.8 - 2016-05-10

$ cat /etc/redhat-release $ uname -a

RHEL 5.11 - 2014-09-16

Page 13: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

X.6

Page 14: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

A Word on Oracle UEK

It’s your ace in the hole. If you run UEK, you get better support form Oracle ☺

UEK has loads of benefits for database workloads (even on virtualized environments) •Improved memory management •Better IO scheduling

Why is Oracle Linux better for Oracle Databases? • Receives more than 128,000 hours of

database and application testing each day • Unbreakable Enterprise Kernel (UEK),is specifically

optimized for the best performance of Oracle software

Page 15: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Oracle Linux Public Yum Serverhttp:/yum.oracle.com/

• Offered for Free• No Support

• By default, all Oracle Linux installations are configured to pull off of Oracle’s public yum server

Page 16: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

RPM REQUIREMENTS

FROM DAYS OF OLD

TO

PRESENT

& FUTURE

Page 17: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

EBusiness R12 RPM Requirements - Days of OldRed Hat 5 or OEL 5

http://oss.oracle.com/projects/compat-oracle/files/Enterprise_Linux/ openmotif21-2.1.30-11.EL5.i3861 xorg-x11-libs-compat-6.8.2-1.EL.33.0.1.i386 For Update 1 or 2: binutils-2.17.50.0.6-6.0.1.i3862 For Update 3: binutils-2.17.50.0.6-9.0.1.i3862

* compat-glibc-2.3.4-2.26 * gcc-4.1.2-14.el5 * gcc-c++-4.1.2-14.el5 * glibc-2.5-123 * glibc-common-2.5-123 * glibc-devel-2.5-12 * libgcc-4.1.2-14.el53 * libstdc++-devel-4.1.2-14.el5 * libstdc++-4.1.2-14.el53 * make-3.81-1.13 * gdbm-1.8.0-26.2.13 * libXp-1.0.0-8.1.el5 * libaio-0.3.106-3.23 * libgomp-4.1.2-14.el5 * sysstat-7.0.0-3.el5 * compat-libstdc++-296-2.96-138 * compat-libstdc++-33-3.2.3-61

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=BULLETIN&id=761564.1

Page 18: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

18

Oracle Database 11g Release 2 – Days of OldRPM Requirements - EL5 or Red Hat 5 64-bit

binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 (32 bit) elfutils-libelf-0.125 elfutils-libelf-devel-0.125 gcc-4.1.2gcc-c++-4.1.2 glibc-2.5-24 glibc-2.5-24 (32 bit) glibc-common-2.5 glibc-devel-2.5 glibc-devel-2.5 (32 bit) glibc-headers-2.5 ksh-20060214 

libaio-0.3.106 libaio-0.3.106 (32 bit) libaio-devel-0.3.106 libaio-devel-0.3.106 (32 bit) libgcc-4.1.2libgcc-4.1.2 (32 bit) libstdc++-4.1.2libstdc++-4.1.2 libstdc++-devel make-3.81 sysstat-7.0.2 unixODBC-2.2.11 unixODBC-2.2.11 unixODBC-devel-2.2.11 unixODBC-devel-2.2.11 (32 bit)

26

Page 19: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Formerly Known as Oracle-Validated on Red HatOracle Linux 6

wgetwget

# yum install oracle-ebs-server-R12-preinstall

EBS ISOhttp://dbaexpert.com/ebs/

Page 20: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Pre-Install Source RPM for Oracle Linux 7http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/index_src.html

wget for Oracle Database 18c

wget for Oracle Database 12c R2 Latest

Page 21: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Setup Local Yum RepositoryEasy as 1-2-3

�21

Mount the ISO as loop device:mkdir /mnt/RHEL.DVD /mnt/rhel7.5.isoscp rhel-server-7.5-x86_64-dvd.iso root@duppy:/mnt/rhel7.5.isomount -o loop -t iso9660 /mnt/rhel7.5.iso/rhel-server-7.5-x86_64-dvd.iso /mnt/RHEL.DVD

Example of RedHat Auto-mounting the DVD$ pwd /run/media/ckim/RHEL-7.5 Server.x86_64

$ cat .discinfo  1499751070.690815 Red Hat Enterprise Linux 7.5 x86_64 1

Page 22: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Setup Local Yum Repository Create a file in the /etc/yum.repos.d:

[root@sql100 ~]# cat /etc/yum.repos.d/viscosity.repo  [viscosity] mediaid=1499751070.690815 name=Local Viscosity Repo baseurl=“file:///run/media/ckim/RHEL-7.5 Server.x86_64/" enabled=1 gpgcheck=no

Needs a double quote because of the space

Page 23: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Setup Local Yum Repository

23

Create a file in the /etc/yum.repos.d: # cat viscosity.repo [viscosity] mediaid=1384196515.415715 name=Local Viscosity Repo baseurl=file:///mnt/RHEL.DVD/ enabled=1 gpgcheck=no

Confirm local yum repository # yum repolist Loaded plugins: product-id, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

repo id repo name status viscosity Local Viscosity Repo 3,690 repolist: 3,690

Test Installation of simple RPM: # yum install screen

Page 24: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�24

Re-Compile PreInstall RPM1. Install the rpm-build and rpmdevtools RPM# yum install rpm-build rpmdevtools –y

2. Create linux user called orarpm # useradd mockbuild -p mockbuild -m -s /bin/bash

3.su to the orarpm user and execute the rpmdev-setuptree command # su – mockbuild $ rpmdev-setuptree

4.Try a mock installation of the source RPM as orarpm user$ rpm –ivh oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.src.rpmwarning: oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.src.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY1:oracle-rdbms-server-12c########################################### [100%]

Page 25: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�25

Re-Compile PreInstall RPM5. Modify the .spec file$ vi rpmbuild/SPECS/oracle-rdbms-server-12cR1-preinstall.spec

#System requirementRequires:procps module-init-tools ethtool initscriptsRequires:bc bind-utils nfs-utils util-linux-ng pamRequires:xorg-x11-utils xorg-x11-xauth# -- get rid of the line below# Requires:kernel-uekRequires:smartmontools

6. Execute the rpmbuild to create the .rpm file$ rpmbuild -ba rpmbuild/SPECS/oracle-rdbms-server-12cR1-preinstall.spec

7. As root, install the 12cR1 preinstall RPMyum localinstall ~orarpm/rpmbuild/RPMS/x86_64/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64.rpm

Page 26: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Yum Installation

26

EBS Essentials ISO

http://dbaexpert.com/ebs/

# yum install oracle-database-preinstall-18c

# yum install oracle-database-server-12cR2-preinstall

# yum install oracle-ebs-server-R12-preinstall

# yum install oracle-em-agent-12cR4-preinstall

Page 27: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

ASMLIB

VS

ASM FILTER DRIVER

Page 28: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

OS Template - Red Hat 6.4+ ASMLIB SupportAs of May 2013 ASMLib requires kmod-oracleasm (RHEL Supplementary Channel), oracleasmlib and

oracleasm-support packages

Convert from udev to ASMLIB – http://dbaexpert.com/blog/

28

Page 29: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

ASM Filter Driver12.2 Full Integration in GI

Filter Driver Installation and ConfigurationInstallation and configuration for ASM Filter Driver (ASMFD) is enabled as part of

Oracle Grid Infrastructure installation

Available on Linux as of 12.1.0.2

Many steps to implement in 12.1

Simplified in 12.2 with GUI Support

Oracle ASM Filter Driver is the recommended replacement for ASMLIB

Page 30: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

ASM Filter Driver

Page 31: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

ASM Filter Driver

Page 32: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�32

OS Template - ssh setup – The Alternative Way

http://www.dbaexpert.com/blog/ssh-setup-the-oracle-way/ http://www.dbaexpert.com/blog/sshsetup-on-a-7-node-rac/

$ pwd /nfs/software/12c/grid/sshsetup    $ ./sshUserSetup.sh -user oracle -hosts "rac1 rac2" \ -noPromptPassphrase -advanced –exverify

The output of this script is also logged into /tmp/sshUserSetup_2013-07-09-16-31-50.log

Space

Page 33: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

33

Agenda

Page 34: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�34

OS Template - OS Watcher – The Alternative Way

Install OS Watcher Service RPM:sudo rpm -ihv oswbb-service-1.1.5-1.noarch.rpm

Modify /etc/oswbb.conf# Set OSW_HOME to the directory where you unpacked OSW or OSWbbaOSW_HOME='/u01/app/oracle/oswbb'# Set OSW_INTERVAL to the number of seconds between collectionsOSW_INTERVAL='30'# Set OSW_RETENTION to the number of hours logs are to be retainedOSW_RETENTION='168'# Set OSW_USER to the owner of the OSW_HOME directoryOSW_USER='root'# Set OSW_COMPRESSION to the desired compression facilityOSW_COMPRESSION='gzip’

http://www.dbaexpert.com/blog/the-better-way-to-configure-oswatcher/ How To Start OSWatcher Black Box (OSWBB) Every System Boot [ID 580513.1]

Start OSWatcher:sudo /sbin/service oswbb start

Setup Auto-Start:sudo /sbin/chkconfig oswbb on

Page 35: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Configure OSWatcherSingle Cron Job

# -------------------------------------------------------------------------

# -- Start OS Watcher if it is not running

# -------------------------------------------------------------------------

0 2,8,14,20 * * * ps -ef | grep oswbb | grep -v grep || cd /orabackup/oswatch/oswbb;nohup ./startOSWbb.sh 60 720 &

Note:

1. collect statistics every 60 seconds

2. the 720 means to retain archive data for 30 days (24*30)

35

Page 36: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

36

OSWatcher Analyzer User Guide (Doc ID 461053.1)

• The OSWatcher Analyzer (oswbba) is a utility that allows the user to graph and analyze data collected from running OSWatcher.

• oswbba is a graphing and analysis utility which comes bundled with OSWatcher.

• oswbba analyzes the OSWatcher archive files (vmstat, iostat, top, ps, netstat, HP-UX sar and Linux meminfo)

• Use Java that is shipped with Oracle – $ export PATH=$ORACLE_HOME/jre/1.4.2/bin:$PATH

• $ export DISPLAY=HOST_IP:0 • $ java -jar oswbba.jar -i $UTIL/osw/archive

Page 37: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

37

AGENDALINUX TUNING

>NETWORK

Page 38: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Enable Jumbo FramesCheck to see

Will Suceedping -M do -s 8972 -c 2 rac01a-privping -M do -s 8972 -c 2 rac01b-privping -M do -s 8972 -c 2 rac02a-privping -M do -s 8972 -c 2 rac02b-priv

PING rac01a (10.17.33.31) 8972(9000) bytes of data.8980 bytes from rac01a-priv (10.17.33.31): icmp_seq=1 ttl=64 time=0.017 ms8980 bytes from rac01a-priv (10.17.33.31): icmp_seq=2 ttl=64 time=0.018 ms

Will Failping -M do -s 8973 -c 2 rac01a-privping -M do -s 8973 -c 2 rac01b-privping -M do -s 8973 -c 2 rac02a-privping -M do -s 8973 -c 2 rac02b-priv

Make sure: switch support is enabled

Must have end-to-end support

•Jumbo Frames for •Private Interconnect •10gigE for storage (iSCSI, FCOE, NFS)

Page 39: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Enable Jumbo Frames# cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0 IPADDR=192.168.89.90 NETMASK=255.255.255.0 ONBOOT=yes BOOTPROTO=none USERCTL=no VLAN=yes

MTU=9000

39

Page 40: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

• Each host must provide a minimum of 2 Ethernet NICs public and private (interconnect) communication

• Oracle RAC configuration, a separation of networks for the• Public network • Private network (cluster interconnect) • Storage network (if applicable) • Backup network

• Run NTPD to an external ntpd server • Chrony in RHEL 7+

• Leverage vMotion/Live Migration Effectively• Set css timeout conservatively to accommodate migration

Best Practices – Oracle RAC Networking

Page 41: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Best Practices – Oracle Data Guard Networking - http://dbaexpert.com/dg/ioug2016/dg/

BDP

• Determine latencyping -c 2 -s 64000 matrix

• Enable NTP with the –x option for slewing

• Tune source and target network queue pairs - Tune network queue (txqueuelen) - Set

sys.net.core.netdev_max_backlog kernel parameter

• Calculate BDP - Set SEND_BUF_SIZE and

RECV_BUF_SIZE Oracle Net Parameters - Set net.ipv4.tcp_wmem and

net.ipv4.tcp_rmem kernel parameters - Script: dg_bdp.ksh from DG Toolkit

❖ dg_bdp.conf

Page 42: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Bandwidth-Delay Product = Bandwidth * Latency * 3

cat dg_bdp.conf WAN=OC3 RTT_RESPONSE=44

$ ./dg_bdp.ksh BANDWIDTH is: 155000000 LATENCY is: .04400 BDP = 2557500

TNSNAMES.ORA ENTRY

VISK_PRI = (DESCRIPTION = (SEND_BUF_SIZE=2557500) (RECV_BUF_SIZE=2557500) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = rac561-vip) (PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = VISK) ) )

LISTENER.ORA ENTRY

LISTENER = (DESCRIPTION_LIST = (DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = rac561-vip) (PORT = 1521) (SEND_BUF_SIZE=2557500) (RECV_BUF_SIZE=2557500))) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (ORACLE_HOME = /app/oracle/product/11.2.0/db) (SID_NAME = VISK1) ) )

Page 43: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

43

HugePagesDisable Transparent Hugepages – Doc ID: 1557478.1

Page 44: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Best Practices - Hugepages

Not /etc/security/limits.conf to set soft and hard limitsInstead, /etc/security/limits.d/99-oracle-limits.conf

oracle soft nofile 131072 oracle hard nofile 131072 oracle soft nproc 131072 oracle hard nproc 131072 oracle soft core unlimited oracle hard core unlimited  # -- The following entries need to adjusted with HugePages settings# oracle soft memlock [Sum SGA + wiggle] # oracle hard memlock [Sum SGA + wiggle]

oracle          soft    memlock        50331648oracle          hard    memlock        50331648

$ ulimit –l 50331648 /etc/sysctl.conf

vm.nr_hugepages = 24576

Page 45: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Hugepages

hugepages_settings.sh from MOS ID: 401749.1

# /etc/sysctl.conf vm.nr_hugepages = 24576 # number of pages specified in 2M increments + 5

# grep ^Huge /proc/meminfo —> HugePages_Rsvd: number of hugepages that are in use.

— Look for hugepage information in the alert log starting in 11g

45

Page 46: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Hugepages

SQL> alter system set memory_target=0; System altered. SQL> alter system set memory_max_target=0; System altered.

Initialization Parameters Cannot use memory_target / memory_max_target

USE_LARGE_PAGES=only [only|true|false] ..true is default [11.2.0.2+] SGA_TARGET=47G

SGA_MAX_SIZE=47G

MEMORY_MAX_TARGET=0

MEMORY_TARGET=0

So what is the difference between AMM and SGA Target? PGA Aggregate Target —> Manually check advisor

46

Page 47: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Automate Hugepages Setup > cat root_set_hugepages.ksh #!/bin/ksh

export HP_SIZE_MB=$1DEFAULT_HP_PERCENTAGE=60

if [ "$HP_SIZE_MB" = "" ]; then  echo "Huge Page Value not specified in the command-line options."  echo "We will set the HugePages value based on $DEFAULT_HP_PERCENTAGE % of physical memory"  SERVER_MEMORY_KB=$(grep ^MemTotal /proc/meminfo |sed -e 's/[^0-9]*//g' -e 's/ //g')  let SERVER_MEMORY_MB=$SERVER_MEMORY_KB/1024  echo "Server Memory: $SERVER_MEMORY_MB"

  let DEFAULT_HP_SIZE=$SERVER_MEMORY_MB*$DEFAULT_HP_PERCENTAGE/100  echo "Default HugePage size based on $DEFAULT_HP_PERCENTAGE %: $DEFAULT_HP_SIZE"

  export HP_SIZE_MB=$DEFAULT_HP_SIZEfi

LINUX_VER=$(cat /etc/redhat-release |sed -e 's/[^0-9]*//g' -e 's/ //g')echo "Linux Version is: $LINUX_VER"echo ""

echo "Checking to see if Huge Pages is already set"grep -i vm.nr_hugepages /etc/sysctl.confRC=$?echo "" 

function calc_hp {let HP_KB=$HP_SIZE_MB*1024echo "HugePages KB = $HP_KB"let HP_PRESETTING=$HP_KB/2048let HP_SETTING=$HP_PRESETTING+6echo "HP Settings:  $HP_PRESETTING $HP_SETTING"echo "New HugePage Setting for /etc/sysctl.conf"echo "vm.nr_hugepages=$HP_SETTING"}

calc_hp

export TMP_SYSCTL=/tmp/sysctl.conf.tmpif [ "$RC" -eq 1 ]; then  echo "Return Code for HugePages: $RC"  echo "HugePages is not set!"  echo "# -- HugePage Setting for Oracle Databases -- #" >>/etc/sysctl.conf  echo "vm.nr_hugepages=$HP_SETTING" >>/etc/sysctl.conf

elif [ "$RC" -eq 0 ]; then  echo "Huge Pages is set..."  cp /etc/sysctl.conf /tmp/sysctl.conf.$$  cat /etc/sysctl.conf |grep -v "vm.nr_hugepages" >$TMP_SYSCTL  echo "vm.nr_hugepages=$HP_SETTING" >>$TMP_SYSCTL  cp $TMP_SYSCTL /etc/sysctl.conffi

let MEMLOCK_VALUE=$HP_SETTING*2048cat /etc/security/limits.conf |grep -v ^# |grep -i memlock |grep -v grep 2>/dev/nullexport MEMLOCK_RC=$?if [ "$MEMLOCK_RC" -eq 0 ]; then  export SECURITY_LIMITS_FILE=/etc/security/limits.confelse  export SECURITY_LIMITS_FILE=$(grep -il memlock /etc/security/limits.d/*.conf)fi

# -- MEMLOCK has never been set so we need to find the limits.conf filecat /etc/security/limits.conf |egrep -v "^#" |grep nprocexport NPROC_RC=$?

if [ "$SECURITY_LIMITS_FILE" = "" ]; then  if [ "$NPROC_RC" -eq 0 ]; then    export SECURITY_LIMITS_FILE=/etc/security/limits.conf  else    # -- We need to find the limits file for RHEL 6 directory structure    export SECURITY_LIMITS_FILE=$(grep -i nproc /etc/security/limits.d/* |awk -F ":" {'print $1'} |tail -1)    [ "$SECURITY_LIMITS_FILE" = "" ] && export SECURITY_LIMITS_FILE=/etc/security/limits.d/90-memlock.conf  fifi

  export TMP_LIMITS_FILE=/tmp/limits.conf.tmp  #echo "Security Limits File:  $SECURITY_LIMITS_FILE"  cp $SECURITY_LIMITS_FILE /tmp/limits.conf.$$

  cat $SECURITY_LIMITS_FILE |egrep -v "memlock" >$TMP_LIMITS_FILE

Page 48: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Hello World!

THP

Page 49: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Disable THP

• # vi /etc/default/grub • GRUB_TIMEOUT=5

GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console” GRUB_CMDLINE_LINUX="nomodeset crashkernel=auto rd.lvm.lv=vg_os/lv_root rd.lvm.lv=vg_os/lv_swap rhgb quiet transparent_hugepage=never" GRUB_DISABLE_RECOVERY="true"

Page 50: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Modifying GRand Unified Bootloader2 (GRUB2)• https://www.unixarena.com/2015/04/how-to-edit-the-grub-on-

rhel-7.html

• Edit the /etc/default/grub  – Main configuration file for grub2 is /boot/grub2/grub.cfg – Do not modify grub.cfg file

• Run the grub2-mkconfig to view the current settings • Commit the changes to grub.cfg.

– # grub2-mkconfig > /boot/grub2/grub.cfg

Page 51: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

THP Configuration• Transparent huge pages are enabled by default. • To check the current status, run:

# cat /sys/kernel/mm/transparent_hugepage/enabled

• To disable transparent huge pages: # echo never > /sys/kernel/mm/transparent_hugepage/enabled

Legend • always - always use THP • never - disable THP

Page 52: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

THP FactoidsHuge Pages and Transparent Huge Pages (THP)

– https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_tuning_and_optimization_guide/sect-virtualization_tuning_optimization_guide-memory-huge_pages

• How to use, monitor, and disable transparent hugepages in Red Hat Enterprise Linux 6 and 7? – https://access.redhat.com/solutions/46111

Page 53: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

53

AGENDALINUX TUNING

>STORAGE

Page 54: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Partition Alignment

If you choose to create separate disk groups for OCR and Vote disk, create a partition alignment of 1M and 4M offset

# --

# -- Partition alignment of OCR / Vote Disks with 1MB offset

echo "2048,," | sfdisk -uS /dev/mapper/ov_disk000p1

echo "2048,," | sfdisk -uS /dev/mapper/ov_disk001p1

echo "2048,," | sfdisk -uS /dev/mapper/ov_disk002p1

  # --

# -- Partition alignment of Data / FRA disks with 4MB offset

echo "8192,," | sfdisk -uS /dev/mapper/data101_disk000p1

echo "8192,," | sfdisk -uS /dev/mapper/data101_disk001p1

echo "8192,," | sfdisk -uS /dev/mapper/data101_disk002p1

echo "8192,," | sfdisk -uS /dev/mapper/data101_disk003p1

echo "8192,," | sfdisk -uS /dev/mapper/data101_disk004p1

Page 55: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Partition Alignment - parted

for DISK in $(cat $CURRDIR/asm_luns.txt \ |egrep -v "^#|grep" |awk {'print $1'}) do … done

# -- Partition alignment of OCR / Vote Disks with 1MB Offset $ sudo /sbin/parted -s ${DISK} mkpart primary ext4 2048s 100% # -- Partition alignment of Data / FRA disks with 4MB Offset $ sudo /sbin/parted -s ${DISK} mkpart primary ext4 8192s 100%

# -- Verify Partition Offset $ sudo /sbin/parted ${DISK} print

Page 56: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

sfdisk# echo "2048,," | sfdisk -uS /dev/emcpowerb Checking that no-one is using this disk right now ... OK Disk /dev/emcpowerb: 1018 cylinders, 166 heads, 62 sectors/track sfdisk: ERROR: sector 0 does not have an msdos signature /dev/emcpowerb: unrecognized partition table type Old situation: No partitions found New situation: Units = sectors of 512 bytes, counting from 0 Device Boot Start End #sectors Id System /dev/emcpowerb1 2048 10477255 10475208 83 Linux /dev/emcpowerb2 0 - 0 0 Empty /dev/emcpowerb3 0 - 0 0 Empty /dev/emcpowerb4 0 - 0 0 Empty Warning: no primary partition is marked bootable (active) This does not matter for LILO, but the DOS MBR will not boot this disk. Successfully wrote the new partition table Re-reading the partition table ... If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1

(See fdisk(8).)

56

Page 57: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Verify Partition Alignment# sfdisk -uS -l /dev/emcpowerb

Disk /dev/emcpowerb: 1018 cylinders, 166 heads, 62 sectors/track Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System /dev/emcpowerb1 2048 10477255 10475208 83 Linux /dev/emcpowerb2 0 - 0 0 Empty /dev/emcpowerb3 0 - 0 0 Empty /dev/emcpowerb4 0 - 0 0 Empty

Page 58: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Partition Alignment - parted

for DISK in $(cat $CURRDIR/asm_luns.txt \ |egrep -v "^#|grep" |awk {'print $1'}) do … done

# -- Partition alignment of OCR / Vote Disks with 1MB Offset $ sudo /sbin/parted -s ${DISK} mkpart primary ext4 2048s 100% # -- Partition alignment of Data / FRA disks with 4MB Offset $ sudo /sbin/parted -s ${DISK} mkpart primary ext4 8192s 100%

# -- Verify Partition Offset $ sudo /sbin/parted ${DISK} print

Page 59: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

XFS is the future!Default File System for OL 7 and RHEL 7

• EXT4 file system is more popular • XFS allows users to have 100 TB (supported by OL) for the file system size, but

Max Size is almost 8 EB • External XFS Journal

• XFS is supported when using OL7 or RHEL 7 or later • Future Snapshotting Capabilities

More information on XFS • http://docs.oracle.com/cd/E37670_01/E37355/html/ol_about_xfs.html • You must have an Oracle Linux Premier Support account to obtain technical support for XFS with Oracle Linux • Direct I/O in XFS implements high throughput, non-cached I/O • Can Freeze and Unfreeze an XFS file system (for hardware based snapshots)

Page 60: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

tuned-adm

60

# yum install tuned# chkconfig tuned on# service tuned start

# tuned-adm tuned-profiles-oracle Switching to profile 'enterprise-storage' Applying deadline elevator: dm-0 dm-1 dm-2 sda sdb sdc sdd [ OK ]sdg sdh Applying ktune sysctl settings: /etc/ktune.d/tunedadm.conf: [ OK ] Calling '/etc/ktune.d/tunedadm.sh start': [ OK ] Applying sysctl settings from /etc/sysctl.conf Starting tuned: [ OK ]

# tuned-adm list |grep ^- |wc 12 24 219

Page 61: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Repository: rhel-7-server-optional-rpms

# yum install tuned-profiles-oracle

Page 62: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Best Practice – Determine IOPS and Throughput

ORION (Part of 11.2 now) sudo -u root ./orion_linux_x86-64 -run advanced –testname myload -num_disks 20 -cache_size 8000 -duration 240 -matrix basic

SLOB2 (Simple Little Oracle Benchmark)

Calibrate I/O – Native to Oracle starting in 11.1 SQL> declare 2 l_latency integer; 3 l_iops integer; 4 l_mbps integer; 5 begin 6 dbms_resource_manager.calibrate_io 7 (5,10,l_iops,l_mbps,l_latency); 8 dbms_output.put_line ('max_iops = '||l_iops); 9 dbms_output.put_line (’latency = '||l_latency); 10 dbms_output.put_line ('max_mbps = '||l_mbps); 11 end; 12 /max_iops = 5348latency  = 10max_mbps = 641

Other Free Tools:• Swingbench

• TPC Benchmark • Custom scripts

How do you know for sure?RAT - Database Replay

Page 63: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

I/O Schedulers# echo deadline > /sys/block/${ASM_DISK}/queue/scheduler < -- bare metal# echo noop > /sys/block/${ASM_DISK}/queue/scheduler < -- VM

Default in OL6 UEK:

# cat /sys/block/sda/queue/scheduler

noop [deadline] cfq CFQ is the default in RHEL 6

• Completely Fair Queuing (CFQ) scheduler is the default algorithm in Red Hat Enterprise Linux 4, 5, 6 • Deadline scheduler is the default for RHEL 7

Permanent Changes to /etc/grub.conf

title Red Hat Enterprise Linux Server (2.6.9-67.EL) root (hd0,0)

kernel /vmlinuz-2.6.9-67.EL ro root=/dev/vg0/lv0 elevator=deadline

initrd /initrd-2.6.9-67.EL.img

63

Page 64: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

IO schedulersDeadline CFQ (Completely Fair Queueing) NOOP

• Default except for SATA devices

• Attempts to provide guaranteed latency for requests from the point at which requests reach the I/O scheduler

• Suitable for most use cases especially where read > write operations

• Default scheduler for SATA disks

• Divides processes into three separate classes: real time, best effort, and idle

• Real time class performed before best effort which is performed before idle class

• Real time class can starve both best effort and idle processes of processor time

• Default is best effort class

• Implements a simple FIFO (first-in first-out) scheduling algorithm

• Requests merged at the generic block layer through a simple last-hit cache

• Best scheduler for CPU-bound systems using fast storage

Recommendation for Virtualized Infrastructure:• Set GOS disk scheduling algorithm to ‘noop’• ‘noop’ (No Op) scheduler lets ESXi perform I/O optimization & queueing

Page 65: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Kernel Parameter that affect Database Performance – Virtual Memory and I/Odirty_background_ratio % of system memory that can be filled with dirty pages

dirty_expire_centisecs How long a dirty page should sit in RAM prior to being written to diskIf dirty pages are older than value, written to disk asynchRecommended Value: 500 à 5 Seconds

vm.dirty_ratio Maximum amount of system memory that can be filled with dirty pages before committed to disk

dirty_writeback_centisecs How often the flush process wakes up to determine need to flush any dirty pages

vm.swappiness Default Value: 60 in RHEL 6; recommended value = 1

fs.aio-max-nr Sets the maximum number of concurrent asynchronous I/O requestsOracle Recommended Value: 1048576fs.aio-max-nr = 1048576

fs.file-max Maximum number of open file handles assigned to the OSCalculated by multiplying ( 512* PROCESSSES ) + in addition to the open file handles by the OSOracle Recommended Value: Not <= fs.file-max = 6815744Need to revisit this value as we increase databases and processes parameters 65

Page 66: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

ntp &| chrony

Page 67: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

67

Ntp – network time protocol

Reliable in RHEL 5/6

• Migrating towards chrony in RedHat 7

NTP can be setup a a server or a client

Choose NTP or chrony (not both)

Chrony is • A client only • More secure • Faster

# Drop root to id 'ntp:ntp' by default. #OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g" OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

NTP Installation

Install NTP # yum install -y ntp

Activate the NTP service at boot: # systemctl enable ntpd

Start the NTP service: # systemctl start ntpd

The NTP configuration is in the /etc/ntp.conf file

To quickly synchronize a server: # systemctl stop ntpd # ntpdate pool.ntp.org # systemctl start ntpd

Page 68: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

68

chrony – Faster for Mobile and Virtual Environments

For more information: https://www.certdepot.net/rhel7-set-ntp-service/

Chrony configuration file: /etc/chrony.conf

chrony InstallationInstall the Chrony service: # yum install -y chrony

Activate the Chrony service at boot: # systemctl enable chronyd

Start the Chrony service: # systemctl start chronyd

To quickly synchronize a server: # ntpdate pool.ntp.org

Page 69: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

69

Agenda – CPU and Memory Management

Page 70: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

CGroupsUsing PROCESSOR_GROUP_NAME to bind a database instance to CPUs or NUMA nodes on Linux (Doc ID 1585184.1)

Page 71: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Another look at top

z – color mode / no color mode Shift M - list processes by Memory Usage Shift P – list processes by CPU usage Shift W – to save top preferences to a file - /home/oracle/.toprc Shift H – to display threads for processes

#1 – list the CPU threads c – provides a full command line syntax d – change refresh rate from 3 seconds (default) to another value * Change the value to like 1000 and manually refresh by hitting the return key

k – to kill a process ID

!71

# free total used free shared buffers cachedMem: 3922696 3574024 348672 0 56460 2067188-/+ buffers/cache: 1450376 2472320Swap: 4063224 8236 405498

Page 72: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Our Favorite Performance Monitoring Tools

top - Displays real-time view of a running system$ top –u oracle$ top -u oracle -n 2 -d 3

tcpdump – Network Packet AnalyzerDump traffic on a network# tcpdump –i eth0# tcpdump –i eth0 -n target_host

netstat – Monitor incoming and outgoing network and packet statistics.

# netstat –a |more# netstat -nlpt : Get process name/pid and user id# netstat -rn: Display kernel routing information# netstat -i : Print network interfaces# netstat -atnp | grep ESTA : Print active connections

iotop –Simple top like I/O monitor for I/O & Processes# iotop –u oracle

nmon$ nmon -ft -s 30 -c 120 : Leverage nmon Analyzer

free - Display amount of free and used memory in the system$ free –m or $ free -g : Memory free in MB or GB

iostat - Report CPU and I/O statistics # iostat –d: displays only disks I/O statistics of all partitions # iostat –c: displays only CPU statistics# iostat –t 2 5: iostat ‘X’ seconds and (‘N’number of times) with timestamp

vmstat: - Report virtual memory statistics#vmstat –t 2 5 :vmstat ‘X’ seconds and (‘N’number of times) with timestamp#vmstat –s: displays event counters and memory statistics

sar - System Activity Reporter# sar -u 2 10 : Report CPU utilization for each 2 seconds x 10

lsof: Display the list of all opened files lsof -i TCP:22

Others: dtrace, strace, perf, collectl, wireshark, tethereal

72

Page 73: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Top CPU Consumers[oracle@rac01 ~]$ ps auxww --sort=lstart | sort -r -k3,4 | head USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND oracle 1718 6.0 2.0 1542388 82132 ? Ss 20:08 0:42 ora_lmd0_VPROD1 oracle 1728 5.0 1.9 1528292 76292 ? Ss 20:08 0:36 ora_lck1_VPROD1 oracle 6323 3.8 0.1 1093736 5376 ? Ss 18:13 4:49 mdb_vktm_-MGMTDB oracle 17073 3.6 0.1 1437804 5724 ? Ss 17:42 5:42 asm_vktm_+ASM1 oracle 1694 3.2 0.5 1526500 20224 ? Ss 20:08 0:22 ora_vktm_VPROD1 oracle 2296 29.6 12.9 1613132 508324 ? Rs 20:09 3:11 oracleVPROD1

(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 5469 27.8 4.3 1351840 170916 ? Sl 20:19 0:04 /u01/app/12.1.0/grid_1/jdk/

bin/java -server -Xms128M -Xmx384M -Djava.awt.headless=true -Ddisable.checkForUpdate=true -Dstdstream.filesize=100 -Dstdstream.filenumber=10 -DTRACING.ENABLED=false -Doracle.wlm.dbwlmlogger.logging.level=INFO -jar /u01/app/12.1.0/grid_1/oc4j/j2ee/home/oc4j.jar -config /u01/app/12.1.0/grid_1/oc4j/j2ee/home/OC4J_DBWLM_config/server.xml -properties -ports default-web-site:http:8888,rmi:23792 -out /u01/app/12.1.0/grid_1/oc4j/j2ee/home/log/oc4j.out -err /u01/app/12.1.0/grid_1/oc4j/j2ee/home/log/oc4j.err

root 17315 2.7 1.2 815024 47168 ? Ssl 17:42 4:21 /u01/app/12.1.0/grid_1/bin/crsd.bin reboot

oracle 1720 2.5 2.8 1542244 110240 ? Ss 20:08 0:18 ora_lms0_VPROD1

73

Page 74: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Top Memory Consumer[oracle@rac01 ~]$ ps aux --sort -rss | head USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND oracle 2296 29.3 13.7 1642416 539020 ? Rs 20:09 3:18 oracleVPROD1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) oracle 1700 0.0 9.9 1526500 389840 ? Ss 20:08 0:00 ora_mman_VPROD1 root 21244 0.6 7.6 1455980 299148 ? Sl 17:31 1:07 /u01/app/12.1.0/grid_1/jdk/jre/bin/java -Xms128m -Xmx512m -

classpath /u01/app/12.1.0/grid_1/tfa/rac01/tfa_home/jlib/RATFA.jar:/u01/app/12.1.0/grid_1/tfa/rac01/tfa_home/jlib/je-5.0.84.jar:/u01/app/12.1.0/grid_1/tfa/rac01/tfa_home/jlib/ojdbc6.jar:/u01/app/12.1.0/grid_1/tfa/rac01/tfa_home/jlib/commons-io-2.2.jar oracle.rat.tfa.TFAMain /u01/app/12.1.0/grid_1/tfa/rac01/tfa_home

oracle 5610 20.5 5.2 1610004 207260 ? Rs 20:20 0:05 ora_m000_VPROD1 oracle 16191 1.8 4.9 725260 193612 ? SLsl 17:41 2:53 /u01/app/12.1.0/grid_1/bin/ocssd.bin oracle 6329 0.0 4.7 1093736 185216 ? Ss 18:13 0:00 mdb_mman_-MGMTDB root 16359 1.4 4.7 755128 184604 ? S<Lsl 17:41 2:22 /u01/app/12.1.0/grid_1/bin/ologgerd -M -d /u01/app/12.1.0/

grid_1/crf/db/rac01 oracle 12017 0.8 4.6 1197448 180476 pts/1 Sl+ 19:16 0:32 /u01/app/oracle/product/12.1.0/dbhome_2/jdk/jre/bin/java -

Doracle.installer.not_bootstrap=true -DCV_HOME=/u01/app/oracle/product/12.1.0/dbhome_2 -DORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_2 -Dsun.java2d.font.DisableAlgorithmicStyles=true -DSET_LAF= -Dice.pilots.html4.ignoreNonGenericFonts=true -mx128m -XX:MaxPermSize=128M -classpath /u01/app/oracle/product/12.1.0/dbhome_2/assistants/dbua/jlib/dbma.jar:/u01/app/oracle/product/12.1.0/dbhome_2/jlib/ewt3.jar:/u01/app/oracle/product/12.1.0/dbhome_2/jlib/ewtcompat-3_3_15.jar:/u01/app/oracle/product/12.1.0/dbhome_2/jlib/swingall-1_1_1.jar:/u01/app/oracle/product/12.1.0/dbhome_2/jlib/share.jar:/u01/app/oracle/product/12.1.0/dbhome_2/jlib/orai18n.jar:/u01/app/oracle/product/12.1.0/dbhome_2/assistants/jlib/assistantsCommon.jar:/u01/app/oracle/product/12.1.0/dbhome_2/assistants/jlib/rconfig.jar:/u01/app/oracle/product/12.1.0/dbhome_2/assistants/netca/jlib/netca.jar:/u01/app/oracle/product/12.1.0/dbhome_2/jlib/help4.jar:/u01/app/oracle/product/12.1.0/dbhome_2/oui/jlib/jewt4.jar:/u01/app/oracle/product/12.1.0/dbhome_2/jlib/oracle_ice.jar:/u01/app/oracle/product/12.1.0/dbh

74

Page 75: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

75

AGENDALINUX TUNING

>SUMMARY

oratop - Utility for Near Real-time Monitoring of Databases, RAC and Single Instance (Doc ID 1500864.1)

ORAchk - Health Checks for the Oracle Stack (Doc ID 1268927.2)

Page 76: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Centralized System Logging

Page 77: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Syslog for centralized system logging# yum -y install rsyslog

Uncomment the following to enable the syslog server to listen on the tcp and udp port.# vi /etc/rsyslog.conf

# Provides UDP syslog reception $ModLoad imudp $UDPServerRun 514   # Provides TCP syslog reception $ModLoad imtcp $InputTCPServerRun 514

Restart the syslog service # systemctl restart rsyslog.service

Centralized Monitoring of Alerts # tail -f /var/log/messages

Client Enablement

Modify /etc/rsyslog.conf file Under the #### RULES #### section, add the following line to enable all syslog events to be sent our new syslog server:

*.* @syslog.viscosityna.com

Restart the syslog service # systemctl restart rsyslog.service

Add firewall rule to open the TCP & UDP 514: #firewall-cmd --permanent --zone=public --add-port=514/tcp #firewall-cmd --permanent --zone=public --add-port=514/udp #firewall-cmd --reload  

Page 78: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Firewall Management

Page 79: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Firewall ManagementOpen Port 1599 $ sudo firewall-cmd --zone=public —add-port=1599/tcp --permanent

success

Open Port 22 $ sudo firewall-cmd --zone=public --add-port=22/tcp --permanent success

Reload $ sudo firewall-cmd --reload success

List Ports $ sudo firewall-cmd --zone=public --list-ports 1433/tcp 22/tcp

Remove Port 22 $ firewall-cmd --remove-port=22/tcp success $ firewall-cmd --runtime-to-permanent success $ sudo firewall-cmd --reload Success

Start/Stop/Restart $ systemctl stop firewalld $ systemctl start firewalld $ systemctl restart firewalld

Page 80: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

80

AGENDALINUX TUNING

>KERNEL

Page 81: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

81

OEL Validated Kernel Parameters - /etc/sysctl.confIncluding comments

# For 11g, recommended value for ip_local_port_range is 9000 65500 net.ipv4.ip_local_port_range = 9000 65500 # For 10g, uncomment 'net.ipv4.ip_local_port_range 1024 65000' # net.ipv4.ip_local_port_range:1024 65000 # Added min_free_kbytes 50MB to avoid OOM killer on EL4/EL5 vm.min_free_kbytes = 51200 # For 11g, recommended value for net.core.rmem_max is 4194304 net.core.rmem_max = 4194304 # For 10g, uncomment 'net.core.rmem_max 2097152’

# For 11g, recommended value for wmem_max is 1048576 net.core.wmem_max = 1048576 # For 10g, uncomment 'net.core.wmem_max 262144'# net.core.wmem_max:262144

# Controls the maximum number of shared memory segments, in pages kernel.shmall = 1073741824 # For 11g, recommended value for file-max is 6815744 fs.file-max = 6815744 # For 10g, uncomment 'fs.file-max 327679'# fs.file-max:327679 kernel.msgmni = 2878 kernel.sem = 250 32000 100 142 kernel.shmmni = 4096 net.core.rmem_default = 262144 # net.core.rmem_max=2097152 net.core.wmem_default = 262144 fs.aio-max-nr = 3145728

Dynamically Load Kernel Parameters # sysctl –p

List Kernel Parameters# sysctl -a

Tip #1:Cheat from Oracle’s

validated installations

Tip #2: Starting from Oracle Linux 6:

Page 82: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

82

OEL Validated Kernel Parameters - /etc/sysctl.confIncluding comments

# oracle-rdbms-server-12cR1-preinstall setting for net.ipv4.ip_local_port_range is 9000 65500 net.ipv4.ip_local_port_range = 9000 65500

# Recommended value for kernel.panic_on_oops kernel.panic_on_oops = 1 # Value of 1 will reboot; value of 0 will try to continue the operation …… # Controls the maximum number of shared memory segments, in pages kernel.shmall = 4294967296

# oracle-rdbms-server-12cR1-preinstall setting for fs.file-max is 6815744 fs.file-max = 6815744

# oracle-rdbms-server-12cR1-preinstall setting for kernel.sem is '250 32000 100 128' kernel.sem = 250 32000 100 128

# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmmni is 4096 kernel.shmmni = 4096

# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmall is 1073741824 on x86_64

# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmmax is 4398046511104 on x86_64 kernel.shmmax = 4398046511104

# oracle-rdbms-server-12cR1-preinstall setting for net.core.rmem_default is 262144 net.core.rmem_default = 262144

# oracle-rdbms-server-12cR1-preinstall setting for net.core.rmem_max is 4194304 net.core.rmem_max = 4194304

# oracle-rdbms-server-12cR1-preinstall setting for net.core.wmem_default is 262144 net.core.wmem_default = 262144

Page 83: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Kernel Parameter that affect Oracle Database Performance - Memory

shmmaxRHEL 7.1 and above, SHMMAX default value is set to18446744073692774399 bytes (18PB)

maximum size in bytes of a single shared memory segmentGood Starting Place ➔ ½ of Physical RAM 128GB of Memory: 128/2 * 1024*1024*1024 = 68719476736

shmall

RHEL 7.1 and above, SHMALL default value is 18446744073692774399pages, the same value set to SHMMAX.

Maximum total amount of shared memory pages; # getconf PAGE_SIZE4096Example: Physical RAM 128GB of Memory:128 * 1024*1024*1024 / 4096 =33554432kernel.shmall = 4294967296

shmmni (Default in RHEL 7 = 4096)

Maximum number of semaphore sets for the entire system ➔ Oracle Recommended Value: 4096 kernel.shmmni = 4096

sem - Semaphores for synchronization of information between processes

Comprised of 4 parameterskernel.sem = 250 32000 100 128

vm.swappiness 100 to force aggressive swapping; recommended value = 1 to 20 in RHEL 7 83

Page 84: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Kernel Parameter that affect Oracle Database Performance – Network

net.core.rmem_default Default OS receive buffer sizenet.core.rmem_default = 262144

net.core.rmem_maxSet Max Receive buffers to 4M

Max OS receive buffer sizenet.core.rmem_max = 4194304

net.core.wmem_default Default OS send buffer sizenet.core.wmem_default = 262144

net.core.wmem_maxSet Max Send buffers to 1M

Max OS send buffer sizenet.core.wmem_max = 1048576

net.ipv4.ip_local_port_range net.ipv4.ip_local_port_range = 9000 65500

84

Page 85: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

‹#›‹#› Copyright © 2011, Oracle and/or its affiliates. All rights reserved.

Top 5 Linux Commands for Oracle DBAs

Arsenal for troubleshooting

Page 86: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

#1: Find Tips That Will Save You TimeRemoving files older than 14 Days find . -type f -mtime +14 -exec rm -f {} \;

Finding the top 5 largest files find . -ls | sort -nrk 7 | head -5 • n = numeric sort • r = reverse • K = key #7 (column #7)

Find files larger than 100MB find . -size +100000k

Delete audit files that’s older than 30 days

find $DIRECTORY -name "*.aud" -mtime +30 -exec rm {} \;

Delete files in /tmp that’s older than 30 days

find /tmp -group dba -type f -mtime +5 -exec rm -f {} \; find /tmp/dba -group dba -type f -mtime +5 -exec rm -f {} \;

Delete filenames with .trc extension more than 5 days old.

find $TRACE_DIR -name '*.trc' -type f -mtime +5 -exec rm {} \;

Page 87: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

#2: Commands to Locate Large Files

Display top 5 largest files in a current directory

ls -alS | head -5

Largest space-consuming directories (Does not include sub-directories)

du -Sm . | sort -nr | head -5

report the sum of space consumed by a directory and its subdirectories

du . | sort -nr | head -5

export DB_SIZE=$(find . -newer $BACKUP_MARKER_FILE -name '*.DB' |xargs du -sk |awk '{SUM += $1} END {print SUM/1024}') export LOG_SIZE=$(find . -newer $BACKUP_MARKER_FILE -name '*.A' |xargs du -sk |awk '{SUM += $1} END {print SUM/1024}') echo "DB Backup Size is: $DB_SIZE" echo ”Log Backup Size is: $LOG_SIZE

http://dbaexpert.com/rman2disk/

List files in a directory greater than 300M ls -l | awk '{if ($5 >314572800) print $0}' |sort +4

Page 88: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

#3: tar Powerful One-Liners to remember

Tar and un-tar on the same machine

Make a clone of ASM Oracle Home to DB Oracle Home

cd /u01/app/oracle/product/11.1.0/asm tar cvf - * | ( cd /u01/app/oracle/product/11.1.0/db; tar xvfp - )

Tar and un-tar to a remote server

Push the ASM Home Directory from Server#1 to the DB Home on Server #2

tar cvf - DIR_NAME |ssh REMOTE_HOST “cd DIR_NAME; tar xvf – “

Create compressed tarfile tar –cvzf orahome.tar /u01/app/oracle/product/11.2/db Or for non GNU tar: tar -cvf - /u01/app/oracle/product/11.2/db | gzip>orahome.tar.gz

Page 89: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

#4: scp One-Liners to remember

scp Copy files across servers

scp pull of the dgmenu directory scp -rp oracle@rac5501:/home/oracle/work/dgmenu . -r recursive -p preserver file and dir permission

@target host

. To my current directory

scp push the dgmenu directory scp -rp dgmenu oracle@rac5502:/home/oracle/work

Push the dgmenu directory to the target host:directory

Page 90: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

#5: Rotate Logs with Linux logrotateOther use cases: 1. Apache httpd.log, access_log, error_log • JVM logs, etc.

#!/bin/ksh /usr/sbin/logrotate -f -s /apps/general/config/listener_HOSTNAME.status /apps/general/config/listener_HOSTNAME.conf

This logrotate config file looks like this: LISTENER_HOSTNAME.conf { weekly copytruncate rotate 4 compress mail [email protected] }

Page 91: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

"91

AGENDAORACLE HOME CLONING* +ASM* ACFS* Discuss AFD versus ASMLIB

Page 92: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

ASM ACFS Menu

echo "# ------------------------------------------------------------------------- #”echo "# ASM ACFS Management SubMenu #”echo "# Primary Host: $PRIMARY_SERVER Standby Host: $STANDBY_SERVER ”echo "# ------------------------------------------------------------------------- #”echo "# 10. Create Volume #”echo "# 11. Volume Information #”echo "# ------------------------------------------------------------------------- ”echo "# 20. Find Device Names Associated With ASM Volumes #”echo "# 21. mkfs file system for $ASM_DEFAULT_VOL ”echo "# ------------------------------------------------------------------------- #”echo "# 30. Mount ACFS File System: $ASM_MOUNT_POINT ”echo "# 40. Un-Mount ACFS File System: $ASM_MOUNT_POINT ”echo "# ------------------------------------------------------------------------- #”echo "# 50. Add To ACFS Registry #”echo "# 51. Remove From ACFS Registry #”echo "# ------------------------------------------------------------------------- #”echo "# 100. Load ACFS (non-RAC) as Part of System Reboot .. Easy as 1-2-3 #”echo "# x. Exit #”echo "# ------------------------------------------------------------------------- #"=

Coming Soon• ASM Filter Driver (AFD SubMenu)

Page 93: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Before we beginLet’s look at how we provision non-RAC

Name Main Content

00_clone_gi.ksh ./clone.pl ORACLE_HOME=${GRID_HOME} ORACLE_HOME_NAME=${GRID_HOME_NAME} ORACLE_BASE=${ORACLE_BASE}

01_asmca.ksh ${GRID_HOME}/bin/asmca -silent -configureASM -sysAsmPassword oracle123 -asmsnmpPassword oracle123 \ -diskstring \'ORCL:*\' \ -diskGroupName DATA \ -disk \'ORCL:DATA01\',\'ORCL:DATA02\', \'ORCL:DATA03\',\'ORCL:DATA04\' \ -au_size 4 \ -compatible.asm 12.1.0.2 \ -compatible.rdbms 12.1.0.2 \ -compatible.advm 12.1.0.2 \ -redundancy EXTERNAL \ -diskGroupName FRA \ -disk \'ORCL:FRA01\',\'ORCL:FRA02\' \ -au_size 4 \ -compatible.asm 12.1.0.2 \ -compatible.rdbms 12.1.0.2 \ -compatible.advm 12.1.0.2 \ -redundancy EXTERNAL ;

Page 94: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!94

Extensions for asmcmd Create Disk Group with XML File Manipulation

# asmcmd mkdg dg_external.xml  

# cat dg_external.xml

<dg name="dg_external" redundancy="external">

<dsk string="ORCL:DATA1" />

<dsk string="ORCL:DATA2" />

<dsk string="ORCL:DATA3" />

<a name="compatible.asm" value="11.2"/>

<a name="compatible.rdbms" value="11.2"/>

<a name="compatible.advm" value="11.2"/>

</dg>

Page 95: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!95

ACFS-ADVM Build - ASMCMD

$ asmcmd ASMCMD [+] > volcreate -G DATA -s 5g ohdg1 ASMCMD [+] > volinfo -a Diskgroup Name: DATA Volume Name: OHDG1 Volume Device: /dev/asm/ohdg1-296 State: ENABLED Size (MB): 5120 Resize Unit (MB): 256 Redundancy: UNPROT Stripe Columns: 4 Stripe Width (K): 128 Usage: Mountpath:

Page 96: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!96

ACFS-ADVM Build - ASMCMD

$ ls -l /dev/asm/* brwxrwx--- 1 root oinstall 252, 151553 Jun 30 12:40 /dev/asm/ohdg1-296

# mkfs.acfs /dev/asm/ohdg1-296 mkfs.acfs /dev/asm/ohdg1-296 mkfs.acfs: version = 11.2.0.0.2.0 mkfs.acfs: on-disk version = 38.0 mkfs.acfs: volume = /dev/asm/ohdg1-296 mkfs.acfs: volume size = 5368709120 mkfs.acfs: Format complete.

# mkdir /u01/app/grid/product/11.2.0/db1 # mount /dev/asm/ohdg1-296 /u01/app/grid/product/11.2.0/db1

Page 97: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!97

ACFS-ADVM Build - ASMCMD ACFS resize - Walk-thru

$ /acfsutil size +200G -d /dev/asm/ohdg1-296 /u01/app/grid/product/11.2.0/db1

acfsutil size: new file system size: 322122547200 (307200MB)

Page 98: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!98

ACFS-ADVM Build - ASMCMD ACFS Snapshots - Walk-thru

$ acfsutil snap create oh_db_snap \ /u01/app/grid/product/11.2.0/db1

acfsutil snap create: Snapshot operation is complete.

$ ls –l /u01/app/grid/product/11.2.0/db1 /.ACFS/snaps]# drwxrwxr-x 69 oracle oinstall 8192 Jan 5 00:23 oh_db_snap

Page 99: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!99

ASM How-Toshttp://www.dbaexpert.com/blog/category/asm/

1. ACFS command-line tools available in Oracle Database 11g Release 2 2. Configure ACFS for auto-startup for non-RAC database servers 3. Volume Management with asmcmd 4. Rename Disk Group 5. Ways to mount and dismount disk groups in Oracle Database 11g Release 2 6. New ways to create disk groups in Oracle Database 11g Release 2 ASMCA Command-

line Interface 7. Maintaining ASM Volumes and Cluster File Systems in Oracle Database 11g Release 2 8. Creating ASM Volumes and Cluster File Systems with Enterprise Manager in 11g Release

2 9. Creating ASM Snapshots with Enterprise Manager in 11g Release 2

Page 100: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�100

Prepare Grid and Oracle HomeUnlock the Grid Home

# cd $GRID_HOME/crs/install

# perl rootcrs.pl –unlock –crshome $GRID_HOME

Create TAR ball of GI Home•Exclude directories, logfiles, text files# export GRID_HOME=/u01/app/grid/12.1.0

# cd ${GRID_HOME}# tar cpfX - ${EXCLUDE_LIST} * > ${NFS_DIR}/Grid.tar

${GRID_HOME}/host_name${GRID_HOME}/rdbms/audit/*${GRID_HOME}/log/host_name${GRID_HOME}/gpnp/host_name${GRID_HOME}/log/diag/asmcmd/*${GRID_HOME}/log/diag/tnslsnr/*${GRID_HOME}/ccr/hosts/*${GRID_HOME}/cdata/*${GRID_HOME}/crs/install/*.txt${GRID_HOME}/evm/log/*${GRID_HOME}/install/*.log${GRID_HOME}/network/admin/*.bak.*${GRID_HOME}/network/admin/*.ora${GRID_HOME}/ohasd/init/*${GRID_HOME}/root.sh${GRID_HOME}/*ouibak**.ouibak*.log

Page 101: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Execute root.sh on each node

* All the Magic happens here

Configure Cluster Stack

* Spend all the time here

performing automation

Execute root.sh on each node

Clone Grid Home on each node

Prepare Source Environment

(Exclude Misc Dirs and Logs)

�101

Clone Grid Home Topology

Un-TAR Grid TARUn-TAR Grid TAR

Page 102: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�102

Clone Database Home Topology Create Golden Image Database

Un-TAR DB TAR

Execute root.sh on each node

* All the Magic happens here

Configure Cluster Stack

* Spend all the time here

performing automation

Execute root.sh on each node

Clone Grid Home on each node

Prepare Source Environment

(Exclude Misc Dirs and Logs)

Un-TAR Grid TARUn-TAR Grid TARClone DB Home

on each node

Execute root.sh on each node

Create RAC DB from Golden

Image

Page 103: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�103

Clone Grid Home on Each Node

cd ${GI_HOME}/clone/bin

perl ${GI_HOME}/clone/bin/clone.pl -silent \ORACLE_HOME=${GI_HOME} \ ORACLE_HOME_NAME=OraGridHome1 \ORACLE_BASE=$ORACLE_BASE \-O'"CLUSTER_NODES={rac1,rac2,rac3}"' \-O'"LOCAL_NODE=$(hostname -s)"' \CRS=TRUE INVENTORY_LOCATION=${INVENTORY_LOCATION}

Page 104: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�104

config.sh in GUI mode

Page 105: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�105

config.sh in silent mode

export DIR=$(pwd)FN=`echo $0 | sed s/\.*[/]//`

${GRID_HOME}/crs/config/config.sh -silent -responseFile \${DIR}/${CLUSTER_NAME}.rsp \-ignorePrereq -ignoreSysPrereqs

Page 106: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�106

Clone DB Home on Each Node

JAVA_HOME=${ORACLE_DB_HOME}/jdk/bin/javaPATH=$PATH:${JAVA_HOME}

cd ${ORACLE_DB_HOME}/clone/binperl ${ORACLE_DB_HOME}/clone/bin/clone.pl -silent \ORACLE_HOME=${ORACLE_DB_HOME} ORACLE_HOME_NAME=OraDBHome1 \ORACLE_BASE=$ORACLE_BASE \-O'"CLUSTER_NODES={rac1,rac2,rac3}"' \-O'"LOCAL_NODE=$(hostname -s)"' CRS=TRUE \INVENTORY_LOCATION=${INVENTORY_LOCATION}

Page 107: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

1. Create Golden Image DB Templateexport BKUP_DIR=/bkups/templatesdbca -silent -createCloneTemplate \-sourceSID RACDB \-templateName db_gold_01 \-sysDBAUserName sys \-sysDBAPassword oracle123 \-maintainFileLocations false \-datafileJarLocation $BKUP_DIR

2. Locate the the tempate xml file in the format of .dbc $ cd $ORACLE_HOME$ find . -name '*.dbc'./assistants/dbca/templates/General_Purpose.dbc./assistants/dbca/templates/Data_Warehouse.dbc./assistants/dbca/templates/db_gold_01.dbc

3. Copy to the target $ORACLE_HOME/assistants/dbca/templates db_gold_01.dbc

-- to /bkups/templates (or NFS)$ ls -l /bkups/templates

Source DBdbca backup

dbca cold backup piece

Copy .dbc file to $ORACLE_HOME on

TargetCopy dbca backup to

target Create symbolic link

to NFS Mount

Create Golden Image Template of Database

Page 108: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�108

Clone Database From Templatedbca -silent \ -createDatabase \ -templateName db_gold_01.dbc \ -gdbName racdb \ -sid racdb \ -SysPassword oracle123 \ -SystemPassword oracle123 \ -emConfiguration NONE \ -redoLogFileSize 500 \ -recoveryAreaDestination FRA \ -storageType ASM \ -asmSysPassword oracle123 \ -diskGroupName DATA \

-listeners LISTENER_RAC \ -characterSet AL32UTF8 \ -nationalCharacterSet AL16UTF16 \ -databaseType MULTIPURPOSE \ -nodelist rac1,rac2,rac3 \ -initparams audit_file_dest=’/oraacfs/trace/racdb/adump' \

-initparams compatible='11.2.0.3' \ -initparams db_create_file_dest='+DATA' \ -initparams db_create_online_log_dest_1='+DATA' \ -initparams db_create_online_log_dest_2='+FRA' \ -initparams diagnostic_dest=’/oraacfs' \ -initparams parallel_max_servers=32 \ -initparams pga_aggregate_target=524288000 \ -initparams processes=400 \ -initparams sga_target=4294967296 \ -initparams db_recovery_file_dest='+FRA' \

-initparams db_recovery_file_dest_size=2097152000

Source DBdbca backup

Target DBrestore/config from

dbca

dbca cold backup piece

dbca cold backup piece +

template .dbc file

Copy .dbc file to $ORACLE_HOME on TargetCopy dbca backup to target

Create symbolic link to NFS Mount

Page 109: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�109

DBCA in 12c with CDB/PDB

cd /u01/app/oracle/product/12.1.0/dbhome_1/bin./dbca -silent \ -createDatabase \ -templateName General_Purpose.dbc \ -gdbName TEST \ -sid TEST \ -SysPassword oracle123 \ -createAsContainerDatabase true \ -numberofPDBs 2 \ -pdbName VNA \ -SystemPassword oracle123 \ -emConfiguration DBEXPRESS \ -redoLogFileSize 100 \ -recoveryAreaDestination FRA \ -storageType ASM \ -asmsnmpPassword oracle123 \ -asmSysPassword oracle123 \ -diskGroupName DATA \

.…

-listeners LISTENER \ -registerWithDirService false \ -characterSet AL32UTF8 \ -nationalCharacterSet AL16UTF16 \ -databaseType MULTIPURPOSE \ -nodelist ol59a,ol59b \ -initparams audit_file_dest='/u01/app/oracle/admin/TEST/adump' \ -initparams compatible='12.1.0.0' \ -initparams db_create_file_dest='+DATA' \ -initparams db_create_online_log_dest_1='+DATA' \ -initparams db_create_online_log_dest_2='+FRA' \ -initparams db_recovery_file_dest='+FRA' \ -initparams pga_aggregate_target=100M \ -initparams diagnostic_dest='/u01/app/oracle' \ -initparams parallel_max_servers=8 \ -initparams processes=400 \ -initparams sga_target=524288000 \ -initparams db_recovery_file_dest_size=4322230272

Page 110: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

�110

Putting it all togetherHow do we do it:

➢Clone GRID Homes on all RAC nodes – Template script and replace Homes and Nodes

➢Setup 2 Configuration files1. Primary config file that has only the relevant information

(Hostname, VIPs, SCAN, Private Subnet, Listener Name, DB Name)

2. Generic config file that applies to every build (OFA related directories, DB Home, Grid Home, Oracle

Base, OraInventory Loc, etc)➢Generate Response File and tag PLACEHOLDERS within the response file

❑ Globally search and replace PLACEHOLDERS

➢Clone DB Homes on all RAC nodes – Template script and replace Homes and Nodes

Page 111: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

111

AGENDALINUX TUNING

>CLEANUP / MAINTENANCE

Page 112: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!112

Find Tips That Will Save You Time

Removing files older than 14 Days find . -type f -mtime +14 -exec rm -f {} \;

Finding the top 5 largest files find . -ls | sort -nrk 7 | head -5

Find files larger than 100MB find . -size +100000k

Delete audit records that’s older than 30 days find $ORACLE_HOME/rdbms/audit -name "*.aud" -mtime +30 -exec rm {} \;

Delete files in /tmp that’s older than 30 days find /tmp -group dba -type f -mtime +5 -exec rm -f {} \; find /tmp/dba -group dba -type f -mtime +5 -exec rm -f {} \;

Delete *.trc files more than 5 days old. find $TRACE_DIR -name '*.trc' -type f -mtime +5 -exec rm {} \;

Page 113: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!113

More Commands to Locate Large Files

Display top 5 largest files in a current directory

ls -alS | head -5

Largest space-consuming directories (Does not include sub-directories)

du -Sm . | sort -nr | head -5

report the sum of space consumed by a directory and its subdirectories

du . | sort -nr | head -5

export DB_SIZE=$(find . -newer $RMAN_BACKUP_MARKER_FILE -name '*.DB' |xargs du -sk |awk '{SUM += $1} END {print SUM/1024}') export ARCH_SIZE=$(find . -newer $RMAN_BACKUP_MARKER_FILE -name '*.A' |xargs du -sk |awk '{SUM += $1} END {print SUM/1024}') echo "DB Backup Size is: $DB_SIZE" echo "Archive Backup Size is: $ARCH_SIZE

List files in a directory greater than 300M ls -l | awk '{if ($5 >314572800) print $0}' |sort +4

Page 114: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!114

tar & scp One-Liners to rememberTar and un-tar on the same machine

Make a clone of ASM Oracle Home to DB Oracle Home

cd /u01/app/oracle/product/12.2.0/asm tar cvf - * | ( cd /u01/app/oracle/product/12.2.0/db; tar xvfp - )

Tar and un-tar to a remote server

Push the ASM Home Directory from Server#1 to the DB Home on Server #2

tar cvf - DIR_NAME |ssh REMOTE_HOST “cd DIR_NAME; tar xvf – “

Create compressed tarfile tar –cvzf orahome.tar /u01/app/oracle/product/12.2/db Or for non GNU tar: tar -cvf - /u01/app/oracle/product/12.2/db | gzip>orahome.tar.gz

scp pull of the dgmenu directory scp -rp oracle@rac5501:/home/oracle/work/dgmenu .

scp push the dgmenu directory scp -rp dgmenu oracle@rac5502:/home/oracle/work

Page 115: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!115

Rotate Listener Logs with Oracle CLI

Rotate Listener Logs in Oracle Database 12c

#!/bin/ksh export LISTENER_NAME=$1

. $HOME/.profile.CRON export DATETIME=$(date +%y%m%d-%H%M)

cd $ORACLE_BASE/diag/tnslsnr/`hostname`/${LISTENER_NAME}/trace

lsnrctl << EOF set current_listener ${LISTENER_NAME} set log_status off mv ${LISTENER_NAME}.log ${LISTENER_NAME}.${DATETIME}.log set log_status on EOF

Page 116: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

!116

Rotate Listener Logs with Linux logrotate

Other use cases: 1. Apache httpd.log, access_log, error_log • JVM logs, etc.

#!/bin/ksh /usr/sbin/logrotate -f -s /apps/oracle/general/config/listener_HOSTNAME.status /apps/oracle/general/config/listener_HOSTNAME.conf

This logrotate config file looks like this: LISTENER_HOSTNAME.conf { weekly copytruncate rotate 4 compress mail [email protected] }

Page 117: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

LogrotateAutomate Rotating Any Kind of Log Files

 > cat logrotate.ksh#!/bin/ksh. $HOME/.ORACLE_BASE. $SH/functions.ksh

export ORACLE_SID=$DEFAULT_DBexport PATH=/usr/local/bin:$PATHexport ORAENV_ASK=NO. oraenv

# ----------------------# Ksh version issue, so enter it again here...#-----------------------------------------------SCRIPTNM=$(basename $0 |awk -F"." {'print $1'})CONFIG_FILE=$SH/${SCRIPTNM}.confCONTROL_FILE=$SH/${SCRIPTNM}.ctlFN=`echo $0 | sed s/\.*[/]//`

function rotate {export LOGFILE=$1export CONFIG_FILE=$2

# --# -- 1.  LOGFILE is the full path of the logfile that you want this script to manage# -- 2.  CONFIG_FILE is the filename only; can be anything but should be the same name as the actual logfile# --## -- Notes for logrotate# size option: logrotate runs only if the filesize is equal to (or greater than) this size.# dateext option:  Rotate the old log file with date in the log filename#  export PATH=$PATH:/usr/sbinexport CONF_DIR=$SH/logrotate[ ! -d "$CONF_DIR" ] && ( echo $CONF_DIR does not exist .. issuing mkdir; mkdir -p $CONF_DIR )

export CONF=$CONF_DIR/$CONFIG_FILE

cat <<!! >$CONF$LOGFILE {rotate 4dateextcopytruncatecompresssize 100M}!!

echo Executing:  logrotate -s $CONF_DIR/log_rotate_status.$CONFIG_FILE -f $CONFlogrotate -s $CONF_DIR/log_rotate_status.$CONFIG_FILE -f $CONF}

cat $CONTROL_FILE |egrep -v "^$|\^#" |while read L Cdorotate $L $Cdone

 > cat logrotate.ctl/u01/app/oracle/diag/rdbms/phhoem12c/PHHOEM12C/trace/alert_PHHOEM12C.log alert_PHHOEM12C.conf/u01/app/oracle/diag/asm/+asm/+ASM/trace/alert_+ASM.log alert_+ASM.conf/u01/app/oracle/diag/tnslsnr/vmls1oraoem1sb/listener/trace/listener.log listener.conf

Page 118: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

RSYNC

Page 119: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

www.viscosityna.com

Poor Man’s EBS DR

RSYNCrsync -avz -e ssh --stats --progress /appsvr/CM applmgr@dr_app_server:/apps702 > $LOGFILE 2>&1

function rsync_appstmp { APPLCSF=/apps/tmp/PROD/APPLCSF rsync -avz -e ssh --del --stats --progress ${APPLCSF}/log applmgr@dr_app_server:/apps702 > $LOGFILE 2>&1 rsync -avz -e ssh --del --stats --progress ${APPLCSF}/out applmgr@dr_app_server:/apps702 > $LOGFILE 2>&1 }

Data Guard (Switchover)(P) ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;

(S)ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN; (S) ALTER DATABASE OPEN;

(P)ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

119

Page 120: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

Rapid Linux Provisioning[oracle@rac01 linux]$ ./linux # ------------------------------------------------------------------------- # # Linux Menu System - rac01 # ------------------------------------------------------------------------- # # 10. Mount the ISO image as a loop device # # ------------------------------------------------------------------------- # # 20. Setup YUM Repository - With Oracle's Public Yum Server # # 21. Install RPM - Oracle-Validated (OL 5) # # 22. Install oracle-rdbms-server-11gR2-preinstall (OL 6) # # 23. Install oracle-rdbms-server-12cR1-preinstall (OL 6) # # 24. Setup Local YUM Repository # # ------------------------------------------------------------------------- # # 30. Setup Jumbo Frames on the server # # ------------------------------------------------------------------------- # # 40. Change the I/O Scheduler # # ------------------------------------------------------------------------- # # 50. Setup NTP # # ------------------------------------------------------------------------- # # 60. Setup Centralized System Logging # # ------------------------------------------------------------------------- # # 80. Setup user equivalence for oracle and root # # 81. Setup OS Watcher BB Auto-startup # # ------------------------------------------------------------------------- # # 90. Setup dnsmasq - DNS Server for Small Networks # # ------------------------------------------------------------------------- # # 100. Setup HugePages # # ------------------------------------------------------------------------- # # x. Exit # # ------------------------------------------------------------------------- # # Enter Task Number:

120

Page 121: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

NFS

Page 122: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

NFS Mount Options for RAC and Clusterware with NFS on NAS devices (Doc ID 359515.1)

• For RMAN backup sets, image copies, and Data Pump dump files➢ "NOAC" mount option should not be specified➢ RMAN and Data Pump do not check this option and specifying this can adversely affect performance.

❖ How To Optimize NFS Performance With NFS options. (Doc ID 397194.1)

Page 123: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,

NFS for EBS & ZFS on Exadata

NFS Mount Options for Application Tier For NFS V3rw,nointr,bg,hard,timeo=600,wsize=65536,rsize=65536,nfsvers=3,tcpFor NFS V4rw,nointr,bg,hard,timeo=600,wsize=65536,rsize=65536

NFS Mount Options for Database Oracle HomeFor NFS V3rw,intr,bg,hard,timeo=600,wsize=32768,rsize=32768,nfsvers=3,tcpFor NFS V4rw,intr,bg,hard,timeo=600,wsize=32768,rsize=32768

NFS Mount Options for Database FilesFor NFS V3rw,nointr,bg,hard,timeo=600,wsize=32768,rsize=32768,nfsvers=3,tcpFor NFS V4rw,nointr,bg,hard,timeo=600,wsize=32768,rsize=32768

NFS for Exadata with ZFS

Page 124: Squeeze the Last Ounce Of Your Linux Server · 2019-03-22 · • Oracle ACE Director • Founder and CEO of Viscosity • Over 27 years of Oracle Expertise: Mission Critical Databases,