You are on page 1of 91

Toad Tips & Tricks for the PL/SQL Pro

Toad for Oracle Tips & Tricks for Analysts, Developer and DBAs

2009 Quest Software, Inc. ALL RIGHTS RESERVED

Three Main Presentation Topics:


Basics for newbies and often even old hands Advanced features for PL/SQL Developers Advanced features for DBAs

Part #1
Basics for newbies and often even old hands

Which Toad Version Do I Have?

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)

I dont like Toads Menus and Toolbars!


Just like Microsoft Office, simply choose menu or toolbar and choose customize

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)

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

Ten Years of Options and Growing

10

What is Toad Doing? How does it do that?


Built-In Method Stand-Alone EXE SQLMonitor.exe

11

12

13

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

14

15

Toad Crashed How do I troubleshoot?


http://support.quest.com
Your Toad Options settings

16

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

17

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

18

19

tnsnames.ora

---Nothing---

OID or MS AD

20

21

22

Hard to see on printed slides, but adds a color border around the entire window too
23

Of the more often used screens, Toad Schema Browser is probably the most user configurable

24

Refresh current or focused RHS details

Refresh current or focused LHS object Left Hand Side (LHS) Right Hand Side (RHS) Refresh all LHS objects

25

26

27

28

29

In Tree-View mode, Toad basically looks and feels just like other tools, such as: SQL Navigator PL/SQL Developer SQL Developer

30

31

32

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

33

34

Now Schema Browser is just right

35

Common object operations on the LHS toolbar, and all object operations available via right-hand-mouse menu

Did you notice that the Funnel icon is red instead of grey? What does that mean? Always notice Funnel color!

36

37

Theres also the Quick Filter Accepts standard wildcards (*) Accepts database wildcards (%)

38

Schema Browser navigation history

39

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)
40

41

42

43

44

45

To delete all saved schema browser layout settings

46

47

48

Cut & Paste

49

Part #2
Advanced features for developers

50

Editor 201
Code Insight
Object name completion (CNTRL + Period) Column Popup (Multi-Select!) PL/SQL Completion

Too Mr. Clippy for your tastes? Disable the feature!

51

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

52

Split Editor

Work with multiple sections of your file simultaneously


Left/Right Top/Bottom
53

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

54

Editor 201
Keyboard Shortcuts
Check your options!

Customize Toolbars
Hate Toads 80 gazillion buttons and toolbars? TURN THEM OFF

55

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!

56

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 applications session sets a DEBUG Flag with a named Identifier You tell Toad which session to grab. Toad automatically steps into the code.

57

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

58

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

59

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.


60

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.

61

PL/SQL Execution View REF Cursors


Does your PL/SQL return a REF Cursor? Let Toad put it into a Data Grid for you.

62

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 Toads Team Coding Feature

63

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 Quests Oracle experts.

Explains why your code is flagged and gives advice for better implementations. Can identify SQL that needs Optimized.

64

Ok, youve written some kick-butt PL/SQL, but tool automatically Quests latest PL/SQL does it work? tests your
PL/SQL for correctness.

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

Code Tester for Oracle Writes the Test Code For You!

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

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. 67

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

68

Part #3
Advanced features for DBAs

69

Database Browser

70

71

72

73

74

75

76

77

Subset of Schema Browser for those objects not owned by a schema (i.e. public owner or simply just no owner)

78

App Designer

79

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 were 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

80

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)

81

82

83

84

85

86

87

88

89

Now you can automate tasks and program dependencies and iterations, with conditional logic and anything else you can imagine and program

90

Thank you Thank you Questions?you

2009 Quest Software, Inc. ALL RIGHTS RESERVED

You might also like