Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large...

48

Transcript of Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large...

Page 1: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets
Page 2: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Effective Oracle Home Management

with the New Release Model

Ludovico Caldara

Computing Engineer

IT Department, CERN

[email protected]

@ludodba

9/4/2018 Effective Oracle Home Management 2

Flora Barriele

Database Engineer

DSI, Etat de Vaud

[email protected]

@floo_bar

Page 3: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

About Ludovico Caldara■ 18+ Years DBA (Not Only Oracle)

■ ITOUG co-founder

■ OCP (11g, 12c, MySQL) & OCE

■ Italian living in Switzerland

■ http://www.ludovicocaldara.net

■ @ludodba

■ ludovicocaldara

9/4/2018 3Effective Oracle Home Management

Page 4: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

CERN

• CERN - European Laboratory for Particle Physics

• Founded in 1954 by 12 Countries for fundamental

physics research in the post-war Europe

• Today 22 member states and world-wide collaborations

• About ~1100 MCHF yearly budget

• 2’300 CERN personnel

• 10’000 users from 110 countries

49/4/2018 Effective Oracle Home Management

Page 5: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Fundamental Research

• What is 95% of the Universe made of?

• Why do particles have mass?

• Why is there no antimatter

left in the Universe?

• What was the Universe like,

just after the "Big Bang"?

59/4/2018 Effective Oracle Home Management

Page 6: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Effective Oracle Home Management 6

The Large Hadron Collider (LHC)

Largest machine in the world27km, 6000+ superconducting magnets

Emptiest place in the solar system

High vacuum inside the magnets

Hottest spot in the galaxy

During Lead ion collisions create temperatures 100 000x hotter than the heart of the sun

Fastest racetrack on Earth

Protons circulate 11245 times/s (99.9999991% the speed of light)

Page 7: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

“Patch soon, patch often” vs reality

9/4/2018 Effective Oracle Home Management 7

Page 8: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Frequent patching?

• Patching is time consuming

• It is complex

• It introduces some risks

• It is not always really necessary

• It leads to human errors

9/4/2018 Effective Oracle Home Management 8

Page 9: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

How many bugs could you encounter?$ opatch lspatches

27923320;Database PSU 12.1.0.2.180717, Oracle JavaVM Component (JUL2018)

22243983;

27762253;OCW PATCH SET UPDATE 12.1.0.2.180717 (27762253)

27547374;Database Bundle Patch : 12.1.0.2.180717 (27547374)

OPatch succeeded.

$ cd $ORACLE_HOME/inventory

$ grep -r "bug description" * | wc -l

2132

$ grep -r "bug description" * | grep -i "wrong result" | wc -l

66

9/4/2018 Effective Oracle Home Management 9

Page 10: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Quick overview of the

New Release Model

9/4/2018 Effective Oracle Home Management 10

Page 11: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

What does it change?Jan 18 Apr Jul Oct Jan 19 Apr Jul Oct

RU 18.1.0 18.2.0 18.3.0 18.4.0 18.5.0 18.6.0 18.7.0 18.8.0

RUR1 18.2.1 18.3.1 18.4.1 18.5.1 18.6.1 18.7.1

RUR2 18.2.2 18.3.2 18.4.2 18.5.2 18.6.2

RU 19.1.0 19.2.0 19.3.0 19.4.0

RUR1 19.2.1 19.3.1

RUR2 19.2.2

9/4/2018 Effective Oracle Home Management 11

2

Page 12: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

What does it change?

9/4/2018 Effective Oracle Home Management 12

Short

Development

cycle

Frequent

Upgrades

And Updates

Page 13: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Which patches should I apply?

9/4/2018 Effective Oracle Home Management 13

Page 14: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Brave vs Fearful

12.1 >= 12.2

Effective Oracle Home Management 149/4/2018

How

do I

feel?

PSUBundle

Patch

BraveFearful How

do I

feel?

Release

Update

Revision

Release

Update

BraveFearful

Page 15: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Brave vs Fearful

12.1 >= 12.2

Effective Oracle Home Management 159/4/2018

How

do I

feel?

PSUBundle

Patch

BraveFearful How

do I

feel?

Release

Update

Revision

Release

Update

BraveFearful

Ludovico(*) Ludovico(*)

(*) yes, it’s Comic Sans

https://mikedietrichde.com/2017/10/24/differences-psu-bp-ru-rur/

Page 16: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Common patching patterns

9/4/2018 Effective Oracle Home Management 16

Page 17: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Common worst practices in maintaining homes

• Installing software by hand

• Different patch levels for Oracle Homes with the same path

• Not tracking the installed patches

