91
© 2009 Quest Software, Inc. ALL RIGHTS RESERVED Toad Tips & Tricks for the PL/SQL Pro Tips & Tricks for Analysts, Developer and DBA’s Toad ® for Oracle

Toad Tips Tricks Expert Insight

  • Upload
    velanc1

  • View
    82

  • Download
    10

Embed Size (px)

Citation preview

Page 1: Toad Tips Tricks Expert Insight

© 2009 Quest Software, Inc. ALL RIGHTS RESERVED

Toad Tips & Tricks for the PL/SQL Pro

Tips & Tricks for Analysts, Developer and DBA’s

Toad® for Oracle

Page 2: Toad Tips Tricks Expert Insight

2

Three Main Presentation Topics:

• Basics for newbies and often even old hands

• Advanced features for PL/SQL Developers

• Advanced features for DBA’s

Page 3: Toad Tips Tricks Expert Insight

3

Part #1

• Basics for newbies and often even old hands

Page 4: Toad Tips Tricks Expert Insight

4

Which Toad Version Do I Have?

Page 5: Toad Tips Tricks Expert Insight

5

How Do I Upgrade my Toad Version?

• You must be current on Toad maintenance contract

• Then simply login and download from Quest Support– http://support.quest.com

• You cannot:

– Upgrade commercial using trial from web site

– Upgrade commercial using trial from show DVD

• What if I let my maintenance lapse? What can I do?

– Contact sales – ask for options (all depends…)

Page 6: Toad Tips Tricks Expert Insight

6

I don’t like Toad’s Menus and Toolbars!Just like Microsoft Office, simply choose menu or toolbar and choose customize …

Page 7: Toad Tips Tricks Expert Insight

7

Drag-and-Drop:

•Existing toolbar icons and/or menu

items around (reorganize)

•Existing toolbar icons and/or menu

items to Customize Window (remove)

•Customize Window toolbar text/icons

to toolbar and/or menu location (add)

Page 8: Toad Tips Tricks Expert Insight

8

Toad does not work the way I want!

Always check Toad Options

•Can Toad do this …

•Can Toad work this way …

•Can Toad look like this …

•How do I customize Toad

Page 9: Toad Tips Tricks Expert Insight

9

Ten Years of Options – and Growing …

Page 10: Toad Tips Tricks Expert Insight

10

Page 11: Toad Tips Tricks Expert Insight

11

What is Toad Doing? How does it do that?

Built-In Method Stand-Alone EXE

SQLMonitor.exe

Page 12: Toad Tips Tricks Expert Insight

12

Page 13: Toad Tips Tricks Expert Insight

13

Page 14: Toad Tips Tricks Expert Insight

14

Toad Seems Slow or Slower Than Before?Speed Up Toad - Updated

http://www.toadworld.com/Community/Blogs/tabid/67/EntryID/274/Default.aspx

Speed Up Toad

http://www.toadworld.com/Community/Blogs/tabid/67/EntryID/162/Default.aspx

Toad Sometimes Slow on Oracle 10g

http://www.toadworld.com/Community/Blogs/tabid/67/EntryID/135/Default.aspx

Page 15: Toad Tips Tricks Expert Insight

15

Page 16: Toad Tips Tricks Expert Insight

16

Toad Crashed – How do I troubleshoot?http://support.quest.com

Your Toad Options settings

Page 17: Toad Tips Tricks Expert Insight

17

Toad (like Keebler Cookies) has Elves !!!

When Toad screen or utility crashes, the Delphi code traps

the error and pops-up the special “Elf” error dialog screen

This is critical – do not just say OK and close the screen

Choose “click here” to see more info …

Page 18: Toad Tips Tricks Expert Insight

18

Toad.ini file + Support Bundle file + Toad.elf file = much better chance finding bug or user error

Page 19: Toad Tips Tricks Expert Insight

19

Page 20: Toad Tips Tricks Expert Insight

20

tnsnames.ora ---Nothing--- OID or MS AD

Page 21: Toad Tips Tricks Expert Insight

21

Page 22: Toad Tips Tricks Expert Insight

22

Page 23: Toad Tips Tricks Expert Insight

23

Hard to see on printed slides, but adds a

color border around the entire window too

Page 24: Toad Tips Tricks Expert Insight

24

Of the more often used screens, Toad Schema

Browser is probably the most user configurable

Page 25: Toad Tips Tricks Expert Insight

25

Left Hand Side (LHS) Right Hand Side (RHS) Refresh all LHS objects

Refresh current or

focused LHS object

Refresh current or

focused RHS details

Page 26: Toad Tips Tricks Expert Insight

26

Page 27: Toad Tips Tricks Expert Insight

27

Page 28: Toad Tips Tricks Expert Insight

