38
1 DBAs and R - At the Intersection of Oracle and Unstructured Data

DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

1

DBAs and R - At the Intersection of Oracle and Unstructured Data

Page 2: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

2

Introduction

Page 3: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

3 3

Today’s Objectives §  Understand the R Language. §  Understand the Data Visualization and it’s value. §  Learn the basic constructs of R §  See R in Action via a Demo §  Learn how Oracle is integrating R into it’s relational database product line.

Page 4: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

4 4

Robert Dawson – Meta7

q Oracle Master Consultant, Meta7q AVP, Enterprise Databases, Oppenheimer Funds, Denver, COq Oracle DBA, Janus Capital, Denver, COq Oracle Application DBA, Blue Cross Blue Shield Denver, CO

Page 5: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

5 5

Ashokkumar Sivasankaran – ACXIOM q Senior Team Leader and Database Architect, Acxiom ITO q OCE RAC Expert & OCP Database Administrator 7.3 to 11g q  ITIL V3 Foundation Certified q Member Chicago Oracle User Group q Chicago “RAC Attack” Instructor

Page 6: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

6

About You.

Page 7: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

7 7

About You. How do you learn? Do you like to read and access to content on media? Do you like digest information from charts, diagrams, timelines or maps? Do you enjoy hands-on activities involving movement? Verbal Learner

Visual Learner

Kinesthetic learner

Page 8: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

8 8

Think about these three questions? What is your learning style? What is the learning style of your boss? What is the learning style of your “customer”?

Page 9: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

9

DBAs and R - At the Intersection of Oracle and Unstructured Data

Page 10: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

10 10

The United States of Data(bases)

The Mainframe Colonies

The Relational Heartland

The NoSQL Outpost

The Hadoop States Somewhere at the Intersection of Relational and Unstructured…..

Page 11: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

11

The Big Data Story

Page 12: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

12 12

The Big Data Landscape

Page 13: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

13 13

R is NOT a Big Data Tool 1.  It’s a Data Tool. 2.  Leveraged by Data Scientists, Analysts, Developers, Engineers, Planners

and Researches. 3.  Open Source. 4.  Processes large sets of data fast!

Page 14: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

14 14

What Data Tools are we using?

Page 15: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

15 15

Telling the Visual Data Story…. “The most common data display is a noun accompanied by a number. For example, a medical patient's current level of glucose is reported in a clinical record as a word and number.” – Edward Tufte

Source: http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR

Page 16: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

16

Stay Relevant.

Page 17: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

17 17

The Data-Driven Organization

Warby-Parker - New York Online Sunglass Companywww.warbyparker.com

Carl Anderson @LeapingLlamas

Page 18: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

18 18

The Data-Driven Organization

"People want to move from a culture of reporting to a culture of analytics”

Page 19: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

19 19

Are you a Data Driven DBA? Data Questions about your Oracle Databases? 1.  What are the average IOPS for you databases during peak load. 2.  How many average active sessions does your primary DB support. 3.  What is the typical HCC compression ratio for you Exadata Storage? 4.  How many executions does you TOP SQL complete every day? 5.  What is the average DOP for your SQL Statements? 6.  What is you average and max CPU utilization? 7.  How many hours do you spend performing refreshes a month? 8.  How many Oracle Core are you utilizing today?

How are you making your next Hardware purchase decision? How do you know you are ready to expand?

Page 20: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

20 20

What’s your learning Style?

Verbal Learner

Visual Learner

Kinesthetic learner

You Boss Customer

Page 21: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

21 21

Traditional DBA Reporting Tools AWR Reports Vendor Tools OEM Graphics ADDM Report

Page 22: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

22 22

R – AWR Reporting PDF File Load.

Page 23: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

23

R In Action: Demo

Page 24: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

24 24

R Language Basics §  Developed at Bell Labs (est. 2004) §  Open Source §  Runs on Windows, OSX, Linux, Unix §  Interpreted Language vs. Compiled §  Session-based §  http://www.r-project.org/ §  5,000 packages available. CRAN: Comprehensive R Archive Network

Page 25: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

25 25

Key Components of R 1.  Simple Data: Vectors 2.  Compound Data Stored in: Data.Frame,Matrix, List 3.  Functional Programming 4.  Shared Code: Packages 5.  Graphic Packages: qplot(), ggplot(), hist()

Page 26: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

26 26

Things to Remember about R-Basics

R is not Perl, Sed or Awk. 1.  Data.Frames = Tables 2.  Package-based. 3.  Use help() 4.  Graphic are ‘Packages’

Page 27: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

27 27

R Development Tools

Page 28: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

28 28

Demo: Data Load from Excel File (5000 rows) > awr_data <- read.xlsx2("awr-io-waits.csv.xlsx", 1, colClasses = c(snap_id="numeric",wait_class="character",event_name="character",wait_time_milli="numeric",wait_count="numeric")) > str(awr_data) 'data.frame': 5000 obs. of 5 variables: $ SNAP_ID : num 8195 8195 8195 8195 8195 ... $ WAIT_CLASS : Factor w/ 3 levels "Commit","System I/O",..: 3 3 3 3 3 3 3 3 3 2 ... $ EVENT_NAME : Factor w/ 4 levels "db file scattered read",..: 1 1 2 2 2 2 2 2 2 3 ... $ WAIT_TIME_MILLI: num 1 2 1 2 4 8 16 32 64 1 ... $ WAIT_COUNT : num 3 1 255 23 33 100 118 70 16 585 ... Key Things to remember: ü Columns are variables ü Rows are observations

Page 29: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

29 29

Demo: Data Head > head(awr_data) SNAP_ID WAIT_CLASS EVENT_NAME WAIT_TIME_MILLI WAIT_COUNT 1 8195 User I/O db file scattered read 1 3 2 8195 User I/O db file scattered read 2 1 3 8195 User I/O db file sequential read 1 255 4 8195 User I/O db file sequential read 2 23 5 8195 User I/O db file sequential read 4 33 6 8195 User I/O db file sequential read 8 100

Page 30: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

30 30

Demo: Simple Table Group by w/ Pie Graph §  > table(awr_data$WAIT_CLASS) Commit System I/O User I/O 1197 1378 2425 §  > pie(table(awr_data$WAIT_CLASS))

Page 31: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

31 31

Demo: Group by Pie Chart > table(awr_data$EVENT_NAME)

db file scattered read db file sequential read log file parallel write log file sync

714 1711 1378 1197

> pie(table(awr_data$EVENT_NAME))

Page 32: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

32 32

Demo: Table Graphic Plot plot(awr_data$EVENT_NAME)

Page 33: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

33 33

Demo: Table Plot Multicolumn.

> plot(awr_data$EVENT_NAME,awr_data$WAIT_COUNT)

Page 34: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

34

Oracle R Extension: Use R with Oracle

Page 35: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

35 35

Some Limitations Data Analysts Face with R. 1.  Memory-based processing. 2.  Data Extraction is time-consuming and painful! 3.  Data Security not included in program. 4.  Programing is “adhoc”, not “production-ready” 5.  Users are not typically, “IT”.

Oracle doesn’t have these limitations.

Page 36: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

36 36

The Oracle R Products

Oracle R Distribution

Oracle R Enterprise (AA)

Oracle R Advanced for Hadoop (Connectors)

R Oracle (Package)

Page 37: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

37 37

R on TechNet

Page 38: DBAs and R - At the Intersection of Oracle and ... · 5 Ashokkumar Sivasankaran – ACXIOM " Senior Team Leader and Database Architect, Acxiom ITO " OCE RAC Expert & OCP Database

38