reports auf oltp daten analytics on oltp data€¦ · schema consolidation makes db management...

27
REPORTS AUF OLTP DATEN The Speaker Alain Fuhrer, born in 1986 Bachelor in computer science Working with Oracle databases for about 12 years now Head IT Databases at Swiss Mobiliar Insurance 1

Upload: others

Post on 07-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

ANALYTICS ON OLTP DATAREPORTS AUF OLTP DATEN

The Speaker

Alain Fuhrer, born in 1986

Bachelor in computer science

Working with Oracle databases for about 12 years now

Head IT Databases at Swiss Mobiliar Insurance

1

Page 2: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Agenda

1. Swiss Mobiliar in a nut shell

2. Oracle MT 12.2 – Our Next Level of consolidation

3. Agile@Swiss Mobiliar Insurance – Impact on DB Management

4. Q & A

2

Page 3: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

3

Swiss Mobiliar Insurance in a nut shell

Page 4: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Open Source

Page 5: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Our Oracle Multitenant Footprint

5

Hardware

8 physical database servers

with 16 CPU each

Databases

1350 PDB’s distributed across 130 CDB

Oracle Audit Refreshable PDB

PDB Lockdown Profile Data Guard

Features

Page 6: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Oracle MT 12.2

Our next level of consolidation

6

Page 7: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Step 1 – Schema consolidation with Oracle 10g

7

Application 2

Application 1

Schem

as

Application 3

Application 4

Application 5

Many applications = one database

Savings

More than 200 databases

2 physical servers or 16 cores

License costs 1 Mio $

Page 8: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Schema consolidation makes db management complicated

8

Multitenant is «production ready» with Oracle 12.2

and becomes the future for us.

Problems after schema consolidation Solution with Multitenant 12.2

PDB cloning is now possible also onlineRMAN cloning is not possible

Flashback on database level Flashback now possible on PDB level

AWR on database level AWR now available on PDB level

Backup / Restore on PDB level with RMANBackup / Restore only with datapump

Memory management on PDB levelOnly limited resource manager

But: It’s not as easy as it seems at first glance !

Page 9: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Data Guard configuration in Multitenant Environments

9

Every online PDB clone in a Data Guard environment leads by default to a corrupt standby database

During an online clone Oracle has to manage the REDO stream of the PDB clone as well as the REDO stream to the

standby DB. This does not (yet) work

Oracle can only transfer a PDB to the standby on its own, if the clone was made in read-only mode.

MRP0: Background Media Recovery terminated with error 1274

2018-03-15T10:14:31.364720+01:00

Errors in file /oradata/u00/app/oracle/diag/rdbms/do10mm98_01/do10mm98/trace/do10mm98_pr00_2938.trc:

ORA-01274: cannot add data file that was originally created as

'+DATAFS/DO10MM99_01/4AC25F1C7F721BA3E0534EC10B0A18D3/DATAFILE/system.3065.938686469'

Managed Standby Recovery not using Real Time Apply

Recovery interrupted!

2018-15T10:14:31.531186+01:00

Errors in file /oradata/u00/app/oracle/diag/rdbms/do10mm98_01/do10mm98/trace/do10mm98_m000_8847.trc:

file 1: '+DATAFS/DO10MM98_01/DATAFILE/system.1693.938075093'

Recovery ORA-01110: data stopped due to failure in applying recovery marker (opcode 17.34).

Datafiles are recovered to a consistent state at change 112084723719 but controlfile could be ahead of datafiles.

Page 10: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Different ways lead to the goal

10

There are different ways of dealing with the problem, but all of them have a high level of automation effort

Master Note «Data Guard Impact on Oracle Multitenant Environments (Doc ID 2049127.1)»

1. Making Use of the STANDBYS=NONE Feature with Oracle Multitenant (Document 1916648.1)

2. Reusing the Source Standby Database Files When Plugging a PDB into the Primary Database of a Data Guard

Configuration (Document 2273829.1)

3. Using standby_pdb_source_file_dblink and standby_pdb_source_file_directory to Maintain Standby Databases

when Performing PDB Remote Clones or Plugins (Document 2274735.1)

As automation of processes is a high priority at Mobiliar, we implemented Workaround 3.

Page 11: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

DB-Link von Standby nach Primary für File Copy

11

First of all Interim Patch (21252050) must be installed, which adds a new DB parameter.

standby_pdb_source_file_dblink

Then the following configuration has to be implemented on the primary CDB

When we wanted to test the workaround, we were unfortunately confronted with a new problem.

PRIM_CDB SQL> create database link copy_from_prim connect to system identified by xxx using ’prim_db’;

PRIM_CDB SQL> alter system archive log current;

STBY_CDB SQL> alter system set standby_pdb_source_file_dblink=’copy_from_prim’;

Page 12: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

12

Because a DB link can only be used if the Database

is in OPEN mode, an Active DG license would be

required for this solution!

„The container root (CDB$Root) of the standby database may be opened

read-only without requiring an Oracle Active Data Guard license. An

Oracle Active Data Guard license is only required if any of the pluggable

databases in the standby is opened for read.“

Page 13: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

PDB online clone in a Data Guard Environment – Step 1

13

