instrumentation and source control: time to act - … · instrumentation and source control: time...

43
This webinar is brought to you by: Check out the sponsors’ websites: www.method-r.com www.red-gate.com/oracle 16:00 UK / 10:00 Central US / 17:00 Central Europe Instrumentation and source control: time to act Cary Millsap and James Murtagh

Upload: lamanh

Post on 07-Sep-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

This webinar is brought to you by:

Check out the sponsors’ websites:www.method-r.comwww.red-gate.com/oracle

16:00 UK / 10:00 Central US / 17:00 Central Europe

Instrumentation and source

control: time to actCary Millsap and James Murtagh

This webinar is brought to you by:

Instrumentation and source

control: time to actCary Millsap and James Murtagh

Thank you for joining us

This webinar is brought to you by:

James Murtagh @allthingsoraclePart of the Oracle Tools’ team at Red Gate,

creator of All Things Oracle.com.

Presenters

Cary Millsap @carymillsapOracle ACE Director, co-founder of the

OakTable network, founder of Method R

Corporation.

This webinar is brought to you by:

Before we start

• You will be on mute for the duration of the event

• We are now talking so please type a message in the Chat box in the

Control Panel if you can’t hear us (please check your speakers and

GoToWebinar audio settings first)

• There will be a Q+A session at the end but please type your

questions in the Questions box in the Control Panel in advance

• A recording of the full webinar will be put up online

This webinar is brought to you by:

About Red Gate

• Over 600,000 technology professionals worldwide use Red Gate’s

software, including 93% of Fortune 100 companies.

This webinar is brought to you by:

About Red Gate

• Our philosophy is to design highly usable, reliable tools that solve

problems commonly faced by DBAs and developers.

“Source Control for Oracle is a huge time saver for me and for teams

that I work with. I am blown away!”

Lewis Cunningham, Database Architect, Oracle ACE Director

This webinar is brought to you by:

• Software, education, and consulting to help DBAs and developers

make faster applications, faster.

About Method R

ToolsMeTHOD R

TM

TraceMeTHOD R

TM

“I turn to Method R not only to provide these wonderful tools

and the education to know how to use them, but also in time of

crisis to ask for help when we’re in over our heads.”

Andrew Zitelli, Principal Software Engineer with Honors, Thales-Raytheon Systems

This webinar is brought to you by:

• Available at Amazon.com

About Method R

This webinar is brought to you by:

Agenda

1. Introduction

2. Instrument your code – Cary Millsap

3. Source control your database – James Murtagh

4. Q+A

This webinar is brought to you by:

Introduction

There are two things that people are often aware they should do, but

don't: instrumenting their application and source-controlling their

database

In this session, we’ll discuss why you need to source-control your

database and instrument your code and demonstrate tools that have

been designed to make this easy

This webinar is brought to you by:

1. Instrument your code

Cary Millsap

This webinar is brought to you by:

Some things you need to be really good at:

• Write a test

• Run a debugger

• Use a version control system

• Run a profiler

This webinar is brought to you by:

Distributing code without profiling…

…is like cooking

without

washing

your

hands.

This webinar is brought to you by:

Why profile?

The universal experience of

programmers who have been

using measurement tools has

been that their intuitive

guesses fail.

—Donald Knuth

This webinar is brought to you by:

So, what is profiling?

• A profile is a tabular decomposition of response time.

CALL-NAME DURATION % CALLS MEAN MIN MAX

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

SQL*Net message from client 40.507440 81.5% 18,585 0.002180 0.000000 0.220486

EXEC 6.684420 13.4% 18,585 0.000360 0.000000 0.128008

FETCH 2.388145 4.8% 18,583 0.000129 0.000000 0.120008

SQL*Net message to client 0.094487 0.2% 18,585 0.000005 0.000000 0.018525

cursor: pin S wait on X 0.025463 0.1% 4 0.006366 0.000000 0.011166

cursor: pin S 0.000005 0.0% 5 0.000001 0.000000 0.000005

PARSE 0.000000 0.0% 2 0.000000 0.000000 0.000000

pooled connection free 0.000000 0.0% 1 0.000000 0.000000 0.000000

XCTEND 0.000000 0.0% 1 0.000000 0.000000 0.000000

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

TOTAL (9) 49.699960 100.0% 74,351 0.000668 0.000000 0.220486

This webinar is brought to you by:

A profile is an invoice for response time.

This webinar is brought to you by:

How do you profile?

• Instrumentation

t0 = current_time();

printf("%s begin FFT", tformat(t0));

/* Fast Fourier Transform */

t1 = current_time();

printf("%s end FFT (%d sec)", tformat(t1), t1-t0);

This webinar is brought to you by:

How do you profile?

• Instrumentation v2

start_task("FFT");

/* Fast Fourier Transform */

end_task();

This webinar is brought to you by:

How do you profile an Oracle experience?

Instru-

mentTrace

Format

trace

This webinar is brought to you by:

How do you profile an Oracle experience?

• Instrument

– Name your tasks

• Client identifier

– dbms_session.set_identifier(string)