28

Page 29: Toad Tips Tricks Expert Insight

29

Page 30: Toad Tips Tricks Expert Insight

30

In Tree-View mode, Toad basically looks

and feels just like other tools, such as:

• SQL Navigator

• PL/SQL Developer

• SQL Developer

Page 31: Toad Tips Tricks Expert Insight

31

Page 32: Toad Tips Tricks Expert Insight

32

Page 33: Toad Tips Tricks Expert Insight

33

Now I have a Schema Browser that fits

my specific job needs, with no excess

stuff displayed and no over crowding!

But not quite done just yet ☺☺☺☺

Page 34: Toad Tips Tricks Expert Insight

34

Page 35: Toad Tips Tricks Expert Insight

35

Now Schema Browser is “just right” ☺☺☺☺

Page 36: Toad Tips Tricks Expert Insight

36

Did you notice that the Funnel

icon is red instead of grey?

What does that mean?

Always notice Funnel color!

Common object operations

on the LHS toolbar, and all

object operations available

via right-hand-mouse menu

Page 37: Toad Tips Tricks Expert Insight

37

Page 38: Toad Tips Tricks Expert Insight

38

There’s also the “Quick Filter”

Accepts standard wildcards (*)

Accepts database wildcards (%)

Page 39: Toad Tips Tricks Expert Insight

39

Schema Browser navigation history …

Page 40: Toad Tips Tricks Expert Insight

40

Instantly jumps from EMPLOYEE table to the EMPLOYEE_PK

index (i.e. it automatically changes the focus or navigates to

“Indexes” tab with the specific index in focus or preselected)

Page 41: Toad Tips Tricks Expert Insight

41

Page 42: Toad Tips Tricks Expert Insight

42

Page 43: Toad Tips Tricks Expert Insight

43

Page 44: Toad Tips Tricks Expert Insight

44

Page 45: Toad Tips Tricks Expert Insight

45

Page 46: Toad Tips Tricks Expert Insight

46

To delete all saved schema

browser layout settings …

Page 47: Toad Tips Tricks Expert Insight

47

Page 48: Toad Tips Tricks Expert Insight

48

Page 49: Toad Tips Tricks Expert Insight

49

Cut & Paste …

Page 50: Toad Tips Tricks Expert Insight

50

Part #2

• Advanced features for developers

Page 51: Toad Tips Tricks Expert Insight

51

Editor 201

• Code Insight– Object name completion (CNTRL + Period)

– Column Popup (Multi-Select!)

– PL/SQL Completion

– Too ‘Mr. Clippy’ for yourtastes? Disable thefeature!

Page 52: Toad Tips Tricks Expert Insight

52

Editor 201• SQL Recall

– Use Named SQL for super fast recall.

– ALT + Up/Dn to scroll through history recall list

• Code Snippets– If..Then..Elsif..

– Exceptions

– Cursor For Loop

– Your custom code

Page 53: Toad Tips Tricks Expert Insight

53

Split Editor

• Work with multiple sections of your file simultaneously– Left/Right

– Top/Bottom

Page 54: Toad Tips Tricks Expert Insight

54

Editor 201• Make/Strip Code

– Translate Delphi, Java, C++, Perl, C#, VB, etc to SQL

– Translate SQL to Delphi, Java, …

– Write your own custom Code Transformation Templates

Page 55: Toad Tips Tricks Expert Insight

55

Editor 201

• Keyboard Shortcuts– Check your options!

• Customize Toolbars– Hate Toad’s 80 gazillion

buttons and toolbars? TURN THEM OFF ☺

Page 56: Toad Tips Tricks Expert Insight

56

Editor 201• Debugger

– Conditional Breakpoints

– Use Watches to change variable values and as breakpoints

– Step into TYPE Body

– Supports DML Triggers

– Toad can now write your DBMS_OUTPUT instrumentation code for you!

Page 57: Toad Tips Tricks Expert Insight

57

External Debugging• Debug a session that is spawned from a remote

application or service.

• Step thorough your code and view the data as it was initialized somewhere else in the world.

• Your application’s session

sets a DEBUG Flag with a

named Identifier

• You tell Toad which session

to grab. Toad automatically

steps into the code.

Page 58: Toad Tips Tricks Expert Insight

58

Editor 201• Never build a DBMS_OUTPUT statement manually !

– Right-click – Output Statements

• Find a matching END IF, END or ) using bracketing

• Code Folding

• Code Refactoring

Page 59: Toad Tips Tricks Expert Insight

59

Code Road Map – Document and Create Local

Test/Development Environments – 1 Click!• Diagram Views &

PL/SQL Objects– Generate Test Data

– Generate DDL Scripts

– Build HTML Reports

Page 60: Toad Tips Tricks Expert Insight