Container Database

Primary CDB

APP 2 TMP1

CDB1 SQL> create pluggable database tmp1 from app1 standby=none;

CDB1 SQL> alter pluggable database tmp open;

CDB1 SQL> alter pluggable database tmp close;

CDB1 SQL> alter pluggable database tmp open read only;

Container Database (RO)

APP 1 APP 2APP 1

Standby CDB

no file copy

Page 14: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

PDB online clone in a Data Guard Environment – Step 2

14

Container Database

Primary CDB

APP 2 TMP1(RO)

CDB1 SQL> create pluggable database app1_copy from temp1;

CDB1 SQL> alter pluggable database app1_copy open;

Container Database (RO)

APP 1 APP 2APP 1

Standby CDB

APP1_COPY APP1_COPY

DB-LINKREDO

Page 15: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

PDB online clone in a Data Guard Environment – Step 3

15

Container Database

Primary CDB

APP 2 TMP1(RO)

CDB1 SQL> alter pluggable database tmp1 close immediate;

CDB1 SQL> drop pluggable database tmp1 including datafiles;

Container Database (RO)

APP 1 APP 2APP 1

Standby CDB

APP1_COPY APP1_COPY

REDO

Page 16: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Agile@Swiss Mobiliar Insurance

&

Impact on DB Management

16

Page 17: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

“I want that the company is able to

deploy productive services every

day in 2020”

17

Rolf Trueb CIO Swiss Mobiliar Insurance

Page 18: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Opportunities for the Company

18

Time to Market can be improved (faster implementation of new business requirements)

Business & customers don’t wait 6 months for new functionality

Effort reduction by much more automatization

Manual testing effort decreases:

automation and smaller software packages increase the efficiency

Minimizing risks by applying smaller software releases

Development can react quickly and flexibly

Quick Business response and quick bug fixing

Cooperation between Business & IT is improved

Business regards IT as a service provider who delivers continuously

Confidence rises -major step towards DevOps

Page 19: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Transformation from Application to µServices

t

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

µService

Typical evolution

19

Page 20: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Impact on Database Management

20

We have to deliver managed services for the development

• In the future we get a large number of µServices that use databases

• Multitenant architecture will help us to solve this challenge

Automatization: we had to implement automatic database deployment (DBaaS)

• Databases have to be available in minutes

• Databases can exists from days to hours or even minutes

• 1:1 mapping between µServices and databases

Page 21: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Starting point: The deployment pipeline

21

Version controlContinuous

integration

Development

registerdetect push image

Get imagePush

Start Image

Docker registry

How and where to build the database

in this deployment pipeline

trigger deployment

Kubernetes

Page 22: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

DBaaS architecture at Swiss Mobiliar

22

t = 2 min

t = 1 min

Continuous

integration

Development

registerdetect build

Get imagePush

Start Image

Docker registry

Kubernetes

order get state

OUD connect

t = 4...6 min

t = 8...10 min

Fully automated application deployment including

Oracle database in less than 10 minutes

trigger deployment

PDB

Version control

Page 23: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Technical implementation

23

Continuous

integration

Container Database

Repository

Database

https://pdborder-api/$pdbname

REST Server

REST Call Execute Function

Execute Procedure

DB Link

Create external Job to execute shell script

Submit os credentials and execute job

Shell script creates, delete, start or stop new

pdb and post actions

Update pdb_orders table when pdb is created

Submit success to Continuous Integration

Create corresponding Docker image

sql over oracle client

pdb_orders

Template

PDB APPL 1 APPL 2

Page 24: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Deployment decision process

24

$pdb_name=topdb1

CDB Inventorydo10mm01 to10ms01 po10ss01

do10mm02 to10ms02 po10ss02

do10mm03 to10ms03 po10ss03

Available

Restrictions

PDB Inventory

pdb count on to10ms01 = 22

pdb count on to10ms03 = 37

to10ms01

Submit job

Restrictions

P = 15 PDB / CDB

T & D = 50 PDB / CDB

Page 25: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future

Conclusion - The DBAAS Interface is a great success

25

We satisfy the requirements of all stakeholders

We delivered more than 1200 PDB’s over the Interface in less than two years

With this service we can cover today and in the near future the requirements, which an agile software

development places on the DB management - and Oracle Multitenant is the right architecture for it

177

65

5

2716

73

57

4034

58

33

49

64

31

49

83

98

24

139

2616

51

1

2916

915 11 14 13 9

28

2 5 9

51

11 14

29 34

48

21

101

2

35

0

20

40

60

80

100

120

140

160

180

200

Dez16

Jan17

Feb17

Mär17

Apr17

Mai17

Jun17

Jul 17 Aug17

Sep17

Okt17

Nov17

Dez17

Jan18

Feb18

Mär18

Apr18

Mai18

Jun18

Jul 18 Aug18

Sep18

Okt18

DBAAS STATISTICS

DB created DB deleted

created +1200 PDB’s

deleted + 500 PDB’s

Page 27: REPORTS AUF OLTP DATEN ANALYTICS ON OLTP DATA€¦ · Schema consolidation makes db management complicated 8 Multitenant is «production ready» with Oracle 12.2 and becomes the future