– OCIAttrSet or setEndToEndMetrics with OCI_ATTR_CLIENT_IDENTIFIER

• Service, module, action

– dbms_application_info.set_module(module, action)

– OCIAttrSet or setEndToEndMetrics with OCI_ATTR_MODULE, etc.

I T F

This webinar is brought to you by:

How do you profile an Oracle experience?

• Instrument v2

– Use Method R Instrumentation Library for Oracle

ilo_task.begin_task(module, action, comment);

// ... code to perform task goes here

ilo_task.end_task;

http://method-r.com/software/ilo for your PL/SQL code

setEndToEndMetrics for your Java code

I T F

This webinar is brought to you by:

How do you profile an Oracle experience?

• Trace

– dbms_monitor.session_trace_enable

– Method R Trace

I T F

“I just finally got ’round to installing MR Trace

in SQLDev, and I can say, ‘Wow… Just wow.’

Absolutely blown away by how simple yet

effective it is.”

—John Scott, Apex Evangelists Ltd, Halifax, England

This webinar is brought to you by:

How do you profile an Oracle experience?

• Format trace

– Oracle tkprof

– Oracle TRCANLZR

– Method R Tools

– Method R Profiler

I T F

“It took me only 30 minutes to install MR

Tools and MR Profiler, analyze a troublesome

trace file and get a whole new view of the

problem. …Blown away.”

—Lars Johan Ulveseth, SYSCO, Bergen, Norway

This webinar is brought to you by:

Feedback is the basis for improvement.

This webinar is brought to you by:

Imagine if hot stove feedback took 30 days.

http://sportsquee.blogspot.com/2007/03/today-on-hot-stove-matt-cotton-schaub.html

This webinar is brought to you by:

Yet it takes far more than 30 days…

…to learn that you’ve designed a bug into your software.

If you don’t instrument your code.

With instrumentation, you can:

• Find your bugs now

• Fix your bugs more easily

This webinar is brought to you by:

The earlier you know, the better.

This webinar is brought to you by:

That is why we wash…

This webinar is brought to you by:

Summary

• Instrumentation and profiling has lots of benefits

• Oracle Database really helps you along

• But profiling Oracle has traditionally been manual and difficult

• Method R tools can help

• Visit us at method-r.com

This webinar is brought to you by:

2. Source control your database

James Murtagh

This webinar is brought to you by:

A potential scenario

Developer 1: It's time to push the app into testing. Do we copy the

database from Jack's machine, or Jill's machine?

Developer 2: Umm, I don't remember which one is up to date.

Developer 1: We're screwed.

Source: http://odetocode.com/blogs/scott/archive/2008/01/30/three-rules-for-database-work.aspx

This webinar is brought to you by:

Always source control your database

• Enables you to have a single, authoritative source for your schema

• See who changed what, why and when

• Gives you the ability to revert to a previous version

• Share changes in a sandboxed environment

• Same applies to the database, so why is it less common?

http://dbareactions.tumblr.com/post/49022996524/when-the-developers-ask-if-ive-got-the-

databases

• Awesome blog post by Jeff Atwood:

http://www.codinghorror.com/blog/2008/02/get-your-database-under-version-control.html

This webinar is brought to you by:

Source control tells the story

Revision Author Date Message

4273 neil.anderson 02/10/2013 10:02:28 Fixed Bug [PA-0215]

4271 cary.millsap 01/10/2013 08:58:11[PA-0214] Profiled the app, found bottleneck in partners trigger. Removed now.

4268 tom.kyte 01/10/2013 07:09:49Fixed Bug [PA-0213] partners trigger should e-mail all admins, not just me

4267 tom.kyte 30/09/2013 17:05:17 Added trigger to e-mail me when a new partner joins

4266 james.murtagh 27/09/2013 09:42:31 Added new partners table [app.partners] to product app schema

This webinar is brought to you by:

Don’t deploy blind

This webinar is brought to you by:

Challenges of db source control

• Generate files that represent your database (for version control)

• Keep the db and files in sync

• Persist data in deployments

• Setting up sandboxed development environments

This webinar is brought to you by:

Red Gate makes db source control easy

• Checking in changes is as simple as writing a log message and

clicking a button

• Make changes in your editor as normal

• Store a complete history of every object checked in

• Compare source control to the database

• Lock objects on a shared development database

• Enable easy setup of sandboxed environments

This webinar is brought to you by:

Demo of Source Control for Oracle

This webinar is brought to you by:

Sandboxed development

SVN

/

TFS

This webinar is brought to you by:

Shared development

SVN/

TFSDev

This webinar is brought to you by:

Deployment

SVN/

TFSTest UAT, Production etc.

This webinar is brought to you by:

Summary

• Source control has lots of benefits

• Your database should be in version control too

• Oracle source control has traditionally been manual and hard

• Red Gate tools can help

• 28-day trial at www.red-gate.com/oracle

This webinar is brought to you by:

Questions?

Cary Millsap & James Murtagh

This webinar is brought to you by:

James Murtagh @allthingsoracle

www.red-gate.com

[email protected].

Contact us

Cary Millsap @carymillsap

www.method-r.com