60

PL/SQL Profiler (DBMS_ & Hierarchical

Support)• Find out which lines take longer to run than others.

• Identify execution bottlenecks

• Figure out what needs tuning

Integrated with the Editor for

instant analysis.

Graphs for quicker identification.

Page 61: Toad Tips Tricks Expert Insight

61

PL/SQL Execution – View Collections• Return Values & Out Parameters for your PL/SQL – let Toad

build DMBS_OUPUT for you

• Example – A 2 Dimensional PL/SQL Table Package Function that returns a PL/SQL Table.

Page 62: Toad Tips Tricks Expert Insight

62

PL/SQL Execution – View REF Cursors• Does your PL/SQL return a REF Cursor? Let Toad put it

into a Data Grid for you.

Page 63: Toad Tips Tricks Expert Insight

63

3rd Party Source Code Control Integration

• CVS

• MSFT TFS 2005, 2008, 2010

• MSFT Visual Source Safe

• Perforce

• PVCS (Serena)

• Subversion

Control files or additionally control objects in the database via Toad’s Team Coding Feature

Page 64: Toad Tips Tricks Expert Insight

64

CodeXpert – let Toad review your code before your

peers laugh at you ☺• Analyzes your code against Best Practices rules

developed by Steven Feuerstein, Bert Scalzo, and Quest’s Oracle experts.

Explains why your

code is flagged and

gives advice for better

implementations.

Can identify SQL that

needs Optimized.

Page 65: Toad Tips Tricks Expert Insight

65

Ok, you’ve written some kick-butt PL/SQL,

but does it work?• Quest’s latest PL/SQL tool automatically tests your

PL/SQL for correctness.

Step 1: Tell Code Tester what your program does in PLAIN ENGLISH

Page 66: Toad Tips Tricks Expert Insight

66

Code Tester for Oracle Writes the Test Code For You!

Step 2: Sit back and relax as Code Tester generates your test code.

Page 67: Toad Tips Tricks Expert Insight

67

Run your tests on demand to see what your programs

DO and DO NOT accomplish.

Step 3: Analyze the results. RED = BAD. See the Expected VS Actual

Results.

Page 68: Toad Tips Tricks Expert Insight

68

Test Performance/Scalability

• Your stored procedure runs OK for 1 user, how will it handle 10? 50? 100?

• Toad can answer that question, track response time to user load

Page 69: Toad Tips Tricks Expert Insight

69

Part #3

• Advanced features for DBA’s

Page 70: Toad Tips Tricks Expert Insight

70

Database Browser

Page 71: Toad Tips Tricks Expert Insight

71

Page 72: Toad Tips Tricks Expert Insight

72

Page 73: Toad Tips Tricks Expert Insight

73

Page 74: Toad Tips Tricks Expert Insight

74

Page 75: Toad Tips Tricks Expert Insight

75

Page 76: Toad Tips Tricks Expert Insight

76

Page 77: Toad Tips Tricks Expert Insight

77

Page 78: Toad Tips Tricks Expert Insight

78

Subset of Schema Browser for those objects not owned

by a schema (i.e. public owner or simply just no owner)

Page 79: Toad Tips Tricks Expert Insight

79

App Designer

Page 80: Toad Tips Tricks Expert Insight

80

Often you go into a Toad screen to set some settings, push

exec, and have something happen (perform work) …

Toad has for a long time had a way to capture those settings

and then let you repeat work that from command line …

But old way had problems, and was not everywhere …

So we’re working on replacing the old command line method

with a cool, new Toad Application Designer. Think of it as a

macro record and playback facility …

Toad 9.6 started this effort – was called actions …

Toad 9.7 revised the approach – now called App Designer

Page 81: Toad Tips Tricks Expert Insight

81

Some screens still not converted to app designer …

Look for open folder and floppy disk icons …

These are for load and save screen settings …

Notice no camera icon in bottom left corner (new method)

Page 82: Toad Tips Tricks Expert Insight

82

Page 83: Toad Tips Tricks Expert Insight

83

Page 84: Toad Tips Tricks Expert Insight

84

Page 85: Toad Tips Tricks Expert Insight

85

Page 86: Toad Tips Tricks Expert Insight

86

Page 87: Toad Tips Tricks Expert Insight

87

Page 88: Toad Tips Tricks Expert Insight

88

Page 89: Toad Tips Tricks Expert Insight

89

Page 90: Toad Tips Tricks Expert Insight

90

Now you can automate tasks and program

dependencies and iterations, with conditional logic

and anything else you can imagine and program ☺☺☺☺

Page 91: Toad Tips Tricks Expert Insight

© 2009 Quest Software, Inc. ALL RIGHTS RESERVED

Thank youThank you

Questions?you