• Oracle Home paths hard-coded in the operational scripts

• Not minding about naming conventions

9/4/2018 Effective Oracle Home Management 17

Page 18: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Worst approach (big bang)

1. Stop everything

2. In-place binaries patching

3. Database patching, all at once

4. Start everything

Effective Oracle Home Management 189/4/2018

UPUPUPUP

DOWNDOWNDOWNDOWN

UPUPUPUP

UP DOWN UP

STOP ALL

START ALLPATCH BINARIES

PATCH DBs

Page 19: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Worst approach (big bang)

1. Stop everything

2. In-place binaries patching

3. Database patching, all at once

4. Start everything

Effective Oracle Home Management 199/4/2018

UPUPUPUP

DOWNDOWNDOWNDOWN

UPUPUPUP

UP DOWN UP

STOP ALL

START ALLPATCH BINARIES

PATCH DBs

No easy

rollback

Long

downtime

Complex

planning

Page 20: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Different approach (still bad)

1. Install new binaries manually

2. Patch the new binaries

3. Stop, change OH, patch

databases one by one

4. Decommission old binaries

Effective Oracle Home Management 209/4/2018

UP

UP

UP

UP

DOWN

DOWN

DOWN

DOWN

UP

UP

UP

UP

PATCH BINARIES STOP, MOVE, PATCH

ONE BY ONE

Page 21: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Different approach (still bad)

1. Install new binaries manually

2. Patch the new binaries

3. Stop, change OH, patch

databases one by one

4. Decommission old binaries

Effective Oracle Home Management 219/4/2018

UP

UP

UP

UP

DOWN

DOWN

DOWN

DOWN

UP

UP

UP

UP

PATCH BINARIES STOP, MOVE, PATCH

ONE BY ONE

Complex to

do manually

Repetitive task

when many servers

Page 22: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Automate the installation!

• Automated creation

9/4/2018 Effective Oracle Home Management 22

Soft

ware Patch Patch

Patched

Software

• runInstaller -silent

• opatch apply

Page 23: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Image repo

Automate the installation!

• Automated creation • Software cloning

9/4/2018 Effective Oracle Home Management 23

Soft

ware Patch Patch

Patched

Software

• runInstaller -silent

• opatch apply

18.3.1

18.4.0

Server

18.3.1

Page 24: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Image repo

Automate the installation!

• Automated creation • Software cloning

9/4/2018 Effective Oracle Home Management 24

Soft

ware Patch Patch

Patched

Software

• runInstaller -silent

• opatch apply

18.3.1

18.4.0

Server

18.3.1

RUNDECK

ANSIBLE

RHP

OTHER

Page 25: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Less paths

Effective Oracle Home Management 259/4/2018

18.3.0 18.4.0 18.4.0+ one-off X

18.5.0+ one-off X

18.5.0+ one-off X

+ one-off Y

18.3.0 18.4.0 18.4.0+ one-off X

18.5.0+ one-off X

18.5.0+ one-off X

+ one-off Y

18.4.1 18.4.1+ one-off Y

GOOD:

BAD:

Page 26: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Workarounds vs one-offs

• Sometimes through underscore parameters

• Mitigate the number of one-offs

• Less merge requests

• Document it! (why, when, who)

9/4/2018 Effective Oracle Home Management 26

1

2

3

alter system set "_px_groupby_pushdown"=off

comment='Ludo, 03.05.16: W/A for bug 18499088'

scope=both sid='*‘;

Page 27: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Rapid Home provisioning

• It might be the perfect product…

• Requires Lifecycle Management Pack

• The technology stack is complex(Clusterware, ASM, ACFS, NFS, GNS…)

9/4/2018 Effective Oracle Home Management 27

Page 28: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Custom approach

• Simple script

• Golden images

• Solid naming conventions

• I blogged about it!http://www.ludovicocaldara.net/dba/oh-mgmt-[1..7]/

9/4/2018 Effective Oracle Home Management 28

Page 29: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Implementation at Etat de Vaud

9/4/2018 Effective Oracle Home Management 29

Flora Barriele

Page 30: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

About Flora Barriele

■ 8 years in IT, 3 years DBA

■ French living in Switzerland

■ @floo_bar

■ http://floobar0.wordpress.com

co-organizer in Geneva

Page 31: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Naming Conventions

• Central Inventory contains OH name

• OH name matches OH location

• No dots (.) allowed (inventory limitation)

9/4/2018 Effective Oracle Home Management 31

Central Inventory

<HOME NAME=“18_3_0"

LOC="/u01/app/oracle/product/18_3_0"

TYPE="O" IDX="2">

• 1 to 1 mapping: easy to code

• 18c read-only OH uses the name

as subdir in `orabasehome`:

consistent naming!

Page 32: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Golden images

9/4/2018 Effective Oracle Home Management 32

Golden Images Store

18_3_0.zip

18_4_0.zip

18_3_1.zip

SERVER1

18_3_0.zip

18_3_1.zip

SERVER2

18_3_1.zip

SERVER3

18_4_0.zip

Golden Image MetadataName Path

------- -----------------

18_3_0 /store/18_3_0.zip

18_3_1 /store/18_3_1.zip

18_4_0 /store/18_4_0.zip

Page 33: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Image store

Typical workflow

9/4/2018 Effective Oracle Home Management 33

SERVER1

18_3_0

SERVER2…

First Install

Page 34: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Image store

Typical workflow

9/4/2018 Effective Oracle Home Management 34

18_3_0.zip

SERVER1

18_3_0

SERVER2…

$ ohctl -c -n 18_3_0

Page 35: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Image store

Typical workflow

9/4/2018 Effective Oracle Home Management 35

18_3_0.zip

SERVER1

18_3_0

SERVER2…

$ ohctl -i 18_3_018_3_0

Page 36: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Image store

Typical workflow

9/4/2018 Effective Oracle Home Management 36

18_3_0.zip

SERVER1

18_3_0

SERVER2…

$ ohctl -i 18_3_0 -n 18_4_0

18_3_0

18_4_0

Page 37: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Image store

Typical workflow

9/4/2018 Effective Oracle Home Management 37

18_3_0.zip

SERVER1

18_3_0

SERVER2…

Manual patching

18_3_0

18_4_0

Page 38: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Image store

Typical workflow

9/4/2018 Effective Oracle Home Management 38

18_3_0.zip

SERVER1

18_3_0

SERVER2…

$ ohctl -c

18_3_0

18_4_0

18_4_0.zip

Page 39: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Image store

Typical workflow

9/4/2018 Effective Oracle Home Management 39

18_3_0.zip

SERVER1

18_3_0

SERVER2…

$ ohctl -i 18_4_0

18_3_0

18_4_0

18_4_0.zip

18_4_0

Page 40: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

What it actually does

Creation workflow• Copy the Home

• Clean it up

• Create the zip

• Store the zip in the repo

• Store metadata

Installation workflow• Security checks

• Create new path

• Unzip from the store

• Attach home

• Relink (opt. with RAC)

• Run setasmgid

• Other stuff (e.g. TNS)

Effective Oracle Home Management 409/4/2018

Page 41: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Effective Oracle Home Management 419/4/2018

DEMO

Page 42: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Further development at CERN

9/4/2018 Effective Oracle Home Management 42

Ludovico Caldara

Page 43: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Read-only Oracle Home$ roohctl –enable

Enabling Read-Only Oracle home.

Update orabasetab file to enable Read-Only Oracle home.

Orabasetab file has been updated successfully.

Create bootstrap directories for Read-Only Oracle home.

Bootstrap directories have been created successfully.

Bootstrap files have been processed successfully.

Read-Only Oracle home has been enabled successfully.

Check the log file /u01/app/oracle/cfgtoollogs/roohctl/roohctl-

180822AM102911.log.

9/4/2018 Effective Oracle Home Management 43

Page 44: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

AGILE INFRASTRUCTURE

SERVER

Insertion in the Agile Infrastructure

9/4/2018 Effective Oracle Home Management 44

Image Store Scripts

REST client

Oracle Home

Page 45: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Grid Infrastructure Installation

• Puppet + Rundeck for automatic GI install

• To be implemented:

• Patched Grid Infrastructure versions beside the first one

https://www.markusdba.net/?p=294

• Automatic patching with 18c independent local-mode automaton

9/4/2018 Effective Oracle Home Management 45

$ rhpctl move gihome –sourcehome Oracle_home_path -destinationhome Oracle_home_path

Page 46: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Back to the demo…

9/4/2018 Effective Oracle Home Management 46

Flora Barriele

Page 47: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Questions?

9/4/2018 Effective Oracle Home Management 47

Page 48: Effective Oracle Home Management · 2018-11-22 · Effective Oracle Home Management 6 The Large Hadron Collider (LHC) Largest machine in the world 27km, 6000+ superconducting magnets

Thank you!

Ludovico Caldara

Computing Engineer

IT Department, CERN

[email protected]

@ludodba

9/4/2018 Effective Oracle Home Management 48

Flora Barriele

Database Engineer

DSI, Etat de Vaud

[email protected]

@floo_bar