Welcome to Toad

Toad for Oracle provides an efficient and accurate way for database professionals of all skill and experience levels to perform their jobs with an overall improvement in workflow and productivity. With Toad for Oracle you can:

  • Understand your database environment through visual representations
  • Meet deadlines easily through automation and smooth workflows
  • Perform essential development and administration tasks from a single tool
  • Deploy high-quality applications that meet user requirements and perform reliably in production
  • Validate database code to ensure the best-possible performance
  • Manage and share projects, templates, scripts, and more with ease

The Toad for Oracle solutions are built for you, by you. Over 10 years of development and feedback from various communities like Toad World have made it the most powerful and functional tool available. With an installed-base of over one million, Toad for Oracle continues to be the standard tool for development and administration.

Toad comes in several bundles, each offering different functionality. For more information on the different bundles, please see the Quest Software website or your Quest Sales Representative.

A video tutorial is available to help you get started with Toad. This video opens in a new browser and requires an Internet connection.

Warning! By default, Oracle installs and enables some features in the database which may not be covered by your existing license, such as Partitioning, RAC, Advanced Workload Repository (AWR) and Oracle Tuning Advisor to name a few. Toad for Oracle takes advantage of these features if found installed in your database, and use of these features (including use by Toad for Oracle) may increase your Oracle licensing fees. Being properly licensed by Oracle is your (organization's) responsibility.

Related Information

Additional Toad Resources


New in Toad

New in This Release (10.6)

Updated: October 26, 2010

Review the following sections for new features in this release. All changes are available in the Base edition unless otherwise indicated.

Show all

General
  • Export File Browser, Top Session Finder, Export Utility Wizard, and Import Utility Wizard are now included in the Base edition of Toad. They no longer require the DB Admin module.
  • The Project Manager now supports Toad Apps and Actions.

  • You can now ignore specific ORA errors for a single script execution or select to always ignore the error. You can edit the list of errors to ignore on the Scripts option page (Idea Pond 25).

    Note: The script output and login script options that were on the Execute/Compile page are now located on the Scripts page.

  • Code Road Map can now model dependencies between procedures, functions, variables, constants, types inside packages, and object types. To use this feature, right-click an object and select Reveal Level 2 Dependencies.
  • You can now completely customize the date format display in data grids by editing the Date format field on the Data Grids | Data options page.
  • The Licensing window now lists all licenses that are valid for the current version of Toad for Oracle. When you install or upgrade Toad, Toad looks for valid licenses you used in previous versions. This is useful when a combination of trial, term, or commercial licenses exist for the current version Toad.
  • If you search Knowledge Xpert through the Online Search toolbar, Toad now searches the online Knowledge Xpert database at www.toadworld.com.

  • The output options in the Set Parameters window are now in their own tab to make it easier for you to select settings.

    Toad 10.5 and Earlier

    Toad 10.6

Editor

  • You can now split the Editor to easily compare code revisions. It can be split left-right (displayed below) or top-bottom. See "Split the Editor Layout" in the online help for more information.

  • You can now keep Editor windows open when a database disconnects. To enable this feature, clear the Close Editor when session ends checkbox on the Editor | Behavior option page (Idea Pond 23).

  • The Editor now underlines syntax errors. Right-click the item to see a list of appropriate tokens.

    Note: To disable this feature, clear the Check syntax as you type checkbox on the Editor | Code Assist page.

  • The Editor now parses during idle time while you type. Parsing is fully threaded and is canceled as you start typing again, which helps prevent Toad from hanging while you type.
  • Documents are now recovered into Editor windows that match the schema in use when it closed. If none are found, new connections and Editor windows are opened as needed (Idea Pond 33).
  • Find in Files is now a stand-alone window and is not associated with the Output window. It supports multiple concurrent searches. When you select a result, a preview window displays and stays on top so you can easily compare other results.
  • You can now undo an action after the file has been saved.
  • You can now press and hold CTRL while dragging one tab onto another to send the contents of both tabs to the File Differences viewer.
Schema Browser
  • The Schema Browser is now faster. It executes fewer queries as you select different objects in the left-hand side.
  • In drop-down mode, you can hide leading characters of object names in the left-hand side. To use this feature, right-click a column and select Hide leading characters of name. The display resets when you change the schema or connection. This feature is also available for the Columns tab on the right-hand side. Select Column and Comment Options in the tab toolbar to enable this option.

    • Before

    After

  • If you describe (F4) an object without using the schema name and multiple objects with that name are found, a dialog now displays for you to choose the appropriate object. This only applies to the object types in DBA_OBJECTS.

  • You can now describe many objects types through database links (Idea Pond 11). However, the following object types are not supported: policy, policy group, java, refresh group, resource groups/plans, sys privs, and transformations.

Team Coding and Source Control
  • File-based source control can now use the same version control providers as Team Coding.

  • Toad now supports Team Foundation Server 2010 and Perforce.

    Note: Toad's Perforce client uses the Perforce command-line client (p4.exe). This client must be installed on your computer, and it is available for free at Perforce Software's web site.

Idea Pond

Idea Pond is a new site where you can submit your ideas to improve Toad for Oracle and vote or comment on other people's ideas. Toad's development has always been driven by our customers, and now it will be even easier for you to tell us what changes are most important. This site is free for all customers, and you can use an existing Yahoo, Google, or Twitter account to sign in.

The following Idea Pond submissions were implemented for this release:

Feature | Enhancement | Idea Pond ID
General | You can now ignore specific ORA errors for a single script execution or select to always ignore the error. You can edit the list of errors to ignore on the Scripts option page. | 25
 | For the FTP utility, you can now use Windows environment variables or Toad variables on both the Local System and Remote System fields. | 54
Editor | You can now keep Editor windows open when a database disconnects. To enable this feature, clear the Close Editor when session ends checkbox on the Editor | Behavior option page. | 23
 | Documents are now recovered into Editor windows that match the schema in use when it closed. If none are found, new connections and Editor windows are opened as needed. | 33
Schema Browser | You can now describe many objects types through database links. However, the following object types are not supported: policy, policy group, java, refresh group, resource groups/plans, sys privs, and transformations. | 11
Team Coding/Source Control | File-based source control can now use the same version control providers as Team Coding. | 14


DB Admin Module

The DB Admin Module is an optional module for Toad for Oracle that adds additional database administration features.

Show all

Database Monitoring and Reports
  • Database Browser—Browse databases from server level all the way down to the object level. View aggregated information about multiple databases on the same server. The Database Browser serves as an organization tool and launch point for many tuning/troubleshooting windows within Toad. See Database Browser for more information.
  • Database Monitor—Allows you to monitor database performance with nine charts: Logical IO, Physical IO, Event Waits, Sessions, Call Rates, Miss Rates, SGA Memory Usage, Shared Pool, and Indexed Queries %. There is a horizontal scroll bar to allow you to see all the charts.See Database Monitor for more information.
  • Database Probe—This real-time monitoring window offers a large collection of alerts. You can also create your own alerts. See Database Probe Overview for more information.
  • ADDM/AWR Report Generator—Create performance analysis reports from Oracle’s Automatic Workload Repository. Also manage snapshots and baselines. See ADDM/AWR Overview for more information.
  • AWR Browser—View Oracle AWR data in predefined or custom charts and grids. Easily observe trends between snapshots. See AWR Browser Overview for more information.
  • Index Monitoring—Monitor indexes to determine whether or not they are being used. You can then drop unused indexes to eliminate unnecessary overhead. See Index Monitoring for more information.
  • Statspack Browser—View Oracle Statspack data in predefined or custom charts and grids. Easily observe trends between snapshots. See StatsPack Browser Overview for more information.
  • Instance Manager—The Instance Manager is designed to let you check on the status your database instances. The Instance Manager can send email alerts when the status of an instance changes. The Instance Manager can start, stop, and alter your database instances. See Instance Manager for more information.
  • View Control Files—The control file contains information about the associated database that is required for the database to be accessed by an instance, both at startup and during normal operation. A control file's information can be modified only by Oracle; no database administrator or end-user can edit a database's control file. This option allows you to view them. See Control Files for more information.
Administration and Auditing
  • ASM Manager—Toad's ASM Manager gives you an easy interface to the Oracle ASM features, and lets you easily manage your disk groups. See ASM Manager Overview for more information.
  • DBMS_FLASHBACK—Use this window to “look back in time” in your database, using Oracle’s DBMS_FLASHBACK package on Oracle version 9i and up. See DBMS_Flashback for more information.
  • Redo Log Manager—Understand your redo log configuration at a glance. Redo log groups and members can be created or dropped. Clear log groups, force a log switch, or perform various "alter system archive log" commands. See Redo Log Manager for more information.
  • Oracle Parameters—You can view Oracle parameters with Base edition, but the DB Admin Module allows you to edit them. See Oracle Parameters for more information.
  • NLS Parameters—You can view the NLS parameters with the Base edition, but the DB Admin Module allows you to edit them. See NLS Parameters for more information.
  • Audit Objects—Display the audit monitoring options for selected database objects. Quickly define auditing options for single or multiple objects. See Audit Objects for more information.
  • Audit SQL and System Privileges—Display the audit monitoring options for SQL statement objects, reserved words and system privileges in the database. See Audit SQL and System Privileges for more information.
Diagnose Problems
  • Database Health Check—The Database Health Check performs a series of checks on a selected database and displays the results. Includes a “Vulnerability Assessment” to help find places where your database could be vulnerable to hackers. Includes a differences report to see what has changed since Health Check was last run. Results can be saved to HTML and sent by email. See Database Health Check for more information.
  • Log Switch Frequency Map—This screen shows when your database performs a log switch. You can use this window to judge the balance of log switches. See Log Switch Frequency Map for more information.
  • Segment Advisor—Examine tables, indexes, and partitions to determine if and how much, space can be reclaimed in them with the SHRINK command. See Segment Advisor for more information.
  • Identify Space Deficits—This displays tables that do not have enough free disk space to allocate their next extent. See Identify Space Deficits for more information.
  • Trace File Browser—Quickly and easily view the contents of an Oracle Trace File in an interactive utility. See Trace File Browser for more information.
  • LogMiner—If a System Change Number (SCN) caused a corruption problem, LogMiner lets you easily analyze a database and recover to the transaction exactly before the corruption. See LogMiner Overview for more information.

  • Tablespace Map—This map provides a graphical view of the contents of your tablespaces. See Tablespace Map for more information.

  • Undo Advisor—The Undo Advisor provides advice and helps to automate the establishment of the database undo environment. The advisor can inform you about the health of the current undo configuration, either overall or within a given time range. See Undo Advisor Overview for more information.
Optimize Performance
  • DBMS Redefinition Wizard—Use this wizard to rebuild tables online using Oracle’s DBMS_REDEFINITION package on Oracle version 10 and up. See DBMS_REDEFINITION Wizard for more information.
  • Resource Plan Scheduling—Easily schedule and change schedules for resource plans. See Schedule Resource Plans for more information.
  • Pinned Code—Pin code into the memory buffer so that it is always accessible and not overwritten by new data. See Pin Objects in SGA for more information.
  • Analyze All Objects—This window is available in the base version of Toad, but when the DB Admin module is added, statistics can be easily exported, imported, or copied to another schema or database. See Analyze All Objects for more information.
Compare Schemas and Databases
  • Compare Databases—Compare database-level objects such as tablespaces, roles, users, and so on between databases or Database Definition Files. See Compare Databases for more information.
  • Compare Schemas—The Compare Schemas screen is available in the base version of Toad, but the DB Admin module allows you to use the synchronization script. The DB Admin module also allows Toad to compare a Schema Definition File to a live schema, or another Schema Definition File. See Compare Schemas for more information.
Import and Export Data
  • Data Pump Import/Export Wizards—This feature is available in either Toad Professional Editions or the DB Admin Module. The Oracle Data Pump is an import/export utility added in Oracle 10g. It is significantly faster and more efficient at loading large volumes of data than the standard import/export utilities. Toad's Data Pump import/export wizards make using it even easier. In addition, Toad has a Data Pump job manager to help you manage import/export tasks. See About Data Pump for more information.
  • Flat File Export—The SQL*Loader tab is only available with the DB Admin Module. See Export Data to Flat File for more information.
Generate DDL Scripts
  • Generate Database Script—Generate DDL for all (or some) non-schema objects such as tablespaces, roles, profiles, etc. Script can be dependency-sorted. Extract from a live database or Database Definition File. See Generate Database Script for more information.
  • Generate Schema Script—Generate DDL for all (or some) objects in a schema. Script can be dependency-sorted. Extract from a live schema or Schema Definition File. See Generate Schema Script for more information.
  • Code Road Map and ER diagram—The Create Object scripts button on both of these windows is only available with the DB Admin Module. See Model Object Relationships (Code Road Map) for more information.
Create New Databases

The Toad Database Wizard provides a rapid way for DBAs to create Oracle databases. It offers an easy wizard-style interface consisting of 5 screens prompting the user to select parameter values for the construction of the database parameter file (INIT.ORA) as well as values used in the construction of a SQL file that can then later be executed by either a batch file (Windows) or a script (UNIX) the wizard generates. See New Database Wizard for more information.

Operating System Utilities
  • Unix Monitor—You can monitor database performance with three charts and a grid: CPU Usage, Process Queues, Disk IO in Kb/Sec (for the top 10 devices), and a process list grid that breaks the information down by user. The process list displays the top 20 CPU usage processes, sorted by %CPU as a default. See UNIX Monitor for more information.
  • Unix Job Scheduler—You can schedule jobs to a Unix machine. See Unix Scheduler Overview for more information.
  • Unix Kernel Parameters—You can easily set Unix Kernel parameters to make Toad and Oracle run more efficiently. See Unix Kernel Parameters for more information.
  • Windows Registry Parameters—You can easily set Windows Registry parameters to make Toad and Oracle run more efficiently. See Windows Registry Settings for more information.
  • Service Manager—You can start, stop, and check status of services on local or remote PCs running Windows. See Service Manager for more information.
Expanded Oracle Object Creation and Maintenance

Create, alter, compare, drop, view information about, and managing the following object types is only available with the DB Admin Module:

  • Contexts
  • Dimensions
  • Directories
  • Flashback Archives
  • Libraries
  • Policies
  • Policy Groups
  • Profiles
  • Refresh Groups
  • Resource Consumer Groups
  • Resource Plans
  • Roles
  • Rollback Segments
  • Scheduler Objects (Chains, Jobs, Job Classes, Programs, Schedules, Windows, and Window Groups)
  • System Privileges
  • Tablespaces

Related Topics

Toad and Oracle Enterprise Manager


OEM and Toad

Toad and Oracle Enterprise Manager

Toad for Oracle offers optional features in the DB Admin module (Toad 8.5 and higher) which access the Oracle OEM Diagnostics Pack such as :

  • ADDM/AWR Report Generator – enables snapshot management and shows both AWR and ASH reports
  • AWR Browser – graphical representation of data collected from AWR
  • ASM Manager – enables management of ASM disk groups and clients
  • Segment Advisor – determines space that can be reclaimed

Toad does offer alternate ways to determine performance bottlenecks without the use of ADDM/AWR. These include, but are not limited to: the StatsPack Browser, TK Prof interface, Database Monitor, Session Browser and the Quest SQL Optimizer’s SQL Inspector. However, if you are already licensed to use the OEM Diagnostics Pack and you wish to get additional value from it, you can use the functionality we offer in Toad.

If you are using Oracle database 10g and above, you can use the Oracle Tuning Advisor feature in all Toad editions (8.6 and higher), which accesses both the Oracle OEM Tuning Pack and Diagnostics Pack.

Alternatively, if you have Toad Xpert, Development Suite or DBA Suite Editions you could use the Quest SQL Optimizer, which does not access any of the Oracle OEM Packs at all. In addition, Quest SQL Optimizer offers a unique way to rewrite your SQL code for maximum performance.

Note: It is your (organization's) responsibility to ensure you have the appropriate Oracle OEM license.

However, there are some steps you can take to mitigate possible risks of using functionality you are not licensed to use.

Note: The following techniques are mitigation methods only. Oracle licensing can change at any moment, so it is important to know exactly what your license allows and what you are not licensed to use. All of these methods within Toad are easily reversed, and, in some cases, can be ignored by any user invested in using the features regardless of license issues.

Disabling Access to OEM Functionality in Toad

You can:

  • Customize your toolbar to hide buttons to Toad functionality.
  • Use the Toad Options window to hide entire Toad windows.
  • Use Toad Group Policy Manager to control Toad Use from a centralized location.

Customizing Your Toolbar

You can remove items from the toolbar by opening the customize window and removing the buttons that open the Toad features in question.

To remove items from the toolbar

  1. Right-click over the toolbar and select Customize.
  2. Drag the buttons and menu items you want to remove off of the toolbar and drop them.

Using Toad Options to Hide Windows

You can hide Toad functionality from the Options window. For more details about the Toad Options | Windows screen, see the Toad help file.

To hide Toad windows

  1. From the View | Toad Options window, select Windows in the left hand pane.
  2. In the Windows grid, clear the checkbox in the Available? column for the windows you want to hide.

Using Toad Group Policy Manager

You can also push these settings onto a group by using the Toad Group Policy Manager. See Group Policy Management for more informationabout details for doing this.

To restrict usage from the Group Policy Editor

  1. Install Toad Group Policy Editor and the Toad Group Policy Server as described in appropriate documentation.
  2. Create groups, and then add users to groups.
  3. Create restrictions to be associated with each group.
  4. Publish the policy file and other associated files to the policy server.
  5. Make sure your windows startup is designed to push the toad.pdl file out to users on login.

Related Topics

DB Admin Module


Quick Search Bar

You can find help about Toad quickly from various locations in Quest using the Quick Search bar on the main toolbar. Each resource provides a different focus, such as Oracle technical references, videos, frequently asked questions, and more. See Additional Toad Resources for more information.

To search for Toad resources

  1. Click the drop down arrow and select the locations you want to search.

  2. Enter a search term in the box.
  3. Press Enter or click [image] to search.


Toad Error

Errors

If Toad itself fails, the Error dialog box displays. This type of an error creates a log, saved as toad.elf. This Eureka LogFile (.elf) contains both the application information and the callstack of the error created, and can be very helpful to Quest Support in solving issues you are having with Toad. The elf is displayed when you click as directed. You can copy this file to the clipboard and send it to support. Alternately, it is automatically saved in the Support Bundle, which you can use in various ways to get help. See Create Support Bundles for more information.


RAC Support

Toad supports Oracle's support for RAC systems. If you have multiple database server boxes, Oracle RAC lets you start an Oracle instance on each server, and have all those instances open the same shared database (or shared set of data files). In this way, you can scale the size of your database server by adding more computers as you add users. Multiple computers, one database.

Additional Information for RAC Connections

When you log in to a RAC connection, Toad notes this fact and makes additional information available in some of its windows to help you manage that connection.

Caption

If a RAC connection is in effect, the caption of the Toad Main window will reflect this by showing: TOAD: RAC[n], where n is the session id.

Connection bar

In the connection bar, RAC connections are listed as SCHEMA@RAC[n], where n is the instance number of the connection.

Database Monitor

Within the database monitor, all information is provided as per a single connection. However, it is summarized or aggregated for all the instances that compose the RAC cluster. For example, looking at SGA memory - if each RAC instance is 150 MB, and you have two RAC instances, this column will display 300MB. See Database Monitor for more information.

Oracle Parameters Screen

RAC database single grid view - The Single Grid checkbox above the grid and to the right of the toolbar toggles whether Toad displays a single grid or a multi-grid. Toad sorts first by default on the option and then by the instance name for easier readability.

RAC database multi-grid view - If you choose the multi-grid view, Toad displays a separate tab for each RAC instance.

See Oracle Parameters for more information.


Using Variables

There are many areas within Toad where variables are appropriate and useful. From the Options | Variable window, you can set user variables, and also view a list of system variables that are usable in various areas within Toad.

Variables can be included in filenames from some windows (such as Compare Databases, Compare Schemas, and Generate Schema Script), allowing you to specify date and timestamps for your generated definition files. Doing this means that the definition file can be generated with new timestamps whenever an action based upon its creation is run.

System Variables

System variables are variables that Toad uses that are system-related. These include variables relating to the active session, date, Toad's working directory and session username.

User Variables

You can also create user variables that Toad can use in the same manner. These can be changed from the Toad Options | Variables window, and can include items such as RMAN locations. You can add a variable of your own devising if you need to include something not listed in the system variables on a regular basis.

Related Topics

Define New Variables

Compare Databases

Compare Schemas

Generate Database Script

Generate Schema Script


Task Bar & Status Bar

Task Bar

This feature is activated or deactivated using View | Toad Options | Toolbars/Menus | Show Connect Strings. See Select to display the schema username, the @ symbol, and the database alias in the window caption on the applicable windows. If this field is cleared, Toad displays the schema username. for more information. At the bottom of the main Toad window, Toad displays the various connections currently open.

  • Click one of these connections to activate the last window you used in that connection.
  • Hover over them to display the following information:
    • user
    • connection type (sysDBA, sysOPER)
    • sysdate on server
    • database version
    • your session ID

      • Note: The SID will only display if you have access to V$session and are not logged in as sysDBA or sysOPER.

    • If your SQL windows are maximized, right-click one of these connections and Toad displays a menu of options.

Status Bar

At the bottom of each individual window within Toad is a status bar. This bar provides information about the active window.

  • The first frame in the status bar is the row and column your cursor is located in the results grid. If you have not opened a results grid, or your cursor is not in the grid, this frame will be blank.
  • The second frame is the connection used by the active window.
  • The last frame is the last displayed error.

You can hover over the information in this bar to see additional information. This includes the session ID (SID), sysdate, and Oracle version you are using. The SID is displayed only if you have access to V$Session and are not logged in as SysDBA or SysOper.

Execution time

When you execute a script or a command in the Editor, the first frame changes to a time. The timing is the amount of time from the point that Toad sends the query to Oracle and the first result set returns. It does not describe how long it took to fetch the data.


Knowledge Xpert

You can use Quest Software's Knowledge Xpert as a comprehensive technical resource to find answers to technical questions without the need to search through manuals, books, or internet sites. Just type a keyword to access technical topics, database specific information, and guidance from experts that can help you tune, monitor, and manage your environment more efficiently and develop best practice, high performance database applications.

You can search Knowledge Xpert in the Quick Search bar. See Quick Search Bar for more information.

To use Knowledge Xpert within the Editor

  1. Select a word or command within the code that you would like information about.
  2. Right-click and select Search Knowledge Xpert.


Using SQL Optimizer with Toad

Note: This feature is available only in Toad editions that include the SQL Optimizer.

To launch Quest SQL Optimizer for Oracle

» Select one of the following:
  • Editor - Click [image] on the Editor toolbar.
  • Create/Alter windows for:
    • View
    • Trigger
    • Snapshot
  • SGA Trace/Optimization Window - SQL Tab. See SGA Trace/Optimization for more information.


Benchmark Factory

Note: Benchmark Factory is a standalone product. For full information about using Benchmark Factory, please open Benchmark Factory and see its relevant documentation.

Benchmark Factory is a database performance and code scalability testing tool that simulates users and transactions on the database and replays production workload in non-production environments. This enables developers, DBAs, and QA teams to validate that their databases will scale as user load increases, application changes are made, and platform changes are implemented. Benchmark Factory is available for Oracle, SQL Server, DB2, Sybase, MySQL, and other databases via ODBC connectivity.

You can connect to Benchmark Factory from Toad, set Performance Test Settings and send the test to Benchmark Factory for further analysis.

To open Benchmark Factory

» Select one of the following:
  • Schema Browser pages - Right-click on the object to be tested and select Test Performance.
  • Code Road Map - Right-click on the object to be tested and select Test Performance. See Model Object Relationships (Code Road Map) for more information.

Setting Benchmark Factory Properties

When you choose to send an object to Benchmark Factory, you will need to set Benchmark Factory properties in addition to the parameters required by the database object. For full descriptions of these properties, see the Benchmark Factory documentation.

Option Description

BMF Tests to Perform

Verify Service Level Agreement or Goal

Pass information through from Toad to Benchmark Factory to check Service Level Agreement compliance.

Test for Scalability based upon User Load

Pass information through from Toad to Benchmark Factory to run a scalability test based upon user load.

SLA

These options apply to the Verify Service Level Agreement or Goal option.

Rule to apply

Select the rule to apply to the Service Level Agreement or goal. Options include:

  • Response time - run test until the response time exceeds the specified value.
  • Throughput - run test until the maximum transactions per second is discovered.

Maximum response time (milliseconds)

For response time testing, specify the maximum response time in milliseconds. If you have chosen Throughput, this box will be disabled.

Minimum number of virtual users

Enter the number of virtual users you want to begin the test.

Maximum number of virtual users

Enter the number of virtual users indicating when the test should stop.

Step value for virtual users

Increment the number of users for each subsequent test run.

For example, using:

  • the default value for this parameter of 1
  • minimum users 1
  • maximum users 20

the test will be run 20 times. The first test will use the minimum number of users: 1. The next test will increment the number of users by 1 so the second test will be with 2 users, the next test will use 3 users, and so on until the last test will be with 20 users.

Duration to execute SQL for each userload (seconds)

Specify how long each iteration (execution at the above-specified userload) should take to execute. Enter this number in seconds.

Scalability

These options apply to the Scalability Test based upon User Load.

Number of virtual users to execute the SQL statements

Enter the number of virtual users that will execute the SQL statements.

Execute Each statement

Select one of the following options to specify how to time the scalability test:

  • Number of Times - Enter the number of times each statement should be executed at a specific userload.
  • Duration (in seconds) - Enter the length of time each iteration should take to execute.

Latency Think Time
  • Duration Model - Select the latency model you want to use. The default is Absolute.
  • Duration - Enter the duration of think time in milliseconds. The default is 100.


Quest Code Tester Integration

Note: Quest Code Tester is a standalone product. For full information about using Quest Code Tester, please open Quest Code Tester and see its relevant documentation.

Quest Code Tester for Oracle automates the process of testing PL /SQL programs, making it possible for you to identify bugs and verify program correctness in a fraction of the time it has taken previously. Rather than write (and maintain) thousands of lines of test code, PL /SQL programmers describe the expected behavior of their programs through a graphical interface. Code Tester then generates the required test code, and runs it whenever you request (either through the interface or via command line execution).

If you have a license for the Quest Code Tester and have previously set up your tests, you can launch them from your code in the Toad Editor or from a right-click menu in the Schema Browser.

  • If you are running Code Tester 1.8 or higher, and have saved your passwords, Toad will automatically log in for you and simply open the results window.
  • If you are running Code Tester 1.6 or below, Toad will open the login window and you will need to login before the results are displayed.

To launch Quest Code Tester from the Editor

  1. Open the code you want to test in the Toad Editor.
  2. Click [image].
  3. Click Code Tester to open the full application (Close returns to Toad).

To launch Quest Code Tester from the Schema Browser

  1. Select the code you want to test in the Schema Browser.
  2. Right click in the Source tab and select Code Tester [image].
  3. Click Code Tester to open the full application (Close returns to Toad).


Additional Toad Resources

There are many resources for you to learn more about Toad, and many of them can be searched directly in the Quick Search bar. See Quick Search Bar for more information.

Resource | Description
AskToad.com

Toad for Oracle's wiki for frequently asked questions and troubleshooting.
Knowledge Xpert for Oracle | An extensive Oracle technical resource with thousands of insightful topics and working examples.
Oracle documentation | Oracle's database documentation.Since Toad is a tool to help you manage Oracle databases, the more you understand Oracle the more intuitive Toad becomes.
ToadForOracle.com

The main website for all things Toad for Oracle, including:

  • Forums—Connect with thousands of other Toad users to get help.

    Tip: Customers often use common Toad acronyms in the forums.

  • Documentation—Download the latest product documentation, including the Install Guide, Release Notes, and other documents.
  • Downloads—Download the latest update, beta, or trial version.
  • Idea Pond—Submit ideas to improve Toad and vote on other customer's ideas.
ToadWorld.com

The parent site for all Toad family products, providing videos, tech briefs, white papers, expert blogs, podcasts, user forums, and tech tips.


Use CodeXpert - Tutorial

Use CodeXpert to compare your code to specific rules and standards. CodeXpert analyzes the PL/SQL against a set of rules for best practices. These rules are stored in a ruleset. You can define your own rulesets if desired. (See CodeXpert Tutorials | Creating a Ruleset for more information.)

In this tutorial, we will take a simple procedure and try out some of the features of the CodeXpert. There are many options and settings you can use to customize how CodeXpert analyzes your code. For more information on these, see the CodeXpert section of the help.

Note: If you do not have the Xpert Edition of Toad, ignore the SQL Scanning portions of this tutorial.

  1. Paste the following code into the Editor:

    CREATE OR REPLACE PROCEDURE loopproc (inval NUMBER)

    IS

    tmpvar NUMBER;

    tmpvar2 NUMBER;

    total NUMBER;

    BEGIN

    tmpvar := 0;

    tmpvar2 := 0;

    total := 0;

    FOR lcv IN 1 .. inval

    LOOP

    total := 2 * total + 1 - tmpvar2;

    tmpvar2 := tmpvar;

    tmpvar := total;

    END LOOP;

    DBMS_OUTPUT.put_line ('TOTAL IS: ' | | total);

    END loopproc;

    /

  2. Click [image] in the Editor toolbar to send the content to CodeXpert.
  3. Make sure the [image] toggle is not selected and then click [image] (F9). Toad analyzed the contents of the editor in its entirety. If part of the code is selected, Toad will review only the selected code.

  4. Look at the results. They should display as follows:

  5. Expand the Efficiency Node. Notice that there are three occurrences of the DATA TYPE - 2829 rule. If you expand this node as well, you will see each instance where the rule was violated. The numbers before them correspond to the row and column number of the violation.
  6. Click on one of the occurrences. The Editor scrolls to that instance, highlighting the line of code in question.
  7. Double-click the occurrence and the rule description displays.
  8. Click the Reports tab. At the bottom of the panel are tabs for Rules Summary, Crud Matrix, or Code Metrics for this analysis. Click the Rules Summary tab.
  9. Notice that the Print icon in the CodeXpert toolbar is now active. You can print these reports with the click of a button, or click the Save button and save them to an html file.

Related Topics

Creating a Ruleset Tutorial


tut_Creating a Ruleset

Creating a Ruleset Tutorial

If the provided rulesets do not meet your needs, you can create your own rulesets.

We will create a ruleset from scratch. You can also select an existing ruleset to use as a template.

  1. Open the CodeXpert window. Click Database | Diagnose | CodeXpert.
  2. Click the Configure Ruleset [image] button. The configuration window opens with a ruleset selected.
  3. Click the Rule Sets node to activate it.
  4. Click the New Rule Set [image] button.
  5. Enter Sample Tutorial Ruleset in the Rule Set Title box. This is the title that will display in the rule set navigator.
  6. Toad creates a filename for you based on your title and stores it in the Rulesets folder. You can change this if desired.
  7. The author is automatically filled in from your computer information. If this is not correct, change it now.

  8. Enter any comments about your ruleset. For this test, enter the following:

    This is a sample ruleset to learn functionality.

  9. Click Next.
  10. We will leave the sort order at the default: Severity, then Objective. If you want to view violations of your ruleset in a different way, this drop-down list is where to do it.
  11. Select the rules you want to enforce. In this case, open the WARNING node and select the following rules:
    • VARIABLE - 6411
    • VARIABLE - 6413
    • GOTO - 4002
  12. Click Finished. The ruleset is now listed at the bottom of the navigation panel, with the User-created [image] icon identifying it.

Related Topics

Use CodeXpert - Tutorial

Configuring RuleSets

CodeXpert Overview


Debugging a Procedure or Function

Debugging a Procedure or Function Tutorial

Debugging a procedure or function is the most straightforward debugging procedure. Yet there are several ways to go about it. This tutorial will walk you through some of the most common commands and methods. It is not designed to teach you to code in PL/SQL, but it will show you the basic features of the Toad Debugger.

Enter the code in the Editor

  1. Open a new Editor tab for PL/SQL:

    Right-click in the Editor and select New Tab | PL/SQL.

  2. In the Desktops toolbar, your desktop should be set to PL/SQL. This will enable the tabs at the bottom of the Editor that are debugger-specific.

    3. Enter the following code into the Editor:

    CREATE OR REPLACE PROCEDURE loopproc (inval NUMBER)

    IS

    tmpvar NUMBER;

    tmpvar2 NUMBER;

    total NUMBER;

    BEGIN

    tmpvar := 0;

    tmpvar2 := 0;

    total := 0;

    FOR lcv IN 1 .. inval

    LOOP

    total := 2 * total + 1 - tmpvar2;

    tmpvar2 := tmpvar;

    tmpvar := total;

    END LOOP;

    DBMS_OUTPUT.put_line ('TOTAL IS: ' | | total);

    END loopproc;

    /

  3. From the File menu, select Save As to save this procedure. The tab at the top now displays "Loopproc.prc".

    4. Click the Compile with Debug [image] button into the depressed position to turn on the debug information.

    Note: If the compile buttons or the debug menu options are disabled check one of the following:

    • Double check that you are connected to a database that allows debugging - you must have access to the DBMS_DEBUG Oracle package.
    • Make sure that the Editor window is associated with the appropriate database connection: click the Change Active Connection [image] button and select the correct database if it is not.
  4. Click the Compile button [image]. The code compiles and is now ready to run. The code must be compiled before you can set parameters.

Continue to Add Watches - Debugging Tutorial


Add Watches

Add Watches - Debugging Tutorial

There are several ways to add a Watch. In the following steps you will add three watches, each one by a different method. Later, you can choose the method that works best for you.

  1. You can only watch variables. Click in the second line of code, in the word TMPVAR and click the Add Watch icon [image] on the Debug toolbar above the Editor window (not the watches tab toolbar). The Watches window becomes active at the bottom of the screen, and a watch is added.

  2. Add a watch to TMPVAR2. This time, press <CTRL><F5> to add the watch at the cursor.

    Note: To watch all variables automatically, select the Smart Watches box on the Watch window. This may not be a good option if your procedure has a large number of variables. However, you can drag watches from the Smart Watches panel to the Watch panel and then close Smart Watches. See Smart Watches for more information.

  3. And finally, add a watch to the TOTAL variable. Click in the TOTAL variable, and then from the Debug menu, select Add Watch at Cursor.

Go back to Debugging a Procedure or Function Tutorial

Continue to Set Parameters- Debugging Tutorial

Related Topics

Smart Watches

Watches Window


Set Parameters

Set Parameters- Debugging Tutorial

Some PL/SQL has variable parameters that need to be set before you can run the code. If values for these variables are not set, running the code will result in an Oracle error. In the Loopproc procedure, the INVAL variable needs to be set.

  1. Click [image] button.

    Note: If you have parameters that need to be set, when you choose to RUN the code, the Set Parameters window will display automatically. There are many more parameters included that are not covered in this tutorial. See Set Parameters for more information.

  2. Set parameters displays because there is a user-defined parameter set in the code. In this case, INVAL defines the number of times to run the code. Click in the Value Field for the INVAL variable. NULL is highlighted.
  3. Set the value at ten. Enter 10 in the value field.
  4. Click OK. The value is set and the Set Parameters window closes.
  5. Continue on to Run Code and Display Output - Debugging Tutorial

Go back to Add Watches - Debugging Tutorial

Related Topics

Set Parameters


Run Code and Display Output

Run Code and Display Output - Debugging Tutorial

  1. Click [image]. A confirmation dialog box displays asking if you want to compile the referenced objects with Debug information. Click Yes. If the Set Parameters dialog displays again, click Execute. The code compiles and then runs, but too quickly to see the watches.
  2. Click OK in the termination dialog.

    3. To confirm that the code has run, click the DBMS Output tab in the Desktop tabs area. The window should display the following:

Continue on to Change Watch Properties - Debugging Tutorial

Go back to Set Parameters- Debugging Tutorial


Change Watch Properties

Change Watch Properties - Debugging Tutorial

  1. Change the watch properties for Tmpvar2 to scientific format. Click the Watches tab. In the Watches window, double-click Tmpvar2. The Watch Properties window displays.
  2. In the Format area, click Scientific. Click OK to save your changes and close the window.

Go back to Run Code and Display Output - Debugging Tutorial

Continue on to Disable a Watch - Debugging Tutorial

Related Topics

Watches Window


Disable a Watch

Disable a Watch - Debugging Tutorial

You can disable a watch you do not want to follow. Disable the watch on Tmpvar.

  1. In the Watches window, double-click tmpvar. The Watch Properties dialog box displays.
  2. Click the Enabled checkbox. The checkmark disdisplays.

    3. Click OK. The Watch Properties dialog box closes. Tmpvar is now disabled in the Watch window.

    Note: You can also disable a watch by:

    • Selecting the watch and clicking the disable button.
    • Right-clicking on the watch and selecting Disable Watch.

    To enable a watch you have disabled, simply reverse one of the above methods.

Continue on to Step Through the Code - Debugging Tutorial

Go back to Change Watch Properties - Debugging Tutorial

Related Topics

Watches Window

Setting Watch Properties


Step Through the Code

Step Through the Code - Debugging Tutorial

  1. To actually see the watches you have set, you will need to step through the code line by line. Press SHIFT+F7 several times to step through the code. Notice how the values for the watches change each time you press SHIFT+F7.

  2. The values for the variables you have marked with watches display in the Watches window. However, you may decide you want to check the value for a variable that is not currently being watched.

    Hover the mouse pointer over the INVAL variable. In a moment, a small popup containing the value of the variable displays.

Continue on to Add Breakpoints - Debugging Tutorial

Go back to Disable a Watch - Debugging Tutorial


Add Breakpoints

Add Breakpoints - Debugging Tutorial

The next sections of this tutorial focus on breakpoints. They assume you have completed the Introductory and Watches sections.

Breakpoints cause the execution of your procedure to stop at the specified location. In the breakpoints tab, you will see two different breakpoints column. One is "line" and the other is "Editor line." Line refers to the line within the procedure block you are working with (excluding comments and blank lines from the count), and Editor line refers to the line number within the Editor. This is because you can have more than one procedure open in the same tab at the same time. For this tutorial, however, we only have one procedure open.

  1. In the desktop tabs area, click the Breakpoints tab. This allows you to see the breakpoints you set.
  2. If line numbers are not displayed to the left of your procedure, turn on Display line numbers in gutter as follows:
    1. From the Edit menu, select Editor Options. The Editor Options – PLSQL window displays.
    2. In the left panel, click General Options. In the right panel, double-click Display Options. The list of display options displays.
    3. If the checkbox beside Display line numbers in Gutter is empty, click it to turn the option on.
    4. If the checkbox beside Show Gutter is empty, click it to turn the option on as well. Click OK. Line numbers should now display in the gray gutter beside your procedure.
  3. Add a breakpoint to the line containing: FORLCV IN 1...INVAL. In my Editor, it is line 12. Click in the gutter beside the line. The line of code is highlighted, and a breakpoint [image] icon displays in the gutter. The breakpoint has been applied. The Editor Line and Line columns in the breakpoint window may or may not display the same number, depending on how your code is formatted.
  4. Add a breakpoint to the line containing TOTAL:=2 * TOTAL +1-TMPVAR2. This time, click in the line of code, and then press Shift+F5.
  5. Click [image]. The code stops the line containing the first breakpoint. Click run again, and the code stops at the next breakpoint.

Go back to Step Through the Code - Debugging Tutorial

Continue to Disable Breakpoints - Debugging Tutorial

Related Topics

Breakpoints Window

Editor Options: Display


Disable Breakpoints

Disable Breakpoints - Debugging Tutorial

As with watches, you can temporarily disable breakpoints.

  1. Disable the second Breakpoint. In the Breakpoints window, double-click the breakpoint. The Breakpoint Properties dialog box displays.
  2. Click the Enabled checkbox. The checkmark disdisplays.

    3. Click OK. The Breakpoint Properties dialog box closes. The second breakpoint is now disabled in the Breakpoints window.

    Note: You can also disable a watch by:

    • Selecting the watch and clicking the disable button.
    • Right-clicking on the watch and selecting Disable Watch.

    To enable a watch you have disabled, simply reverse one of the above methods.

  3. You can delete the breakpoint entirely instead of just disabling it. In the Editor, click the Breakpoint [image] icon in the margin by the first.

Continue on to Edit Line Number

Go back to Add Breakpoints - Debugging Tutorial

Related Topics

Breakpoints Right-Click menu

Breakpoints Window


Edit Line Number

Rather than creating a new breakpoint and deleting an old one, you can change the line number for an existing breakpoint.

  1. In the Breakpoints window, double-click the line 12 breakpoint.
  2. Double-click in the Line number box. The line number is highlighted. Change the number to 11. Enable the Breakpoint.
  3. Click OK. The dialog box closes, and the breakpoint moves to line 11.

Continue on to Use Passcount - Debugging Tutorial

Go back to Disable Breakpoints - Debugging Tutorial

Related Topics

Breakpoints Window


Use Passcount

Use Passcount - Debugging Tutorial

You can set a breakpoint to only break after a certain number of iterations through the loop. This can be useful when you are working with extremely long loops of code, because you can set it to stop after, for example, seven passes.

  1. Replace the first breakpoint.
  2. In the Breakpoints window, double-click the breakpoint.
  3. Double-click in the Passcount field. Type 7. Click OK.
  4. Click [image]. The Procedure runs through 6 iterations of the loop and stops just before it reaches line 11 for the 7th time.
  5. Click the Call Stack tab. It should say LOOPPROC(11). This marks the line where you stopped execution.
  6. Click the Watches tab. Your watches are still set, and since execution has not completed, they will have values.
  7. Click the Run icon again. A dialog box displays stating "Execution terminated." This indicates that the Procedure has completed its run. Click OK.

Continue on to Use Conditional Breakpoint - Debugging Tutorial

Go back to Disable Breakpoints - Debugging Tutorial


Use Conditional Breakpoint

Use Conditional Breakpoint - Debugging Tutorial

You can set a condition on a breakpoint, so that the execution will not stop until it meets this condition.

  1. In the Breakpoints window, double-click the breakpoint that is still enabled.
  2. Double-click the Passcount field, and replace the 7 with 0.
  3. In the Condition field, add LCV>=7. Execution will now break at this line when LCV is greater or equal to 7.
  4. Click OK.
  5. Click the Run icon. Execution stops at line 11. Hover the pointer over the variable LCV. The value should be 7.
  6. Click the Run icon again. LCV is now 8, which is greater than 7, so execution has stopped again.
  7. Disable the breakpoint without deleting it. In the Breakpoints window, select the breakpoint, right-click and select Disable breakpoint. The stop sign icon is unavailable.
  8. Click the Run icon to complete execution. When the dialog box displays stating that execution has terminated, click OK.

Continue on to Use Passcount and Conditions together - Debugging Tutorial

Go back to Use Passcount - Debugging Tutorial


Use Passcount and Conditions together

Use Passcount and Conditions together - Debugging Tutorial

You can combine passcounts and conditions on breakpoints. When doing this, remember that the passcount counts the number of times the condition is met, not the number of times the code passes the line number.

  1. Click the Set Parameters button. Change the value for INVAL to 17 and then click OK.
  2. In the Breakpoints window, double-click the breakpoint with the condition added.
  3. Check the enabled box to enable the breakpoint.

    4. Leave the condition on the breakpoint, but add a passcount of 9. Click OK. The Breakpoints properties window closes.

    The breakpoint now has a passcount of nine and a condition of LCV>=7.

  4. Run the code again. Execution stops at pass 9 of 9. When you hover the curser over LCV, notice that it has a value of 15. This is the 9th time that LCV>=7.
  5. Click Run one last time to end the debugging.

Go back to Use Conditional Breakpoint - Debugging Tutorial

Return to Debugging a Procedure or Function Tutorial


Debugging a Package

Debugging a Package - Debugging Tutorial

Debugging a package works in a similar manner to debugging a procedure or function. You are debugging a group of procedures or functions, however, and how they work together, so it is a little different. This tutorial assumes that you are comfortable with watches and breakpoints, and the features described in the Debugging a Procedure or Function Tutorial.

  1. Open a new PL/SQL Editor tab.

    2. Enter the code below into the Editor. This is the package we will use.

    CREATE OR REPLACE PACKAGE trigonometry

    IS

    FUNCTION sine (

    opposite IN NUMBER,

    hypotenuse IN NUMBER,

    MESSAGE OUT VARCHAR2

    )

    RETURN NUMBER;

    FUNCTION cosine (

    adjacent IN NUMBER,

    hypotenuse IN NUMBER,

    MESSAGE OUT VARCHAR2

    )

    RETURN NUMBER;

    FUNCTION tangent (

    opposite IN NUMBER,

    adjacent IN NUMBER,

    MESSAGE OUT VARCHAR2

    )

    RETURN NUMBER;

    numcalls NUMBER := 0;

    END trigonometry;

    /

    CREATE OR REPLACE PACKAGE BODY trigonometry

    AS

    FUNCTION sine (

    opposite IN NUMBER,

    hypotenuse IN NUMBER,

    MESSAGE OUT VARCHAR2

    )

    RETURN NUMBER

    IS

    tmpsine NUMBER;

    BEGIN

    numcalls := numcalls + 1;

    IF (opposite <= 0)

    OR (hypotenuse <= 0)

    OR (opposite IS NULL)

    OR (hypotenuse IS NULL)

    THEN

    MESSAGE := 'Opposite and Hypotenuse must be numbers > 0';

    RETURN NULL;

    ELSE

    /*Calculate the sine*/

    tmpsine := opposite / hypotenuse;

    IF tmpsine BETWEEN -1 AND 1

    THEN

    MESSAGE := 'Success';

    RETURN tmpsine;

    ELSE

    MESSAGE := 'Unreasonable Sine: ' | | tmpsine;

    RETURN NULL;

    END IF;

    END IF;

    END sine;

    FUNCTION cosine (

    adjacent IN NUMBER,

    hypotenuse IN NUMBER,

    MESSAGE OUT VARCHAR2

    )

    RETURN NUMBER

    IS

    tmpcosine NUMBER;

    BEGIN

    numcalls := numcalls + 1;

    IF (adjacent <= 0)

    OR (hypotenuse <= 0)

    OR (adjacent IS NULL)

    OR (hypotenuse IS NULL)

    THEN

    MESSAGE := 'Adjacent and Hypotenuse must be numbers > 0';

    RETURN NULL;

    ELSE

    /*Calculate the Cosine*/

    tmpcosine := adjacent / hypotenuse;

    IF tmpcosine BETWEEN -1 AND 1

    THEN

    MESSAGE := 'Success';

    RETURN tmpcosine;

    ELSE

    MESSAGE := 'Unreasonable Cosine: ' | | tmpcosine;

    RETURN NULL;

    END IF;

    END IF;

    END cosine;

    FUNCTION tangent (

    opposite IN NUMBER,

    adjacent IN NUMBER,

    MESSAGE OUT VARCHAR2

    )

    RETURN NUMBER

    IS

    BEGIN

    numcalls := numcalls + 1;

    IF (adjacent <= 0)

    OR (opposite <= 0)

    OR (adjacent IS NULL)

    OR (opposite IS NULL)

    THEN

    MESSAGE := 'Opposite and Adjacent must be numbers > 0';

    RETURN NULL;

    ELSE

    /*Return the value of the tangent*/

    MESSAGE := 'Success';

    RETURN opposite / adjacent;

    END IF;

    END tangent;

    END trigonometry;

    /

  2. Click [image] on the Edit toolbar. The code is formatted to the default format, and a comment to this effect is added to the beginning.
  3. Compile the package by clicking [image]. The name Trigonometry displays on the tab above the package, and the structure of the package displays in the left panel.
  4. Save the file. Close the file and open it again. Toad will ask you if you want to split the file. Select Yes. Now the package body and the package spec are in separate tabs in the Editor. In addition, the comments at the beginning of the code specify that each tab is a "Toad Chunk" of one file.

Continue to Set Appropriate Options - Debugging Tutorial

Related Topics

Debugging a Procedure or Function Tutorial


Set Appropriate Options

Set Appropriate Options - Debugging Tutorial

Before you debug this example package, you need to set the Debugger Options.

Note: This may not be necessary when debugging your own packages, or you can set the options at different stages in your debugging procedure.

  1. From the View menu, select Toad Options.
  2. In the left panel, select Editor | Debug. The debugging options panel displays in the right panel.
  3. Make sure Step through package initialization is checked. This specifies that when you step through the code it will also step through the initialization. If it is not checked, Toad will run the initialization and only step through the procedure you have chosen to debug. This defaults to off, so it is a good idea to check it before you start debugging.
  4. Click OK to close the Options window.

Continue on to Set Watches and Breakpoints - Debugging Tutorial

Go back to Debugging a Package - Debugging Tutorial


Set Watches and Breakpoints

Set Watches and Breakpoints - Debugging Tutorial

Set any breakpoints or watches.

  1. In the body tab, set a breakpoint at Line 25 (tmpsine := opposite / hypotenuse;).
  2. Set a watch on the variable Numcalls in line 14. This is a package variable. In order to watch it, you will have to change the properties.
  3. In the Watches window, double-click the watch on Numcalls.

    4. Click in the Package Variable checkbox. Notice that the OK button is now disabled. You must choose a package to activate this option.

    Note: This may not be available if you are connecting on a RAC. See Debugging on a RAC for more information.

  4. The Owner name is automatically filled in with the current schema owner. Change it using the drop-down menu if necessary. For now, it should be correct. From the drop-down Package menu, select Trigonometry and then click OK. This creates a watch on a package variable.
  5. Add a watch on the variable tmpSine on line 25.

Continue on to Select Procedure or Function to Run - Debugging Tutorial

Go back to Set Appropriate Options - Debugging Tutorial


Select Procedure or Function to Run

Select Procedure or Function to Run - Debugging Tutorial

When debugging a package, you can only debug one procedure or function at a time. The package will run through its initialization process (or step through it if that option is checked in the Options window).

  1. Click within the SINE function.
  2. Click [image] on the toolbar. The Set Parameters window displays.
  3. In the left pane, click Sine. This selects this procedure. Notice how the arguments in the right pane change.
  4. Click in the value field for opposite. Enter 15.
  5. Click in the value field for hypotenuse. Enter 20.
  6. Click OK. The Set Parameters window closes.

Continue on to Step through Package - Debugging Tutorial

Go back to Set Watches and Breakpoints


Step through Package

Step through Package - Debugging Tutorial

  1. Press SHIFT+F7. If the parameters window opens, set variables for the other procedures as desired, or leave them NULL, and then click OK. Toad steps into the Package initialization, opening it in another tab. The watch for the Numcalls shows as NULL.
  2. Press SHIFT+F7 again. Toad moves into the SINE procedure. The watch for Numcalls is now 0.
  3. Press SHIFT+F7 again. The Numcalls watch moves up to 1, and Toad steps to line 14.
  4. Click [image] (Run). Toad stops at the breakpoint at line 22.
  5. Click Run again. Toad completes running the SINE procedure, and notifies you that execution has terminated. All watches are returned to "process not accessible".

In order to debug the other procedures in the package, set watches and variables as desired and select the appropriate procedure from the left pane in the Parameters window. Then repeat the stepping through the code and making changes until you are satisfied.

Go back to Select Procedure or Function to Run - Debugging Tutorial

Return to the beginning of the tutorial Debugging a Package - Debugging Tutorial


Debugging an INSERT Trigger

Debugging an INSERT Trigger - Debugging Tutorial

Debugging a trigger works in a similar manner to debugging procedures, functions and packages. As with debugging packages, most of the changes occur when you are setting trigger parameters. This tutorial assumes that you are comfortable with watches and breakpoints, and the features described in the Debugging a Procedure or Function Tutorial.

  1. Triggers always need a table to act upon. For this exercise, create a table called TESTTAB. Include the following columns:
    • ID - VARCHAR2(3)
    • FIRST_NAME - VARCHAR2(10)
    • LAST_NAME - VARCHAR2(30)
  2. Open a new PL/SQL Editor tab.
  3. Enter the code below into the Editor. This is the trigger we will use. It simply assigns and declares a variable when you perform an INSERT on the TESTTAB table.

    4. CREATE OR REPLACE TRIGGER testtrig

    BEFORE INSERT ON TESTTAB

    DECLARE

    tmpVar NUMBER;

    BEGIN

    tmpVar := 0;

    EXCEPTION

    WHEN OTHERS THEN

    NULL;

    END testtrig;

    /

  4. Make sure the Compile with Debug [image] button is selected. Click the Compile [image] button to compile the trigger.
  5. Continue on to Set Watches and Breakpoints - Debugging Tutorial


Set INSERT Trigger Parameters

Set INSERT Trigger Parameters - Debugging Tutorial

Now that you have a trigger in the Editor, you can set parameters for the variables and begin the debugging procedure.

Note: Usually, when debugging, you are not going to want to change the data in your database. However, you must act on that data in order to step through a trigger: the trigger must be activated to debug it. In order to prevent data from changing, you may want to change the commit options in View | Toad Options | Debugger | Transaction Control to Rollback or Prompt to keep from altering data. For this tutorial, go ahead and commit the data, as it will be used in the DELETE and UPDATE tutorials later.

  1. Press SHIFT+CTRL+F9 or the parameters [image] button on the toolbar.
  2. If a dialog asking you to compile with debug information displays, click OK.

  3. In the Set Parameters window, Column Values grid, modify the anonymous block so that the trigger will fire. In this case, we are adding values that will be inserted into the table. Notice how as you add these values, the anonymous block in the Code area of the dialog changes.

    Column Name

    Value

    ID

    13b

    FIRST_NAME

    JOE

    LAST_NAME

    SMITH

    Entering a value in the WHERE clause for an INSERT trigger will produce no results, so don't make any changes to that column.

  4. Click OK.

Continue on to Set INSERT Trigger Watches - Debugging Tutorial

Go back to Debugging an INSERT Trigger - Debugging Tutorial


Set INSERT Trigger Watches

Set INSERT Trigger Watches - Debugging Tutorial

Set any watches or breakpoints you want to use for debugging. In this case, we are going to set a watch on the variable TMPVAR.

  1. Click in line 4 (tmpVar NUMBER).
  2. Click [image] on the toolbar. The watch is displayed in the Watch window.

Continue on to Step through the INSERT trigger - Debugging Tutorial

Go back to Set INSERT Trigger Parameters - Debugging Tutorial


Step through the INSERT trigger

Step through the INSERT trigger - Debugging Tutorial

At this point you can proceed with debugging.

  • Press SHIFT+F7 to step through the code. Note how the TMPVAL watch changes values when you reach line 7.

Go back to Set INSERT Trigger Watches - Debugging Tutorial

Return to Debugging an INSERT Trigger - Debugging Tutorial


Debugging an UPDATE Trigger

Debugging an UPDATE Trigger - Debugging Tutorial

For this tutorial, we assume you have already gone through the INSERT tutorial. The UPDATE trigger we will be using acts upon the same TESTTAB table, and looks for the data you inserted in the INSERT Tutorial.

The steps for debugging an UPDATE trigger are the same as for an INSERT trigger, but triggering requires different parameters to be included.

  1. Triggers always need a table to act upon. For this exercise, we will be using the table we created in the Debugging an INSERT Trigger - Debugging Tutorial, and the data we inserted into it.
  2. Open a new PL/SQL Editor tab.

    3. Enter the code below into the Editor. This is the trigger we will use. It simply assigns and declares a variable when you perform an DELETE on the TESTTAB table.

    CREATE OR REPLACE TRIGGER testtrig

    BEFORE UPDATE ON TESTTAB

    DECLARE

    tmpVar NUMBER;

    BEGIN

    tmpVar := 7;

    EXCEPTION

    WHEN OTHERS THEN

    NULL;

    END testtrig;

    /

  3. Make sure the Compile with Debug [image] button is selected. Click the Compile [image] button to compile the trigger.

Continue on to Set UPDATE Trigger Parameters - Debugging Tutorial

Related Topics

Debugging an INSERT Trigger - Debugging Tutorial


Set UPDATE Trigger Parameters

Set UPDATE Trigger Parameters - Debugging Tutorial

Now that you have a trigger in the Editor, you can set parameters for the variables and begin the debugging procedure.

Note: Usually, when debugging, you are not going to want to change the data in your database. However, you must act on that data in order to step through a trigger: the trigger must be activated to debug it. In order to prevent data from changing, you may want to change the commit options in View | Toad Options | Debugger | Transaction Control to Rollback or Prompt to keep from altering data. For this tutorial, go ahead and commit the data, as it will be used in the DELETE and UPDATE tutorials later.

  1. Click [image] on the toolbar(SHIFT+CTRL+F9).
  2. If a dialog asking you to compile with debug information displays, click OK.
  3. In the Set Parameters window, Column Values grid, modify the anonymous block so that the trigger will fire. In this case, we are adding values that will be changedin the table. As such, we need to specify both an identifier (a WHERE clause) to find the record we want to change, and the value in the column we want to change. We will change "JOE SMITH" to "FRED SMITH".
Name | Value | WHERE Value
ID | NULL | 13b
FIRST_NAME | FRED | NULL
LAST_NAME | NULL | NULL

Continue on to Set UPDATE Trigger Watches - Debugging Tutorial

Go back to Debugging an UPDATE Trigger - Debugging Tutorial

Related Topics

Debugger Options


Set UPDATE Trigger Watches

Set UPDATE Trigger Watches - Debugging Tutorial

Set any watches or breakpoints you want to use for debugging. In this case, we are going to set a watch on the variable TMPVAR.

  1. Click in line 4 (tmpVar NUMBER).
  2. Click the Watch [image] button on the toolbar. The watch is displayed in the Watch window.

Continue on to Step through the UPDATE Trigger - Debugging Tutorial

Go back to Set UPDATE Trigger Parameters - Debugging Tutorial


Step through the UPDATE Trigger

Step through the UPDATE Trigger - Debugging Tutorial

At this point you can proceed with debugging.

  • Press SHIFT+F7 to step through the code. Note how the TMPVAL watch changes values when you reach line 7.

Go back to Set UPDATE Trigger Watches - Debugging Tutorial

Return to Debugging an UPDATE Trigger - Debugging Tutorial


Debugging a DELETE Trigger

Debugging a DELETE Trigger - Debugging Tutorial

For this tutorial, we assume you have already gone through the INSERT tutorial. The DELETE trigger we will be using acts upon the same TESTTAB table. The steps for debugging a DELETE trigger are the same as for an INSERT trigger, but triggering requires different parameters to be included.

  1. Triggers always need a table to act upon. For this exercise, we will be using the table we created in the Debugging an INSERT Trigger - Debugging Tutorial, and the data we inserted into it.
  2. Open a new PL/SQL Editor tab.

  3. Enter the code below into the Editor. This is the trigger we will use. It assigns and declares a variable when you perform an DELETE on the TESTTAB table.

    CREATE OR REPLACE TRIGGER testtrig

    BEFORE INSERT ON TESTTAB

    DECLARE

    tmpVar NUMBER;

    BEGIN

    tmpVar := 0;

    EXCEPTION

    WHEN OTHERS THEN

    NULL;

    END testtrig;

    /

  4. Make sure the Compile with Debug [image] button is selected. Click the Compile [image] button to compile the trigger.

Continue on to Set DELETE Trigger Parameters - Debugging Tutorial

Related Topics

Debugging an INSERT Trigger - Debugging Tutorial

Set DELETE Trigger Parameters - Debugging Tutorial


Set DELETE Trigger Parameters

Set DELETE Trigger Parameters - Debugging Tutorial

Now that you have a trigger in the Editor, you can set parameters for the variables and begin the debugging procedure.

Note: Usually, when debugging, you are not going to want to change the data in your database. However, you must act on that data in order to step through a trigger: the trigger must be activated to debug it. In order to prevent data from changing, you may want to change the commit options in View | Toad Options | Debugger | Transaction Control to Rollback or Prompt to keep from altering data.

  1. Click [image] on the toolbar SHIFT+CTRL+F9).
  2. If a dialog asking you to compile with debug information displays, click OK.
  3. In the Set Parameters window, Column Values grid, modify the anonymous block so that the trigger will fire. In this case, we are going to delete rows of the table that have an employee last name of SMITH. The value sections of the grid are irrelevant to the trigger, so we need to modify the WHERE values:
Column Name | WHERE Value
ID | NULL
FIRST_NAME | NULL
LAST_NAME | SMITH

Continue on to Set DELETE Trigger Watches - Debugging Tutorial

Go back to Debugging a DELETE Trigger - Debugging Tutorial

Related Topics

Debugger Options


Set DELETE Trigger Watches

Set DELETE Trigger Watches - Debugging Tutorial

Set any watches or breakpoints you want to use for debugging. In this case, we are going to set a watch on the variable TMPVAR.

  1. Click in line 4 (tmpVar NUMBER).
  2. Click the Watch [image] button on the toolbar. The watch is displayed in the Watch window.

Continue on to Step through the DELETE Trigger - Debugging Tutorial

Go back to Set DELETE Trigger Parameters - Debugging Tutorial

Related Topics

Watches Window


Step through the DELETE Trigger

Step through the DELETE Trigger - Debugging Tutorial

At this point you can proceed with debugging.

  • Press SHIFT+F7 to step through the code. Note how the TMPVAL watch changes values when you reach line 7.

Go back to Set DELETE Trigger Watches - Debugging Tutorial

Return to Debugging a DELETE Trigger - Debugging Tutorial


SQLLoader Tutorials

Learning to use the SQL*Loader functionality is something best done by trying it out. These tutorials for using the SQL*Loader are designed to let you do just that in a small steps.

Basic SQL*Loader Tutorial

Start by creating an Input file, and then move on to telling Toad how to load your data and execute the import. See Create Input File - Basic SQL*Loader Tutorial for more information.

Intermediate Tutorials

Move on to some of the more advanced features:

  • Load Logical Records into Multiple Tables - Intermediate SQL*Loader Tutorial
  • Conditional Loads into Partitions - Intermediate SQL*Loader Tutorial
  • Load from Several Files of Different Formats - Intermediate SQL*Loader Tutorial

Advanced Tutorial

Learn about more of the Advanced Features of the SQL*Loader interface. See Advanced Features - SQL*Loader Tutorial for more information.


Create Input File

Create Input File - Basic SQL*Loader Tutorial

For this tutorial we will need to create an file containing the data we'll insert into a table, and the table where it will be inserted.

  1. Create and populate a sample table. Copy and paste the following script into Toad's Editor:

    create);number Rank ),30(varchar2 Name( MarksFavoriteFoods table

    insert);1 ,'Tuna'(values MarksFavoriteFoods into

    insert);2 ,'Salmon'(values MarksFavoriteFoods into

    insert);3 ,'Broccoli'(values MarksFavoriteFoods into

    insert);4 ,'Asparagus'(values MarksFavoriteFoods into

    insert);5 ,'Bell peppers'(values MarksFavoriteFoods into

    insert);6 ,'Chicken'(values MarksFavoriteFoods into

    insert);7 ,'Yogurt'(values MarksFavoriteFoods into

    insert);8 ,'Brown rice'(values MarksFavoriteFoods into

    insert);9 ,'Carrots'(values MarksFavoriteFoods into

    insert);10 ,'Lean ground beef'(values MarksFavoriteFoods into

  2. Execute the script.
  3. Save the new table as an ASCII file.
  4. Open the Schema Browser. Click the Tables tab and then MARKSFAVORITEFOODS.
  5. In the right panel, select the Data tab.
  6. Right-click, select Save As, choose Delimited Text, enter a filename in the Output area, and set Comma as the delimiter.
  7. Click OK. You have now created the data, or input, file.

    8. Empty the table by running this small script in the Editor:

    delete from MarksFavoriteFoods;

    commit;

    You can verify in Schema Browser that it is empty.

    From the Start menu, open the Notepad application and load the data file you just created. You are going to edit the first line to intentionally create "bad" data.

    Here is how the first three lines from the data file display:

    Name,Rank

    Tuna,1

    Salmon,2

  8. Remove the first line from the file.
  9. In the second line, replace the comma with a tab. The first line should now display as follows:

    10. Tuna 1

  10. Save the file and close Notepad.

Related Topics

Go on to Add Input File - Basic SQL*Loader Tutorial

SQL*Loader Wizard Overview


Add Input File

Add Input File - Basic SQL*Loader Tutorial

You must add an input file. The input file is the actual data file that is loaded using the SQL*Loader Wizard.

To add an input file

  1. From the Database menu, select Import | SQL*Loader Wizard. The first window lets you select, "What would you like to do?" Select Build Control File. ;Leave the Specify Fields box selected and then click Next.
  2. The second window is where you enter the list of the data files you want to load into one or more tables. At least one input file is required. Click Add to add a file.
  3. In the Add input file dialog, click the drilldown button next to Input filename and choose the data file. In this case, choose the MarksData.txt file that you created in the previous step. The following filenames will be created based on the input file name you enter:
    • Bad file name – This file will contain rejected records. By default, it gets named the same as the input file, with a .BAD extension. In our example, this file should contain our bad Tuna record because it does not conform to the parameters you will specify.
    • Discard file name – The discard file contains records that were not inserted during the load because they did not match any of the selection criteria. You will see in a later example that you can actually tell SQL*Loader WHEN you want a record inserted – it must match criteria you specify.

      • Note: When the pointer passes over each field in the Add Input dialog box, "MicroHelp" is displayed in the status bar.

  4. Records can be in one of three formats:
    • Stream - This is the default format. Lines are read until an end-of-record marker is found (end of line character, by default).

      • Streamrecord format, end-of-line character – default: Tuna,1

      Fixed -- each record must be a fixed number of bytes in length.

      Fixed record format - all data records must be same length

      Variable -- each record may be a different length, as specified by a special field – the first field in each record. The user must specify the length of this field.

      Variable record format, specifier field is 3 bytes long: 006Tuna,1

      Stream is chosen by default. Leave the end of record string box empty, taking the end of line character as the default.

  5. The Discard field indicates the maximum number of records to put into the discard file. Leave this empty also, indicating that you want all discarded records.

    6. Click OK.

    At this point you could choose as many different input files as you want – as long as they all had the same record layout (i.e. they all contained the same fields, in the same order). However, as you will see in a later example, they can have different formats.

  6. Click Next. The wizard moves to Set Delimiters.

Related Topics

Go back to Create Input File - Basic SQL*Loader Tutorial

Go on to SQL*Loader Tutorial Set Delimiters for Field Mapping - Basic SQL*Loader Tutorial

SQL*Loader Wizard Overview


SQL*Loader Tutorial Set Delimiters

SQL*Loader Tutorial Set Delimiters for Field Mapping - Basic SQL*Loader Tutorial

The third window of the SQL*Loader Wizard lets you set the delimiter for the data file.

Note: If you have cleared the Specify Fields box on the Add Input File page, this window will not display.

  1. Select String and enter a comma as the delimiter (this is the default).

  2. The grid below lists the data and separates it by the selected delimiter. You can change the number of lines displayed in this grid.

    In places where the comma was replaced with a tab, the data does not fit the selection.

  3. Click Next.

Related Topics

Go back to Add Input File - Basic SQL*Loader Tutorial

Go on to Choose Destination Table - Basic SQL*Loader Tutorial

SQL*Loader Wizard Overview


Choose Destination Table

Choose Destination Table - Basic SQL*Loader Tutorial

The fourth window of the SQL*Loader Wizard lets you choose your destination tables. If you have selected Specify Fields on the first screen, you can also map fields to columns. These settings are displayed in the upper and lower grids in this window.

  1. In the upper area, add a destination table. Click Add.

  2. Select MarksFavoriteFoods from the table list, and leave the other settings as defaults. Click OK.
  3. Skip the Columns area for now, and in the Field Mapping area, click the Auto Map button. The field numbers are mapped to the columns from the tables.

    4. Click the Preview tab to see how the data maps to the columns. Notice that the error we included when creating the input file is reflected in the preview data. You may have to scroll to the top of the data to see this.

  4. Click Next to move to the Global options window and set parameters.

Related Topics

Go back to SQL*Loader Tutorial Set Delimiters for Field Mapping - Basic SQL*Loader Tutorial

Go on to Set Parameters - Basic SQL*Loader Tutorial

SQL*Loader Wizard Overview


SQL_Loader_Set Parameters

Set Parameters - Basic SQL*Loader Tutorial

The next window of the Wizard lets you Specify global options and default values.

For this tutorial, you are going to use the defaults.

» Click Next to specify control file and log file names.

Control File

At the bottom of all of the previous windows (and this one) is a preview of your control file.

It should display similar to the following (the paths to the various files will reflect where you saved the original input file:

LOAD DATA

INFILE 'C:\marksdata.txt'

BADFILE 'C:\marksdata.bad'

DISCARDFILE 'C:\marksdata.dsc'

INTO TABLE "MARKSFAVORITEFOODS"

FIELDS TERMINATED BY ','

(NAME,

RANK)

Related Topics

Go back to Choose Destination Table - Basic SQL*Loader Tutorial

Go on to SQL*Loader Specify Control and Log Files - Basic SQL*Loader Tutorial


SQL*Loader Specify Control and Log Files

SQL*Loader Specify Control and Log Files - Basic SQL*Loader Tutorial

This window lets you enter a name for a control file.

  1. Enter a name that you want to use as a control file in the Control file name box. We used c:\confile.ctl; you can name it whatever you want. Press <Tab>.
  2. The control file name is entered into the log file box with the extension .log. If you want to use a different name for your log file, you can change this now.
  3. Click Save Settings. Save these settings as MarksFood. You can now Load them at any time.
  4. Click Next to go to the next step and execute SQL*Loader.

Related Topics

Go back to Set Parameters - Basic SQL*Loader Tutorial

Go on to Execute SQL*Loader - Basic SQL*Loader Tutorial

SQL*Loader Wizard Overview


Execute SQL*Loader

Execute SQL*Loader - Basic SQL*Loader Tutorial

  1. The last window of the wizard lets you choose how to execute your load. Select Execute Now. Be sure the Watch progress option is selected.

    2. Click Finish. The SQL*Loader Watch dialog box displays as follows:

    The first tab is the output tab, and provides the standard output from running the loader. If any errors occurred when running the loader itself, they would be displayed here.

    • The first thing listed on the Output tab is some information about SQL*Loader itself – its version and the date and time it was executed.
    • The last line indicates that 10 rows were inserted into the table. You can verify this with the Schema Browser.
  2. Click the Log tab.

    3. The log tab contains the text of the log file and presents detailed information about what occurred. The log file contents are loaded into this tab after the SQL*Loader is finished running.

    The log file contains a lot of data about what happened as the data was loaded. Scroll down in the window to see that one record was rejected and why.

    From your Windows Start menu, open Windows Explorer. You will see that the file named "MarksDiet.bad" was created in the same directory as your data file. Open it. It contains one row:

    Tuna 1

    This row did not match the criteria you specified for the load: that each record should be comma delimited.

Related Topics

SQL*Loader Wizard Overview

Create Input File - Basic SQL*Loader Tutorial


Execute SQL*Loader on a Populated table

Execute SQL*Loader on a Populated table - Basic SQL*Loader Tutorial

Executing the SQL*Loader when the table is populated will generate errors, unless you choose a "load method" of Replace, Append, or Truncate in the global options screen of the wizard. To see this in action, do the following procedure after you have run the SQL*Loader tutorial:

To Load data into a Populated Table

  1. Close the SQL Loader Watch window.
  2. From the Database menu, select Import | SQL*Loader Wizard. In the first window, click Load Settings.
  3. Open MarksFood from the drop-down menu. Click OK. The wizard moves to the final stage.

    4. Select Execute Now and click Finish. The watch window reopens, containing the line:

    SQL*Loader-601: For INSERT option, table must be empty. Error on table "MARKSFAVORITEFOODS"

    Unless otherwise specified, the SQL*Loader performs the load in INSERT mode and does not load data into a table that already contains rows.

  4. You can solve this problem by changing the load method. Return to the SQL*Loader window and open MarksFood as described above, but this time uncheck Proceed to Finish after loading.
  5. Click Next three times to get to the Destination table and columns screen. The load method field of the grid is blank, indicating the default of INSERT.
  6. Select the Load Method cell, click the drop-down arrow and select Append from the drop-down list.
  7. Click Next | Next | Next, Execute Now and Finish.
  8. You can read the Messages and Log file (or simply look in Schema Browser) to see that all 9 records (remember that 1 is still bad) were successfully appended into the table.

Related Topics

Go back to Execute SQL*Loader - Basic SQL*Loader Tutorial

SQL*Loader Wizard Overview


Load Logical Records into Multiple Tables

Load Logical Records into Multiple Tables - Intermediate SQL*Loader Tutorial

This tutorial will demonstrate how you can load data from one data file into multiple tables by using logical records. What is different about this data is that each line of the data file corresponds to more than one physical record (row of a table). There are two logical records in each line.

  1. Create an input file identical to the one described in Create Input File. See Create Input File - Basic SQL*Loader Tutorial for more information.
  2. Create another table identical to the MarksFavoriteFoods table. Name it TESTTHIS. Make sure both tables are empty.

  3. Edit the input file to make it look like this:

    It is important that the data be lined up exactly. Use spaces – no tabs. The first column of numbers should line up as the 14th character. The second column of foods should line up at the 18th character. The second column of numbers should be located at the 35th character.

  4. Open the SQL*Loader Wizard, and then select Build control file. Uncheck the Specify Files box. Click Next.
  5. Add the new data file as your input file. Click Next.
  6. From the Destination Tables grid, add both the MarksFavoriteFoods, and TestThis tables. Clear the Terminated by field.
  7. Select MARKSFAVORITEFOODS in the tables grid.

    8. In the Columns grid, in the From/To column fields, Name row, enter 1 and 12 respectively.

    Note: This tells the table to read the first 12 columns in our data file to extract the Name field.

  8. In the Rank row, enter 14 and 14 for the From/To. That is where the Rank data resides in our input file for that field.
  9. You can also select the column positions graphically. Select TESTTHIS in the tables grid and select its Name column.
  10. Click Edit and then click the Position tab.

  11. Click in front of the S in Salmon, and then after the f in beef. If you click in the wrong location, you can also drag the marker. Click OK.

    The From/To columns now contain the numbers 18 and 33.

  12. Finally, select the last Rank column, click Edit and then Position, and set the column boundaries around the rank in the second set of data.
  13. Click Next twice.
  14. Click [image] and select a control file from the Open dialog box, or enter a new name for your control file. Click OK.
  15. Click Next.
  16. Select Execute Now and Watch Progress and then click Finish. If you open the Schema Browser and check the tables, you will see that the foods ranked 1, 3, 5, 7 and 9 went into the first table, while those ranked 2, 4, 6, 8 and 10 went into the second table.

Related Topics

Go on to Conditional Loads into Partitions - Intermediate SQL*Loader Tutorial

SQL*Loader Wizard Overview


Conditional Loads into Partitions

Conditional Loads into Partitions - Intermediate SQL*Loader Tutorial

This tutorial demonstrates loading into a partition with conditions.

Note: At this time when you select a table the subpartitions field does not get populated with the available subpartitions (as the partitions field does with the tables’ partitions); you must enter the name directly.

  1. Drop and recreate your first table with range partitions. Run the following code:

    DROP TABLE MARKSFAVORITEFOODS;

    CREATE (MARKSFAVORITEFOODS TABLE

    NAME ).30(VARCHAR2

    RANK )NUMBER

    PARTITION)RANK(RANGE BY

    (PARTITION).5(LESS THAN VALUES FoodRank1

    PARTITION(MAXVALUE)); LESS THAN VALUES FoodRank2

    If you were to re-run the first tutorial on this table, foods with a ranking up through and including four would go into the partition named FoodRank1, and all the rest would go into the partition named FoodRank2. Try it, and verify the contents through the following SQL:

    SELECT * from MarksFavoriteFoods partition (FoodRank1)

    SELECT * from MarksFavoriteFoods partition (FoodRank2)

    For this example, however, you will attempt to load all our data into partition FoodRank1. If you ran the first tutorial again to try out the Note above, empty the table now.

  2. Open the SQL*Loader wizard.
  3. Select Build control file. Leave the Specify Fields box checked and click Next.
  4. Select the original, comma delimited file from the beginning of example 1 and add it to the input file list. Click Next.
  5. Click the Add button in the tables area. Select MarksFavoriteFoods from the Table drop-down.
  6. Check the Partition box. Click the drop down partition list and you will see the two partitions listed that you created. Choose FOODRANK1.

    7. Make sure that the Terminated by box contains a comma (,).

    Note: If the data were tab delimited, you would choose TAB from the drop-down.

    On the lower right side of the add table window is the Load Rec Condition When area. This means "load the record into the table when the following conditions are present". In this field, enter the following:

    RANK != "1"

    This says that you only want records whose RANK field is not equal to the character "1".

    Note: All character data is interpreted automatically by Oracle. If you wanted to enforce certain data types for special conditions you could do so under the Column Parameters data type field.

  7. Click OK and then click Next.
  8. Leave global options and defaults blank. Click Next.
  9. Enter a control file name to create. Click Next.
  10. Select Execute Now and Watch progress and then click Finish. The status window opens.

    11. Click the Log File tab. Scroll down and you should come to these lines:

    Record 1: Discarded - failed all WHEN clauses.

    Record 5: Rejected - Error on table "MARKSFAVORITEFOODS", partition FOODRANK1.

    ORA-14401: inserted partition key is outside specified partition

    [and so on for the rest of the records]

    This says that the first record failed the WHEN clause. It certainly did – it had a rank of 1 and we told Toad not to load any records with that rank. The rest of the rejection lines state that the inserted partition key is outside the partition bounds. This is because records with a rank of 5 and above exceed the partition bounds you chose for FOODRANK1. Look in Schema Browser and you should find the foods ranked 2 through 4 in the data.

Go back to Load Logical Records into Multiple Tables - Intermediate SQL*Loader Tutorial

Go on to Load from Several Files of Different Formats - Intermediate SQL*Loader Tutorial

Related Topics

SQL*Loader Wizard Overview


Load from Several Files of Different Formats

Load from Several Files of Different Formats - Intermediate SQL*Loader Tutorial

This example will use three different data files and demonstrate the three supported format types: stream, fixed and variable.

  1. Use the MarksData.txt data file from the previous tutorial. Use Notepad (this is important) as an editor.
  2. Split the original file, creating three files, MarksDiet1.dat, MarksDiet2.dat and MarksDiet3.dat.

  3. Edit the first file (MarksDiet1.dat). It should look as follows:

    Tuna,1*Salmon,2*Broccoli,3*

    Note: There are no extra spaces or new line characters at the end of that line. This sample demonstrates using an asterisk as an end of record marker. Up until now, you have been using the carriage return/new line character combo to designate physical records.

  4. Edit MarksDiet2.dat as follows:

    Asparagus, 4,Bell peppers,5,Chicken, 6,

    Once again, use no spaces or new line characters at the end of the line. This is going to be our fixed record length file. Each record is fixed at precisely 15 characters.

  5. The third file should be named MarksDiet3.dat and look like this:

    0009Yogurt,7,0015Brown rice,8,

    0010Carrots,9,0019Lean ground beef,10

    Note: On SQL*Loader versions prior to 8 (7.3, for example), a space is required after the record length field

    This is the variable format file. At the beginning of each record is a field that designates how long that record is. Notice Brown Rice on the first line. You may count 13 characters. But Notepad also adds two more characters – a carriage return/line feed pair, so they have to be added into the total.

    Note: Other editors may only add one line feed character.

    Once again, make sure there are no extra spaces or carriage returns at the end of the second line.

  6. Open the SQL*Loader Wizard and select Build control file. Uncheck the Specify Files checkbox. Click Next.

  7. Add files as follows:

    File | Parameters
    MarksDiet1.dat | Select Stream format, and enter an asterisk into the end of record string field.
    MarksDiet2.dat | Select Fixed format, with a length of 15.
    MarksDiet3.dat | Select Variable format, with a length of 4 bytes long (enter a 4 in the length field).

    After adding these, your Source Files tab should look like:

  8. Click Next. Select the same Destination table.

    Note: Remember that the table must be empty before you attempt to Execute the command. If your table is not empty, save the settings, empty it and load the settings back into the wizard.

  9. Click Next. Leave the global options blank.
  10. Click Next. Add a control file.

  11. Click Next. Select Execute Now and click Finish.

    If your table is still partitioned, as mine was, you can use these lines to see the data in each one:

    select * from MarksFavoriteFoods partition (FoodRank1)

    select * from MarksFavoriteFoods partition (FoodRank2)


Advanced Features

Advanced Features - SQL*Loader Tutorial

This final tutorial will demonstrate specifying input data delimiters at the column level, capturing constraint errors and some of the command line options available.

    For this example, you are going to create a foreign key to a table containing all of our food ranks.

  2. In the Editor, execute the following as script:

    3. CREATE TABLE FOODRANK (RANK NUMBER PRIMARY KEY);

    DECLARE

    I INTEGER;

    BEGIN

    I := 1;

    LOOP

    INSERT INTO FOODRANK

    VALUES (I);

    I := I + 1;

    IF I > 10

    THEN

    EXIT;

    END IF;

    END LOOP;

    END;

    /

    CREATE TABLE MARKSFAVORITEFOODS (NAME VARCHAR2 (20), RANK NUMBER);

    CREATE TABLE LOADEREXCEPTIONS (ROW_ID UROWID,

    OWNER VARCHAR2 (30),

    TABLE_NAME VARCHAR2 (30),

    CONSTRAINT VARCHAR2 (30));

    ALTER TABLE MARKSFAVORITEFOODS ADD CONSTRAINT CHECK_RANK FOREIGN KEY (RANK) REFERENCES FOODRANK(RANK)

    EXCEPTIONS INTO LOADEREXCEPTIONS;

  3. Create the input data file as follows. Be very careful about copying and pasting into an editor. Make sure you don’t get an empty line at the end.

    4. "Grease^#1

    "Tuna^#1

    "Salmon^#02

    "Broccoli^#3

    "Asparagus^#4

    "Bell peppers^#5

    "Chicken^#6

    "Yogurt^7

    "Brown rice^#8

    "Carrots^#9

    Lean ground beef#10

    "Egg whites^#11

    "Congealed Fat^#99

    Look at this input file briefly. It is clear that the first field, Food Name, has a double-quote as its first delimiter. Its closing delimiter is a caret. And its ending field specifier is a # character. The Rank field is not delimited. Or is it? Copy and paste that data into an editor and again, make sure there are no hidden characters anywhere. (Incidentally, how did Grease and Congealed Fat make it into the list? You will fix that later.)

  4. Save the data file and run the SQL*Loader Wizard, choosing Build control file on the first screen and leaving Specify fields checked.
  5. Select the datafile you just created as the input file, leaving all other defaults. Click OK and then click Next.
  6. Click Next to skip the Delimiter screen.
  7. Add MarksFavoriteFoods as the destination table:
  8. In the Exception Table area, enter or pick LOADEREXCEPTIONS as the Exceptions table.

    9. Remove any entries in the Terminated By: box.

    This indicates that you want any constraint exceptions to go into LOADEREXCEPTIONS. The exceptions table must be in the format as shown above. The RowID of the rows that violate the constraint go into this table.

    In the options area in the upper right area of the Add Table dialog, check Reenable Constraints. This tells the SQL*Loader to re-enable constraints when the load is finished. When the constraints are re-enabled, the referential integrity checks fire, causing some of the data to fail and the row to be marked in our exceptions table.

    Look back at the data. It is pretty clear that Congealed Fat with a food rank of 99, will violate our referential integrity constraint. You only have ten ranks in our FOODRANK table - 1 through 10, so anything else will not be allowed.

  9. In the Columns area grid, select the Name column and click Edit.
  10. Enter # in the Terminated by: field.
  11. The Field is enclosed by " and ^,so enter those characters in the appropriate fields as well.
  12. Not all of the food name fields are delimited, so you will check the Optionally checkbox.
  13. Move to the Null If field. Null If tells the SQL*Loader: "set character columns to null, and number columns to zero, upon this condition". Enter RANK="3" in the Null If field. This will blank out the Food Name column when Rank is 3. The food for that rank is Broccoli, so it will never display.
  14. Move to the Default if field. Enter NAME="Bell peppers". This will set the Food Name column to null whenever the Name is "Bell peppers".

    15. The screen should look like this:

  15. Click OK.
  16. Click NEXT. The command line options are options that can be specified on the executable command line. Enter a 1 into Skip. This tells Toad to skip 1 record. The Grease field will be skipped.
  17. Enter 11 into the Load field. This tells Toad to load 11 records from our data file. So the first line will be skipped and the next 11 loaded. The Congealed Fat record will not be loaded. Even if it was, it has a Rank of 99, so it would fail the constraint check.
  18. Select the Direct checkbox, since you want to do a Direct Path Load (a very different style of loading, and does not perform standard SQL Inserts but rather uses buffers. This will permit the constraint to be turned off).

    19. Finally, under Silent, check the All checkbox. This tells loader to suppress all output messages (the log file will still be created).

    Note: These options are not mutually exclusive – you can disable Feedback and Errors, but not Discards, and so on.

  19. Click Next. Enter a control file name (we used D:\confile.ctl, but you can name it anything). Click Next.
  20. Click Save Settings and save these settings. We’ll want them again later.
  21. Select Execute now and Watch progress. Click Finish.

    22. Since you suppressed all messages, the Messages tab shows only these lines:

    SQL*Loader: Release 8.1.6.0.0 - Production on Fri Oct 27 13:57:14 2000

    (c) Copyright 1999 Oracle Corporation. All rights reserved.

    "Yogurt^7

    What’s wrong with that line? It has no field termination character - #. Notice that the lean ground beef line:

    Lean ground beef#10

    made it in, even though it does not have delimiters. That’s because you said they were optional.

  22. The Log file states that 10 rows were loaded; 1 row was not, due to data errors. Which row was that? Open MarksDiet.bad (or whatever you named the data file, plus the .bad extension). You will find this line:

    23. Now, open Schema Browser and look at the Data tab for MarksFavoriteFoods. It looks like this:

    Broccoli and Bell Peppers were blanked out, as specified. Grease was skipped and Congealed Fat was not loaded because it was beyond our "Loaded" limit. Yogurt was not loaded due to bad data. But Egg Whites had a Rank of 11. Why didn’t the constraint fail? And what’s up with the Rank of 0 for Salmon? It had a rank of 2.

    Open the log file to find out. Whatever you named the control file, but with a .LOG extension, and in the same directory as the control file is your log file. Near the bottom you will find the following:

    Column Name Position Len Term Encl Datatype

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

    NAME FIRST * # O(")

    CHARACTER

    O(^)

    NULL if RANK = 0X33(character '3')

    DEFAULT if NAME = 0X42656c6c2070657070657273(character 'Bell peppers')

    RANK NEXT 1

    CHARACTER

    Len means length. You see a length of * for Name, meaning – read to the end of field marker, (# - the Terminator character). But Rank has a length of 1. That’s why only 1 character was loaded. But why? Well, you never specified a field terminator for Rank. You did for Name, but not Rank.

    Open an Editor window and remove the records from MarksFavoriteFoods by entering:

    delete from marksfavoritefoods

  23. Open the SQL*Loader Wizard. Load the settings you saved previously (uncheck the Proceed to finish box). Click next until you get to the Destination Tables.
  24. Select Rank and change the Field is terminated by field, by selecting WHITESPACE from the drop-down.
  25. Execute the SQL*Loader wizard once more. Notice in Schema Browser that all the numeric data is entered properly. In examining the log file, you see that our constraint was disabled, the records loaded, and an attempt was made to re-enable the constraint. But the particular constraint you used – a foreign key constraint – could not be re-enabled because there were orphaned records – the Egg White. Look in the LOADEREXCEPTIONS table and you will find the RowID of the offending record.

Related Topics

SQL*Loader Wizard Overview


Team Coding Tutorials

Team Coding is a cooperative source control feature. You can use Team Coding alone or in conjunction with a third party version control system. Team Coding works with the Editor to control access and development of functions, procedures, packages, triggers and types.

There are several ways to use Team Coding, and these tutorials will help you set the feature up in the best way for your situation.

  • Installing Team Coding Database Objects - Team Coding Tutorial
  • Setting up Team Coding without Version Control Software - Team Coding Tutorial
  • Setting up Team Coding using Version Control Software - Team Coding Tutorial


tut_Installing Team Coding Database Objects

Installing Team Coding Database Objects - Team Coding Tutorial

Before you can use Team Coding as a basis for source control, it must be set up and configured on your Toad instance. This tutorial will walk you through the most basic Team Coding configuration, using only Toad and no external version control software.

In order to use Team Coding, a repository must be set up on the database (usually in the TOAD schema), and Team Coding must be configured on your machine.

  1. If you haven't already, open Toad.
  2. From the Database menu, select Administer | Server Side Objects wizard.
  3. On the first page of the wizard, select Install, upgrade or remove objects for all users to share and then click Next.
  4. Enter login information for either the TOAD schema or a DBA user (you must have DBA privileges on your account to do this) information and click Next. Toad logs in to the selected schema.
  5. The Server Side Objects wizard checks to see if Team Coding has been installed and that all components are valid. If they are, the Team Coding area will display "Found and OK." If they are not there, it will display "Team Coding not Found". Click Add and then Next to install them.
  6. Click Next to skip the Toad Space Manager features.
  7. Create the Team Coding roles. It is recommended that you create new roles for Team Coding, but you can also assign the team coding privileges to an existing role. When you have selected the options for these roles, click Next.
  8. Select the tablespaces where you want to create the Team Coding Objects. Click Next.
  9. Click Run Script to create the Team Coding Objects. When the wizard displays "Update of TOAD complete," review the output and click Next.
  10. The Server Side Objects wizard checks for other necessary objects and reports on the status. Click Close to finish.

Continue to Setting up Team Coding using Version Control Software - Team Coding Tutorial

Continue to Setting up Team Coding without Version Control Software - Team Coding Tutorial

Related Topics

Team Coding Overview


tut_Setting up Team Coding_noVCS

Setting up Team Coding without Version Control Software - Team Coding Tutorial

Team Coding Roles

Grant Users the Team Coding roles as desired. These roles are:

Administrator (TC_ADMIN_ROLE)

Can configure the instance to define how Team Coding operates, which VCS (if any) is used, and so on. This role is automatically assigned to the Toad user.

Project Manager (TC_MGR_ROLE)

Can create and delete code control groups (CCGs) and relate them to a VCS project.

Team Leader (TC_LDR_ROLE)

Can modify CCGs, define the objects or scripts are included in the group, and freeze objects. Can also delete rows from the Team Coding Viewer.

Users without a role granted

Users not granted one of the three Team Coding Roles hold the default role of developer. They can view the status of objects within the Team Coding Viewer, and check items in and out of source control.

  1. Grant Roles as follows:
  1. From the Schema Browser | Users tab
  2. Select a user in the left panel
  3. Click the Alter User button.
  4. Do one of the following:
    • Click the Roles tab. Add or remove roles as desired.

      • You can also grant roles from the Editor. Enter the appropriate SQL and execute it. For example:

      grant TC_ADMIN_ROLE to ARTHUR

      grant TC_LDR_ROLE to SUSAN

Continue on to Enabling Team Coding in the Database - No VCS - Team Coding Tutorial

Go back to Installing Team Coding Database Objects - Team Coding Tutorial

Related Topics

Team Coding Overview


tut_Enabling Team Coding in the Database1

Enabling Team Coding in the Database - No VCS - Team Coding Tutorial

  1. On the Team Coding Toolbar, click the View Team Coding Status for this session [image] button. The Team Coding Status dialog box displays, with the connection information in the title bar.

    If Team Coding is enabled, the Permissions area will display a green check mark beside Team Coding Available and the permissions the current user has.

  2. Click Settings to see and edit Team Coding status for this connection.
  3. Check Enable Team Coding.

Go back to Setting up Team Coding without Version Control Software - Team Coding Tutorial

Related Topics

Team Coding Overview


tut_Setting up Team Coding using Version Control Software

Setting up Team Coding using Version Control Software - Team Coding Tutorial

The first step is to grant users the Team Coding roles as desired. These roles are:

  • Administrator (TC_ADMIN_ROLE)
  • Can configure the instance to define how Team Coding operates, which VCS (if any) is used, and so on. This role is automatically assigned to the Toad user.
  • Project Manager (TC_MGR_ROLE)
  • Can create and delete code control groups (CCGs) and relate them to a VCS project.
  • Team Leader (TC_LDR_ROLE)
  • Can modify CCGs, define the objects or scripts are included in the group, and freeze objects. Can also delete rows from the Team Coding Viewer.
  • Users without a role granted
  • Users not granted one of the three Team Coding Roles hold the default role of developer. They can view the status of objects within the Team Coding Viewer, and check items in and out of source control.

Steps

  1. Grant Roles as follows:
  1. From the Schema Browser | Users tab
  2. Select a user in the left panel
  3. Click the Alter User button.
  4. Do one of the following:
    • Click the Roles tab. Add or remove roles as desired.

      • You can also grant roles from the Editor. Enter the appropriate SQL and execute it. For example:

      grant TC_ADMIN_ROLE to ARTHUR

      grant TC_LDR_ROLE to SUSAN

  5. From View | Toad Options | Team Coding, set the appropriate Team Coding options. See Source Control Options for more information and descriptions. At the very least you will need to set:
    • Default Working directory - Enter the full path of the working directory for your Version Control Software. You can browse and select it if necessary by clicking the drilldown [image] button.
  6. If you are using CVS, click VCS Provider Options and use CVS_Configurations_Options to specify the options you want to use for that provider. Other supported providers do not require these options.

Continue on to Enabling Team Coding in the Database - VCS - Team Coding Tutorial

Go back to Installing Team Coding Database Objects - Team Coding Tutorial

Related Topics

Team Coding Overview


tut_Enabling Team Coding in the Database2

Enabling Team Coding in the Database - VCS - Team Coding Tutorial

  1. On the Team Coding Toolbar, click the View Team Coding Status for this session [image] button. The Team Coding Status dialog box displays, with the connection information in the title bar.

    2. If Team Coding is enabled, the Permissions area will display a green check mark beside Team Coding Available and the permissions the current user has.

  2. Click Settings to see and edit Team Coding status for this connection. The Configuration tab is active.
  3. Check Enable Team Coding.
  4. You must use code control groups if you are using 3rd party VCS. Check Use Code Control Groups and Use 3rd party version control.
  5. Select your Version Control Provider from the list provided.
  6. Click the File extension tab to change default file types associated with using Team Coding, and the General tab to set defaults such as automatic generation of new version numbers.
  7. Click OK to save your settings and enable Team Coding.

Continue on to Setting up Code Control Groups - Team Coding Tutorial

Go back to Setting up Team Coding using Version Control Software - Team Coding Tutorial

Related Topics

Team Coding Overview


tut_Setting up Code Control Groups

Setting up Code Control Groups - Team Coding Tutorial

When Team Coding is enabled and your VCS has been set up, you will need to set up your Code Control Groups.

Code Control Groups are like buckets that you can use to separate your code projects. You can put some code into one or more buckets that will be under source control, and you can put some code into a bucket that won't be controlled. In addition, you can sort the code within those buckets into smaller containers using filters. These filters can be applied depending on the developer using the code, as well as globally.

Create a code control group as follows:

  1. From the Toad menu bar, choose Team Coding | Code Control Groups, or on the Team Coding toolbar, click the Code Control Groups [image] button.
  2. In the Code Control Groups toolbar, click the Add Group [image] button.
  3. If a login window displays, provide the needed information.
  4. In the New Group dialog box, enter a descriptive name for the Group.
  5. If you are using a third party Version Control System (VCS), select a VCS project by following the prompts in the dialog boxes that display. This will vary depending on the product in use. The Code Control Group window displays.
  6. If you are not using a VCS, the Code Control Group window displays immediately.
  7. In the Code Control Group window, create New Object and script mask definitions for the current CCG.

Continue on to Setting up New Object and Script Masks - Team Coding Tutorial

Go back to Mapping Users to CCGs - Team Coding Tutorial

Related Topics

Team Coding Overview

Code Control Groups Overview


tut_Setting up New Object and Script Masks

Setting up New Object and Script Masks - Team Coding Tutorial

  1. From the Code Control Group window, select the group where you want to add masks and then click the Open Group [image] button.
  2. Click the New Database Mask [image] button.
  3. Select from the following options:
    • Object Type - Choose from View, Procedure, Function, Package, Package Body or All.
    • Schema - Pick a user from the list, or type a schema name. You can use the % wildcard character.
    • Object Name - You can type an object name, including the % wildcard. Alternatively, you can launch the Open DB Object dialog box to choose an object matching the Object Type and Schema settings.
    • Excluded - Select Excluded to exclude any objects matching this object mask from the CCG.

Continue on to Mapping Users to CCGs - Team Coding Tutorial

Go back to Setting up Code Control Groups - Team Coding Tutorial

Related Topics

Team Coding Overview

Specifying CCG Object Masks


tut_Mapping Users to CCGs

Mapping Users to CCGs - Team Coding Tutorial

You must be logged in as the user you want to map.

  1. From the Team Coding menu, select Code Control Groups.
  2. Select the appropriate CCG.
  3. Click the Map Current User [image] button on the toolbar.
  4. If the CCG contains object masks for multiple schemas, follow the prompts to select the schema you want.
  5. If required, perform an Import to update the objects in your schema.

Go back to Setting up New Object and Script Masks - Team Coding Tutorial

Related Topics

Team Coding Overview

Map Users to a Code Control Group


Window Privileges and Toad

Windows Privileges and Toad

In order to install and run Toad, make a connection, and do basic operations, you must have the following privileges:

Operating System Requirements

Windows 2000

Windows XP

Windows Server
  • Read access to the Oracle client folder
  • Read/write privileges on the Oracle homes directories that you use for your connections
  • Be a Power User or Administrator

Windows Vista

Windows 7
  • Read access to the Oracle client folder
  • Read/write privileges on the Oracle homes directories that you use for your connections
  • If UAC (user account control) is enabled, you must have administrator privileges

Note: Additional functionality in Toad may require additional privileges.


Installation Notes: Making Toad Read Only

Toad for Oracle, Read-Only

Toad Read Only is a way to allow users to view data and SQL through Toad without making changes to the database. Toad can be made read only using the two license files: READONLY.LIC and FULLToad.LIC.

Why Use Toad Read-Only?

Toad Read Only allows administrators to give their users a powerful tool without worrying about a user committing a change to a sensitive production instance.

While Toad honors privileges granted to the Oracle user, Toad Read Only will not allow the user to do anything which changes the content of the database.

Where to Get Toad Read-Only?

You can make any Toad installation read-only, you can use Toad Security to make selected users or roles read-only, or you can get a special read-only installation that has extra exclusions to prevent users from making changes.

How to make any Toad installation Read-Only Using License files

Toad can be made read-only using the two license files: READONLY.LIC and FULLToad.LIC found in the installation directory where Toad is installed.

Toad.EXE only reads Toad.LIC to determine if it is full Toad or read-only. The license file contains a setting for read only database access. The network administrator can copy READONLY.LIC over the Toad.LIC on an individual workstation to make Toad read-only at that workstation. Remember, the Toad.LIC file must be in the Toad folder.

This is the least secure method of limiting Toad.

To use read only license files

» Copy READONLY.LIC over the TOAD.LIC on an individual workstation.

Toad Security

Using Toad Security you can make Toad read-only to a selected user or role. This is useful if you have someone who needs to view database objects but does not have the authority to change them.

Note: This Toad Security option does not apply to the DB Admin Module. To restrict Toad entirely, you will also need to restrict the DB Admin Module from the appropriate users.

To make Toad read-only using Toad Security

» Move the Read-only Override function from the Features Non-menu list to the Restricted features list in the Toad Security window. This makes Toad read-only to the selected user.

Toad Read-Only Installation

Quest Software, Inc. can provide a read only copy of Toad. The Toad Standard Edition - READ ONLY install is a read only executable designed to prevent its users from changing the database. For this reason, it does not include Quest ScriptRunner (which lets a user write a script that can update database objects).

To download the Toad Standard Edition - READ ONLY install

» The Toad Standard Edition - READ ONLY install is available for download from the Quest Software Support Download Site.


Register Toad

You can add and delete license keys in the Licensing window. All of your active keys display in a separate tab.

To register Toad

  1. Select Help | Licensing.

  2. To add a license, click Modify, enter the key and site message,and click Apply.

    Note: To delete a license, click Delete License.


Group Policy Management

The Toad Group Policy Manager is a free utility which is currently available with a licensed copy of Toad for Oracle. Quest Software reserves the right to remove, change or alter this utility at any time. The Toad Group Policy Manager provides a facility by which multiple copies of Toad within an organization can share the same set of options. It consists of a Windows Service which runs on a common server and publishes subsets of option data to defined groups of Toad users via TCP/IP, and an Editor which is used to define option sets and user groups. Users can be restricted from changing published Toad options or permitted to alter them.

Note: The Toad Group Policy Manager is not currently Unicode Compliant.

Using the Toad Group Policy Editor, policies and standards can be distributed throughout a group environment.

The Group Policy functionality consists of three parts:

  • Group Policy Server
  • Group Policy Editor
  • Toad Policy files

Additional information is provided in the Toad Policy Editor help file, also available as the GrpPlcyEdtr.pdf file.

Toad

All installations of Toad will have a toad.pdl file in the installation directory. This file is encrypted, and required to be present and uncorrupt for Toad to function (whether or not Group Policy Management is enabled).

If you find Toad functionality limited, check the Toad Advisor. Functionality that has been limited will be noted with a notation of Restricted or Published. See Toad Advisor for more information.


Installation Notes: SQL_Net and Net8

Net8 Versions

Toad does not require any other support libraries beyond the 32 bit Net client itself.

Oracle Version | Name of Client Software | Name of DLL
Oracle 8 and 8i | Net8 | Oraclient8.dll
Oracle 9i | Oracle Net9 | Oraclient9.dll
Oracle 10g Standard Client | Oracle Net10 | oraclient10.dll
Oracle 10g Instant Client (Universal Installer Version) | Oracle Net10 | oraociei10.dll
Oracle 11g Client | Oracle Net11 | oraclient11.dll

If you have the client above installed and can connect to Oracle using any of Oracle's tools (with the exception of SQL*Plus), Toad should work properly.

Note: The most frequent cause of problems is the resetting of the PATH environment variable. To set your default Oracle home, you can use the Oracle Home Selector (provided with Oracle) to set it accurately. See Oracle's documentation for more information.

Related Topics

Properties Files


V$ Tables Required

Note: This list is always expanding. If you receive a "Table does not Exist" error, you can find what table is missing by spooling SQL to screen to see the code Toad is using. See Spool SQL for more information.

Access to V$ synonyms required on some common Toad windows are:

AutoTrace (Editor/Query Builder)

V_$Sesstat

V$Statname

V$Session

Optimization & Session Info screens

The following public synonyms must be present.

v$rowcache

v$sysstat

v$system_event

v$librarycache

v$STATNAME

v$SESSTAT

v$sess_io

v$session

v$process

v$latch

Database Browser

The following public synonyms must be present.

V$DATABASE

v$datafile

v$filestat

V$INSTANCE

v$latch

v$librarycache

V$OPTION

V$PARAMETER

v$rollname

v$rollstat

v$sess_io

v$session

v$sesstat

v$sgastat

v$sqlarea

v$statname

v$sysstat

v$system_event

v$tablespace

Database Probe

The following public synonyms must be present.

V$ARCHIVE_PROCESSES

V$BH

v$buffer_pool

V$buffer_pool_statistics

v$database

v$dispatcher

V$INSTANCE

v$librarycache

v$library_cache_memory

V$LOG

V$LOG_history

V$PARAMETER

v$pq_slave

v$process

V$ROWCACHE

v$session

V$SESSTAT

v$sga

v$sgastat

V$STATNAME

v$sysstat

v$version

Database | Monitor | Database Monitor

The following public synonyms must be present.

v$sysstat

v$system_event

v$session

v$librarycache

x$ksllt

v$sgastat

Database | Diagnose | Database Health Check

The following public synonyms must be present.

v$version

v$instance

v$sysstat

v$librarycache

v$rowcache

v$sgastat

v$parameter

v$database

v$log_history

v$filestat

v$datafile

v$tablespace

Database | Monitor |Index Monitor

To see indexes other than your own you must have access to the following:

sys.ob$

sys.ind$

sys.user$

sys.object_usage

You must also have the ALTER ANY INDEX privilege.

Database | Administer | Oracle Parameters

The following public synonym must be present:

v$parameter

Database | Diagnose | LogMiner

The following public synonyms must be present.

v$logmnr_contents

v$logmnr_logs

You must also have:

  • Execute privileges on DBMS_logmnr
  • Execute privileges on DBMS_logmnr_d
  • the Parameter UTL_FILE_DIR set in init.ora (Oracle 8i only)

Database | Monitor | SGA Trace

The following public synonyms must be present.

v$sqlarea

v$sqltext_with_newlines

You must also have:

access to the V$ Oracle Dictionary views

Debugging

No special public synonyms required. However:

DBMS_DEBUG must be valid

On 10g databases:

Debug Connect Session privileges must be granted

Instance Manager | Shutdown

The following public synonym must be present.

v$parameter

V$INSTANCE

Toad Server Statistics | Analysis

The following public synonyms must be present.

V$SESS_IO

V$SESSION

V$PROCESS

V$STATNAME

V$ROWCACHE

V$SYSSTAT

V$SYSTEM_EVENT

V$LIBRARYCACHE

V$SESSION_PRIVS

Toad Server Statistics | Waits

The following public synonym must be present.

V$SYSTEM_EVENT

Toad Server Statistics | Latches

The following public synonym must be present.

V$LATCH

Toad Server Statistics | Sessions

The following public synonyms must be present.

V$SESS_IO

V$SESSION

V$PROCESS

V$STATNAME

Toad Server Statistics | Instance Summary

The following public synonym must be present.

V$SYSSTAT

Toad Session Browser

The following public synonyms must be present:

V$SESSION

V$PROCESS

V$SESS_IO

V$SESSION_WAIT

V$SESSION_EVENT

V$ACCESS

V$SESSSTAT

V$STATNAME

V$OPEN_CURSOR

V$SQL

V$LOCK

V$SESSION_LONGOPS

V$SQLTEXT_WITH_NEWLINES

In addition, you must have access to the following:

SYS.V_$TRANSACTION

SYS.V_$ROLLNAME

Toad Space Manager Setup

The following public synonym must be present.

V$SYSSTAT

The Toad schema must have the privileges to create and alter jobs, create and drop its own tables and procedures, and must have SELECT access on the following:

DBA_DATA_FILES

DBA_FREE_SPACE

DBA_JOBS

DBA_TABLESPACES

V_$FILESTAT

Related Topics

Toad INI File Settings

Transferring Configuration files

Properties Files


Toad INI File Settings

There are only a few settings that require a manual edit of the TOAD.INI file. For all other settings, use the appropriate GUI.

Debugging Settings

Debug=1 | Enables debugging in Toad. This creates the standard ToadDebug.txt file in the [User Files] folder.
LogActivities=1 | Creates a ToadActivities.log file in the [User Files] folder.
ScriptDebug=1 | Creates debugging scripts in Toad (ToadScriptDebug.txt) and Toad Script Runner (TSRDebug.txt).
VCPDebug=1 | Creates a log for debugging version control calls (VCPDebug.log) in the [User Files] folder. This may return a very large amount of information and decrease Toad's performance.

SQL Results Panel Splitter

[SETTINGS]

SLIDER_TOP=200

If you cannot see the SQL Results panel because of resizing the MDI child window too small, you can quit Toad, edit this value to a low number, like 150 or 200, and restart Toad. There is no default value.

Prevent Users from Dropping or Truncating Tables

[SETTINGS]

ALLOW_DROP_TBL=0

By default, Toad permits the user to drop tables and truncate tables. If you do not want to give a Toad user this power, put in ALLOW_DROP_TBL=0 into their TOAD.INI file. The default is 1.

Add Comment Between Identifier and Procedure Name

The default to this is not included automatically in the TOAD.INI file. You can add it:

[SETTINGS]

PELineOffsetOverride=1

On is 1, set it to 0 to turn it off without deleting it.

You should only set this if you want to put lines of comments between the identifier and the name of the procedure, as in:

create or replace procedure
-- xx
-- yy
aaa
as
begin
raise no_data_found ;
end ;
/

For Toad to use the correct line number in the above example, this setting must be on (PELineOffsetOverride=1).

However, if this is on (PELineOffsetOverride=1), you will then get the wrong line # for cases where you do this:

create or replace procedure aaa
-- xx
-- yy
as
begin
raise no_data_found ;
end ;
/

Related Topics

V$ Tables Required

Transferring Configuration files

Properties Files


How to create your Toad for Oracle\Temps\ToadStats.ini file

How to create your ToadStats.ini file

On the Toad Server Statistics window, Analysis tab, if you do not have the Documents and Settings\username\Toad for Oracle\ToadStats.ini threshold file, these are the default threshold values used. See Toad Server Statistics for more information.

INI Entry | Min Value | Warn Value | Max Value | Description | Warning Message
dg_row | -9999 | -9999 | -9999 | dictionary gets | n/a
dm_row | 98 | -9999 | -9999 | dictionary misses | n/a
dcr_row | -9999 | -9999 | -9999 | dictionary cache hit rate | high dictionary cache miss
bcr_row | 90 | -9999 | -9999 | buffer cache hit ratio | may need to increase db_block_buffers
dsr_row | -9999 | -9999 | 10 | disk sort ratio | increase SORT_AREA_SIZE or tune the SQL
bbw_row | -9999 | -9999 | 1 | buffer busy wait ratio | tables with insufficient free lists or too few rollback segments or extents
fbw_row | -9999 | -9999 | 1 | free buffer wait ratio | too many disk sorts?
lchr_row | 85 | -9999 | -9999 | library cache get hit ratio | dynamic or unsharable SQL?
lcpr_row | -9999 | -9999 | 1 | redo space wait ratio | n/a
lcpr_row | 90 | -9999 | -9999 | library cache pin hit ratio | Shared Pool area too small
rswr_row | -9999 | -9999 | 1 | redo space wait ratio | n/a
cfr_row | -9999 | -9999 | 0.01 | chained fetch ratio | PCTFREE too low for a table
per_row | -9999 | -9999 | 20 | parse/execute ratio | high parse to execute ratio
cpo_row | -9999 | -9999 | 15 | cpu parse overhead | high parse cpu overhead
tsr_row | -9999 | -9999 | -9999 | ratio of rows from idx/total rows | low ratios indicate too many full
dbwra_row | -9999 | -9999 | 255 | DBWR avg scan depth | # DB_FILES too high?
dbwrs_row | -9999 | -9999 | -9999 | DBWR avg buffers scanned | n/a

-9999 = No value

To set your own custom thresholds, create an ini file, called ToadStats.ini. Place this file into your Toad for Oracle\User Files folder.

For each "INI Entry" above, you can set Minimum values, Warning values, and Maximum values. Also, you can specify a custom Title and Set the warning message when the warning value is exceeded.

When the warning value is exceeded, the circle is pink. When the maximum value is exceeded, the circle is red.

As in standard Windows .ini format, place the "INI Entry" string within left and right brackets. This becomes the section. Then, you can place Min, Warn, Max, Title, and ErrorMsg items into each section.

For example:

[dm_row]

Min=98

[bcr_row]

Min=90

[dsr_row]

Max=10

[bbw_row]

Max=1

[fbw_row]

Max=1

[lchr_row]

Min=85

Warn=90

ErrorMsg=Dynamic or Unsharable SQL?

[lcpr_row]

Max=190

Warn=80

Title=library cache pin hit ratio

[rswr_row]

Max=1

[cfr_row]

Max=0.01

[per_row]

Warn=17

Max=20

Title=Parse to Execute Ratio

ErrorMsg=High parse to execute ratio

[cpo_row]

Max=15

[dbwra_row]

Max=255

Related Topics

V$ Tables Required

Toad INI File Settings

Transferring Configuration files

Properties Files


Properties Files

Options settings for Toad are stored in several different locations. We maintain them this way so that it is easier to reset or share only a small set of options.

Location

Options file

Function

Toad for Oracle directory/docs

3rdprtylic.txt

Contains copies of our 3rd party license agreements
Toad.chm, Toad.pdf, ReleaseNotes.htm, Tips Folder Help files, User Guides, Release Notes, and Tips folder.

Toad for Oracle directory

beef.dat

Export File Browser

chc.rev

CodeXpert

CMDLineCEGrid.xslt

CodeXpert Command Line - Grid

CMDLineCEScripts.xslt

CodeXpert Command Line - Scripts

CMDLineCETrees.xslt

CodeXpert Command Line - Trees

cvs.ini

Holds options and logins for CVS integration.

DatabaseProbe.txt

Stores the settings and alerts for the Database Probe.

FmtPlus.opt, FmtOptions.ini

Contain options for code formatting.

install.txt

Contains start and end times for Toad installation.

install.log

Detailed log file for Toad installation

qexplainplan2full.msi

Explain plan install file

Quest ScriptRunner.ini

Stores settings for Quest ScriptRunner (qsr.exe).

releasenotes.html

Toad Release notes

rolelog.txt

Stores previously created Team Coding roles.

RNetPin.ini

This stores the full path to the file CHC.rev This is setup by the installer and only needs modification if you copy your Toad directory to another location.

RuleUniverse.xml

Stores CodeXpert rules.

SBQueries.dat

Stores Custom Queries for the Schema Browser.

SettingsLocations.ini

Stores the path of the /User Files folder

SilentInstallNotes90

Stores the instructions for Silent Install.

TNSLoad.xslt

TNSNames Editor

TNSSave.xslt

TNSNames Editor

TNSValidate.xslt

TNSNames Editor

unidbmon.cfg

Stores settings for Quest SQL Tracker (SQLTracker.exe).

Documents and Settings\username\User Files

aliases.txt

Stores your previously used table aliases.

AWRCharts.ini

Stores your configurations for displaying charts in the AWR browser. See ADDM/AWR Overview for more information.

codemap.ini

Stores colors for objects in the Code Road Map. See Model Object Relationships (Code Road Map) for more information.

CodeXpert.ini

Stores locations and names of all rule sets used by CodeXpert. It also stores window sizing and position for a modal window that CodeXpert uses.

coloring.txt

Script Engine (QSE.exe) syntax highlighting.

coloring1.txt

Script Engine (QSE.exe) syntax highlighting.

Connectionpwds.ini

Stores your server information, and any passwords that you choose to have Toad save. These are tied to a single machine. Passwords are not observed if you migrate Toad settings from one machine to another.

connections.ini

Stores connect info for the server login window. See About Database Connections for more information.

DatabaseBrowser.tdb

Stores the treeview for the left hand side of the Database Browser.

DatabaseProbe.ini

Stores customization and alerts for the Database Probe. See Database Probe Overview for more information.

DataModeler.ini

Stores configuration for the Query Builder

<dbname>\DefSchema.txt

Holds the name of the default schema for that database.

<dbname>\<username>_tablefilters.xml

Store filters for the schema browser right hand side grids for the specified connection.

<dbname>\<username>\ DefSchema.txt

Holds the name of the default schema for that user\database combination

DBWizSettings.ini

Stores saved settings for the Database Creation wizard.

desktops.xml

Holds Toad desktop configurations.

Editor_toolbars.ini

Stores custom toolbar configurations of the Editor.

Editor_toolbars_Default.ini

Stores the default toolbar configurations for the Editor.

EditorFooter.txt

EditorHeader.txt

EditorLayout_hex.lay

EditorLayout_PLSQL.lay

EditorLayout_Text.lay

EditorLayout_XML.lay

EditorMacros.bin

Explainplancolumndefs.xml

Stores Default column settings for Explain Plan.

ExplainPlanGlobalPrefs.xml

Stores explain plan text colors and fonts.

ExplainPlanUserPrefs.XML

Stores explain plan column visibility information, widths, and order.

ExportWizSettings.ini

Stores saved settings for the Export Utility wizard.

Filters.txt

Stores previous filters for the Filter Data window. See Filter Condition for more information.

Filecompare.ini

Holds options for the Differences Viewer.See Viewing File Differences for more information.

Files with a .FLT extension

Store filters for the schema browser left hand side.

Files with an SDF extension

Store your Categories for the Script Manager.

Files with a .TMD extension

Store configuration info for the Master/Detail Browser.

FindDirs.txt

Stores find dialog directory saves.

ftp.ini

Stores user FTP information.

Healthcheck.htm

DB Health Check File. See Database Health Check for more information.

htmlsub.txt

Stores html editor autocorrect settings.

ImportWizSettings.ini

Stores saved settings for the Import Utility wizard

jobdates.txt

Not editable through Toad, but users can alter it to change the drop down menus in the Create/Alter job window.

LexLib.lxl

The lexicon library for the Editor formatting component.

LoginGrd.ini

Stores the configuration of the grid in the Server Login window. See About Database Connections for more information.

MainFormLayout_default.lay

MenuShortcuts.ini

Custom shortcut keys for the main Toad menu.

NewEditorBarItems.ini

NewMainFormBarItems.ini

NewCompoundTrig.sql,Newfunc.sql, Newproc.sql, Newpackage.sql, NewPackageBody.sql, NewPkgFunc.sql, NewPkgProc.sql, Newtrig.sql, Newtype.sql, Newtypebody.sql, NewTypefunc.sql, NewTypeproc.sql

Your default templates for creating new objects in the Editor.

Oracle Data Dictionary.sdf

Pre-created Script Manager datafile containing Oracle 8i data dictionary scripts. See Script Manager Overview for more information.

OriginalEditorLayout_Hex.lay

Original EditorLayout.PLSQL.lay

Original EditorLayout.SQL.lay

Original EditorLayout.Text.lay

Original EditorLayout.XML.lay

OriginalMainFormLayout_default.lay

Params.txt

Parameters for single line queries in the SQL editor.

Project.tpr

Holds information for the Project Manager window.

Project_bak.tpr

Holds information for the Project Manager window as a backup.

ProjectConfig.txt

Holds information for the Project Manager Window.

REVWORDS.TXT

SavedSQL.dat

Stores your Named SQL, Personal SQL and SQL history.

SBFilterList.xml

Schema Browser filter list.

SBProjManFilterList.xml

Stores Schema Browser filter list for the Project Manager.

SchemaCompSummary

Stores summary information for the Schema Compare feature. See Compare Schemas for more information.

SchemaObjects.sdf

Script manager datafile containing pre-created Schema objects.

Services.ini

Stores the list of services for the Service Manager window. See Service Manager for more information.

SGATrace.ini

Saves the layout of your SGA Trace window's grid. See SGA Trace/Optimization for more information.

SQLFILES.TXT

SQLLoaderSettings.ini

Stores saved settings for the SQL*Loader wizard. See SQL*Loader Wizard Overview for more information.

StatsPackCharts.ini

Stores configuration information for the Chart area of the Statspack Browser. See StatsPack Browser Overview for more information.

Sysviews.txt

Preserves system view names.

templates.xml

Stores MakeCode and CodeSnippets templates.

temptxt.txt

Stores temporary text for Schema Compare.

Terr.sql

Contains export grants. If you lose your connection while attempting to save, this file is created.

TOAD.INI

Stores many of the basic Toad options, including most items from View | Toad Options.

Toad_GUI.ini

Stores Toad Session Browser GUI settings.

Toad_GUI2.ini

Stores GUI settings for other Toad windows.

Toad_SessBrowFilters.ini

Stores the filters for the Session Browser.

ToadActions.dat

Contains saved ToadActions

ToadActions.log

Contains the logfile for used ToadActions and their results.

ToadMAIL.ini

Stores settings from View | Toad Options | Email Settings

ToadMONITORS.ini

Stores settings from View | Toad Options | Monitors and View | Toad Options | Instance Manager.

ToadParams.ini

Stores the parameters you have previously entered for the Debugger.

ToadRun.txt

Toad command-line run file.

Toad_SessBrowFilters.ini

Stores the filters for the Session Browser.

toadstats.ini

Not editable through Toad, but users can change it to affect the DBA | Server Statistics window.

ToadTips.dat

Contains any information you have entered into the note field of the ToadTips window.

toolbars.ini

Toolbar and menu configuration for the main Toad window.

Toolbars_Default.ini

Default toolbar and menu configuration for the main Toad window.

TopSess.ini

Holds your list of profiles for the Top Session Finder.

views.txt

Preserves user views.

\<servicename>\ <username>Syns.txt

Holds the lists of synonyms for syntax highlighting.

\<servicename>\ <username>Views.txt

Holds the lists of synonyms and views for syntax highlighting.

\<servicename>\ projects.lst

Holds the configurations of the Favorites tab on the Schema Browser.

Documents and Settings\username\ATResults

ressume.res

Documents and Settings\username\RMAN Templates

.rcv files

RMAN Template files:

Default provided with Toad:

  • RMANDBHotBackup.rcv
  • RMANDBHotBackupIncr0.rcv
  • RMANDBHotBackupIncr1.rcv
  • RMANSetup.rcv
  • RMANTSHotBackup.rcv

See RMAN Scripts in Toad for more information.

Documents and Settings\username\RuleSets

Contains RuleSets for CodeXpert. These should not be modified except through the RuleSets dialog box in Toad. See Configuring RuleSets for more information.

Documents and Settings\username\ScriptMgr

DBA folder

Schema Objects folder

Documents and Settings\username\Unixjobs

Files with a .JDF extension

Store information for the Unix Scheduler.

Related Topics

V$ Tables Required

Toad INI File Settings

Transferring Configuration files


Transferring Configuration files

If you are installing Toad on a new computer, you may want to move your settings, personal SQL, SQL History and Named SQL Statements to the new machine. This will save you the trouble of recreating all of these settings.

To transfer all personalized settings

  1. Install Toad on the new machine.
  2. Copy the Documents & Settings\username\User Files folder from your old machine to the new machine, making sure the file structure remains the same.

Related Topics

V$ Tables Required

Toad INI File Settings

Transferring Configuration files

Properties Files


Features with Server Side Objects

Several Toad features require objects installed on the server side of the Oracle instance. These objects can be installed into the Toad schema, an individual schema, or a third, publicly accessible schema. They may not be installed into more than one of these choices, or problems can occur. See Install Server-Side Objects for more information.

Note: These server side objects apply only to their corresponding features, and Toad's other features will run successfully without the server side objects.

Features with server side objects | Schemas where the features can be installed
 | Toad | Individual | Publicly Accessible
CodeXpert | X |  | X
Data Generation | X | X | X
Explain Plan† | X | X | X
Profiler | X | X | X
Team Coding | X |  | X
Toad Space Manager* | X |  |
Security | X |  |

†The Explain Plan Server Side Objects can be installed and edited from within Toad itself. They are not included in the Server Side Objects wizard.

* The Toad Space Manager wizard helps you set up the privileges for Toad, but the View Tablespaces window will install and administer the objects. See View Tablespaces for more information.

Caution: Explain Plan tables and Profiler objects should be installed into EITHER the Toad schema or an individual user schema, not both.

Related Topics

Install Server-Side Objects

View Tablespaces


Install Server-Side Objects

Several Toad features require objects installed on the server side of the Oracle instance. They must be installed into specific schemas. See Features with Server Side Objects for more information.

In order to install server side objects, you will need to have access to either the account for the Toad user, the account for the schema where you are installing them, or an account with the DBA role.

To install server side objects

  1. Select Database | Administer | Server Side Objects Wizard.

  2. Select what you want to do:

    Install, upgrade or remove objects for all users to share

    Use this to create and administer a special schema called TOAD. This schema gives you a central location from which to maintain the tables needed to run the above-mentioned portions of Toad. You could create some of these objects (Explain Plan and Profiler) in every schema in which you intend to use them (in other words, every schema would have these same tables, see below) but if you have a large number of users, using the Toad schema is more efficient. In addition, Toad Security, ObjectName, and Team Coding must reside in the Toad schema.

    Install, upgrade or remove objects for an individual schema to use

    If you do not want to create the Toad user, you can create and administer certain objects in the schemas where you intend to use them. This may be more efficient if you have a small number of users for these special features and you do not want all of your users to have access.

    Create setup scripts without a database connection

    You can create the scripts to set up the Toad schema, and so on without access to the database connection you need. Then you can log in later and run the scripts.

  3. Refer to the following for more information:

    Administer TOAD schema

    Description

    Logon information

    Whether you are using a TNS file or an LDAP server, servers will be listed in the database list.

    Dropping the TOAD schema

    The Toad user and associated public synonyms will be dropped. If you previously set up Team Coding, you will also be prompted to drop any roles created for Team Coding.

    Administer Private Schema

            If you choose to administer server side objects on an individual basis, remember that each user will need to have setup done individually.
    Server Side Objects

    Description

    CodeXpert

    Allows reports to be saved and retrieved in the database.

    Toad Security

    Set up Security administrator who can restrict user access to features of Toad.

    Caution: Users who have not been granted direct rights to Security Administration may still be able to administer Toad Security if they have been granted the appropriate rights through a role or through system privileges. This can be avoided by maintaining strict control over rights and privileges granted to users.

    Toad Profiler

    Caution: Toad Profiler objects should be installed into either the TOAD schema or an individual user schema, but not both.

    Toad Space Manager

    From the wizard, you can:

    • Drop the Toad Space Manager job and objects, removing the ability to use Toad Space Manager.
    • Grant Toad the necessary privileges to configure Toad Space Manager.

    Note: Toad Space Manager must be set up while connected to the Toad Schema.

    Team Coding Roles

    This feature must be installed in either the Toad schema, or another publicly accessible schema, such as SQLNAV. See Use Team Coding in SQL Navigator Environments for more information.

    Roles must be set for the Team Coding environment. The standard roles are:

    • Administrator: TC_Administrator
    • Project Manager: TC_ProjectManager
    • Team Leader: TC_TeamLeader
    Creating Scripts without a Database Connection

    When completed, you can load the script into the Toad Editor and create the necessary objects.

  4. Complete the wizard.


About Database Connections

This topic provides a very general overview of how Toad connects to Oracle databases. Please refer to Oracle's documentation for more information on Oracle connections.

Troubleshooting: If your previous connections do not display in the Database Login window, ensure that the Show favorites only and Show selected home only fields in the bottom of the Database Login window are not selected. See Troubleshoot Connections for more information.

Oracle Clients and Database Servers

To connect to a database server (referred to as "database"), Toad requires that you have a database client ("client") installed on your computer. A client is simply software that accesses the database through a network.

You can have multiple Oracle clients installed on your computer. The client location is also referred to as the Oracle home, and you can select which one Toad uses on the Database Login window. See Select an Oracle Home for more information.

See the Release Notes for a complete list of the client and database versions that Toad supports.

Important: It is recommended that your client version be of the same release (or later) as your database server. This is an Oracle recommendation to prevent performance issues.

Connection Files

The client installation generally includes connection files that are used to communicate between your computer and the database. Toad uses the following connection files, depending on the connection type you select:

Connection File Description
SQLNET.ora

Specifies configuration details for Oracle's networking software, such as trace levels, the default domain, session characteristics, and the connection methods that can be used to connect to a database (for example, LDAP and TNSNAMES). If a method is not listed, you cannot use it.

Toad uses the SQLNET.ora file for all connection methods, and consequently you must be able to access this file for any connection method.
TNSNames.ora

Defines database addresses to establish connections to them. Toad must be able to access the TNSNames.ora file for TNS connections.

Note: If you have multiple Oracle clients installed or want to use a TNSNames.ora file on a network, you may want to use the TNS_NAMES environment variable to simplify managing TNS connections. See Create a Variable for the TNSNames.ora File for more information.
LDAP.ora

Defines directory access information using Lightweight Directory Access Protocol (LDAP). Toad must be able to access the LDAP.ora file for LDAP connections.

Related Topics

Create New Connections

About Managing Multiple Connections


Create New Connections

There are a few prerequisites you must have to connect to an Oracle database. See About Database Connections for more information.

Notes:

  • See Troubleshoot Connections for information on resolving connection issues.

  • Click [image] at the top of the Database Login window to refresh the connections grid.

  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To create a new connection

  1. Click [image] in the standard toolbar to open the Database Login window.

    Note: You can also select Session | New Connection.

  2. Enter the login information in the User/Schema and Password fields.

    Tip: You can have Toad save passwords for selected connections or for all connections. See Save Connection Passwords for more information.

  3. Select a connection method:

    4. TNS

    Select a database in the Database field. Toad uses the listings in your TNSNames.ora file to populate the list.

    You can edit the TNSNames.ora file directly in Toad. See Edit TNSNames Files for more information.

    Note: If you have multiple Oracle clients installed or want to use a TNSNames.ora file on a network, you may want to use the TNS_NAMES environment variable to simplify managing TNS connections. See Create a Variable for the TNSNames.ora File for more information.

    Direct

    Enter the Host, Port, and either the Service Name or SID of the database to which you want to connect.

    LDAP

    Select the LDAP descriptor in the LDAP Descriptor field. You can edit the LDAP.ora file directly in Toad. See Edit LDAP Files for more information.

    Notes:

    • Toad must be able to access the SQLNET.ora file to use any of the connection methods. Toad must also be able to access the LDAP.ora file for LDAP connections and the TNSNames.ora file for TNS connections.

    • If Toad cannot connect to one of these files, a red X displays beside the editor button for that file. For example, the following image indicates that Toad cannot access to the LDAP.ora file. You would have to resolve the issue before you could make an LDAP connection.
  4. Select the connection privilege level in the Connect as field. The default is Normal.

  5. Optional: Select a connection color in the Color field.

    Note: The color displays in all Toad user interface elements that use the connection, which is very helpful when you have multiple active connections. See Color Code the User Interface per Connection for more information.

  6. Select the Oracle home in the Connect using field.

    Note: You can only connect to one Oracle home at a time. This field is disabled if you are already connected to a database. See Select an Oracle Home for more information.

  7. Click Connect.
  8. Review the following fields that are available in the Database Login connections grid after you connect to the database:
    9. Auto Connect | Select this checkbox to have Toad automatically make the selected connection on startup. See Automatically Connect on Startup for more information.
Favorite | Select this checkbox to mark the connection as one of your favorites. You can have the connections grid only display your favorites by selecting Show favorites only at the bottom of the window.
Alias | Enter a description or nickname for the connection. By default the alias only displays in the connections grid, but you can have Toad display the alias instead of the database name. To enable this option, select View | Toad Options | Windows and select the Use alias instead of database checkbox.
Note: Toad provides many options to help you organize the connections grid. See Organize the Database Connections Grid for more information.
  9. Optional: About Managing Multiple Connections

Related Topics

Use Previous Connections


Save Connection Passwords

You can have Toad save all passwords automatically or individually save passwords for selected connections. Passwords are saved in an encrypted file called connectionpwds.ini. The encryption is tied to the currently logged in user profile, and it supports roaming profiles and Citrix installations.

Important: To save a connection password, you must connect to the database first, and then you can save the password in the connections grid.

Note: If the Save Password field is disabled, your ability to save passwords may have been removed during installation. See the Toad for Oracle Installation Guide for more information.

To automatically save all passwords

  1. Click [image] in the standard toolbar to open the Database Login window.

    Note: You can also select Session | New Connection.

  2. Select the Save passwords checkbox in the bottom of the window.

To save passwords for individual connections

  1. Click [image] in the standard toolbar to open the Database Login window.

    Note: You can also select Session | New Connection.

  2. Clear the Save passwords checkbox in the bottom of the window, if it is selected.

  3. Select the Save Pwd checkbox for the connection in the connection grid.

    Note: If the connection is not listed in the connection grid, ensure that the Show favorites only and Show selected home only fields are cleared. If it still does not display, connect to the database again.

  4. Enter the password in the Password field on the right.
  5. Click Connect.

Related Topics

Create New Connections

About Managing Multiple Connections


Automatically Connect on Startup

Toad can connect to a connection of your choice whenever you start Toad.

To select connections to automatically make when Toad starts

  1. Click [image] in the standard toolbar to open the Database Login window.

    Note: You can also select Session | New Connection.

  2. In the connections grid, select the checkbox in the Auto Connect column.

Related Topics

About Managing Multiple Connections

Create New Connections


About Managing Multiple Connections

When working with Toad you may have multiple connections open at once. Trying to keep track of which open window is related to which connection can be difficult. Toad provides a variety of features and options to help you manage multiple open connections.

Method Description
Organize the Database Connections Grid

The Database Login window displays all of your previous connections in the connections grid. You can reduce the number of connections that display and organize how they display in a variety of ways:

  • Display only your favorite connections or connections for a specific Oracle home
  • Hide columns or add custom columns
  • Group connections (create your own tree view)
Color Code the User Interface per Connection

You can use connection colors to help you distinguish between open connections. The color coding displays prominently throughout Toad's user interface. For example, you may use red for all production databases and yellow for all test databases.
Display Connection and Window Bars

You can use the Window and Connection bars to help you keep track of your open windows and connections when you have several open concurrently. The active window and connection are selected in the bars (they display with a lighter color), which is helpful so you can always tell which connection you are using.

Right-clicking these bars gives you helpful options. For example:

  • Connection bar—You can viewing a list of all of the windows that use the connection, which you can click to display the selected window in front of all other windows.
  • Window bar—You can select Show Buttons for Current Connection. This option only displays windows that use the active connection, which can be very helpful when you have numerous windows open for one connection.

You may also find the following general connection management features helpful:

  • Automatically Connect on Startup
  • Change Active Connection in Window
  • Commit or Rollback Changes
  • Reduce Users/Schemas Displayed in Drop-Downs
  • Use Previous Connections

Related Topics

Create New Connections

About Database Connections


Organize the Database Connections Grid

The Database Login window displays all of your previous connections in the connections grid. You can reduce the number of connections that display and organize how they display in a variety of ways:

  • Display Only Favorite Connections
  • Add Custom Columns
  • Group Connections (Create Tree View)
  • Hide/Display Columns
  • Display Only Connections for Selected Oracle Home

  • Display Tabs for Each Server or User

  • Delete Previous Connections

Tips:

  • Toad provides a variety of features and options to help you manage multiple open connections. See About Managing Multiple Connections for more information.
  • Click [image] at the top of the Database Login window to refresh the connections grid.

Access the Database Login Window

All of the organization options are configured from the Database Login window.

To access the Database Login window

Click [image] in the standard toolbar to open the Database Login window.

Note: You can also select Session | New Connection.

Display Only Favorite Connections

If you have a long list of connections but only use a few of them regularly, you can mark the connections that you use frequently as favorites and hide the other connections. You can still view the other connections by displaying all connections instead of just favorites.

To select favorite connections

» In the connections grid, select the Favorite check box of the connection you want to make a favorite.

To view only favorites in the connections grid

» Below the connections grid, select the Show favorites only checkbox.

To view all connections in the connections grid

» Below the connections grid, clear the Show favorites only checkbox.

Add Custom Columns

You can add columns to the connections grid. For example, you may want to add a Locations column if you manage databases in multiple physical locations, or you may want to add an Environment column to distinguish between Test and Production databases.

Tip: You can also group the connections grid by custom fields. See Group Connections (Create Tree View) for more information.

To add a custom column

  1. Click [image] in the Database Login window toolbar.
  2. Click Add.
  3. Enter the name for your custom field.

Group Connections (Create Tree View)

You can group connections by column header to create a tree view. You can add multiple column headers to add grouping levels.

To group connections in the data grid

  1. Drag a column header into the grey area above the grid.

  2. Drag additional column headers to add grouping levels.

    Tip: The image above is grouped by a custom column. See Add Custom Columns for more information.

To remove grouping

» Drag the column header into the connections grid.

Hide/Display Columns

If you have a small screen area, you can hide some of the columns that display in the connections grid.

To hide or show columns

  1. Click [image] in the left-hand side of the grid headers.
  2. Select the columns you want to display, or clear the checkbox for columns you want to hide.

Display Only Connections for Selected Oracle Home

If you have many connections using different Oracle homes, you may want to display only those using a particular home in the grid.

To limit connections to one Oracle home

  1. Select the Oracle home you want to display in the Connect using field on the right side of the Database Login window.

    Note: You can only connect to one Oracle home at a time. This field is disabled if you are already connected to a database. See Select an Oracle Home for more information.

  2. Click the Show selected home only checkbox at the bottom of the window.

Display Tabs for Each Server or User

By default, the connections grid does not contain tabs; it is a unified grid that displays all connections. You can change the grid to display separate tabs for each server or user. Each tab contains a grid of its database connections.

To display tabs for each server or user

» Click [image] at the top of the Database Login window and select Tabbed by Server or Tabbed by User.

Delete Previous Connections

To permanently remove connections from the Database Login window

» Select the connection and press the DELETE key.

Related Topics

About Database Connections

Create New Connections

Color Code the User Interface per Connection


Color Code the User Interface per Connection

You can use connection colors to help you distinguish between open connections. The color coding displays prominently throughout Toad's user interface. For example, you may use red for all production databases and yellow for all test databases. The color coding would display as follows:

  • Any open window related to that connection

  • Window and Connection bar buttons

    1) Connection Bar 2) Window Bar

  • Status bars

Tip: Toad provides a variety of features and options to help you manage multiple open connections. See About Managing Multiple Connections for more information.

To select a connection color

  1. Click [image] in the standard toolbar to open the Database Login window.

    Note: You can also select Session | New Connection.

  2. Select a color in the Color column in the connection grid.

Related Topics

About Database Connections


Display Connection and Window Bars

You can use the Window and Connection bars to help you keep track of your open windows and connections when you have several open concurrently. The active window and connection are selected in the bars (they display with a lighter color), which is helpful so you can always tell which connection you are using.

1) Connection Bar 2) Window Bar

Notes:

  • Toad provides a variety of features and options to help you manage multiple open connections. See About Managing Multiple Connections for more information.
  • You can customize what and how these bars display, such as changing the font or allowing them to span multiple lines. See Toolbar Options for more information.

Connection Bar

The Connection bar lists all of the connections that you have open. Right-clicking one of the connections in the Connections bar gives you helpful options, including:

  • Opening a new Editor or Schema Browser window for the connection
  • Ending the connection
  • Committing or rolling back changes
  • Viewing a list of all of the windows that use the connection, which you can click to display the selected window in front of all other windows

To display the Connection Bar

» Right-click in the file menu area and select Connection Bar.

Window Bar

The Window bar lists all of the windows that you currently have open. If you right-click a blank area in the Window bar, you can select Show Buttons for Current Connection. This option only displays windows that use the active connection, which can be very helpful when you have numerous windows open for one connection. Compare the following image to the previous image, and notice how the red Editor button no longer displays because it does not use the active connection:

To display the Window Bar

» Right-click in the file menu area and select Window Bar.

Related Topics

Create New Connections


Use Previous Connections

Toad saves your previous connections so you can easily connect to them again. You can also change the active connection in open windows. See Change Active Connection in Window for more information.

To open a previous connection

» Select one of the following:
  • Click [image] in the standard toolbar to open the Database Login window, and then double-click the previous connection from the grid.
  • Click the arrow beside [image] in the standard toolbar, and then select a connection from the list.

Related Topics

About Database Connections

Create New Connections


Change Active Connection in Window

You can easily change the connection in an open window to a connection you currently have open or a connection that you have recently used.

Tip: Toad provides a variety of features and options to help you manage multiple open connections. See About Managing Multiple Connections for more information.

To change the active connection in a window

» Click the arrow beside [image] in the window toolbar and select an open or recent connection from the drop-down.

Related Topics

About Database Connections


File: Test Connections

Test Connections

This command reconnects if Oracle has dropped the session.

To test connections

» Select Session | Test Connections (Reconnect).


End Connections

To end one connection

» Select Session | End Connection.

Or

Click [image] in the standard toolbar to end the currently active session. You can also click the arrow by the button to select a different open connection to end.

To end all connections

» Select Session | End All Connections.

Related Topics

Create New Connections

About Database Connections


Commit or Rollback Changes

You can commit or rollback recent changes to the database from the Session menu at any time while working with Toad.

Note: You can configure Toad to either automatically commit changes or prompt to commit on exit. See Oracle Transaction Options for more information.

To commit or rollback your changes

» Select Session | Commit or Session | Rollback.

Tip: You can also right-click the connection in the Connection Bar, and select Commit or Rollback.

Related Topics

Oracle Transaction Options

Editor Behavior Options

Debugger Options


Reduce Users/Schemas Displayed in Drop-Downs

Many databases have hundreds of users (schemas), most of which own no database objects and exist only for secure access to the database. You can remove these unwanted users from the drop-down user lists on many windows in Toad by using the Oracle Users List window to select users.

The user list is stored in a text file, SCHEMA_DATABASE.LST, where SCHEMA is the schema in use, and DATABASE is the current database alias.

There is another option to only show users that own objects in the database. See Schema Browser Left-Hand Side Options for more information.

To reduce the users displayed in drop-downs

  1. Select Session | Oracle Users Lists.
  2. Clear the checkbox beside users you do not want to display in lists.

Related Topics

Schema Browser Data Tab Options

About Database Connections


View Session Information

This general-purpose utility window displays information about the current Oracle user as well as information on the Oracle connection itself.

To view session info

» Select Session | Session Information.


SET ROLE

You can configure Toad to issue a SET ROLE command immediately upon connection, before it checks any privileges. This can be done either by making a manual entry in the toad.ini file, or by using the Toad Group Policy Manager. See Group Policy Management for more information.

To manually edit the toad.ini file

  1. Using Notepad, or another text editor, open toad.ini.
  2. Add the following line:

    3. [SET ROLE]

  3. Enter as many specific SET ROLE entries under this line as needed. The syntax for these parameters is:

    4. Entry#=<DB>db_name</DB><USER>User_name</USER><ROLE>role_name</ROLE><ONFAIL>Fail_action</ONFAIL>

    Where:

Variable | Meaning
# | An identification number that keeps the entries unique. You can have as many entries as you want.
db_name | Corresponds to the database alias in your tnsnames.ora file (or LDAP entry). An asterisk (*) can be used to specify "any database."
User_name | Logon user name. An asterisk (*) can be used to specify "any user."
Role_name | Any valid argument to the SET ROLE command. See Oracle's documentation for more information.
Fail_action | One of the following: Abort, Message, or ignore. Abort - don't allow the connection Message - display an error message and then allow the connection Ignore -silently ignore the error message

Related Topics

Properties Files

Group Policy Management


Select an Oracle Home

Only one Oracle home can be in use at one time. This means that once a connection is made, all future connections use the same Oracle home, regardless of default home. If you want to use a different Oracle home, you must close all open connections first.

Default homes can be assigned for a connection or for Toad. When a default Oracle home is assigned to a particular connection, any time you make that connection from the connection grid, Toad automatically uses that Oracle home. When a default Oracle home is assigned to Toad, Toad automatically uses that Oracle home any time you create a connection to a new database.

Toad searches for Oracle homes in several different ways. See How Toad Finds Oracle Homes for more information.

Notes:

  • If you have multiple Oracle clients installed or want to use a TNSNames.ora file on a network, you may want to use the TNS_NAMES environment variable to simplify managing TNS connections. See Create a Variable for the TNSNames.ora File for more information.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To select an Oracle home

  1. Click [image] in the standard toolbar to open the Database Login window.

    Note: You can also select Session | New Connection.

  2. With no open connections, select an Oracle home in the Connect using field.

    Note: To see more information about the home you have selected or change the SID, NLS_LANG, or SQLPATH, click [image] to open the Oracle Home Editor. See Edit the Oracle Home for more information.

  3. To set this as the default Oracle home for all connections, select Make this the Toad default home.


Edit the Oracle Home

You must restart Toad to have changes made here take effect.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To edit the Oracle home

  1. Click [image] beside the Connect using box on the Database Login window.
  2. Select an Oracle home by clicking on its node. You can then:
    • Click Clipboard. This will copy the selected information to the clipboard so you can past it into an email, or another document.
    • Click Advice. This will tell you if you have a proper Net8 installation for this home, or suggest changes to your installation.
    • Right-click and choose to edit one of the following:
      • SID for the selected home
      • NLS_LANG for the selected home
      • SQLPATH for the selected home

Related Topics

Select an Oracle Home

How Toad Finds Oracle Homes


How Toad Finds Oracle Homes

Your Oracle homes display in the Connect using field on the Database Login window. Toad finds Oracle homes by going through the following process:

  1. Toad first looks in the Toad command line for OCIDLL. If this is not found, Toad looks for the path for the Oracle home as follows:
    • If the command line argument "ORACLEHOME" was passed in, then Toad uses that home.
    • If there is no Toad home defined, then Toad displays the home that is set as the default home using Oracle’s Home Selector application as the default in the drop-down. Toad uses the home that is active in the drop-down.
  2. To populate the drop-down, Toad searches the registry as follows:
    • First, Toad reads the list of Oracle home names from the keys under HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES
    • If no Oracle homes are found there, then the Oracle home is set to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
    • Otherwise, Toad finds the ORACLE_HOME value for each Oracle home, if it exists. Then Toad checks the system environment variable called PATH to see whether it contains the "bin" folder under ORACLE_HOME. Toad selects the Oracle home whose path displays first in PATH.
    • If Toad still hasn't found an Oracle home, it uses HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE.
  3. Toad looks for the client DLL in the "Bin" folder under the path found for the Oracle home.
    • If that fails, Toad looks for the ORACLE_HOME key under HKEY_LOCAL_MACHINE\ORACLE\SOFTWARE, and look for the client dll in the "Bin" folder under that.
    • If that also fails, Toad looks for the client dll in every \bin directory in PATH.

Related Topics

Select an Oracle Home

Edit the Oracle Home


Edit SQLNET Files

From the SQLNET editor you can easily edit your SQLNET.ora parameters. The parameters on this window are standard Oracle parameters. See Oracle's documentation for more information.

To edit your SQLNET.ora file

  1. Click [image] in the standard toolbar to open the Database Login window.

    Note: You can also select Session | New Connection.

  2. Click SQLNET Editor.

  3. To back up your file before editing it, click Create Backup File.

    Note: It is recommended that you create a backup file before you make any changes. This assures that if something goes wrong you can restore the original settings.

  4. Make any necessary changes.

    Note: If you are using a multi-threaded server and plan to use the PL/SQL Debugger, make sure you check the USE_DEDICATED_SERVER checkbox. This allows the PL/SQL Debugger to work.

  5. To view the SQLNET.ora file after you update parameters, click View File as Modified.

Related Topics

About Database Connections

Create New Connections

Edit LDAP Files

Edit TNSNames Files


Edit LDAP Files

You can use the LDAP editor to edit your LDAP parameters. Toad supports both Oracle LDAP and Windows LDAP servers.

The parameters on this window are standard Oracle parameters. See Oracle's documentation for more information.

To edit your LDAP.ora file

  1. Click [image] in the standard toolbar to open the Database Login window.

    Note: You can also select Session | New Connection.

  2. Click LDAP Editor.

  3. To back up your file before editing it, click Create Backup File.

    Note: It is recommended that you create a backup file before you make any changes. This assures that if something goes wrong you can restore the original settings.

  4. Make any necessary changes.

    Note: The directory server types apply to all servers listed in the Directory Servers area.

  5. To view the file after you update parameters, click View File.

Related Topics

About Database Connections

Create New Connections

Edit TNSNames Files


Edit TNSNames Files

From the TNSNames Editor, you can easily edit your TNSNames files. You can add a new service, edit a service, delete a service, or work with two files and transfer services back and forth between the two.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Notes:

  • The TNSNames Editor supports much of the standard Oracle syntax, but there are certain old or advanced features that it does not support. See Limitations of the TNSNames Editor for more information.
  • An incorrect TNSNames.ora entry may block all valid entries after it. You can copy names to the top of the list until you find the incorrect entry.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To edit TNSNames files

  1. Select Utilities | TNSNames Editor to open the TNSNames Editor.

  2. Open a TNSNames file in one or both sides of the window.

    Note: If you are working with two TNSNames files at the same time, the TNSNames Editor does not prevent duplicate entries in the tnsnames.ora file. This allows you to copy a service and then edit it. Use the arrows in the middle of the screen to copy entries between the two files.

  3. Make changes as necessary. Review the following for additional information:

    Add new service

    Click [image] and complete the required fields.
    Clone a service

    To clone a service:

    1. Right-click the service and select Clone Service.

      Note: When you clone a service, the new service entry will have a blank Net Service Name and displays at the top of the service list.

    2. Select the new service and click [image] to make necessary modifications.
    Copy and paste entries

    You can paste entries directly into either side of the TNSNames Editor from either the Project Manager or from a text file. To copy connections to the TNS Names Editor:

    1. Copy the text of the connection information from the email, file, or Project Manager.

      Note: To copy from the Project Manager, right-click the connection in the Connections tab and select TNSNames information to clipboard.

    2. Click [image] in the pane containing the TNSNames.ora where you want the information.
    Test a connection

    To test a connection:

    1. Save the file to the location where your TNSping executable reads files.
    2. Select the connection and click [image].

    Tip: Click [image] to check the syntax of your TNSNames file from the editor. If there are errors, Toad lists them in the Message tab and suggest ways to fix them.

    Note: You can add a UR tag to a CONNECT_DATA tag of a TNS entry. This is available ONLY through the text edit area of the editor, not the Edit Service window. This tag is supported as a patch to Oracle 10g and is no longer necessary in Oracle 11 and later.


Create a Variable for the TNSNames.ora File

If you have multiple Oracle clients installed or want to use a TNSNames.ora file on a network, you may want to use the TNS_NAMES environment variable to simplify managing TNS connections. This variable specifies the location of your TNSNames.ora file, and all installed Oracle clients use this file for connections. If the TNS_ADMIN variable is not defined, then each Oracle client must have its own TNSNames.ora file. Consequently, using the TNS_NAMES variable allows you to maintain one TNSNames.ora file instead of maintaining multiple copies for the clients.

To create an environment variable for the TNSNames.ora file

  1. Access the Environment Variables window:

    Windows 7

    Windows Vista

    Select Start | Computer | System Properties | Advanced system settings | Environment Variables.
    Windows XP Select Start | My Computer | View system information | Advanced | Environment Variables.
  2. Click New beneath the System variables field.
  3. Enter TNS_ADMIN in Variable name the field. This must be an exact match.

  4. Enter the TNSNames.ora file location in the Variable value field.

    Note: This file is generally located in the following directory: ORACLE_HOME\NETWORK\ADMIN.

Related Topics

About Database Connections

Create New Connections

Edit TNSNames Files


Limitations of the TNSNames Editor

The TNSNames Editor supports much of the standard Oracle syntax. There are, however, certain old or advanced features that it does not support:

  • Multiple Description Lists

    Note: Multiple Description entries are supported, and a DESCRIPTION_LIST will be created automatically to encompass them.

  • Multiple Address Lists
  • No ADDRESS_LIST keyword (The editor parses it correctly, but it adds the ADDRESS_LIST parameter back in to the entry, which produces a completely equivalent configuration. Existing entries with multiple ADDRESS_LIST tags are preserved, even if edited in the Editor window. )

In all of these cases, the TNSNames Editor will not change the entry unless the user chooses to edit that particular entry. If you do not try to change a non-supported entry, the file will remain useable.

If you do try to edit a service name with one of these unsupported features, the editor does its best to parse the entry into the Edit Service dialog box. It will write the entry into a structure it does support, if you click OK in the Edit Service dialog box and then save the file.

Whenever the TNSNames Editor overwrites a file, it first makes a backup of that file in the same directory. So if you do accidentally cause problems to your file, you can revert to the backup.


OPS$ Accounts

Toad can accept system logins where the operating system validates the user and password. See About Database Connections for more informationabout system logins.

Select the database alias and leave the Username and Password boxes empty. Oracle will prefix your workstation login and attempt a login.

In order to use OPS$ accounts, the customer's database init.ora initialization parameters file must have these two entries:

remote_os_authent = TRUE

os_authent_prefix = OPS$

(or whatever prefix you select)

The user account must be created like this:

create user (username)identified externally...

Oracle verifies that the operating system username matches the database username specified in the database connection. Oracle takes the operating system username: for example, SCC14433, and places the "os_authent_prefix" value in front, to yield "OPS$SCC14433", which is then used as the schema name in Oracle. For example, "select * from all_objects where owner = 'OPS$SCC14433'".

Scenario

Joe Smith logs onto the ORA805 database, enters "ORA805" in the Database box, and leaves Username and Password empty. His NT login is "JSMITH" which gets prefixed with "OPS$" giving a username of "OPS$JSMITH". Oracle attempts a login and Toad starts up.

The next time you open the Server Login window, any previous logins that were O/S authentication logins will have username = "EXTERNAL". So, you do not need to type the word EXTERNAL in the username box when reconnecting.

Using "Create user ... identified externally..." lets a database administrator create a database user that can only be accessed from a specific operating system account. During a database connection, Oracle verifies that the operating system username matches the specified database username (prefixed by the value of the initialization parameter OS_AUTHENT_PREFIX). Basically, you are relying on the login authentication of the operating system to ensure that a specific operating system user has access to a specific database user. So, the effective security of such database accounts is dependent entirely on the strength of the operating system security mechanisms. This presents a security loophole on Windows 95 and 98, where specific users are not identified. Windows NT identifies each user with a specific username.


Troubleshoot Connections

General Connection Issues

Problem

Description and Possible Solution
Cannot connect to Oracle

You must have a full install of a 32-bit version of Net8. Connecting by SQL*Plus is not verification that Net8 is installed.

Confirm that the registry setting specifies the correct folder where your TNSNames.ora file lives:

HKEY_LOCAL_MACHINE\Software\Oracle\TNS_ADMIN

If you cannot connect to Oracle using Toad, your Oracle client software may not be installed correctly. Re-install the Net8 client from the Oracle setup disks. Or, if you have installed OEM, NetAssist, Oracle Lite, or any other Oracle software recently, remove that software and see if you can connect using Toad.

This issue can also be caused by an error in the TNSNames file. See Edit TNSNames Files for more information.

Toad is connecting with the wrong Oracle Home

The default home that Toad uses matches the one you have chosen in the Oracle Home Selector, unless you have previously selected the checkbox: Make this the Toad default home.

Only one Oracle home can be in use at one time. This means that once a connection is made, all future connections use the same Oracle home, regardless of default home. If you want to use a different Oracle home, you must close all open connections first.

OCI/DLL Not Found

(Cannot load OCI DLL: <path to OCI.DLL>)

This problem commonly occurs when customers use a 64-bit Oracle client, which is not supported. Toad requires a 32-bit client. See the Toad for Oracle Installation Guide for more information.

If you have a 32-bit client, make sure that the Oracle BIN directory is in your system path. This directory will be ORAWIN\BIN, or ORANT\BIN, or something similar.

To check your path, Open a command line window, type PATH, and then press Enter.

Database Login Window

Problem

Description and Possible Solution

There's an X beside TNSNames Editor or SQLNet Editor.

Toad can't find the TNSNames.ora file or the appropriate SQLNet file. Make sure they are in the appropriate directory, and that your path points to them.

All of my past connections are not visible in the grid.

Clear the Show favorites only and Show selected home only fields in the bottom of the Database Login window.

Toad is/is not saving the password for a connection.

Make sure the Save Password column is selected or cleared as appropriate in the row for that connection. If Toad is saving all passwords and you do not want them saved, make sure the Save passwords checkbox beneath the grid is cleared.

Note: If the Save Password field is disabled, your ability to save passwords may have been removed during installation. See the Toad for Oracle Installation Guide for more information.

Related Topics

Create New Connections


Popular Shortcut Keys

This topic covers some of the most popular shortcut keys in Toad. Toad provides dozens of standard shortcut keys, and you can assign new ones or customize the standard ones. Toad also allows you to print out your current list of shortcut keys. Review the following for additional information:

  • Print List of Shortcut Keys
  • Customize Shortcut Keys

Note: If you have customized your shortcut keys, you will not automatically be able to use new shortcuts added in Toad upgrades. However, you can reset your shortcut keys to the default to gain access to all new shortcuts. See Shortcut Keys Options for more information.

General | Description
CTRL+D | Open Quick Describe window. See Describe Objects for more information.
CTRL+TAB | Cycle through a collection of "child windows" or tabs in a window
F1 | Open the Toad documentation
F4 | Immediately describe object in popup window. See Describe Objects for more information.
F10 | Display right-click menu
Debugger | Description
CTRL+F5 | Add watch at cursor
CTRL+ALT+B | Display the PL/SQL Debugger Breakpoints window
CTRL+ALT+D | Display the PL/SQL Debugger DBMS Output window
CTRL+ALT+E | Display the PL/SQL Debugger Evaluate/Modify window
CTRL+ALT+C | Display the PL/SQL Debugger Call Stack window
CTRL+ALT+W | Display the PL/SQL Debugger Watches window
F11 | Run (continue execution)
F12 | Run to cursor
SHIFT+F5 | Set or delete a breakpoint on the current line
SHIFT+F7 | Trace into
SHIFT+F8 | Step over
SHIFT+F10 | Trace out
SHIFT+CTRL+F9 | Set parameters
Editor | Description
ALT+UP | Display previous statement
ALT+DOWN | Display next statement (after ALT+UP)
CTRL+B | Comment block
CTRL+E | Execute Explain Plan on the current statement
CTRL+M | Make code statement. See Strip Code Statement and Make Code Statement Functions for more information.
CTRL+P | Strip code statement. See Strip Code Statement and Make Code Statement Functions for more information.
CTRL+T | Display pick list drop-down There are a variety of shortcut keys to use with the pick list. See Toad Insight Pick List Shortcuts for more information.
CTRL+F9 | Verify statement without execution (parse) in the Editor
CTRL+F12 | Pass the SQL or Editor contents to the specified external editor. See Use an External Editor for more information.
CTRL+PERIOD | Display code completion list
CTRL+ENTER | Execute current SQL (same as SHIFT+F9)
CTRL+ALT+PAGEUP | Navigate to the previous results panel tab
CTRL+ALT+PAGEDOWN | Navigate to the next results panel tab
F2 | Toggle full screen Editor
F5 | Execute as script. See Execute Scripts for more information.
F6 | Toggle between Editor and Results panel
F7 | Clear all text, trace into the Editor
F8 | Recall previous SQL statement in the Editor
F9 | Execute statement in the Editor
SHIFT+F2 | Toggle full screen grid
Find and Replace | Description
CTRL+F | Find text
CTRL+G | Go to line number
CTRL+R | Find and replace
F3 | Find next occurrence
SHIFT+F3 | Find previous occurrence


Print List of Shortcut Keys

You can print your list of shortcut keys to use as a reference.

To print the list of shortcut keys

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Toolbars/Menus | Shortcuts.
  3. Click the Category or Shortcut column to sort the list.
  4. Click Print.


Customize Shortcut Keys

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Note: If you have customized your shortcut keys, you will not automatically be able to use new shortcuts added in Toad upgrades. However, you can reset your shortcut keys to the default to gain access to all new shortcuts. See Shortcut Keys Options for more information.

Menu Hot Keys

Menu hot keys are the keys that you access by pressing the ALT key and then the character in the menu item that is underlined to open that menu or command. You can configure the underlined character.

To change the hot key

  1. Right-click the toolbar and select Customize.
  2. Right-click the menu item you want to change.
  3. Change the underlined character by changing the location of the ampersand in the Name field. For example, &Tools underlines the T, while T&ools underlines the o.

Shortcut Keys

To change shortcut keys

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Toolbars/Menus | Shortcuts.
  3. Select the command for which you want to set or change the shortcut keys.

  4. Type the keystrokes you want to use.

    The shortcut key is changed as you type. If there is a conflict with another shortcut key, an asterisk (*) displays in the Conflict column. You can then find the conflict and remove it.

    Note: This option only allows you to use one keystroke after a control key (such as CTRL or ALT).

Related Topics

Print List of Shortcut Keys

Popular Shortcut Keys


About Customizing Toolbars and Menus

You can customize Toad's default menus and toolbars, and you can create new ones with custom options. This lets you arrange Toad to best reflect how you want to work. Review the following for additional information:

  • Create New Toolbars and Menus
  • Customize Toolbars and Menus

In addition, Toad menu bars can configure themselves to how you work with Toad. As you work, Toad collects usage data on the commands you use most often. Menus personalize themselves to your work habits, moving the most used commands closer to the top of the list, and hiding commands that you use rarely. See Customize Toolbars and Menus for more information.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

View New or Previously Removed Commands

If you are using a custom configuration, new commands are not added to your custom toolbars when you upgrade Toad. However, you can see both new commands and commands that have been completely removed from the toolbars and menus.

Note: Commands that have been removed from the toolbar and not the menu bar (or the other way around) do not display in the Unused area. Because of this, it may not be obvious that you have removed a command from one location and not the other.

To view new/removed commands

  1. Right-click the toolbar/menu and select Customize.
  2. Select the Commands tab.
  3. To view new commands, select [New] in the Categories field.
  4. To view commands you removed, select [Unused] in the Categories field.
  5. To add a new/removed command to a menu/toolbar, drag the command to the toolbar/menu.

Related Topics

Display Additional Menus

Display/Hide Toolbars

Reset Default Toolbars and Menus

Customize Shortcut Keys


Create New Toolbars and Menus

If you want to heavily modify an existing toolbar or menu, it may be easier to create your own custom toolbar or menu instead.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To create a custom toolbar or menu

  1. Right-click the toolbar/menu and select Customize.
  2. Create the new toolbar/menu. Review the following for additional information:
    3. To create a... Complete the following:

    toolbar
    1. Click New.
    2. Enter a name your new toolbar. A blank toolbar displays in the user interface below the existing toolbars.

    menu
    1. Select the Commands tab.
    2. Select New Menu in the Categories field.

    3. Select New Menu in the Commands field and drag it to the menu bar where you want it located. The pointer changes to a vertical I-bar at the menu bar.

      Tip: You can create sub-menus by dragging a new menu into an existing one.

  3. To add commands, select the Commands tab in the Customize window. Drag the command from the Commands field to the toolbar/menu. An I-bar pointer marks where the command will be dropped

    Note: You can rearrange and rename the commands, toolbars, and menus. See Customize Toolbars and Menus for more information.

  4. To lock the toolbars, right-click a toolbar and select Lock Toolbars.

Related Topics

About Customizing Toolbars and Menus

Display Additional Menus

Display/Hide Toolbars

Reset Default Toolbars and Menus


Customize Toolbars and Menus

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

To customize the toolbar or menu

  1. Right click the toolbar or menu and select Customize.

  2. Change the toolbar or menu. Review the following for additional information:

    If you want to... Complete the following:

    Change the order of commands

    Drag the item on the toolbar/menu to where you want it. An I-bar pointer marks where the command will be dropped.

    Add commands

    Complete the following:

    1. Select the Commands tab in the Customize window.
    2. Drag the command from the Commands field to the toolbar/menu. An I-bar pointer marks where the command will be dropped.

    Rename the toolbar, menu, or command

    Complete the following:

    1. Right-click the icon or text on the item you want to change.

    2. Enter the new name in the Name field. If you want to define a hotkey, include an ampersand (&) before the letter you want to assign as the hotkey.

      Note: These are not the same as Toad shortcut keys, but rather the underlined letter for keyboard navigation. See Customize Shortcut Keys for more information.

    Remove a command or menu

    Right-click the item and select Delete.

    Tip: You can create sub-menus by dragging a new menu into an existing one. See Create New Toolbars and Menus for more information.

  3. To have Toad menus configure themselves, select Menus show recently used commands first on the Options tab.

    If you select this option, Toad collects usage data on the commands you use most often. Menus personalize themselves to your work habits, moving the most used commands closer to the top of the list, and hiding commands that you use rarely.

  4. To lock the toolbars, right-click a toolbar and select Lock Toolbars.

Related Topics

About Customizing Toolbars and Menus

Display Additional Menus

Display/Hide Toolbars

Reset Default Toolbars and Menus


Display Additional Menus

You can display additional menus, such as Team Coding or Create Objects.

To display additional menus

  1. Right-click the menu bar and select Customize.
  2. Select the Commands tab.
  3. Select Menus in the Categories field.
  4. Click the menu you want to add (for example, Team Coding) in the right pane and drag it to the menu bar where you want it located. The pointer changes to a vertical I-bar at the menu bar.

Related Topics

About Customizing Toolbars and Menus

Create New Toolbars and Menus

Customize Toolbars and Menus

Display/Hide Toolbars

Reset Default Toolbars and Menus


Display/Hide Toolbars

To change the toolbars you display

  1. Right-click the toolbar area.
  2. Select the toolbars you want to display, and clear the toolbars you want to hide.

Related Topics

About Customizing Toolbars and Menus

Create New Toolbars and Menus

Customize Toolbars and Menus

Display Additional Menus

Reset Default Toolbars and Menus


Reset Default Toolbars

Reset Default Toolbars and Menus

To reset default toolbars and menus

» Right-click a toolbar and select Restore defaults.

Restore Lost Toolbars

It is possible to remove all the toolbars from the Editor. If this happens, you can restore the toolbars to your windows without resetting all the default settings.

To restore lost toolbars from the Editor

  1. Right-click the Desktop panels tab area.
  2. Select Desktop Panels | Customize Toolbar.
  3. Select the Toolbars tab.
  4. Select the Editor toolbars you want to display.

Related Topics

About Customizing Toolbars and Menus

Create New Toolbars and Menus

Customize Toolbars and Menus

Display Additional Menus

Display/Hide Toolbars


RMAN Scripts in Toad

This feature is only available in the commercial version of Toad with the optional DB Admin module.

You can execute RMAN scripts from Toad.

  • Edit templates
  • Add templates to the listing
  • Execute RMAN scripts

See Working with RMAN Templates for more information.

A video tutorial is available for this feature. This opens a new browser window and requires an internet connection.

Templates are edited and created from the Toad Options window. Execution takes place from the Database Browser. RMAN executes outside of Toad and automatically closes when finished.

Related Topics

Working with RMAN Templates

Execute RMAN Scripts from Toad


Working with RMAN Templates

RMAN templates are stored in a property file within the User Files directory. See Properties Files for more information and more specific location information.

From the Toad Options window, you can add your own files, edit existing ones, and remove them from the listing.

To view the RMAN files listing

» From the View | Toad Options window, select RMAN templates.

To add files to the RMAN files listing

  1. From the View | Toad Options | RMAN Templates page, click Add.
  2. Enter the name you want displayed in the listing.
  3. Do one of the following:
    • Enter the filename and path in the Filename box
    • Browse to the file using the drilldown [image] button.
  4. Click OK.

To edit an RMAN file

  1. From the Options | RMAN Templates page, select the file you want to edit.
  2. Click Edit.
  3. Edit the file in the external editor, save it and close the editor.

To remove files from the RMAN files listing

  1. From the Options | RMAN Templates page, select the file you want to remove.
  2. Click Delete.
  3. Click Yes when prompted.

Related Topics

RMAN Scripts in Toad

Execute RMAN Scripts from Toad


Executing RMAN Scripts in Toad

Execute RMAN Scripts from Toad

You can execute RMAN scripts from the Toad Database Browser.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To run an RMAN script

  1. From the Database Browser, right-click on the target database. See Database Browser for more information.
  2. Select Generate RMAN script and then select the script you want to run.
  3. Enter the variables that are not defined automatically, and select the ones you want to apply. Click OK to send the script to the Editor.

    4. Note: If there are no variables to be defined, the script will be sent directly to the Editor.

  4. Press F9 to run the script.
  5. RMAN opens and runs outside of Toad and then closes independently.

Related Topics

RMAN Scripts in Toad

Working with RMAN Templates


Data Duplicates

Use this dialog box to view record duplicates based on user input.

To view record duplicates

  1. Select Database | Compare | Data Duplicates
  2. Select the Owner, Object Type and Object from the drop-down lists. A list of columns is displayed below. Now, you can either:
    3. Find duplicates on all columns | Check the Find duplicates on all columns option button. Do not select any columns in the list.
Find duplicates on just selected columns | Check the Find dupes of selected columns option button. Select one or more columns in the column list.
On the Duplicate Data tabs, an additional column called Occurences is added to the end of the grid to display the number of resulting duplicates.

To edit duplicate data

  1. From the Table Data Duplicates window, select Owner and Table from the drop-down lists.
  2. Click the Duplicate Data (Editable) tab.
  3. Click the cell you want to edit and make your changes.
  4. Click [image] on the toolbar.


Single Object Compare

Compare Single Objects

You can compare single objects from the Schema Browser. All objects accessible from the Schema Browser can be compared.

To compare objects

  1. In the Schema Browser, right-click on an object.

  2. Select Compare with another object.

    Note: Reference source information will be filled in for you.

  3. Enter comparison source information (a text file or an object in a live schema).

    4. Select options to apply:

    Compare columns only | Applies only to tables, views, and materialized views.
Alphabetical | Arranges columns alphabetically before comparing.
Format before comparing | Formats both files consistently so that cosmetic differences do not impact your results.

  4. If you are using Toad with the optional DB Admin Module, you can choose to view your results in one of two ways:

    Results as File Compare

    Use the Differences Viewer to compare the two selected objects. For more information about the differences viewer, see Compare Files.

    Results as Sync Script

    Only available if the objects chosen have the same name, and are in different schemas, this option the objects and creates a sync script.


Compare Databases

You can compare database-level objects such as tablespaces, roles, users, and so on between databases or Database Definition Files

Notes:

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To compare databases

  1. Select Database | Compare | Databases.
  2. Complete the fields as necessary. Review the following for additional information:
    3. Databases Tab Description

    Reference Source

    Select a live database or database definition file to use as the basis for comparison. If you execute the sync script, the target database is updated to match the reference source.

    Tip: If you select Create Database Definition File, you can use variables in the filename. By default, Toad includes the %DATEFILE% and %TIMEFILE% variables, which inserts the current date and time into the filename when it creates the definition file.

    Targets and Output

    Click [image] in the Live Databases or Def Files field to add a target database for comparison. You can repeat this step to compare multiple target databases to the source.

    Tip: Right-click a target to edit it, delete it, or switch it with the reference source.

    Options Tab

            Description

    Database Object Types

    Select the object types you want to compare. Reducing the object types reduces the amount of time it takes to complete the comparison.

    Tip: Right-click to select or clear all fields.

    "Safe Drop" on users, tablespaces, and profiles

    Select to only drop a user or tablespace if it does not own any objects, or a profile if no users are assigned to it.

    Object Set Tab

            Description

    Specify Object Set

    Select to determine specific object sets to compare. This lets you limit your comparison even more than the Options tab.

    Click [image] to add an object set. If you already have objects loaded, a confirmation dialog ask you if you want to clear the grid before loading the new objects. Click Yes to start over, or No to append the new objects into the grid.

  3. Click [image] to execute, or save or schedule the selections as a Toad action. See Automation Designer Overview for more information.

    Tip: You can execute actions from the command line. See Execute Actions from the Command Line for more information.

  4. Review the differences on the Results tab. Review the following for additional information:

    If you want to...

    Complete the following:

    Show the sync script for selected objects.

    Select the objects and click [image].

    View the differences for one object

    Select the objects and click [image].
    View the differences for another target Select the target in the Target Database field (only applicable if you selected more than one target for comparison).

  5. To sync the databases, select the Sync Script tab and click [image] to execute immediately from the Editor or [image] to schedule its execution.

    Caution: Review this script thoroughly before executing it to prevent unintentional data loss.


Compare Schemas

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Note: You can compare schemas in the base Toad editions, but definition files and sync scripts are available only in the commercial version of Toad with the optional DB Admin Module.

To compare schemas

  1. Select Database | Compare | Schemas.
  2. Complete the fields as necessary. Review the following for additional information:
    3. Schemas Tab Description

    Reference Schema (Source)

    Select a schema connection or schema definition file to use as the basis for comparison. If you execute the sync script, the target schema is updated to match the reference source.

    Tip: If you select Create Schema Definition File, you can use variables in the filename. By default, Toad includes the %DATEFILE% and %TIMEFILE% variables, which inserts the current date and time into the filename when it creates the definition file.

    Targets and Output

    Click [image] in the Live Schemas or Def Files field to add a target schema for comparison. You can repeat this step to compare multiple target schemas to the source.

    Tip: Right-click a target to edit it, delete it, or switch it with the reference source.

    Options Tab

            Description

    Object Types to Compare

    Select the object types you want to compare. Reducing the object types reduces the amount of time it takes to complete the comparison.

    Tip: Right-click to select or clear all fields.

    Object Set Tab

            Description

    Specify Object Set

    Select to determine specific object sets to compare. This lets you limit your comparison even more than the Options tab.

    Click [image] to add an object set. If you already have objects loaded, a confirmation dialog ask you if you want to clear the grid before loading the new objects. Click Yes to start over, or No to append the new objects into the grid.

  3. Click [image] to execute, or save or schedule the selections as a Toad action. See Automation Designer Overview for more information.

    Tip: You can execute actions from the command line. See Execute Actions from the Command Line for more information.

  4. Review the differences on the Results tab. Review the following for additional information:

    If you want to...

    Complete the following:

    Show the sync script for selected objects.

    Select the objects and click [image].

    View the differences for one object

    Select the objects and click [image].
    View the differences for another target Select the target in the Target Schema field (only applicable if you selected more than one target for comparison).

  5. To sync the schemas, select the Sync Script tab and click [image] to execute immediately from the Editor or [image] to schedule its execution.

    Caution: Review this script thoroughly before executing it to prevent unintentional data loss.


Compare Data

You can use Toad's Compare Data wizard to compare data between tables within different schemas, or different databases. This can be useful for comparing the data in a production and test environment, for example.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To access the Compare Data wizard

  1. From the Database menu, select Compare | Data.

  2. Review the following for additional information:

    Select data sources page

    Description

    Use DB Link box

    If your first data source is remote, select an existing DB Link.

    If your first data source is local, leave this box blank.

    Object Type

    Tables, Views and Snapshots are supported.

    Select Performance Options Page

    Description

    Sort Area Size

    This only affects queries going through a Database Link.

    When selected:

    • The default area size is 10 MB
    • You can select to set another sort area size when the first window closes. The default for this is also 10MB.

    Optimizer Hints - Use parallel hint

    Default: Cleared

    When selected, you can set the amount of parallelism you want. The default amount when checked is 4.

    Select Columns to Compare

    Description

    Column colors

    Black - Columns display in both sources and can be compared.

    Red - Columns cannot be compared.

    Purple - Columns display only in Source 1.

    Teal - Columns display only in Source 2.

Related Topics

Reviewing Differences


Reviewing Differences

From the last three windows of the Compare Data wizard you are now ready to view the differences between your data sources. See Compare Data for more information.

  • The first window reviews rows in Source 1 that are not in Source 2.
  • The second window reviews rows in Source 2 that are not in Source 1.
  • The last window reviews all differences.

You must run the SQL code for each window as described below.

Editable Datasets

You can edit the dataset from within the grid. In some editions of Toad, you can delete rows from one table, and insert them into the other directly in the grid.

To make dataset editable

» On the Review Differences page, select the Editable Dataset checkbox.

To review rows

  1. Perform any desired optional steps:
    • Click the View/Edit SQL button to view or edit the SQL used to compare differences. You can make changes in the Edit SQL dialog box.
    • Click Check to verify that the query parses correctly.
    • Click OK to apply changes to your query.
    • Click Execute to find differences in the columns you want to compare.

To delete selected rows

  1. Select the rows you want to delete.
  2. Right-click and select Delete Selected Rows.

To delete all rows

» Right-click and select Delete All Rows.

Related Topics

Comparing Data


Compare Files

Compare Files and Objects

You can use the File Differences Viewer to compare the contents of two files from a disk, or an object to a file or to another object.

To compare tabs in the Editor

» Press and hold CTRL while dragging one tab onto the other tab.

To compare two files on disk

  1. From the Utilities menu, select Compare Files.
  2. Select one or two files.
  3. Click OK.

To compare objects in the Schema Browser

» From either the Procedures or Views page, right-click on an object and select Compare with another object. See Compare Single Objects for more information.

To compare differing objects from a schema compare

» From the Schemas | Results (Interactive) tab, right-click an object listed as differing between schemas and select Show Difference Details to compare the scripts of the two objects. See Compare Schemas for more information.

Related Topics

Team Coding Overview

Viewing File Differences

File Comparison Rules

Difference Viewer Options


Viewing File Differences

When you have specified the objects you want to compare, whether they are files, database objects, or scripts, you can use the Differences Viewer. See Compare Files and Objects for more information.

The Differences Viewer lets you compare database objects in a split window. Differences between the objects are highlighted and the toolbar gives you access to controls for customizing the view and creating reports.

File Comparison Rules and Options let you specify the way Toad displays the similarities and differences between two files, or two versions of a file.

Thumbnail view

This lets you quickly change sections of the file. The thumbnail view (to the left of the viewing window) is a visual summary of differences. Colored lines show the relative position of line mismatches. A white rectangle represents the part of the text currently visible in the Differences Viewer window. You can click the thumbnail view to position the viewer at that point in the documents.

Related Topics

Team Coding Overview


File Comparison Rules

To access file comparison rules

» Click [image] on the differenced viewer toolbar. See Compare Files and Objects for more information.

Available Rules

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

General Tab

Synchronization Settings

Synchronization Settings control the comparison engine that reports differences and similarities between files. Unless you are experienced in manipulating comparison synchronization algorithms, you will probably find that the default settings work well enough for most situations. In general, the following principles apply:

  • Set the synchronization parameters low - Allows more efficient searches for small differences.
  • Set the synchronization parameters higher - Handle larger files or files with large differences.
  • Initial Match Requirement - The minimum number of lines that need to match in order for text synchronization to occur.
  • Skew Tolerance - The number of lines the Differences Viewer will search forward or backward when searching for matches. Smaller numbers improve performance.
  • Suppress Recursion - Refers to the method used to scan for matches. Recursion improves the ability to match up larger as well as smaller sections of text, but it can take longer.

Minor Differences

Use the Ignore Minor Differences checkbox to activate or deactivate the highlighting of minor differences in the Differences Viewer window. (As explained below, you specify what constitutes minor differences in the Rules options under Define Minor Differences.)

Define Minor tab

You can have the comparison engine either highlight or ignore minor differences—such as comments, or spacing characters and tabs. This gives you the option of focusing only on significant differences, or, alternatively, reviewing even minor differences between versions. Place a checkmark next to the items that you want to classify as minor differences. Then, under the General category, you can select or clear the Ignore Minor Differences checkbox.

Line Weights tab

The Line Weights tab lets you assign synchronization priorities to the lines that match. You can use the values listed in the tab, or you can create your own.

Miscellaneous tab

Use the Miscellaneous tab to make choices about line termination.

You can also limit comparisons to specific columns by entering a column range in the comparison boxes.

Related Topics

Compare Files and Objects

Viewing File Differences

Difference Viewer Options


Difference Viewer Options

To access options

» Click [image] in the Differences Viewer. See Compare Files and Objects for more information.

From this dialog box, you can set the colors and other visual characteristics used to highlight the following elements in the Differences Viewer:

  • Matching text
  • Similar text
  • Different text
  • Missing text
  • Horizontal lines between mismatches

You can also set Find Next difference to use position only (so as not to obscure color coding), or normal line selection.

Related Topics

Compare Files and Objects

Viewing File Differences

File Comparison Rules


Review the Alert Log

The alert log is a text file stored on the server that lists all messages and errors from an Oracle database. This file is a good resource for identifying issues with a database, but due to its formatting it can be difficult to read and assess.

The Alert Log Viewer allows you to easily access the alert log and review it for issues. It groups events on a single row in the grid, and the lower portion of the screen lists the lines associated with the selected grid row.

Notes:

  • The user account must have the EXECUTE privilege on Oracle's UTL_File package. The SYS schema has this privilege by default.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To review the alert log

  1. Select Database | Diagnose | Alert Log Viewer.

    Tip: The Alert Log Viewer accesses the log for your current database connection. Click [image] to connect to a different database.

  2. Select a history length in the Amount to load field.

  3. Click [image].

    Tips:

    • You can filter, sort, and save the alert log results.
    • You can double-click a trace file to open it.


View Extents

To view extents

  1. From the Database menu, select Diagnose | Extents.
  2. Select the desired Object Type: All Objects, Tables, Indexes, Rollback, or Cluster.
  3. Click [image] to fetch results.

To see extents for objects owned by SYS

» Select SYS from the Owner list.

Note: If you have access to the DBA_views, make sure the View | Toad Options | Startup | Check for DBA Views checkbox is checked. If it is checked, the Owner drop-down list will become active, and a DBA user can select a specific schema owner. Click GO to fetch the results.

Related Topics

Results Grids


Identify Space Deficits

This displays tables that do not have enough free disk space to allocate their next extent.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To identify space deficits

» Select Database | Diagnose | Identify Space Deficits.


Log Switch Frequency Map

This screen displays log switch records. Many DBAs try to size their redo logs so that there are few log switches per hour. Frequent log switches can drastically decrease performance, and infrequent log switches can increase database startup times. Use this window to judge the balance of log switches.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the Log Switch Frequency Map

» Select Database | Diagnose | Log Switch Frequency Map.

Note: Log switches in each hour of the day begin with Midnight to 1:00 a.m. A cell is left empty if there were no log switches during that hour, and days with no log switches do not display in the grid at all. Every log switch that is recorded in the control file for the database is displayed.

To see log switch details

» Double-click in any cell for details:
  • Hour column - Just the selected hour.
  • Date, day or total column - Details for the entire day.

To export the grid

» Right-click and select Save As. See Export Dataset for more information.


Tablespace Map

This map provides a graphic view of how space is allocated to objects in the tablespaces in your database. This lets you view Segment Fragmentation by tablespace.

As you move the pointer over cells in the map, Toad displays the segments that consume data blocks represented by that cell. However, if this is a large tablespace that cell might represent hundreds of actual data blocks. Thus they may not overlap at all. Keep in mind that red cells really represent segments that consume a high percentage of blocks for their overall size. Thus they may be candidates for object rebuilds.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To view tablespace graphically

  1. Select Database | Diagnose | Tablespace Map.

  2. Select a tablespace.

  3. Click [image] to fetch the data for the map.
    4. Green | Areas used by selected Tablespace
Red | Areas that equal or exceed fragmentation limits (set in View | Toad Options | DBA). Note: Toad measures Internal Fragmentation, a measure of the fragmentation of the object within the tablespace.

To coalesce a fragmented chart

  1. Select a tablespace.
  2. Click [image] to coalesce and analyze the tablespace.

To view segments and extents

  1. Click either the Segments or Extents tab.

    2. View details for segments and extents as follows:

    Hover the pointer over the tablespace map. | Segments display beside the pointer.
Click in a grid cell | All segments containing those in the clicked cell display in yellow.
Click | Now when you hover the pointer, details display in the Segments dialog, along with percentage of fragmentation.

To filter the tablespace map

  1. Select a tablespace.
  2. Click [image] to fetch the data. Cells representing occupied blocks are highlighted in green.

    3. Click [image]. Filters are arranged in categories:

    Note: Selected filters are cumulative, whether on the same tab or on multiple tabs. They remain in effect until you clear them.

  3. Select the filters you want to see.
  4. You can select multiple filters by holding down CTRL while selecting.
  5. You can also select filters on multiple tabs. The spaces covered by the filters you choose turn yellow on the Tablespace map.

To clear highlighting from View settings and Filters

» Click [image].

To restore window size

» Click [image].

To Display Tablespace Legend

» Click [image].

Quest Space Manager

Quest Space Manager can only be launched if you have it installed and licensed.

To launch Quest Space Manager

» Click [image] on the Tablespace Map toolbar.


TKProf Interface Wizard

The TKProf Interface wizard lets you easily use the TKPROF feature of Oracle, creating the necessary scripts. Oracle provides documentation for the parameters and options. See Oracle's documentation for more information.

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To use this wizard

  1. Select Database | Diagnose | TKProf Interface.

  2. Enter the parameters and options in appropriate fields. Review the following for additional information:

    3. Some Helpful information

    This section displays Ora.ini parameter information. In order to see this information you will need select privileges on v_$parameter.

    Define Input and Output Files

    Description

    Input Files

    These are the trace files that were produced by Oracle when you enabled tracing. Oracle places them in the directory specified by the script USER_DUMP_DEST, also known as the "udump directory".

    Add Input files

    Click the drilldown button beside Files at the top right of the Input Files field.

    • Browse Windows files - select a file from a Windows OS.
    • Open files with FTP - this lets you select files on a UNIX based server.
    • UNIX File name Browse (no file transfer) - This lets you select files on a UNIX server without transferring them. If you want to run TKProf against trace files that are still on the server, you will need to copy the code and run it server side. See TKProf Interface Wizard for more information.

    Output File Extension

    The output files are placed in the same directory as the input files. The filenames are the same, but the extension is different. You can change the extension if necessary.

    Insert File Extension

    Inserts the results of the trace file into a database table

    Record Files

    The record file is a script produced by TKPROF. It records the SQL statements issued by the traced session

    Sort Options

    Description

    Sort Options

    You can choose more than one sort option, and sort results are cumulative from the top of the list to the bottom.

    Other Options

    Description

    Use this table for Explain Plan

    You must also choose Connect to DB to perform Explain Plan to use this option.

    Execution Options

    Description

    Execute Locally

    Use the instance of TKPROF located on your computer. If you do not connect to the database to perform explain plans, you can copy files from any Oracle database of the same or earlier version to your machine to run TKPROF.

    This works as file parsing, with no database activity. Define where your TKPROF is located in Toad Options | Executables. See Executables for more information.

    View Output Files When Finished

    Output files open in your external editor.

    Just copy the commands to the clipboard

    Copies all generated commands into the clipboard. You might use this option if you run TKPROF on a Unix machine by telnet. Toad’s TKPROF interface lets you just paste the code in, saving you the time spent typing.
  3. Complete the wizard.

Related Topics

Executables


Undo Advisor

Undo Advisor Overview

The Undo Advisor in Oracle versions 10g and later provides advice and helps to automate the establishment of the database undo environment. Use the advisor to analyze the health of the current undo configuration, either overall or within a given time range. From this baseline, you can then:

  • Alter the Undo tablespace
  • Switch to another Undo tablespace
  • Adjust the database's retention time
  • Create projections of required undo space given a retention time that you define

Notes:

  • Unless you have instructed Toad to make this window accessible, this functionality is disabled by default. You can restore functionality from View | Toad Options | Windows and clicking the Available checkbox in the appropriate row of the grid.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the Undo Advisor

» Select Database | Diagnose | Undo Advisor.

Related Topics

Altering the Undo Tablespace

Altering Undo Retention

Switching Tablespaces


Altering the Undo Tablespace

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The Undo Advisor lets you alter the current Undo Tablespace. You can change some of the basic information options, and also add, edit or remove data files.

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To alter the undo tablespace

  1. Confirm that the current tablespace is the one you want to alter. If not, switch to the correct tablespace before continuing. See Switching Tablespaces for more information.
  2. On the Undo Advisor toolbar, click [image].

Related Topics

Undo Advisor Overview

Altering Undo Retention

Switching Tablespaces


Altering Undo Retention

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Altering the undo retrention time frame may require additional tablespace. Because of this, Toad also provides an estimate of required tablespace so that you can gauge what to add. See Undo Advisor Overview for more information

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To estimate required tablespace

» Enter the desired retention in the For this amount of retention box.

Note: The required undo size for the selected options is displayed beneath it.

To alter the undo retention

  1. Click [image].
  2. Enter the desired retention in the box.

Related Topics

Undo Advisor Overview

Altering Undo Retention

Switching Tablespaces


Switching Tablespaces

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

If you have multiple undo tablespaces, you can switch between them from the Undo Advisor. See Undo Advisor Overview for more information.

To switch between tablespaces

» From the Undo Advisor, click [image] and select a tablespace.

Related Topics

Undo Advisor Overview

Altering the Undo Tablespace

Altering Undo Retention


Segment Advisor

Active with Oracle 10g and above, this screen is an interface to Oracle's segment advisor. It can examine tables, indexes, and partitions to determine if and how much, space can be reclaimed in them with the SHRINK command.

Notes:

  • Unless you have instructed Toad to make this window accessible, this functionality is disabled by default. You can restore functionality from View | Toad Options | Windows and clicking the Available checkbox in the appropriate row of the grid.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To Access Segment Advisor

» Select Database | Diagnose | Segment Advisor.

The Segment Advisor generates advice at three levels:

Object Level | Advice is generated for the entire object, such as a table. If the object is partitioned, then the advice is generated on all the partitions of the object. Advice does not cascade to dependent objects such as indexes, LOB segments, and so forth.
Segment Level | Advice is generated for a single segment, such as unpartitioned table, a partition or subpartition of a partitioned table, or an index or LOB column.
Tablespace Level | Advice is generated for every segment in the tablespace.

Related Objects

Examining Objects

Advisor Tasks

Advisor Recommendations

Use Excel-Style Filtering


SA_Examining Objects

Examining Objects

Note: This Toad feature is only available in the commercial version of Toad with the optional DB Admin Module.

The heart of the Segment Advisor is its ability to examine objects and give recommendations. See Segment Advisor for more information. You can view objects by owner, object type, or tablespace and then select objects to be examined.

To examine objects

  1. From the Database menu, select Diagnose | Segment Advisor.
  2. Click the Examine Objects tab.
  3. Select a schema from the Object Owner drop down menu.
  4. Select an object type.
  5. From the Tablespace drop-down, select a tablespace (or All tablespaces).
  6. In the grid, select the objects you want to submit for advice in the grid.
  7. Click [image].
  8. Select Segment Advisor options.
  9. Click Execute.
  10. Enter connection information if necessary, and click Connect.

Related Topics

Segment Advisor

Advisor Tasks

Advisor Recommendations

Use Excel-Style Filtering


SA_Advisor Tasks

Advisor Tasks

Note: This Toad feature is only available in the commercial version of Toad with the optional DB Admin Module.

When you have examined objects, you can view or delete the tasks run by the Segment Advisor. See Segment Advisor for more information.

To review tasks

» Click the Advisor Tasks tab.

To delete tasks

  1. Click the Advisor Tasks tab.
  2. In the data grid, select the tasks you want to delete.
  3. Click [image].
  4. Click Yes to confirm.
  5. Enter connection information if necessary and click Connect.

Related Objects

Segment Advisor

Examining Objects

Advisor Recommendations

Use Excel-Style Filtering


SA_Advisor Recommendations

Advisor Recommendations

Note: This Toad feature is only available in the commercial version of Toad with the optional DB Admin Module.

Advisor recommendations is the output of a Segment Advisor task. See Segment Advisor for more information about creating tasks. Toad sorts recommendations into an easy-to-read grid format.

You can choose to display either only the tasks you have created, or only tasks entered through Toad.

To act on recommendations

  1. Select the recommendation you want to use.
  2. Click on one of the toolbar buttons.
  3. Complete any required steps.

Related Topics

Segment Advisor

Examining Objects

Advisor Tasks

Use Excel-Style Filtering


LogMiner Overview

The Oracle LogMiner packages DBMS_LGMNR and DBMS_LOGMNR_D help you extract information from the online or archived Oracle redo logs. This information can be used to analyze where problems occurred. With LogMiner, if a System Change Number (SCN) caused a corruption problem, you can analyze the database and recover to the transaction exactly before the corruption.

This package is only available in Oracle 8i and above.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the LogMiner Interface

From the Database menu, select Diagnose | LogMiner.

See Logminer Wizard for more information about the wizard itself.

Requirements

Before Toad starts LogMiner, it checks whether all of the requirements for using the LogMiner have been satisfied. These include:

  • Execute privileges on DBMS_LOGMNR
  • Execute privileges on DBMS_LOGMNR_D
  • Select privileges on V$LOGMNR_CONTENTS
  • Select privileges on V$LOGMNR_LOGS
  • Parameter UTL_FILE_DIR set in init.ora (required for Oracle 8i only)

If any of these parameters are not met, Toad will display a screen listing them, with the missing requirement displayed in red.

Troubleshooting

  • Access to some V$ tables are required to use this option. See Database | Diagnose | LogMiner for more information about required tables for LogMiner.
  • If you cannot access V$PARAMETER, V$LOGFILE, V$SESSION, V$VERSION, the screen will still work, but will not do some things automatically for you (such as tell you if utl_file is not set up, automatically determine where your log files are stored, or so on).
  • If you cannot access things that are actually required (like execute privs on dbms_logmnr) the screen will tell you what is required, and the permissions you are missing will be highlighted.

Related Topics

Logminer Wizard

LogMiner Interface Grid


Logminer Wizard

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To use the Logminer wizard

  1. From the Database menu, select Diagnose | LogMiner.

  2. Review the following for additional information:

    Dictionary

    You can choose to use DBMS_LOGMNR_D.BUILD to create a new dictionary file, or you can specify the location of an existing file.

    This window saves its settings. If you enter a path and filename, then close the wizard; the path and filename will still be filled in when you reopen the window. Options vary depending on what version of Oracle you are using:

    Oracle 8i

    • Verify UTL_FILE Parameter - This box displays the value of the UTL_FILE_DIR.

    If it is incorrect, you will need to edit your init.ora file and then shut down and restart the database to make the parameter change take effect.

    • Dictionary File Name and Path - Enter the file name and directory path of the dictionary. Whether you build a new file or use an existing one, these paths must be entered.

    The dictionary file path must be a path accessible by the database server, and accessible by UTL_FILE.

    Oracle 9i & up

    Dictionary

    • Use Online Data Dictionary - This option is the fastest, because there is no file building required.
    • Use Dictionary in Redo Logs - This option activates the next area, "Next" button action, letting you choose to build a new dictionary or use an existing dictionary.

    Files to Mine

    Click Find Files.

    • From the drop-down, select Select from Online redo logs to open the browse dialog box in the redo log directory. If you have a network drive mapped to the server, the browse dialog box will show the redo log directory; otherwise it will show the last browsed directory you browsed.
    • From the drop-down, select Select from Archive Logs to open the browse dialog box in the archive log directory. If you have a network drive mapped to the server, the browse dialog box shows the archive log directory; otherwise it shows the last browsed directory you browsed.
    • If your database is on a UNIX server, use the FTP-style dialog box.
    • If you are running Oracle 9i and have written a dictionary to the redo logs, be sure to include the redo log containing the dictionary in your file selection.

    Note: If your database is running on a Windows server (but not your local PC) it is important to make sure that the drive letters display as they do on the server when selecting files. For example, if the Browse window adds this file to your file list:

    \\Car004555\d$\oracle\oradata\CARY9I\REDO01A.LOG

    You may want to change it to this:

    D:\oracle\oradata\CARY9I\REDO01A.LOG

    You can edit directly in the files list window.

  3. Complete the wizard.
  4. View results in the Logminer Interface grid.

Related Topics

LogMiner Overview

LogMiner Interface Grid


LogMiner Interface Grid

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To view results in the LogMiner interface grid

  1. Click [image] on the toolbar.
  2. Select the columns you want displayed.

  3. Do one of the following:

    Execute the LogMiner SQL immediately

    Click [image].

    Note: This can take some time, depending on the size of the LogMiner files.

    Copy the SQL into the Editor to edit, save and execute later

    Click

  4. Right-click the grid to:

    Print Grid

    Open the Print dialog, where you can format and print the grid contents.

    Save as

    Export the grid’s contents to a file or to the clipboard.

    Filter

    Filter the information retrieved into a format more suited to your needs. You can set Boolean filter conditions and Apply them to the grid. Click Cancel or close the dialog box to continue. The filter remains on the grid until you open the filter dialog box and click Clear.

In the Editor

Alternatively, you can leave this window open and open a Editor window to view your results. You may need to do this if you want to specify a ‘where clause’ so you can retrieve a more focused dataset from v$logmnr_contents.

To view results in the Editor

  1. Leave the Logminer window open and open an Editor window.
  2. In the Editor, SELECT data from v$logmnr_contents. This data is only available from your current session in the database. It will be cleared when you close the LogMiner interface window or click Back.

Related Topics

LogMiner Overview

Logminer Wizard


Database Health Check

The DB Health Check performs a series of checks on a selected database and displays the results. You can save the results to a color-coded RTF or HTML file, or to a plain text file. You can also send the results through email in any of these formats.

Notes:

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

  • The DB Health Check opens a separate connection to Oracle, and then closes it after the check, even if Toad already has a connection open to the selected database. This connection shows in the Session Browser as a separate session, and could cause difficulties if you have limited Toad connections.
  • Actions performed on jobs are not viewable to other connections until they are committed. This means that when it is run, the DB Health Check does not catch actions that have been performed, but not committed.
  • Health checks require access to the DBA_views and to some of the V$ views. See V$ Tables Required for more information.
  • Health checks utilize optimizer hints configured on the Optimizer Hints options page. See General Oracle Options for more information.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To run a health check

  1. Select Database | Diagnose | DB Health Check.

  2. In the left pane, select the databases you want to check.

    Note: If you select a node in a RAC cluster, Toad tests the entire cluster.

  3. In the Checks tab on the right side of the window, select pre-defined health checks. See DB Health Check - Checks Tab for more information.
  4. Select the appropriate settings on the Settings tab. See DB Health Check - Settings Tab for more information.
  5. If you want to email the results, make appropriate settings to the Email Settings tab. See DB Health Check - Email Results for more information.
  6. When all your options have been set, click [image] on the toolbar.
  7. View results on the Report Output tab. See DB Health Check - Saving Results for more information.

Scheduling Health Check to Run Later

To save your settings as an action from the DB Health Check window

Note: See Automation Designer Overview for more information about ToadApps and Actions.

  1. Create your health check as described above in steps 1 through 4.
  2. Click [image] in the status bar at the bottom of the window.
  3. Select Create, select the ToadApp where you want it to reside, and give it a name.
  4. Click OK.

To create a DB Healthcheck Action from the Automation Designer

  1. From the Automation Designer window, select the app you want to contain the health check.
  2. Click the DB Misc tab, click [image] and then click in the app.
  3. Double-click on the action icon and set properties as described in Database Health Check.
  4. Click Apply, then Cancel to save your settings and close the window.

To schedule your health check

  • From the command line: See Execute Actions from the Command Line for more information about how to schedule or run your health check.
  • As a Windows Task: See Scheduling Actions and Apps for more information.

Related Topics

DB Health Check - Checks Tab

DB Health Check - Settings Tab

DB Health Check - Schemas

DB Health Check - Email Results

DB Health Check - Saving Results

Automation Designer Overview

Creating New Actions


Health Check - Checks and Options

DB Health Check - Checks Tab

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

In the Checks tab of the Health Check window, you can set many different pre-set conditions. Each of these preset checks represents something that a DBA or Developer should be aware of in their databases. In addition, some of these conditions are adjustable.

Finding Specific Checks

There are many checks that you can run on your database. Although checks are grouped by settings, database, and schema checks, you may find that it is difficult to locate every check you want to make just by looking down the list. Toad provides a search feature that will highlight the checks that meet your specified criteria.

To search for a specific health check

» In the Filter: box, enter the word you want to search for.

Note: Toad searches for entries as they are typed. You can enter entire words, multiple or portions of words. For example, you entering data will find checks containing data, datafile, datatype, and so on. However, if you are using multiple words, Toad sees everything you enter as one word. Therefore, Toad will only find the words that are in the order you enter. For example, if you are looking for the check containing "datafile IO distribution," entering "IO datafile" will not find the check you want. You must enter "datafile IO."

Adjusting Conditions in Checks

Some of the conditions described in Check Descriptions are adjustable.

To change parameters

  1. In the Parameters column, click params.
  2. Change the condition and click OK.

Dropping Synonyms

Health check items listing synonyms pointing to nonexistent objects can be dropped using the script provided within the report. The synonyms will be listed, and a script provided.

Related Topics

Database Health Check

DB Health Check - Settings Tab

DB Health Check - Email Results

DB Health Check - Saving Results


DB Health Check - Check Descriptions

DB Health Check - Settings Tab

The Settings tab controls the output content of the health check, how it is stored, and other options.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Check Name

Description

Show output only for ‘bad’ conditions

If this option is checked, Toad displays only items that fail the health check. If your databases are generally in good working order, this can shorten your reports dramatically.

Suppress header for a database when the report is empty

If this option is checked, and your health check ran on several databases in one report, then only the databases that failed the health check will display in the report. While this can shorten your reports dramatically, you will not have a record of the databases that pass all aspects of the health check.

For items 62, 63, and 64, exclude objects in "SYSTEM" tablespaces

This option applies to:

  • List tablespaces that are more than 30% fragmented, having more than 50 total extents
  • List tablespaces with less than 10% free space remaining.
  • List segments that can’t extend because there is not enough room in the tablespace.

Play a custom script at the end of the health check

This option executes a user-supplied script at the end of the health check. The script output is included in health check report.

The file name for the script to play is adjustable.

Store results in table TOAD.TOAD_HEALTH_CHECK in database being checked

Use this option to populate results into a table on each database being checked, or results of all health checks into a single table in a repository database. Use the adjust option to specify one database, or many.

If the table specified does not exist, Toad will attempt to create it when the health check runs.

Save results to file:

This option automatically saves health check results to a file at the end of the health check.

The file name is adjustable, and the type of file is determined by the file extension you specify.

  • If file extension is "HTM", the file will be HTML format.
  • If the file extension is "RTF", the file will be a rich-text format.
  • All other file extensions will result in a non-color coded ASCII text file.

Save differences report to file:

This option saves your differences report to the file specified. Clicking Params lets you change the path to the file location, and the filename.

Always send results by email as HTML

When selected , this option sets when Toad emails results, and the file format of those results. Click params to change when and how results are sent. See DB Health Check - Email Results for more information.

Related Topics

Database Health Check

DB Health Check - Checks Tab

DB Health Check - Schemas

DB Health Check - Email Results


Health Check - Schemas

DB Health Check - Schemas

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The Schemas tab on the Database Health Check window provides you with a location to select the schemas you want to examine.

From this tab, you can:

  • Load schemas from the selected database.
  • Choose how to include schemas (the default is to include all schemas except for SYS, SYSTEM, and so on).

Related Topics

Database Health Check

DB Health Check - Checks Tab

DB Health Check - Email Results

DB Health Check - Saving Results


Health Check - Differences Since Last Run

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Toad's DB Health Check automatically saves health check reports to your user files directory. When a new healthcheck is run on the same database, you can click the Diffs since last run tab to display differences in findings. The differences tab can also be used to compare previously saved reports, and can be printed or saved.

To view differences since last run

    Run a second health check on the same database.

    Note: Settings do not need to be identical.

  3. Click the Diffs Since Last Run tab.
  4. Change any options in the toolbar as desired.

If there are no differences, the differences report will remain blank.

To view differences between two saved reports

  1. Click [image] on the toolbar.
  2. Select two files and click OK.

Toad compares the two and provides a difference report in the Diffs Since Last Run tab.

Diffs Since Last Run Toolbar

You can alter how you view your differences report using the toolbar. You can also save or print the file.

Button | Command
 | Expand all nodes.
 | Expand to first level.
 | Collapse all nodes.
 | Load two reports and run a differences check on them.
 | Save the differences report to a file.
 | Print the Differences report.
Group By | Choose to group by run or item.
Show Differences Only | Show only differences. If there are no differences, the report will be blank.
'Bad' Results only | Display only results that fail the health check.

Related Topics

Database Health Check


Health Check - Email Results

DB Health Check - Email Results

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To have email sent when you run a health check you must first set up the email pages. From the Database Health Check window, click the Checks and Options tab.

You must also have the global Email Options set up with your SMTP server, and recipient addresses. See Email Settings for more information.

To set email parameters

  1. Select the Settings tab.
  2. Click Params beside the Always send results by email as field.
  3. Select when and how to send email.

Related Topics

Database Health Check

DB Health Check - Checks Tab

DB Health Check - Settings Tab

DB Health Check - Saving Results

Email Settings


Health Check - Saving Results

DB Health Check - Saving Results

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

When the Database Health Check report has been executed, you can save the results to a file, in Rich Text Format (.rtf), web page (.htm), or plain text (.txt) format.

To save the report

  1. From the Report Output tab, click [image] on the toolbar.
  2. Enter a name for the report in theFile name: box.
  3. Select the type of file format you want to use for your report.
  4. Click Save.

Related Topics

Database Health Check

DB Health Check - Checks Tab

DB Health Check - Settings Tab

DB Health Check - Schemas

DB Health Check - Email Results

Scheduling Actions and Apps

Execute Actions from the Command Line


Trace File Browser

The Trace File Browser displays the contents of an Oracle trace file so you can easily isolate problem areas. The browser displays trace files on four tabs:

  • Statement Details
  • Wait Summary
  • Query Summary tab
  • File Header

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the Trace File Browser and load a trace file

  1. Select Database | Diagnose | Trace File Browser.
  2. In the Trace File Browser toolbar, click [image].

    3. Note: If your trace file is still located on the server, you will need to use the FTP feature to copy it to your machine where Toad can open it. Click [image] and transfer your file. See FTP for more information.

  3. Select your trace file and click Open.

Troubleshooting the Trace File Browser

Issue | Possible Reason
Blank Columns | In the last several releases, Oracle has added more information to trace files. If the Trace File Browser is displaying a trace file produced by an older version of Oracle, some columns may be blank.
Slow database Performance | Your trace files will be most helpful if you set the statistics_level initialization parameter to ALL. However, some people in the Oracle community warn that setting it to ALL has an adverse effect on performance. You may want to test it and draw your own conclusions.
Timing and Statistics in Trace Files are set to ZERO | If you have the statistics level set to BASIC or NONE then many of the timings and statistics will be ZERO. Be sure to set statistics level to TYPICAL or ALL before starting a trace on a session.

Related Topics

Statement Details

Wait Summary

Query Summary tab

File Header

General Functionality


General Functionality

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

There are several features that can be found throughout the Trace File Browser to make viewing data easier. See Trace File Browser for more information.

Hiding and moving columns in column grids

In many of the grids, right-click in the column header to see a listing of all columns. By default, all columns are visible. If you want to hide certain columns, uncheck them and they will disdisplay from the grid. Toad remembers changes to column visibility, not only when you open the current trace file, but also when you open others.

Change the column order by clicking a column header and dragging the column where you want it. Column position will be remembered.

Autosize columns

You can also right-click in the column header to manually adjust column sizes. Manually sized columns will be remembered.

To manually adjust columns

  1. Right-click in a column header and clear the Autosize column selection.
  2. Manually resize your columns by dragging the edges to the size you want.

To revert to autosize

» Right-click in a column header and select Autosize Columns.

Saving, Printing and Sending to Excel

Right-click in any grid to save, print, or send the contents to Microsoft Excel.

Advice

Toad can provide advice about certain wait events. If a wait event is blue and underlined in the grid, double-click on it to open an advice window.

Navigating the Trees and Grids

You can use the keyboard to move around in the trees and grids as well as the mouse.

Key Command | Navigation
Arrow Up | Previous Node
Arrow Down | Next Node
Arrow Right | Next column to the right
Arrow Left | Prior column to the left
HOME | Leftmost column
END | Rightmost column
SPACE | Expand/Collapse
CTRL+HOME | First Node, Leftmost column
CTRL+END | Last Node, Rightmost column
CTRL+Arrow Right/Left | Scroll horizontally without changing focused node
CTRL+Arrow Up/Down | Scroll vertically without changing focused node
SHIFT+Arrow up | Jump to parent node
SHIFT+Arrow down | Jump to next sibling. If there is no sibling, jump into child nodes

Related Topics

Trace File Browser

Statement Details

Wait Summary

Query Summary tab

General Functionality


Statement Details

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

In the Trace File Browser, the Statement details tab displays details of each statement.

Filtering the statement details grid

Within this window, you can filter the statements by wait with a number of predetermined filters.

To filter the grid

  • Click on the Filter by Wait box and select one of the following filters from the drop down list:
  • None (Show all statements)
  • Net8 message from client
  • Net8 message to client
  • Net8 more data to client

Viewing Selected Details

You can select specific statements and see details of that statement. Details available are displayed on the following tabs in the lower section of the window. In many of these tabs, you can right-click in the grid to hide the idle events.

Tab | Description
SQL Statement | Displays the current statement in full, including any bind variables. Some bind variables may show "n/a" for data type and value. This occurs if the variable is used more than once in the query.
Explain Plan | Displays the execution plan actually used by the query. All timings and totals of each step include child steps. In this way you can see the total for the whole query by looking at the top line.
Executions | Lists the statistics for each execution of the statement.
Fetches | Lists each fetch by query.
Waits | Lists each wait by query. If the "filter by wait" filter is active, then wait types matching the filter are highlighted in blue.
Wait Summary | Displays the wait types for the selected statement, including min, max and average for each wait type.
Transaction Waits | Displays each transaction wait by query. If the "filter by wait" filter is active, then wait types matching the filter are highlighted in blue.
Raw data | Displays the data from the trace file for the selected query. If you want a particular piece of information that is not otherwise displayed in the Trace File Browser, it will display here.
Using these details combined with the aggregate details as provided in the statement grid above it allows you to focus on and diagnose the trouble spots within the trace file.

Related Topics

Trace File Browser

Wait Summary

Query Summary tab

File Header

General Functionality


Wait Summary

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The wait summary tab in the Trace File Browser displays aggregate wait information for the various types of Wait Events. The summary grid at the top of the window displays each distinct wait time in the trace file and some statistics. See Oracle's documentation for more information.

Within this grid, you can right-click to hide idle events.

Details of wait events

The lower portion of the screen displays all statements with at least one wait of the type selected in the summary grid at the top of the screen. A statement will be listed in this area if it has the corresponding wait in the Waits tab, or the Transaction Waits tab of the Statement Details tab.

To view details of the wait events

  • Select a Wait Event in the upper data grid to view details of the statements with that wait in the lower grid.

Related Topics

Trace File Browser

Statement Details

Query Summary tab

File Header

General Functionality


Query Summary

Query Summary tab

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The Query Summary tab in the Trace File Browser displays a summary of queries and statistics contained in the open trace file.

The Bar graph

In addition, the query summary provides a bar graph that charts the Number of queries against the combined exec, parse, fetch and wait times.

You can also separate the Recursive queries from the user queries in the bar graph.

To separate query types

  • Right-click over the bar graph and select Display User and Recursive Queries Separately.

To aggregate query types

  • Right-click over the bar graph and clear Display User and Recursive Queries Separately.

Related Topics

Trace File Browser

Statement Details

Wait Summary

File Header

General Functionality


File Header

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Select the File Header tab to view the file header for the open trace file. This information includes information about the database, server, and session.

All additional information from the trace file can be found in the other tabs of the Trace File Browser.

Related Topics

Trace File Browser

Statement Details

Wait Summary

Query Summary tab

General Functionality


CodeXpert Overview

CodeXpert analyzes the code against a set of rules for best practices. These rules are stored in a ruleset and can be either user-defined or pre-defined. (See Configuring Rulesets.) CodeXpert can be accessed from various locations within Toad.

CodeXpert can store reports within the Toad schema on the database. To enable this feature, CodeXpert objects must be set up using the Server Side Objects window.

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

Related Topics

CodeXpert Options

CodeXpert Parameter File

Run CodeXpert from the Command Line

SQL Scanning Overview


View the CodeXpert Icon Legend

The tree structure of the CodeXpert includes icons to identify the various objects listed. Toad includes an Icon Legend that you can use to easily decipher these images.

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

To access the icon legend

» On the CodeXpert Toolbars, click [image].

Related Topics

CodeXpert Overview


CodeXpert Options

General Options

General options are applicable to all of the CodeXpert.

Prompt for CodeXpert Run names

When selected, Toad will prompt you for a name to use for the database insert. If not selected, Toad will insert it with a number followed by the date and time stamp.

Default: Selected

Use Central Repository for DB Inserts

When this option is selected, Toad will use a central database for database inserts.

If not selected, it will use the active connection. The default is unselected.

To change the repository connection

  1. Select Use Central Repository for DB Inserts.
  2. Click Change.
  3. Do one of the following:
    1. Select a connection from the list of current connections.
    2. Click New and select a connection from the login window.
  4. Click OK.

SQL Scanning Options

Note: This extended Toad feature is only available in Toad for Oracle Xpert edition.

To select SQL Scanning options

» Click [image] on the CodeXpert toolbar.

Scanning tab

Scanning options are designed to help you specify how and what the scanner will scan. In this way, you can choose to ignore duplicate statements, skip some SQL, and so on. See Scanning tab for more information.

SQL Classification Options tab

The classification of SQL statements is designed to help you quickly identify the SQL statements that are likely to be causing performance problems in your database environment. This classification lets you specify the criteria to analyze your SQL statement. A problematic SQL statement indicates potential performance problem because the SQL statement has characteristics that can contribute to poor performance. Optimizing these SQL statements gives you the best possibility for improving the database performance.

These classification settings are used to set the criteria for Simple, Complex, and Problematic SQL statements. See SQL Classification Tab for more information.

Related Topics

CodeXpert Overview

SQL Scanning Overview

SQL Classification Tab

Scanning tab

Applying the Classification Options


Running CodeXpert Alone

Run CodeXpert

By running CodeXpert away from the Editor window, you can analyze multiple files (from either the database or saved files) at one time and schedule CodeXpert runs.

To run CodeXpert

  1. Select Database | Diagnose | CodeXpert.
  2. Load the files you want to analyze into the grid by selecting one of the following:
    • Click [image] to opens saved files.

    • Click [image] to load objects from the database. You can click the drop-down arrow beside this button to load all objects or choose a group of objects to load.

  3. Select the files or objects you want to analyze. You can multi-select using either the Shift or Control key.
  4. In the Ruleset drop-down, select the ruleset you want to use. See Configuring RuleSets for more information. If you have the Toad Xpert Edition, you can toggle the SQL Scan button on or off as desired. (The default is on.)
  5. Click [image].
  6. To send the results to the Editor, click [image].

Related Topics

CodeXpert Overview


Results Tab

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

The CodeXpert Results tab displays results of the analysis. This is provided in a tree hierarchy. The main window displays all rules in the selected ruleset, and provides details of the rules that have been violated and where in the code the problem resides. (See Rules for more information.) For a quick review of the state of the analyzed code, you can glance at the Toad Code Rating line in the tree.

Additional Information

Beneath the tree, there are three more tabs:

  • All Rules by Objective (the default display) - lists the results of the rules scan. See Rules for more information.
  • Properties - Displays the properties of the code analyzed. See CodeXpert Properties for more information.

  • SQL Scan - This displays the results of running a SQL scan on the code. See SQL Scanning Overview for more information.

    Note: The SQL Scan tab is visible only if you have run a scan with the review.

Related Topics

Rules

Statistical Analysis

CodeXpert Properties

Reports Tab


CodeXpert Rules

Rules

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

The contents of the CodeXpert Rules area is sorted according to how the sorting option is configured on the RuleSet. The two sorting options are:

  • Severity, then Objective
  • Objective, then Severity

To view rules

  • Select the results tab and then click the Rules tab at the bottom of the window.

The different types of rules issues are represented by icons to the left of the topic. (See Icon Legend for more information.)

Moving to the right, the information provided in the second level of the Rules node is:

  • Icon
  • Code Element
  • RuleNumber
  • (Number of Occurrences)
  • Rule Title

For example, the highlighted occurrence in the screen above, is one occurrence of forty-six for Rule 2609 – ‘Consider using a parameter list to reference variables outside of this cursor’, belonging to the 'Cursor' Code Element group.

The numbers in parentheses represent where the occurrence displays in the code:

(453, 38) = Line 453, Column 27 of the code

By observing the icons in the tree, it can be determined that this rule falls under the Maintainability Objective, and a Warning Severity.

Related Topics

Statistical Analysis

Properties

Reports


CodeXpert Statistical Analysis

Statistical Analysis

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

There is a code metrics column in the stand-alone CodeXpert and a tab in the CodeXpert Results panel, both within the Editor and the standalone CodeXpert window, that displays a statistical analysis of your code. See CodeXpert Overview for more information.

The code metrics area contains three sections that highlight program units that exceed criteria for:

  • Computational Complexity (Halstead Volume)
  • Cyclomatic Complexity (McCabe’s)
  • Maintainability Index

Related Topics

Rules

CodeXpert Properties

Reports Tab


CodeXpert Properties

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

The CodeXpert Properties tree contains a profile analysis of the PL/SQL.

To view the Properties tree

» At the bottom of the Results tab, click the Properties tab. See Results Tab for more information.

Categories include:

  • Cursor Analysis
  • Declaration Analysis
  • DML Analysis
  • Exception Handling Analysis
  • Flow of Control Analysis
  • Module Analysis
  • Oracle Version Dependencies
  • Procedure/Function Analysis
  • Complexity Analysis

Related Topics

CodeXpert Overview

RuleSet Window

Statistical Analysis

Reports Tab


Overriding Statements

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

You can override specific occurrences in CodeXpert. An overridden occurrence is not counted against the total statements ‘Flagged’.

This feature is only available in a single-user environment and will be overwritten if source control is used and another user runs an analysis on the code.

Toad will add a comment to your code to mark that you want to override certain rules or occurrences of rules violations.

To override a rule

  1. In the Results area, select the rule you want to override.
  2. Right-click and select Override Rule.

To override an occurrence

  1. In the Results area, elect the occurrence of the rule you want to override.
  2. Right-click and select Override Occurrence.

Related Topics

CodeXpert Overview

Results Tab


CodeXpert Report Tab

Reports Tab

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

The Reports tab contains graphical displays of the CodeXpert analysis. These reports can be saved as HTML documents, printed, or viewed in a separate viewer through the functionality of the Report Toolbar.

Reports available from this tab include:

Report | Description
Rules Summary | The Rules Summary displays any best practices rules violated in a graphic form. See Configuring RuleSets for more information.
CRUD Matrix | The CRUD (Create (i.e. INSERT), Retrieve (i.e. SELECT), Update and Delete) matrix, can be used to analyze the consistency of functional requirements. This analysis helps to identify performance bottlenecks in the form of unused tables, as well as tables used heavily.
Code Metrics | Code metrics analyze your code for performance issues under the Halstead Volume (computational complexity), McCabe's (cyclomatic complexity), number of statements and Maintainability Index (MI). For more information on any of these metric scales, click the appropriate header in the first chart for a detailed description.

Related Topics

CodeXpert Overview

Results Tab

Rules and Statements Breakdown

Statistical Analysis

CodeXpert Properties


Report Toolbar

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

The CodeXpert Report toolbar consists of the last four buttons in the toolbar area, and are only available when the CodeXpert Report tab is selected. The functions relate specifically to the Report window.

Button | Command
 | Zoom on summary: opens the summary report in a separate window
 | Save the CodeXpert Report to a variety of HTML formats
 | Print Preview
 | Print

Related Topics

CodeXpert Overview

Reports Tab


Toad Code Rating

The Toad Code Rating (TCR) is displayed in the CodeXpert | Results | Rules. It provides a quick reference for how your code has performed in the analysis.

Toad rates each metric as follows:

Metric | Status Value | Value
Existing Metrics | 4 | >=251
 | 2 | 101-250
 | 1 | <101
Halsted Metric | 4 | <=3001
 | 2 | 1000-3000
 | 1 | <1000
McCabe's Cyclomatic | 4 | <=51
 | 3 | 21-50
 | 2 | 11-20
 | 1 | <=10
Maintainability Index | 4 | <=64
 | 2 | 65-85
 | 1 | >=85

The TCR is derived from the average rating of all the metrics (TCR always rounds up), and then the numbers are assigned a color as follows:

  • 1 = Green
  • 2 = Yellow
  • 3 = Orange
  • 4 = Red

Related Topics

CodeXpert Overview'

Statistical Analysis

Reports Tab

Results Tab


Email Results

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

You can email the results of a CodeXpert run to an email of your choice.

Settings must be set before using the email feature.

To set email settings

  1. From the View menu, select Toad Options.
  2. On the left hand side, click Email settings.
  3. In the Windows area, select CX Results.
  4. Enter the settings for to and from, and the global email settings (if they are not already set).
  5. Click OK.

Related Topics

Email Settings


Configuring RuleSets

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

The selected CodeXpert RuleSet determines what rules will or will not be included in a particular Analysis. How a RuleSet is displayed is configured through the CodeXpert RuleSet window. See RuleSet Window for more information on creating your own rulesets and otherwise using your ruleset window.

To configure custom rulesets

  1. Click [image] on the CodeXpert General Toolbar.
  2. Select and clear the checkboxes for the rules you want to include or exclude.
  3. Click Close.

To configure Quest-defined rulesets

  1. Click [image] on the CodeXpert General Toolbar.
  2. Select and clear the checkboxes for the rules you want to include or exclude.
  3. Change the Sort Order drop down selection.
  4. Click Close.

Related Topics

CodeXpert Overview

RuleSet Window

Rules Tab Toolbar

Summary Tab Toolbar

Creating a RuleSet


RuleSet Window

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

The CodeXpert RuleSet Window is divided into two panels with the right panel containing two tabs.

Left Pane

The left pane contains the RuleSet list, a list of all available RuleSets for CodeXpert. Every RuleSet is uniquely identified by its properties and will be one of two types – User-defined or Quest-defined.

Icon | Meaning
 | Quest-defined RuleSet
 | User-defined RuleSet

Right Panel

The right panel contains two tabs: Rules and Summary.

Rules Tab

The rules tab contains the Rules List, a list of all available rules for the CodeXpert. Every rule is identified by a rule number. These can be sorted, and searched from the Rules Tab toolbar. See Rules Tab Toolbar for more information.

To view the advice tip for a rule

» Double-click the item in the list.

Summary Tab

The Summary tab contains a graphical display of the RuleSet’s properties and characteristics. This summary can be saved as an HTML document, printed, or viewed in a separate viewer. See Summary Tab Toolbar for more information.

Related Topics

CodeXpert Overview

Configuring RuleSets

RuleSet Window

Rules Tab Toolbar

Summary Tab Toolbar

Creating a RuleSet


RuleSet Toolbar

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

The CodeXpert CommandRuleSet toolbar lets you adjust and optimize RuleSets for the way you work.

Button | Command
 | Create new RuleSet. Only available if have the RuleSet node active.
 | Deletes the selected user-defined RuleSet. Note: Toad RuleSets cannot be deleted.
 | Load an existing RuleSet.
 | Save RuleSet.
 | Save RuleSet with new name.
 | Save all RuleSets.
 | Add new folder.

Related Topics

CodeXpert Overview

Configuring RuleSets

RuleSet Window

Rules Tab Toolbar

Summary Tab Toolbar

Creating a RuleSet


Rules Tab Toolbar

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

From the CodeXpert Rules tab toolbar, you can:

  • Change the sort order for the selected rule.
  • Find a rule by rule number
  • View the icon legend

Button | Command
Sort Order | Select a sort order from the drop down menu.
 | Find a rule by its number.
 | View icon legend. See View Schema Browser Icon Legend for more information.
 | Open CodeXpert Options. See CodeXpert Options for more information.
 | Save Ruleset to Text, CSV, or HTML.

Related Topics

CodeXpert Overview

Configuring RuleSets

RuleSet Window

Summary Tab Toolbar

Creating a RuleSet


Summary Tab Toolbar

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

The CodeXpert Summary tab toolbar provides the means to save or print the summary in various ways. See CodeXpert Overview for more information.

Button | Command
 | Zoom in on Summary by launching in a separate viewer
 | Save the Summary to a variety of HTML formats
 | Print Preview
 | Print

Related Topics

CodeXpert Overview

Configuring RuleSets

RuleSet Window

RuleSet Toolbar

Creating a RuleSet


Creating a Ruleset - Overview

Creating a RuleSet

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

You can create custom CodeXpert RuleSets that include the rules your company wants code to follow. RuleSets can be organized into folders under the RuleSets node on the RuleSet tree.

To create a new folder

» Right-click in the tree structure and then select New Folder. Name your folder.

To create from a blank RuleSet

  1. Select the folder or node where you want your ruleset created.
  2. Click [image] on the Ruleset toolbar.

To create from a template

  1. Select the folder or node where you want your ruleset created.
  2. Near [image], click the drop-down arrow to the right of the button.
  3. Select an existing RuleSet to use as a template. All rules selected in the existing RuleSet are selected for the new template.
  4. Make changes as desired by selecting or clearing boxes in the tree.

Related Topics

CodeXpert Overview

RuleSet Window

Rules Tab Toolbar


CdXpert Create Ruleset Wizard

Create Ruleset Wizard

If the provided CodeXpert RuleSets do not meet your needs, you can create your own.

  1. Click [image]. The configuration window opens with a RuleSet selected.
  2. Click the RuleSets node.

  3. Click [image].

    Note: If you want to base your ruleset on another ruleset, click the drop-down button beside the New Rule Set button and then select the ruleset you want to use as a template. Rules will be pre-selected using this method.

  4. Enter a title in the Rule Set Title field.
  5. Toad creates a filename for you based on your title and stores it in the Rulesets folder. You can change this if desired.
  6. The author is automatically filled in from your computer information. If this is not correct, change it now.
  7. Enter any comments about your ruleset.
  8. Click Next.
  9. Change the sort order if desired.
  10. Select the rules you want to enforce.
  11. Click Finished.

The ruleset is now listed at the bottom of the navigation panel, with the User-created [image] icon identifying it.


RuleSet Properties

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

When a CodeXpert RuleSet is newly created, it displays as a generic node on the RuleSet tree, usually possessing a name such as RuleSet0*. This indicates that the properties have not been set for this RuleSet and they must be done before a save can be performed.

When the RuleSet has had properties set, rules selected, and been saved it is available for selection and use in the RuleSet drop-down found on the CodeXpert General Toolbar.

To select RuleSet properties

  1. Right-click the RuleSet and select Properties.

    2. Set the properties:

    Rule Set Title | The title identifies the RuleSet in the tree
Author | The author of the RuleSet
Comments | Comments about the RuleSet can be entered here

Related Topics

CodeXpert Overview

CodeXpert Properties

Reports Tab

Rules

Statistical Analysis


SQL Scanning Overview

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

Including a SQL Scan within your CodeXpert ruleset can find additional ways to improve your code. You can attach a SQL scan to all rulesets, or you can attach it to limited numbers of them.

To include a SQL Scan

  1. Click on the CodeXpert tab at the bottom of the Editor.
  2. Toggle [image] into the depressed position.
  3. Click [image] and select any SQL Scanning Options.
  4. Run CodeXpert against the chosen code with whatever ruleset, if any, you want to use.

Related Topics

CodeXpert Overview

SQL Scanning Overview

SQL Conversion Overview


SQL Scanning Results

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

When you choose a CodeXpert Ruleset that includes SQL Scanning, the results nodes in the Report tab will include a SQL Scan Results node.

Results are divided into four areas:

  • Invalid SQL
  • Problematic SQL
  • Complex SQL
  • Simple SQL

The numbers in parenthesis refer to the location of the SQL statement in the code. For example, the notation (10,1) means that the code in question begins at line 10, column 1.

In addition, if Toad has had to convert any code (see SQL Conversion Overview), it will display here. The notation Double-click for more information displays. When you double click on that line, a dialog with details on the conversion displays. Any other pertinent information will display in the line below the entry.

Related Topics

CodeXpert Overview

CodeXpert Options

SQL Scanning Overview

SQL Scanning Results

SQL Classification Tab

Applying the Classification Options


SQL Conversion Overview

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

When the SQL Scanning process identifies a SQL statement, it retrieves the execution plan. If it is unable to retrieve the execution plan, it checks to see if a SQL conversion can be applied to the SQL statement in order to render the SQL statement as a valid standalone SQL statement. The following conversions may be applied:

  • Indicator Conversion
  • External Parameter Conversion
  • PL/SQL Conversion
  • Date Conversion
  • COBOL Conversion
  • Local Variable Conversion

If any of the above conversions were applied to the SQL statement during the scanning process, the results panel shows what conversions were applied and what changes were made to the SQL text.

Related Topics

CodeXpert Overview

SQL Scanning Overview

SQL Conversion Overview


Indicator Conversion

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

Within SQL Scanning, for Pro*C or similar programming languages, every host variable can be associated with an optional indicator variable. There are two cases in which the Indicator Conversion is applied by the SQL scanning algorithm.

INDICATOR keyword found in an INTO clause

When the INDICATOR keyword is found in an INTO clause, it is concatenated with the variable name. For example:

Original SQL statement

SELECT EMP_ID, EMP_NAME

INTO :v_empid INDICATOR :I_emp_id,

:v_empname INDICATOR :I_empname

FROM EMPLOYEE

WHERE EMP_ID = 100

After conversion

SELECT EMP_ID, EMP_NAME

INTO :v_empid_INDICATOR_:I_emp_id,

:v_empname_INDICATOR_:I_empname

FROM EMPLOYEE

WHERE EMP_ID = 100

TWO Variables found in the INTO clause without a separator

When two variables are found in the INTO clause without a comma separator, it is concatenated together. For example:

Original SQL statement

SELECT EMP_ID, EMP_NAME

INTO :v_empid :I_emp_id,

:v_empname :I_empname

FROM EMPLOYEE

WHERE EMP_ID = 100

After conversion

SELECT EMP_ID, EMP_NAME

INTO :v_empid_:I_emp_id,

:v_empname_:I_empname

FROM EMPLOYEE

WHERE EMP_ID = 100

Related Topics

CodeXpert Overview

SQL Scanning Overview

SQL Conversion Overview


External Parameter Conversion

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

In some source codes, a question mark (?) is used to define external parameters. In order to make it possible to use unique referencing for individual parameter, the SQL Scanner adds a number so that each parameter has a unique name within the SQL statement. For example:

Original SQL statement

SELECT EMP_ID

FROM EMPLOYEE

WHERE EMP_ID = ?

AND EMP_NAME = ?

After conversion

SELECT EMP_ID

FROM EMPLOYEE

WHERE EMP_ID = ?1

AND EMP_NAME = ?2

Related Topics

CodeXpert Overview

SQL Scanning Overview

SQL Conversion Overview


PL/SQL Conversion

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

This conversion in SQL Scanning simulates the behavior of PL/SQL by adding a /*+CHOOSE*/ hint when the optimizer_mode is FIRST_ROWS. For example:

Original SQL statement

SELECT EMP_ID

FROM EMPLOYEE

WHERE EMP_ID = 100

After conversion

SELECT /*+CHOOSE*/ EMP_ID

FROM EMPLOYEE

WHERE EMP_ID = 100

Related Topics

CodeXpert Overview

SQL Scanning Overview

SQL Conversion Overview


Date Conversion

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

The Date conversion within SQL Scanning adds the TO_DATE function to a date variable parameter. See SQL Scanning Overview for more information.

If there is an "Inconsistent datatype" error returned when the execution plan is retrieved from your original SQL, then the SQL Scanner checks for a variable calculation using a date (for example: var_date – date_field) and applies the conversion since only a date can perform a calculation using another date. If there is still an "Inconsistent datatype" error, then the SQL Scanner checks all remaining variable names for "'%date%" and converts all variables whose name includes the word "date", (for example datefield – lastdateused).

An expression with the pattern date_field – var_a, where the variable name is on the right side of the expression and does not include the word “date”, is not converted. This is because the variable can be a date, a number, or even a string. Oracle can perform an implicit conversion on this variable or on the result of this expression, therefore making it difficult to detect if the variable on the right-side of the expression is actually a date.

The following are examples when the conversion is applied.

Example 1

Original

SELECT 1 FROM dual WHERE a – sysdate = 1

Conversion

SELECT 1 FROM dual WHERE to_date(a) – sysdate = 1

Example 2

Original

SELECT 1 FROM dual WHERE sysdate – mydate = 1

Conversion

SELECT 1 FROM dual WHERE sysdate – to_date(mydate) = 1

Example 3

Original

SELECT 1 FROM dual WHERE sysdate – a = 1

Conversion

No conversion

Related Topics

CodeXpert Overview

SQL Scanning Overview

SQL Conversion Overview


COBOL Conversion

The COBOL conversion within SQL Scanning searches for three items within the syntax of a SQL statement that are allowed in the COBOL, but are not valid SQL syntax: 1) a dash or minus in a variable name, 2) comments in the middle of the SQL statement, and 3) the ]] (double right square bracket) as the concatenate symbol. See SQL Scanning Overview for more information.

Conversion for variable name

If a variable name contains "-" minus sign, then it will be replaced with an "_".

Conversion for comment

If the 7th column of the line is an "*" (asterisk) then the complete line will be recognized as a line comment.

Conversion for concatenate character

If "]]" (two right square brackets) are used to concatenate column names, they will be replaced with a "+".

For example:

Original SQL statement:

SELECT * FROM EMPLOYEE

* Get the department number

WHERE EMP_ID > :employee-id

AND ENAME]]JOB = :name-job

After conversion:

SELECT *

FROM EMPLOYEE -- * Get the department number

WHERE EMP_ID > @employee_id

AND ENAME | | JOB = @name_job

Note: If your COBOL file has tags at the beginning of the lines of code, you need to use the "Number of characters to be skipped at the beginning of every line for all files" option found on the SQL Scanner tab page in the Preferences window.

This conversion is only applied when the Scanner Job is added to the Job Manager window using the COBOL option under the Source Codes tab in the Add Jobs window.

Related Topics

CodeXpert Overview

SQL Scanning Overview

CodeXpert Options

SQL Conversion Overview

Indicator Conversion

External Parameter Conversion

PL/SQL Conversion

Date Conversion

Local Variable Conversion


Local Variable Conversion

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

The local variable conversion within SQL Scanning is only applied to the Single Command Line Dynamic (SCLD) SQL files and database objects. See SQL Scanning Overview for more information.

If a local variable is detected in the SQL statement, the SQL Scanner encloses the variable name with "&[" and "]".

For example:

Original source SQL statement before scanning:

"SELECT " + VEMPID + " FROM EMPLOYEE WHERE EMP_ID > 100"

After conversion:

SELECT &[VEMPID] FROM EMPLOYEE WHERE EMP_ID > 100

Note: The local variables in a scanned SQL statement should be treated as replacement or substitute variables rather than bind variables. Therefore, you should hard code the values before you optimize the SQL statement. The reason for hard coding the values is that the local variables may be literals and when the application is run, these values are replaced before the SQL is sent to the database. That’s why the SQL Scanner uses "&[" and "]" to differentiate the local variables from the bind variables.

This conversion is only applied if the SCLD option is selected from the Summary tab page in the Add Jobs window or from the Modify option from the Pop-up menu in the Job Manager window.

Related Topics

CodeXpert Overview

SQL Scanning Overview

SQL Conversion Overview


SQL Scanning tab

Scanning tab

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

The Scanning tab is part of Code Xpert options.See CodeXpert Options for more information.

Skip SQL within comments

Specify that the scanning algorithm ignore any SQL statement within comments using the /* */, // or –- comment format. Otherwise, the scanning algorithm finds SQL statements that are not currently being executed in the application. It may also attempt to build a SQL statement if it finds the word SELECT, INSERT, UPDATE, or DELETE within the text of a comment.

Skip SQL that only involves the SYS.DUAL table

Specify to ignore any SQL statement that only references the SYS.DUAL table.

Ignore duplicate SQL statements

Specify to include a SQL statement only once in the scanning results when it is found multiple times in the text.

Whole word matching for the first SQL keyword

Specify to search for SELECT, INSERT, UPDATE, or DELETE as a whole word. When this option is selected, these keywords must be preceded and followed by a space or end of line character and, therefore, the SQL Scanner will not find the word INSERT in text like PROCEDUREINSERT and then attempt to build a SQL statement from it.

Maximum scanned word size (Bytes)

Specify the largest size (in bytes) for scanned word. If a word is larger than this size, the SQL is ignored, and the scan resumes in the next position.

The default is 1024KB. Choose from 30 to 9,999,999.

Related Topics

CodeXpert Overview

CodeXpert Options

SQL Scanning Overview

SQL Scanning Results

SQL Classification Tab

Applying the Classification Options


SQL Classification Tab

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

SQL Scanning Classification lets you specify the criteria to analyze your SQL statement. A problematic SQL statement indicates potential performance problem because the SQL statement has characteristics that can contribute to poor performance. Optimizing these SQL statements gives you the best possibility for improving the database performance.

To access the SQL Classification options

  1. From the CodeXpert toolbar, click [image].
  2. Click the SQL Scanning tab.
  3. Click the SQL Classification tab.

Simple SQL

Number of table scan operations less than

This read-only field indicates the number of table scan operations referenced in the execution plan. If the total number of table scan operation is less than this value, then this SQL statement is classified as Simple. This value is the same as the lower limit of the Complex table scan operations range.

The default is 2.

Complex SQL

Number of table scan operations

Specify the number of table scan operations referenced in the execution plan for Complex SQL statements. The default is 2 /3 and the range is 2 to 99.

Including SYS.DUAL table

Select this box to include the SYS.DUAL table when counting the number of tables referenced by the SQL statement.

With Full Index Scan

Specify whether SQL statements with full index scans are classified as Complex SQL statements.

Problematic SQL

Number of table scan operations greater than

This is a read-only field indicating the number of table scan operations referenced in the execution plan. If the total number of table scan operation is greater than this value, then the SQL statement is classified as Problematic. This value is the same as the upper limit of the Complex table scan operations range.

The default is 3.

With full table scan

Specify to classify, as Problematic, a SQL statement with one or more full table scans when the table size is greater than or equal to the defined table size (in Kbytes) or the specified number of rows. For a detailed explanation for setting the table size or number of rows see the Full Table Scan Threshold topic.

Option

Description

Table size

The default is 8 and the range available for selection is 8 to 9,999,996. With the Table size (KBytes) option, the unit of comparison is Kbytes. The value specified for the Table size (KBytes) option should be divisible by 4.

Number of rows

Select either Table size or the Number of rows in the table to determine how large the table must be before the SQL statement is classified as Problematic.

The default is 1000.

Note: If a more precise table size calculation is required, then the use of the Table size (KBytes) is recommended.

Including SYS.DUAL table

Specify to investigate the full table scans referencing the SYS.DUAL table.

With full table scan iterated by nested loop

Specify to classify as Problematic, SQL statements with a full table scan inside a nested loop. This classification depends upon the size of the table. For a detailed explanation for setting this table size or number of rows see the Full Table Scan Threshold topic.

Option

Description

Table size

The default is 8 and the range available for selection is 8 to 9,999,996. With the Table size (KBytes) option, the unit of comparison is Kbytes. The value specified for the Table size (KBytes) option should be divisible by 4.

Number of rows

Select either Table size or the Number of rows in the table to determine how large the table must be before the SQL statement is classified as Problematic.

The default is 1000.

Note: If a more precise table size calculation is required, then the use of the Table size (KBytes) is recommended.

Including SYS.DUAL table

Specify to investigate the full table scans referencing the SYS.DUAL table.

Retrieve table size by counting: SYS.DBA_SEGMENTS

To calculate the table size using SYS.DBA_SEGMENTS, the SQL Scanner counts the total number of bytes allocated for a table. This information is obtained with the following SQL statement:

SELECT SUM(BYTES)/1024 AS "KB"

FROM SYS.DBA_SEGMENTS

WHERE OWNER = :OWNER

AND SEGMENT_NAME = :TABLE_NAME

AND SEGMENT_TYPE LIKE 'TABLE%'

Retrieve table size by counting: System tables

To calculate the table size the SQL Scanner utilizes the information on table blocks. This information can be obtained with the following SQL statement:'

SELECT SUM(SEG.BLOCKS * TS.BLOCKSIZE)/1024 AS "KB"

FROM SYS.USER$ USR,

SYS.OBJ$ OBJ,

SYS.TS$ TS,

SYS.SYS_OBJECTS TAB,

SYS.SEG$ SEG

WHERE SEG.FILE# = TAB.HEADER_FILE

AND SEG.BLOCK# = TAB.HEADER_BLOCK

AND SEG.TS# = TAB.TS_NUMBER

AND SEG.TYPE# = TAB.SEGMENT_TYPE_ID

AND SEG.TS# = TS.TS#

AND TAB.OBJECT_ID = OBJ.OBJ#

AND TAB.OBJECT_TYPE_ID = OBJ.TYPE#

AND OBJ.OWNER# = USR.USER#

AND TAB.OBJECT_TYPE_ID IN (2, 19, 34)

AND USR.NAME = :OWNER

AND OBJ.NAME = :TABLE_NAME

Related Topics

CodeXpert Overview

SQL Scanning Overview

SQL Conversion Overview


Applying the Classification Options

Note: This extended Toad feature is only available in Toad for Oracle XPert edition.

When performing a SQL Scan, you can specify if full table scans should be analyzed in execution plans to categorize SQL statements as Problematic.

You can access the classification options from the CodeXpert Options window. Click the SQL Scanner tab and then the SQL Classification tab.

For more information about these options, see the SQL Classification tab topic.

Full Table Scan Threshold

Since each database environment is unique, you can specify the threshold (size of the table) for the full table scan to be considered a problematic operation. If the full table scan threshold is exceeded and the execution plan has a full table scan operation, then the SQL statement is classified as Problematic.

Default values

The default table size threshold for the full table scan operation is 8 KB. This threshold may be too low for production systems. It is recommended to review the SQL Classification options before using the SQL Scanner.

Calculating Table Size

To calculate the table size that is compared against the full table scan threshold, the SQL Scanner uses one of the following methods depending on your selection in the Retrieving table size by counting option:

  • Method 1 - Utilizing the table information from SYS.DBA_SEGMENTS system view
  • Method 2 - Utilizing the table information from the system tables SYS.SEG$, SYS.OBJ$, SYS.TS$, SYS.SYS_OBJECTS, and SYS.USER$.

The table size reported by each of these methods may differ according to the information available in Oracle in the system view or tables utilized. The performance of retrieving the table information under each method could be different according to the specific database environment, thereby affecting the time it takes to scan.

To use SYS.DBA_SEGMENTS or system tables, select the corresponding option in the Problematic SQL section of the SQL Classification Preferences.

Example – Determining the Full Table Scan threshold using SYS.DBA_SEGMENTS

This example illustrates how it was determined what number of Kbytes to use for the Full table scan threshold to classify SQL statements. It was decided that a full table scan on the EMPLOYEE table was not a performance problem for this database and should not be classified as Problematic.

First, it was decided that a full table scan on the EMPLOYEE table was not a performance problem for this database and should not be classified as a Problem.

Second, the table size of the table EMPLOYEE was obtained by running the SQL statement from Method 1 above using SYS.DBA_SEGMENTS.

SELECT SUM(BYTES)/1024 AS "KB"

FROM SYS.DBA_SEGMENTS

WHERE OWNER = OWNER_NAME

AND SEGMENT_NAME = EMPLOYEE

AND SEGMENT_TYPE LIKE 'TABLE%'

The result of this SELECT statement showed that the table size for the table EMPLOYEE is 64,804 KB.

Third, in the CodeXpert – SQL Classification Options, the SYS.DBA_SEGMENTS option was selected and the full table scan threshold was set to 64,800 KBytes (or slightly higher to allow for growth).

Related Topics

CodeXpert Overview

SQL Scanning Overview

CodeXpert Options

SQL Classification Tab

Scanning tab


Audit SQL and System Privileges

The Audit SQL/Sys Privs window displays the audit monitoring options for SQL Statement Objects, Reserved Words and System Privileges in the database. From this window, you can enter and modify monitoring levels for each type or for groups of types. You can also view the audit trail records for the selected schemas.

Certain privileges are required to use this screen:

  • To audit occurrences of a SQL statement, you must have the AUDIT SYSTEM privilege.
  • To audit operations on a schema object, the object you choose for auditing must be in your own schema or you must have AUDIT ANY system privilege. In addition, if the object you choose for auditing is a directory object, even if you created it, then you must have AUDIT ANY system privilege.

Notes:

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

  • To use auditing functionality within Toad, AUDIT_TRAIL must be set to DB.

To view audit details

  1. Select Database | Administer | Audit SQL/Sys Privs.
  2. From the Schema drop down menu, select the schema you want to audit and then Audit Options or Audit Trail.


NLS Parameters

The NLS (National Language Support) parameters window is used to view the Session, Instance, and Database parameter settings, and to change the Session and/or Instance parameters.

  • Note: You can view the parameters with the Base edition, but you must have the DB Admin module to edit them.

    • To change a NLS setting

    1. Select Database | Administer | NLS Parameters.
    2. Select one of the following options to change a NLS setting:
      • Double-click a parameter; enter the new setting.
      • Single-click the parameter line, click [image]; enter the new setting.

    Notes:

    • If a parameter cannot be edited, the Edit button will be disabled. Session parameters are all editable. Other parameters may not be editable.
    • Notice that changing a value in one cell can cause a change in other cells. For example, if you change the NLS_TERRITORY from America to Japan, the NLS_CURRENCY symbol changes from the dollar to the yen.

    Related Topics

    Oracle Parameters


Toad Features Security

This feature restricts Toad users from having access to specific Toad features. By default users are granted access to all features of Toad. You can restrict individuals or groups of users from accessing some Toad features. In addition, you can make Toad read-only for individuals or groups of users.

Caution: Toad Security Read-only only affects Base Toad. If you have the DB Admin Module, those module components will remain fully accessible.

To set up the security mechanism

  1. Run the Server Side Objects Install Wizard to create the Toad_RESTRICTIONS table in the Toad schema. This is REQUIRED to be in the Toad schema, not another schema with synonyms pointing back. See Install Server-Side Objects for more information.
  2. Run Toad, log in as the DBA_USER (as you set it in step 1), and then select the Administer | Toad Security menu item to bring up the Toad Features Security window.
  3. Select the user or role, and then select the features you want to deny to that user or role.

    4. All other Toad Security features will be granted to this user. Since other non-DBA users only have SELECT privileges to the Toad_RESTRICTIONS table, they cannot make changes to the security.

  4. Click the Grant Select button so that the user or role can see the Toad.Toad_RESTRICTIONS table.
  5. If the user cannot "see" the Toad_RESTRICTIONS table (in other words, they do not have SELECT access granted to them), then they have FULL access to all Toad features.
  6. If the user has SELECT privilege on the Toad_RESTRICTIONS table, then the security is in effect.
  7. Move any commands you do not want the user to have from the Features list to the Restricted Features list. Not all buttons, menus, or functions in Toad are contained within this security scheme. If you need to restrict other functionality, please let us know.
  8. When you have completed restricting features, click OK to save your changes. You can also create collections of Toad features using existing Oracle roles. Grant the features to a role (for example, DEVELOPER_ROLE), then those Toad users will get the collections of Toad functionality without having to set up the same list of Toad features for multiple users.

Example

To set up a list of different kinds of Toad Features, and then revoke that list of features from select groups of users, do the following.

  1. Start Toad, log in as user Toad, go to Administer | Toad Security.
  2. Select a role, for example "DEVELOPER_ROLE" from the user/role drop-down list. These are standard Oracle roles. Have your DBA create the roles if necessary.

    3. Caution: DO NOT use the DBA role for users subject to Toad Security. When Toad starts, if the user has the DBA role, then that overrides everything else, security included.

  3. Ensure that DEVELOPER_ROLE has SELECT privilege to the Toad.Toad_RESTRICTIONS table. If the Grant Select button caption is "Grant Select", then click it to execute the grant. If the button caption is "Revoke Select" then the grant already exists.
  4. Copy the desired features to the "Restricted Features" list.

  5. Click OK. Toad will "grant select on toad_restrictions to developer_role" and write these records into the Toad_RESTRICTIONS table:
    6. USER_NAME | FEATURE
DEVELOPER_ROLE | CHANGE A PASSWORD
DEVELOPER_ROLE | CREATE ROLLBACK SEG
DEVELOPER_ROLE | CREATE SNAPSHOT LOG
DEVELOPER_ROLE | CREATE USER
  6. Ensure that the Oracle Roles have been granted to the user: [grant developer_role to scott].
  7. Have user SCOTT log off/on to Toad. Scott’s Toad features should be limited as specified.
  8. Repeat setting up restricted features for the other desired roles, e.g., TUNER_ROLE, MAINTENANCE_ROLE, and so on.

Disable Saving Oracle Passwords by Toad

This option is in the Features | Non-menu list as Save passwords. Moving it to the Restricted list lets you disable the ability to save passwords.

Read-only

You can make Toad read-only to a selected user or role. This is useful if you have someone who needs to view database objects but does not have the authority to change them.

To make Toad read-only, move the Read-only Override function from the Features | Non-menu list to the Restricted features list. This makes Toad read-only to the selected user.

Note: This Toad Security option does not apply to the DB Admin Module. To restrict Toad entirely, you will also need to restrict the DB Admin Module from the appropriate users.


ASM Manager Overview

In Oracle 10g and above, Oracle provides a means for managing the Oracle DB file system from within the Oracle database through Automatic Storage Management (ASM). In ASM, a standalone Oracle instance collects raw server disks into disk groups and performs management functions necessary to make ASM files available to database instances. Oracle database files are then stored in these disk groups.

A template, or collection of file attributes, is used by ASM during file creation. Templates simplify file creation by mapping complex file attribute specifications into a single name. A default template exists for each Oracle file type. You can modify the attributes of the default templates or create new templates.

Oracle provides detailed information about ASM, raw server disks, and templates. See Oracle's documentation for more information.

Toad's ASM Manager

Toad's ASM Manager gives you an easy interface to the Oracle ASM features, and lets you easily manage your disk groups. The ASM Manager window is divided into two pages, accessible by tabs: Disk Groups and Clients. You can view by database instance or ASM Instance, which opens a new connection to that instance while you are viewing and working with information. Using the ASM instance will display more data and allow you to make changes to your disk groups.

Notes:

  • Connection to the ASM instance is created through the Toad ASM Manager from the Database | Administer menu. Toad does not support creating a connection to this instance in any other way.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the ASM Manager

» Select Database | Administer | ASM Manager.

Related Topics

Creating Disk Groups

Viewing Disk Groups

Altering Disk Groups

Dropping Disk Groups

Viewing Clients


ASM Viewing Disk Groups

Viewing Disk Groups

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can view disk groups from Toad's ASM Manager. See ASM Manager Overview for more information.

Disk group information is divided into summary information and detail information. Summary information is displayed in the upper grid, and includes the group number and disk group name. Detail information is provided in the lower grid when you when you select a disk group in the upper panel.

To view disk groups

  1. From the Database menu, select Administer | ASM Manager.

    2. Select either the database instance or the ASM instance you want to use.

    Note: The ASM instance provides more data and allows changes.

  2. If it is not selected, click on the Disk Groups tab.

    3. In the upper panel, select the disk group you want to view.

    Note: Data for that disk group is displayed in the lower pane.

Signing in with an ASM instance

Using an ASM instance instead of a database instance provides more data and allows changes.

To select an ASM instance

    When you select ASM instance from the Connected to box, the Connect to ASM Instance dialog displays.

    Note: You must log in as SYS to use the ASM instance. This username cannot be edited.

  3. Enter the password.

    4. Select the database.

    Note: ASM instances are designated as +databasename and display near the top of the list.

  4. Host and Connect As information is static and cannot be changed.
  5. Click OK.

Summary information

You can view summary information about a particular disk group in the upper area of the grid. Information provided includes Group number, Disk Group name, sector size, block size, allocation unit size, state, type, total MB, free MB, Required mirror free MB, and so on.

Using the toolbar, you can create, drop, and alter disk groups if you are connected to the ASM instance (see related topics).

Detail information

Detail information is provided in the lower panel grids. Information is separated into five data grids: Disks; Templates; Operations; Files, Directories, and Aliases; and Usage. If connected by ASM Instance, changes can be made to the Files, Directories, and Aliases area by use of the provided toolbar.

Related Topics

ASM Manager Overview

Creating Disk Groups

Altering Disk Groups

Dropping Disk Groups

Viewing Clients


Creating Disk Groups

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

If you are connected through an ASM instance, you can create and drop disk groups from the Disk Groups toolbar.

Creating disk groups

You can create a disk group quickly using the combination of Oracle ASM and Toad's ASM Manager.

To create a disk group

  1. From the Database menu, select Administer | ASM Manager.
  2. Select an ASM Instance in the Connected To box.
  3. Click [image].
  4. Enter a Disk Group Name.
  5. If it is not already selected, click the Basic Info tab.
  6. Select the redundancy of the disk group:

    7. Select an availability from the Status after creation drop down box.

    Note: The Alter Actions section will be disabled when creating a disk group. See Alter Disk Groups for more information.

  7. If you are using Oracle 11g, you can also set several attributes.
  8. Click the Disks tab.
  9. Click Add Disks and select any disks you want to include in this disk group. Click OK.
  10. Click OK to add the disk group.

Related Topics

ASM Manager Overview

Viewing Disk Groups Creating Disk Groups

Altering Disk Groups

Dropping Disk Groups

Viewing Clients


ASM Dropping Disk Groups

Dropping Disk Groups

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can drop disk groups from the ASM Manager. See ASM Manager Overview for more information.

To drop a disk group

  1. From the ASM Manager | Disk Group tab, select the disk group you want to drop.
  2. Click [image].

    3. In the Confirm ialog, choose to include or exclude contents when you drop the disk group.

    Note: if you are using Oracle 11g or later, you can also apply the FORCE option.

  3. Click OK.

Related Topics

ASM Manager Overview

Viewing Disk Groups

Creating Disk Groups

Alter Disk Groups

Viewing Clients


Altering Disk Group

Alter Disk Groups

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To alter a disk group

  1. From the Database menu | Administer | ASM Manager, click the Disk Groups tab.
  2. Make sure the ASM instance is selected in the Connected To drop down box.
  3. Select the disk group you want to alter and then click.

    4. Make any changes you need to make. You can change disk groups in any one of the three tabs:

    Basic Info tab | Information
Availability | The availability of the disk group can be changed with the Alter command. Toad displays the current status of the disk group and provides a change to drop down to select a new status easily.
Disks tab | Information
Add or Drop | Select the disk you want to alter, click Add or Drop.
Alter | Click in the cell you want to alter and make changes. Note: You can alter some, but not all data.
Templates Tab | Information
Add or Drop | Select the disk you want to alter, click Add or Drop.
Alter | Click in the cell you want to alter and make changes. Note: You can alter some, but not all data.

Related Topics

ASM Manager Overview

Viewing Disk Groups

Creating Disk Groups

Dropping Disk Groups

Viewing Clients


Viewing Clients

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can use the ASM Manager to view client information for each disk group.

As for disk groups, if you are connected to an ASM instance you will see more information than if you are connected via the database instance.

To view client information

  1. From the Database menu, select Administer | ASM Manager.
  2. From the Connected to drop down, select either the Database instance (default) or an ASM instance.
  3. Click the Clients tab. Information is displayed in the grid.
  4. Refresh the grid if necessary by clicking [image].

Related Topics

ASM Manager Overview

Creating Disk Groups

Viewing Disk Groups

Dropping Disk Groups

Alter Disk Groups


Audit Objects

The Audit Objects window displays the audit monitoring options for selected database objects. You can enter and modify monitoring levels for each individual object or for groups of objects.

Notes:

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

  • To use auditing functionality within Toad, AUDIT_TRAIL must be set to DB.
  • Audit parameters for objects are also available in the Schema Browser | Object Page | RHS Auditing tab.

To populate the audit object data grid

  1. Select Database | Administer | Audit Objects.
  2. From the Object Type drop down, select the type of object you want to audit.
  3. Click the [image] drop down, and select what you want to load.

Related Topics

Audit SQL and System Privileges


Setting an Object Audit

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To view the Audit Objects window

» From the Database menu, select Administer | Audit Objects.

Audits display in the grid in an abbreviated code. Audit options for when successful come first, followed by a slash, followed by when not successful.

Option | Abbreviation
By Access | A
By Session | S
No Audit | -
Therefore, an audit pattern will display in the grid as follows: A/S - audit records when successful by access, and when not successful by session

To set audit options

  1. Populate the audit object grid.

    Note: This must be something other than All Object Types, which is read-only.

  2. In the row containing the object you want to audit, click in the column of the audit you want to perform.

    Note: For example, if you want to audit on Alter commands, click in the Alter box.

  3. Click [image].
  4. Select the options you want to audit when the command is successful or when it is not successful.
  5. Click OK.

Related Topics

Audit Objects


Multiple Object Privileges

You can manage privileges for multiple objects from the Multiple Object privileges screen. You can grant or revoke privileges on multiple objects at once.

To access multiple object privileges

» From the Database | Administer menu, select Multiple Object Privileges.

To grant privileges

» Click the Grant tab. See Granting Multiple Privileges for more information.

To revoke privileges

» Click the Revoke tab. See Revoking Multiple Privileges for more information.


Granting Multiple Privileges

You can grant multiple privileges at once, either from selected objects, or from all objects on the screen. See Multiple Object Privileges for more information.

To grant all objects to selected grantees

  1. From the Objects Owned by drop-down, select the schema owning the objects you want to grant.
  2. In the Grantees area, select the users or roles to whom you want to grant privileges.
  3. In the toolbar, click [image].
  4. Choose All or specify privileges you want to grant on the objects.
  5. Choose to include Grant or Hierarchy options.

To grant selected objects to selected grantees

  1. From the Objects Owned by drop-down, select the schema owning the objects you want to grant.
  2. In the Objects area, select the objects you want to grant.
  3. In the Grantees area, select the users or roles to whom you want to grant privileges.

    4. Note: You can select or clear the Users and Roles checkboxes to limit the list to one or the other or both.

  4. In the toolbar, click [image].
  5. Select privileges you want to grant on the objects.
  6. Choose to include the Grant or Hierarchy options.


Revoking Multiple Privileges

To revoke privileges

  1. From the Multiple Object Privileges screen, select the schema that owns the objects with privileges you want to revoke. See Multiple Object Privileges for more information.
  2. Click the Revoke tab.
  3. Do one of the following:
    • Select All.
    • Select Objects I granted.
  4. In the grid, select the privileges to revoke.

    5. Note: You can filter the grid by any column by clicking the arrow in the column header. Select Custom and set the filter.

  5. Click Actions.
  6. Do one of the following:
    • Select either:
      • Revoke all
      • Revoke selected.


Oracle Parameters

Oracle Parameters allows you to modify or edit the System Modifiable and Session Modifiable options.

Notes:

  • You can view Oracle parameters with the Base edition, but you must have the DB Admin module to edit them.
  • This feature requires access to some V$ tables. See V$ Tables Required for more information.

To access the Oracle Parameters window

» Select Database | Administer | Oracle Parameters.

When you change a parameter, you are presented with a window listing the current setting and boxes to change it, adding comments if desired. In addition, if applicable, you can set the scope, choose where to apply the change, and, if on a RAC, whether to make the change in all instances, or only the current instance.

Related Topics

Changing a Parameter String

Export Dataset

Database | Administer | Oracle Parameters

Use the QuickFilter (Filter from Memory)


Viewing Parameter Strings

Viewing a Parameter Setting

If you do not have the DB Admin Module, you can view the parameters but not change them.

To view a parameter setting

» Double-click on the parameter you want to view.

Searching for a Parameter Setting

There are several ways to search for a parameter string. For example,

  • You can search for a specific Oracle setting in any column of the grid using incremental search.
  • You can use the QuickFilter to filter the grid. See Use the QuickFilter (Filter from Memory) for more information.

To find a parameter setting using incremental search

  1. Click in the column describing the parameter you want to find.
  2. Enter the first few characters of the entry you want to find. The cursor will jump to the entry as you enter characters.

Related Topics

Oracle Parameters

Changing a Parameter String


Changing a Parameter String

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

If a parameter is both session modifiable and system modifiable, Toad modifies at the system level. You can change Oracle Parameter settings individually. See Oracle Parameters for more information.

If you are using a RAC-based database, you will also have the option to choose whether to apply the change to all instances or only the current instance.

Note: Some parameters may not allow changes. The Change Parameter Setting button will remain disabled even if you select one of these parameters.

To change a setting using the mouse

  1. Do one of the following:
    • Double-click the parameter you want to change.
    • Click the parameter you want to change and then click [image].
  2. Make any changes to your setting and click OK.

To change a setting using the keyboard

  1. Double click the parameter you want to change.
  2. Make any changes to your setting and click OK.

Related Topics

Oracle Parameters

Viewing Parameter Strings


View Tablespaces

To view tablespace information

» From the Database menu, select Administer | Tablespaces.

Note: This feature requires SELECT access to the DBA_ Oracle dictionary views. Without access, you will get an error dialog box, "This function requires access to: dba_free_space, dba_data_files, and dba_tablespaces".

From either the Space or Data Files tab, double-click a tablespace to see details. (Note: This Toad feature is only available in the commercial version of Toad with the optional DBA module.) See Tablespace Details for more information.

Tabs

Note: The Space, Space History, and IO History tabs are only available in the commercial version of Toad with the optional DB Admin Module.

On each of these tabs, to sort the information in ascending order, click the desired column header. To sort in descending order, click the same column header a second time. Double clicking on the divider between two column headings, where the mouse pointer turns into a vertical line with left and right arrows, will size the column to the width of the data.

Tab

Description

Space

Note: The Space, Space History, and IO History tabs are only available in the commercial version of Toad with the optional DB Admin Module.

Lists each tablespace by name, including Usage, Size Mgs, Free Mgs, Used Mgs, Free Pct, Used Pct, and Used Pct of Max.

Files

Lists each tablespace by name, including Type, Status, Used MB, Free MB, Reclaimable MB, Min MB, Initial Extent, Next Extent, Min Extents, Max Extents, Percent Increase, and Filename.

Note: By default, Reclaimable MB and Min MB are not filled in. The query used to calculate this data can be slow. Click Calculate Reclaimable MB to populate these columns. In addition, you can right click on one or more datafiles and choose Shrink to Min MB to shrink the selected datafiles.

Free Space (in KB)

Lists each tablespace by name, including Blocks, Min, Average, Max, and Total.

Objects

Select a Tablespace from the drop-down list. Toad will display all objects contained within the selected tablespace, including Owner, Object Name, Object Type, Size (MB), Initial Extent, Next Extent, Num Extents, and Size (bytes).

The totals of Size (MB), Num Extents, and Size (bytes) will be listed on the "TOTAL SIZE" line, at the bottom of the list.

Fragmentation

This tab describes the fragmentation of your tablespace, including the number of total blocks, empty blocks, how many fragments (pieces) there are, the sizes of those pieces (largest, smallest and average) and the number of extents are below the high water mark.

Space History

Note: The Space, Space History, and IO History tabs are only available in the commercial version of Toad with the optional DB Admin Module.

From the Space History tab, Toad Space Manager tracks and forecasts database usage over time, displaying the results in an easy to read, and easily configured graph format. See Use Toad Space Manager for more information.

IO History

Note: The Space, Space History, and IO History tabs are only available in the commercial version of Toad with the optional DB Admin Module.

From the Space History tab, Toad Space Manager tracks and forecasts datafile usage over time, displaying the results in an easy to read, and easily configured graph format. See Use Toad Space Manager for more information.


Tablespace Details

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The Tablespace Details window displays the same information that is found in the Schema Browser | Tablespaces tab. However, because it is displayed in a unique window, the majority of the grid can be seen without scrolling.

To Access Tablespace Details

» From the View Tablespaces window, in either the Space or Data Files tab, double-click a tablespace.

Datafiles tab

Lists general information about the file, for example, number of files in each file, a usage graph, the percentage used, and so on.

Free Space tab

Displays the statistics for the free space parameters of the datafile.

Fragmentation tab

Displays the number of files and information about the general fragmentation of those files, including number of pieces, the size of those fragments, and the number of empty blocks remaining.

Objects tab

Displays a list of all objects in the datafile and their pertinent statistics.

Quotas tab

Displays a list of quotas and space-used statistics by user for the selected datafile.

Extents tab

Displays a list of segments, owners and ID numbers for extents.

Related Topics

View Tablespaces


Space Manager Setup

Toad Space Manager Setup

The Toad Space Manager is a part of the View Tablespaces window. In order to use Toad Space Manager, you must have certain objects in the TOAD Schema.

Notes:

  • This feature requires access to some V$ tables. See V$ Tables Required for more information.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access Toad Space Manager

  1. From the Database menu, select Administer | Tablespaces.
  2. Toad Space Manager consists of the final two tabs on the Tablespaces window: Space History and IO History. Click one of these tabs to access Toad Space Manager.

Set Up Toad Space Manager

Before you can use Toad Space Manager, you must set up specific objects in the Toad schema. These objects can be created from Toad Space Manager, or from the Server Side Objects wizard.

To Set up Toad Space Manager

  1. Click the Create/Recreate Toad Space Manager Tables button [image]. If you are not logged in under the Toad Schema, the following dialog box displays:

  2. Click OK and then log in under the Toad schema.

    3. Note: The Toad schema must have the privileges to create and alter jobs, create and drop its own tables and procedures, and must have SELECT access on: DBA_TABLESPACES, DBA_DATA_FILES, DBA_FREE_SPACE, and V_$FILESTAT.

  3. From the Toad schema, View Tablespaces, click the Create/Recreate Toad Space Manager Tables button [image]. If there are already Space Manager tables present, a confirmation dialog box displays. Selecting yes will lose all existing data.

    4. Click Yes.

  4. The Collection Status area shows the status of the existing Toad Space Manager job: Active, Inactive, or Not Present. When the Toad Space Manager tables are recreated, the job will be created or activated if necessary.

  5. Set collection schedule information:

    Field

    Additional Information

    Execute

    Enter the starting date to the job. Click the drop down to display a calendar, or edit the day and year directly in the edit box.

    • If the collection job is not present, then the default is a few minutes in the future.
    • If the collection job is active, then the default is the Next Execution date of the existing collection job. If the collection job is inactive, then the default is many years in the future (this is what Oracle stores as the Next Execution date of the existing job)

    At this time
    • Select a choice from the drop down menu below the At this time: field,
    • Or you can enter the formula by hand in the field beneath the Execute this job on: field. Each time after the job is executed, Toad will use this formula to calculate the next date of execution.

    Note: Whatever formula is entered in these fields, Toad Space Manager cannot collect information more frequently than once daily.
  6. Set the History Retention information.

  7. Set the Data initialization information:

    Start with empty tables

    Data is presented from the first collection only. No attempt is made to back-fill history.

    Back fill tables with generated values indicating positive growth

    Data is presented with a generated history: this history is created by Toad, and indicates an increase in space usage over time.

    Toad creates the necessary tables to maintain the Toad Space Manager history. The information in these tables provides the basis for the graphs displayed on the Toad Space Manager tabs.

To edit Toad Space Manager setup information

You can edit Toad Space Manager information in a similar manner to setting it up. If the collection job has been dropped, Collection Status will display as Not Present. Altering the Toad Space Manager settings will recreate the job.

  1. You must be logged in under the TOAD schema. From the Database | Administer menu, select Tablespaces. The Tablespace window displays.
  2. Click either the Space History or IO History tab.
  3. Click [image].
  4. Change the information as described in Set Up Toad Space Manager.


Use Toad Space Manager

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The Toad Space Manager is a part of the View Tablespaces window. In order to use Toad Space Manager, you must have certain tables created in the TOAD Schema. Toad Space Manager can add these tables automatically. See Toad Space Manager Setup for more information about how to add these tables to the TOAD Schema.

Toad Space Manager tracks and forecasts database usage over time, displaying the results in an easy to read, and easily configured graph format.

To access Toad Space Manager

You must have DBA privileges to view the Toad Space Manager windows.

» Select Database | Administer | Tablespaces.

Toad Space Manager consists of the final two tabs on the View Tablespace window: Space History and IO History. Click one of these tabs to access Toad Space Manager.

Related Topics

Space History Tab

IO History Tab

View Tablespaces


Space History Tab

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The Space History area of the Toad Space Manager graphs usage in several different ways. You can print the graphs and forecast future usage. See Use Toad Space Manager for more information.

Graph Usage

The graph on the Space History tab displays the tablespace usage.

To change the display configuration

» Do one of the following:

View all the Tablespaces

Uncheck the By datafile box and select <All> from the Tablespaces drop-down.

Select a specific tablespace

Uncheck the By datafile box and select a tablespace from the drop-down Tablespaces: menu.

View tablespaces by Datafile

Check the By datafile box and select a datafile from the drop-down Datafile menu.

View all the Datafiles

Check the By datafile box and select ALL from both drop-downs.

To find a single line

  1. Click the tablespace in the legend and highlight the line you want to see.
  2. Click the line and highlight it.

    3. Move your mouse over a line. The status bar displays the tablespace name, the date and # mb for that date. For example:

    SYSTEM (12/11/2002, 123 mb)

Forecast Usage

You can forecast usage of tablespaces and datafiles using the Forecasting tool. You can set the number of days in the future and Toad uses linear regression (continuation of a line based on its slope or trend) to extrapolate the tablespace and datafile space usage at the specified time.

To forecast usage

  1. Create your graph as described above in Graph Usage to create the graph you want to forecast.
  2. On the Toad Space Manager toolbar, click [image].
  3. At the bottom of the forecast window, you can select the number of days (the default is 30) in the future you want to forecast. The estimated number of MB displays, and the graph changes as you change the number of days.
  4. Click Print to print the forecast.
  5. Click OK to close the forecast window.

Zoom

To zoom a graph

» Zoom in on a specific area by dragging a rectangle from left to right around the area you want to zoom.

To restore a graph

» Drag a rectangle from the right to left, and the chart will zoom back to 100%.

Print Graph

When you have selected the graph view you want, you can print it from the toolbar above the graphs.

To print a graph

» Click [image] and the graph is sent directly to the default printer.

Related Topics

Use Toad Space Manager

IO History Tab


IO History Tab

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The IO History portion of the Toad Space Manager tracks datafile I/O history.

To select datafiles

» Select the datafile to view by clicking the drop-down menu at the top of the tab, and selecting the datafile (or All Datafiles) from the list. The graph changes immediately to display the information for the new datafile.

To print a graph

» Click [image] and the graph is sent directly to the default printer.

To zoom a graph

» Zoom in on a specific area by dragging a rectangle from left to right around the area you want to zoom.

To restore a graph

» Drag a rectangle from the right to left, and the chart will zoom back to 100%.

Related Topics

Toad Space Manager Setup

Use Toad Space Manager

Space History Tab


Redo Log Manager

The Oracle background process log writer (LGWR) stores information about database changes in redo log files. These files can be used to recover the database in case of failure by reapplying the changes. The redo records are stored in the redo log buffer in the SGA and then written to the redo log files when either the buffer is full or the associated transaction is committed.

The DBA defines "groups" of identical (same size) redo logs, so that LGWR simultaneously writes identical information in parallel to each member of a group and switches between groups in a circular fashion. Each redo log within a group is called a "member". An Oracle database must have at least two groups, so that one group can be active while the other group can be archived (if in ARCHIVELOG mode).

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the Redo Log Manager

» Select Database | Administer | Redo Log Manager.

Upper and Lower Panes

The upper pane displays groups and information pertaining to them at a glance. The current Group is highlighted in blue. If a log group is unbalanced, then the Members column will display in red and a suggestion for fixing it displays above the grid. In addition, you can use the toolbar to:

The lower panel contains the details for the members of each log group. From the toolbar you can access each member, make changes to it or drop it.

Related Topics

Balancing Redo Log Groups


Balancing Log Groups

Balancing Redo Log Groups

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Redo Log groups can be managed from the Redo Log Manager. Each redo log group must have an equal number of members (redo log files), and each redo log file must be the same size as all others.

If either of the above conditions is not met, the entry is considered out of balance and displayed in red. For example:

In this example, Group 4 does not meet the member condition: there is only one member contained in it, rather than the 2 members of each of the other groups.

Add another member using the Add button below the grid in the lower panel.

The Members grid will now display as follows, entirely in black:

Related Topics

Redo Log Manager


DBMS_Flashback

Using Oracle's DBMS_FLASHBACK, you can revert to a version of the database at a specified wall-clock time or a specified system change number (SCN). When enabled, the user session uses the Flashback version of the database, and applications execute against the Flashback version of the database.

You can use the DBMS_FLASHBACK functionality to restore data to your sessions. You may want to use DBMS_FLASHBACK for the following reasons:

  • Self-service repair. If you accidentally delete rows from a table, you can recover the deleted rows.
  • Packaged applications such as email and voicemail. You can use Flashback to restore deleted e-mail by re-inserting the deleted message into the current message box.
  • Decision support system (DSS) and online analytical processing (OLAP) applications. You can perform data analysis or data modeling to track seasonal demand, for example.

DBMS_FLASHBACK is turned off automatically when the session ends, whether by disconnection or by starting another connection.

Requirements

  • You must have EXECUTE privileges for DBMS_FLASHBACK.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Using Wall-Clock time

When enabling Flashback using a wall-clock time, the database chooses an SCN that was generated within five minutes of the time specified.

Using an SCN

You can enable an SCN for finer control of the flashback. An SCN identifies the exact version of the database, and therefor allows you to specify the exact moment you want to flashback.

Using Flashback

PL/SQL cursors opened in Flashback mode return rows as of the flashback time or SCN, letting you recover data. These cursors will remain open when you disable the Flashback session so that you can transfer the data to the current session.

Different concurrent sessions (connections) in the database can perform Flashback to different wall-clock times or SCNs.

DML and DDL operations and distributed operations are not allowed while a session is running in Flashback mode.

You can use PL/SQL cursors opened before disabling Flashback to perform DML.

Note: In a Flashback-enabled session, SYSDATE will not be affected; it will continue to provide the current time.

Oracle provides information about DBMS_FLASHBACK. See Oracle's documentation for more information.

To use Toad's Flashback functionality

  1. From the Session menu, select DBMS Flashback.
  2. If necessary, change the session for the window by selecting the active session [image].
  3. Click [image].
  4. Select either:
    • Enable at Timestamp
    • Enable at System Change Number
  5. Enter the timestamp or SCN in the appropriate box.
  6. Click OK.


Data Pump Overview

About Data Pump

Data Pump is an import/export utility added in Oracle 10g. When you use Toad to perform a Data Pump import or export, Toad creates a parameter file and passes it to Oracle. You can save your selections in Data Pump as a Toad Action, which you can save and run on a schedule. Review the following topics for instructions on how use Data Pump:

  • Import with Data Pump
  • Export with Data Pump

Notes:

  • Data Pump can only process parameter files with ANSI encoding; the parameter file cannot contain Unicode characters. Therefore, explicitly including objects with Unicode characters in their names within the parameter file (such as table names) is not supported.

  • This feature is available in the Professional Edition and higher, or with the optional DB Admin Module.

Data Pump Requirements

You must have read/write permissions to the Oracle Directory specified by the Data Pump operations. In addition, you must have the import (IMPDP.EXE) and export (EXPDP.EXE) utilities in your client Oracle bin directory. Toad stores Data Pump utility paths in the Toad.ini file. You can view and change them from View | Toad Options | Executables.

Note: The Data Pump utilities are not the same as the legacy import/export utilities. If you need to import data from an older version of Oracle, you must use the legacy utilities. See Import Utility Wizard or Export Utility Wizard for more information.

Differences Between Data Pump and Legacy Utilities

Data Pump is significantly faster and more efficient at loading large volumes of data than the import/export utilities used in previous versions. The legacy utilities and Data Pump have the following key differences:

Legacy Import/Export | Data Pump
Runs on the client machine | Runs on the database server
Accesses files on client machine | Accesses files on the database server
Transfers data across Net8 | No data transfers across network
Works with any version of Oracle client | Works only with Oracle clients version 10g and later

Notes: The Data Pump engine generates files that are incompatible with the old import/export utilities. This also means that the Toad Export File Browser cannot be used to open or review Data Pump generated export files.

Related Topics

Data Pump Job Manager

Filter Data with Queries in Data Pump

Remap Schemas, Tablespaces, and Datafiles


Export with Data Pump

Data Pump is an import/export utility added in Oracle 10g. When you use Toad to perform a Data Pump import or export, Toad creates a parameter file and passes it to Oracle. You can save your selections in Data Pump as a Toad Action, which you can save and run on a schedule.

Notes:

  • The parameters in Data Pump are defined by Oracle. See Oracle's documentation for more information.

  • This feature is available in the Professional Edition and higher, or with the optional DB Admin Module.

  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To export with Data Pump

  1. Select Database | Export | Data Pump Export.
  2. Select one of the following options:
    New Export | Select to create a new export parameter file. Complete the rest of this procedure.
    Use Existing File | Select to use an existing export parameter file. Select the parameter file in the File tab and then proceed to the final step in this procedure.

  3. Select one of the following export modes:

    • Tables
    • Schemas
    • Database
    • Tablespaces

    • Transportable Tablespace

  4. Complete the following tabs as necessary:
    5. Items

    Select the items to export by listing them individually or through a query. To list items individually, click Add and select the item in the Object Search window.

    Table queries must return at least two columns. The first column must be the schema name and the second column must be the table name. If you are also exporting partitions, the partitions must be the third column. For example:

    SELECT 'user', 'table', 'partition' FROM dual

    Queries for schemas, tablespaces, or transportable tablespace mode must return at least one column. For example:

    SELECT tablespace FROM DBA_tablespaces

    This tab is not available for databases.
    Queries

    Enter queries to filter the data. See Filter Data with Queries in Data Pump for more information.

    This tab is not available in transport tablespace mode.
    Filters | Add a filter to include or exclude specific objects types. See Filter by Object Type in Data Pump for more information.
    Files | Use these fields to...

    Parameter file name

    Enter a name for the parameter file that will be passed to the Data Pump utility (expdp.exe).

    Execution mode

             Select one of the following options:
    • Perform Export—Immediately perform the export when Data Pump is run.
    • Generate Parameter File Only—Generate the parameter file, but do not execute the Data Pump export. This option is helpful if you want to review the parameter file before executing it or if you need to share it.

  5. Click [image] to execute, or save or schedule the selections as a Toad action. See Automation Designer Overview for more information.

    Tip: You can execute actions from the command line. See Execute Actions from the Command Line for more information.

Related Topics

About Data Pump

Import with Data Pump


Import with Data Pump

Data Pump is an import/export utility added in Oracle 10g. When you use Toad to perform a Data Pump import or export, Toad creates a parameter file and passes it to Oracle. You can save your selections in Data Pump as a Toad Action, which you can save and run on a schedule.

Notes:

  • The parameters in Data Pump are defined by Oracle. See Oracle's documentation for more information.

  • This feature is available in the Professional Edition and higher, or with the optional DB Admin Module.

  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To import with Data Pump

  1. Select Database | Import | Data Pump Import.
  2. Select one of the following options:
    New Import | Select to create a new import parameter file. Complete the rest of this procedure.
    Use Existing File | Select to use an existing import parameter file. Select the parameter file in the File tab and then proceed to the final step in this procedure.
  3. Select one of the following import modes:
    • Entire dump file
    • Tables
    • Schemas
    • Tablespaces

    • Transportable Tablespace

  4. Complete the following tabs as necessary:
    5. Items

    List items to import or select a file that contains the items to import.

    Tip: If you save the import as a Toad Action, selecting a file can be a superior way of importing objects. Another Action or process can create the file prior to executing the import Action, thereby making the entire process dynamic.

    This tab is not available if you are importing the entire dump file.
    Queries

    Enter queries to filter the data. See Filter Data with Queries in Data Pump for more information

    This tab is not available with transportable tablespace mode.
    Filters

    Add a filter to include or exclude specific objects types. See Filter by Object Type in Data Pump for more information.

    This tab is not available with transportable tablespace mode.
    Remappings

    Select schemas, tablespaces, or datafiles to remap these objects to different names. See Remap Schemas, Tablespaces, and Datafiles for more information.
    Files Use these fields to...

    Parameter file name

    Enter a name for the parameter file that will be passed to the Data Pump utility (impdp.exe).

    Execution mode

             Select one of the following options:
    • Perform Import—Immediately perform the import when Data Pump is run.
    • Generate Parameter File Only—Generate the parameter file, but do not execute the Data Pump import. This option is helpful if you want to review the parameter file before executing it or if you need to share it.
    • Generate SQL DDL File Only—Generate a SQL DDL file, but do not execute the Data Pump import.

  5. Click [image] to execute, or save or schedule the selections as a Toad action. See Automation Designer Overview for more information.

    Tip: You can execute actions from the command line. See Execute Actions from the Command Line for more information.

Related Topics

About Data Pump

Export with Data Pump

Data Pump Job Manager


Filter Data with Queries in Data Pump

When you import or export data using the Data Pump, you can use queries to filter the data. The format of these queries is important and affects the data you import or export. The query statement must be in the following format:

[[schema_name.]table_name:]"query_clause"

The schema name and table name are optional. The query_clause is a WHERE statement. If the table name is not specified, the query will be applied to all tables.

Some sample query statements are as follows:

Statement | Definition
DEPT:"WHERE DName='ACCOUNTING'" | Limits the import for the DEPT table to just those rows where the DName column equals 'Accounting'.
SCOTT.EMP:"WHERE EName='SMITH'" | Limits the SCOTT.EMP table to just those rows where the EName column equals 'Smith'.
"WHERE Col1=10" | Limits ALL tables in the dump file. Each table will have to have a "Col1" for this query to work.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Effect of Remapping on Queries

Remapping a schema to a different schema when importing can affect the results of queries. For example, in the second query above, if you remap the SCOTT schema to JSMITH, then the query will fail, and all data will be imported. However, in this scenario the first and third queries will still function. See Remap Schemas, Tablespaces, and Datafiles for more information.

Failure versus No Results

If a query fails (it cannot be resolved), Data Pump imports all data. For example:

  • When you remap a schema to a new schema and then look for the old schema, all data will be imported.
  • If, in the third query example above, some tables did not have a Col1, all data would be imported/exported.

If the query is valid but results in no matches, no data is imported/exported. For example:

  • In the first query example, there is a DName column but no 'Accounting' entries. Data is not imported/exported from the DEPT table.
  • In the third query example above, all tables have a Col1 but none of them have an entry of 10. Data is not imported/exported from any table.

Related Topics

About Data Pump

Remap Schemas, Tablespaces, and Datafiles

Import with Data Pump

Export with Data Pump


Filter by Object Type in Data Pump

One of the distinct advantages to the Data Pump is that you can filter by object type with a metadata filter. Metadata filters identify a set of objects to be included or excluded from the Data Pump operation. For example, you could request a full export, but without tables.

Filtering inclusion or exclusion applies to the selected objects and their dependent objects. For example, if a table is excluded by a filter, then its indexes, constraints, and other dependant objects are also excluded by the filter.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To filter by object type

  1. Select the Filters tab in the Data Pump.
  2. Click Add.
  3. Select an object type in Filters window.
  4. Select whether you want to:
    • Include - Include only selected object types.
    • Exclude - Exclude only selected object types.
  5. Enter any further selection criteria you want to use in the Clause box.

Example

You want to import Table metadata from only tables that match a specific criteria.

  1. Select the Filters tab in the Data Pump.

  2. Click Add.
  3. Select TABLE in the Filters window.

  4. Click INCLUDE. This limits the import to table metadata only.

    Note: If you clicked EXCLUDE, then only table metadata would be excluded from the export, and all other types would be included.

  5. To filter the metadata further, enter a filter criteria in the Clause field. This is optional, and is a further refinement of how you can control what gets put into the import or export.

    The criteria must be a SQL expression, and operates on the metadata. In this example, enter LIKE ‘EMP%'.

Related Topics

About Data Pump

Import with Data Pump

Export with Data Pump


Remapping Schemas, Tablespaces, and Datafiles

Remap Schemas, Tablespaces, and Datafiles

You can remap schemas, tablespaces, and datafiles in Data Pump depending on the mode and choices you have made. For Oracle 11g databases you can also remap tables. The tabs for these will usually all display. However, if you choose one that is inappropriate to the choices made, it will fail when run by Oracle.

The remapping grid requires the following:

  • A source can only display once in each remapping grid.
  • A row must contain both a source and a target.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To remap

  1. Select the Remappings tab in the Data Pump.
  2. Select the tab of the type of object you want to remap.
  3. Click [image].
  4. Enter the name of the object to remap in the Source column.
  5. Enter the name of the table, schema, tablespace or datafile you want to rename the Source to in the Target column

Related Topics

About Data Pump

Import with Data Pump

Export with Data Pump

Filter Data with Queries in Data Pump


Data Pump Job Manager Overview

Data Pump Job Manager

The Data Pump Job Manager provides a way of tracking your Data Pump jobs. Because the Data Pump is not limited to a connection, the windows can be closed after starting a job. The job manager gives you the ability to manage these jobs and start, stop, and kill them after the Data Pump Watch window has been closed.

Note: This feature is available in the Professional Edition and higher, or with the optional DB Admin Module.

To open the Data Pump Job Manager

» Select Database | Import | Data Pump Job Manager.

Related Topics

About Data Pump

Import with Data Pump

Export with Data Pump


Export Dataset

You can export the dataset to the clipboard or a file. Toad preserves your sorting and filtering settings in the exported file. In addition, you can set your choices here and then run the actual export of the results from the command line later. See Execute Actions from the Command Line for more information.

Notes:

  • You can export to a flat file, which is a file that does not contain TAB or comma characters between values. See Export Data to Flat File for more information.
  • CLOBs and BLOBs are automatically exported, but LONG columns are not exported using this method.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To export a dataset

  1. Right-click the data grid and select Export Dataset.

  2. Customize how you save the data, if necessary. See Saving Formats for more information.

    Tip: You can use a variable to create dynamic filenames, such as including a date or a timestamp.


Saving Formats

When exporting a dataset from a grid, you have the choice of several different formats. Each format provides different options to customize your file. These formats include:

Some of these formats let you copy to the clipboard; for others you are required to save the document to a file. The options vary depending on which format you choose.

  • Access Database File
  • Text Options (delimited text)
  • Fixed Field Spacing
  • HTML Options
  • Insert Statements Options
  • Merge Statements
  • SQL*Loader Options
  • XLS File Options
  • XLS Instance Options
  • XML (Plain) Options
  • XML (With XSL) Options

Note: There may be problems with your export in the following formats if your table contains columns containing XML data:

  • SQL Loader
  • XML (with XSL)
  • XML (Plain)


Access Database File

Select this option in the Export Dataset window to save your data as an MDB (Access Database) file. See Export Dataset for more information.

You can also set the following options:

  • Change file where doc is saved
  • Compress file in zip format
  • Launch File after Creation
  • Data Substitutions (for columns)
  • Display all exported results in grid
  • Export selected rows
  • If MDB file exists..
  • Create table in MDB file
  • Prompt for overwrite/abort
  • Automatically detect table name
  • Name
  • If Table exists...
  • Append rows (if columns match)
  • Overwrite
  • Abort

Related Topics

Saving Formats

Text Options

Fixed Field Spacing

HTML Options

Insert Statements Options

Merge Statements

SQL*Loader Options

XLS File Options

XLS Instance Options

XML (Plain) Options

XML (With XSL) Options


Text Options

When you select text from the Export Dataset window, you can set the delimiter to your choice. The default is a pipe ( | ). See Export Dataset for more information.

To change to a common delimiter

» Right click in the delimiter box and then select the delimiter you want to use, or type the delimiter in using the keyboard.

When you change this delimiter, Toad will remember your choice.

Related Topics

Export Dataset

Saving Formats


XLS File Options

If, from the Export Dataset window, you choose to export to an XLS file, you can choose from a long list of options. You can:

  • Display all exported results in grid
  • Export selected rows
  • Include null text
  • Include column headers
  • Lowercase
  • Quoted
  • Include SQL statement
  • Include cell borders
  • Use only "General" cell formatting
  • Match cell fonts to grid
  • Hide time portion of date if zero
  • Write wide strings (This feature can help Unicode export correctly. It is unchecked by default because it can slow the XLS writer down dramatically.)
  • Auto column width
  • Click the Data Substitutions button
  • Set date or number formats
  • Set papersize
  • Name worksheet

Related Topics

Saving Formats

Saving Formats


XLS Instance Options

Selecting Instance options from the Export Dataset window creates an Excel file within the current Excel instance running on your machine. The following options are available:

  • Include NULL text
  • Export selected rows
  • Start at active cell - if selected, this places the exported data (the top left corner) in the active cell in MS Excel. Using this option you can place the data anywhere you want, verically or horizontally on any sheet. When unchecked, the data will start in the A1 cell of a new sheet.
  • Treat string fields as strings - if selected, Toad sends a single quote before a string field making Excel treat it as a string. Leading zeros are preserved.
  • Include column headers -if selected, lowercase column headers become available.
  • Specify a Sheet name
  • Click the Data Substitutions button

Related Topics

Saving Formats

Saving Formats


Fixed Field Spacing

You can export your grid from the Export Dataset window with a fixed field width. See Export Dataset for more information.

Widths are derived from the column definitions.

Note: Widths come from the definition of the table in the database, not the way it looks in the grid.

  • Click the Substitutions button to specify a constant value or expression to save into a column, instead of the actual value. For example, use this when you want to put SEQ.NEXTVAL in the INSERT statements in place of an ID column, instead of actual ID's, or to cover up a value in a column when you save the data to HTML.

Related Topics

Export Dataset

Saving Formats


HTML Options

You can choose to export your results from the Export Dataset window as an HTML table.

If you choose this format, you can choose from the following options:

  • Export selected rows
  • Include null text
  • Include column headers - Lowercase or quoted
  • Include cell borders
  • Word wrap
  • Substitute column values

Related Topics

Export Dataset

Saving Formats


Insert Statements Options

If you choose to export your results from the Export Dataset window as INSERT statements, column headers will automatically be included. See Export Dataset for more information.You can also set the following options:

  • Display all exported results in grid
  • Export selected rows
  • Include null text
  • Include schema name
  • Include SQL Statement
  • Include "set define off"
  • Lowercase column names
  • Column names in values clause

  • Set commit interval

    Note: A commit inteval of 0 (zero) will produce one insert statement after all of the SQL statements. A commit interval of -1 will leave off the commit entirely.

  • Automatically detect schema and name
  • Set Schema and name
  • Set Data Substitutions

Relate Topics

Export Dataset

Saving Formats


Merge Statements

Select this option to save the grid from the Export Dataset window as a series of MERGE statements. This merge is created based on the table's primary key. If no primary key is found, you can select columns to merge on. Invisible grid columns are excluded from the merge statement. See Export Dataset for more information about exporting grid contents.

Commit Intervals

A commit inteval of 0 (zero) will produce one insert statement after all of the SQL statements.

A commit interval of -1 will leave off the commit entirely.

Note: You can generate these statements from any version of Oracle, but can run them only in Oracle 9i and newer.

Related Topics

Export Dataset

Saving Formats


SQL*Loader Options

Choosing SQL Loader from the Export Dataset window creates a SQL Loader file. See Export Dataset for more information.

Select from the following options:

  • Display all exported results in grid
  • Export selected rows
  • Parallel load
  • Include schema name
  • Include SQL Statement
  • Operation
  • Insert
  • Truncate
  • Append
  • Replace
  • Allowable Discards
  • All
  • Set Maximum
  • Direct path load
  • Recoverable
  • Unrecoverable
  • Field separator (default ;)
  • Enclose string fields in (default ")
  • Table
  • Automatically detect schema and name
  • Set schema and name
  • Click the Substitutions button

Related Topics

Export Dataset

Saving Formats


XML (Plain) Options

This format option from the Export Dataset window exports the results to a plain XML file.

You can also set other options such as:

  • Display all exported results in grid
  • Export selected rows
  • Include null fields
  • Click Data Substitution

Related Topics

Saving Formats

Saving Formats


XML (With XSL) Options

This formatting option from the Export Dataset window exports the results to an XML file with XSL. You can choose to zip the resulting file. You can also click the Substitutions button and specify substitutions for data.

Related Topics

Saving Formats

Saving Formats


Export DDL

Use this dialog box to export selected DDL to a file, the clipboard, or the Editor.

To export DDL

  1. Select Database | Export | DDL.
  2. Click Add on the Objects and Output tab to select objects to export. See Object Search for more information.
  3. Set the output options in the bottom pane.
  4. Select the Script Options tab and set the script options. Review the following for additional information:
    5. Common Tab | Description
Schema name | Include the schema name in the DDL.
Drop statement | Include a drop statement as well as the create statement.
Related Objects | Select the related objects you want to include.

  5. Click [image] to execute, or save or schedule the selections as a Toad action. See Automation Designer Overview for more information.

    Tip: You can execute actions from the command line. See Execute Actions from the Command Line for more information.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview

Export Dataset


Viewing an Export File

Use the Export File browser to view the contents of an export file before you import it.

A video tutorial is also available for this feature. This video opens in a new browser and requires an Internet connection.

Caution: While the scripts produced by the Export File Browser are very good for giving you a glimpse into the objects contained in the export file, Oracle meant for these scripts to run only in the context of Oracle's IMP utility. Many extracted DDLs will run as standard SQL, and some will not. Please examine scripts produced by the Export File Browser very carefully before running them.

To open an export file

  1. From the Database menu, select Export | Export File Browser.
  2. On the Export File Browser toolbar, click [image].
  3. Select a file from the Open Export File window. See Open Export File Window for more information.

  4. Click OK.

    Note: If the file has not been parsed before, it may take a few minutes to process it. Processing progress will be displayed in the status area at the bottom of the window.

Related Topics

Dataset Operations


Finding Information in an Export File

Use the right hand side tree view of the Export File Browser to select a portion of the export file to view. Nodes are organized by:

  • Schema
  • Storage
  • Security
  • Code
  • Tuning and Configuration

Object nodes are displayed with the number of objects of that type in parentheses beside it. For example, Schemas (6). If you expand the Schemas node, you will find six schemas beneath it.

In the left hand side, you can click the DDL tab to view the code. If the selected object has data, such as a table, click the Data tab to view the data within that object.

Filtering Data

You can use the QuickFilter in the same way as it works in the Schema Browser. See Use the QuickFilter (Filter from Memory) for more information. However , it will display results in the tree view slightly differently.

Reading the Treeview

With NO filter applied (* in the QuickFilter box), you will see a node like Tables (42) if there are 42 tables in a certain schema, for example.

If a filter is applied that only makes 10 of these tables visible, that node displays one of the following: Tables (? of 42) or Tables (10 of 42).

  • ? indicates that the you have not expanded the node yet, so how many pass the filter is not known.
  • (10 of 42) indicates that the node has been expanded (or is currently expanded)

You will never see Tables (0 of 42) because if all tables are filtered out, then the Tables node is hidden too. Schema-level nodes are never hidden, even if everything under them is hidden.

To find something quickly

  1. Open the export file in the Export File Browser.
  2. Type its name or an appropriate filter in the QuickFilter box.
  3. Click the Expand All [image] button.

Related Topics

Viewing an Export File

Dataset Operations

Use the QuickFilter (Filter from Memory)


Open Export File Window

The Export File Browser window is more than just a file selection screen. It provides you with information about the export files, including basic file information, who created them, and whether or not they have been parsed. See Viewing an Export File for more information about the Export File Browser.

To open an export file

» Click [image] on the Export File Browser toolbar.

Window Layout

The left hand side of the Open Export File window is the directory tree. Use this to find the file you want to open. It works in the same manner as the Windows Explorer.

When you have selected a directory the files are listed on the right hand side. By default Toad displays only the .dmp files in a directory.

To see all files in a directory

» Select All Files from the File Type box.

If you have selected all files, the info grid will be more sparsely populated for the files that are not export (extension .dmp) files. Non-export files display only File Name, File Size, and File Date.

Parsed File color

Toad keeps track of files you have previously parsed by changing their color.

By default, all unparsed files are displayed in black. Parsed files are displayed in Green.

To change the color of parsed files

  1. Click the Settings button in the lower left of the screen.
  2. Select Set pre-parsed color.
  3. Select the color you want to use and click OK.

To remove parsing information for the selected file

  1. Click the Settings button in the lower left of the screen.
  2. Select Remove pre-parsed information.

To remove parsing information entirely

» In the Toad Directory | ParsedExportFiles directory, remove all files.

Related Topics

Viewing an Export File


DB Compare Mode Overview

You can use the Export File Browser to compare an export file with the objects in a database. This is a cursory compare and will not indicate deep, data-level differences.

To compare a file to a database

  1. Open a data export file in the browser. See Viewing an Export File for more information.
  2. Click [image].
  3. In the right hand side compare screen, select a connection from the connection drop down to compare to the file.

    4. Note: If the connection you want to use is not listed in the drop-down, you can either:

    • Click the connection drill down and then click New and open a new connection.
    • From the Session menu | New Connection, open a new connection.
  4. In the left hand side, select one or more nodes to compare to the selected database.

Related Topics

Reading the Compare Grid


Reading the Compare Grid

The compare mode grid in the Export File Browser provides basic information for both the database and the selected nodes. You can print or export the compare grid from the Export Dataset menu item.

Troubleshooting

Because of the way Toad parses .dmp files, some items will be listed as in the database but not in the file. These include:

  • Constraints that were created inline with the table DDL, as follows:

    • CREATE TABLE WK$DOC_RELEVANCE

    (

    URL_ID NUMBER NOT NULL ENABLE,

    TERM VARCHAR2(500) NOT NULL ENABLE,

    SCORE NUMBER NOT NULL ENABLE,

    CONSTRAINT WK$DOC_RELEVANCE_PK PRIMARY KEY ("TERM", "URL_ID") ENABLE

    );

  • System named constraints.
  • Indexes created by Oracle when a user created a constraint.
  • Many objects in the SYS, MDSYS, etc, schemas. Certain objects are created automatically when you create a database do not go into export files even when you do a "full database export."
  • System named hash partitions and subpartitions.

Related Topics

DB Compare Mode Overview

Reading the Compare Grid


Freezing the Compare Grid

Freeze the Compare Grid

You can freeze the compare grid in the Export File browser so that you can view other items without losing the data from the compare you are doing. See Viewing an Export File for more information.

This will hold the Compare Grid steady while you toggle Compare mode off, and view DDL or data in Browser mode. When you return to Compare DB mode, the last compare you performed will be active in the grid regardless of what is selected in the left hand side.

To freeze the compare grid

  1. In the Export File Browser, compare a node or nodes to a database connection. See DB Compare Mode Overview for more information
  2. Select the Freeze Grid checkbox to freeze the grid.

Related Topics

DB Compare Mode Overview

Reading the Compare Grid


Copying DDL to Clipboard

Copy DDL to Clipboard

You can copy DDL from the right hand side of the Export File Browser to the clipboard and then paste it wherever you need it, including other editors.See Viewing an Export File for more information.

To copy DDL from the right hand side to the clipboard

  1. Select an object from the left hand tree view and click the DDL tab on the right hand side.
  2. Select any or all of the DDL.

    3. Press CTRL+C.

    Note: Scripts for a few objects will look wrong. The reason for this is that the export files we are browsing were meant only to be used by Oracle's IMP utility. Things that may look wrong in script form because of this include:

    • Materialized views and materialized view logs.
    • Queue tables
    • Any object that has storage (tables, indexes, etc) when the export was done in "Transportable tablespace" mode.

Related Topics

Saving DDL as a File

Extracting DDL from Multiple Nodes


Saving DDL as a File

From the Export File Browser, you can save the DDL in the right hand side to a file for later use.

To save DDL from the right hand side to a file

  1. Select an object from the left hand tree view of the Export File browser and click the DDL tab on the right hand side.
  2. Right-click and select "Save to File."
  3. Name the file and click Save.

Note: This method saves all of the DDL for an object to a file. You cannot be selective as you can with the copy method.

Related Topics

Copy DDL to Clipboard

Extracting DDL from Multiple Nodes


Extracting DDL from Multiple Nodes

You can extract DDL from multiple nodes of the Export File browser to the clipboard and then paste it wherever you need it, including other editors.

To extract DDL from multiple nodes

  1. Select one or more nodes from the left hand tree view. These can be objects, or groups of objects.
  2. Right click on the tree and select "Extract DDL For Selected Nodes and SubNodes."
  3. Select your options.
  4. Click OK.

Related Topics

Copy DDL to Clipboard

Saving DDL as a File


Export Data to Flat File

You can export to a flat file, which is a file that does not contain TAB or comma characters between values.

Notes:

  • The SQL*Loader tab in this feature is only available in the commercial version of Toad with the optional DB Admin Module.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To export data to a flat file

  1. Right-click the grid and select Export to Flat File.

    or

    Select Database | Export | Table as Flat File.

  2. Click Load Spec File and select the specifications file.

    Note: You need to set up the Specifications File. See Example Specifications File for more information.

  3. Complete the fields as necessary.
  4. Click Execute.

Example Specifications File

The specifications file defines the table name, table owner, how many lines in the output file are covered by a single record of data, the columns of data, what line they display on, the starting column, and the length of each column of data. For example:

TABLENAME=EMPLOYEE

TABLEOWNER=DEMO

LINESPERRECORD=1

COL1=EMPLOYEE_ID,1,1,5

COL2=LAST_NAME,1,6,15

COL3=FIRST_NAME,1,21,15

COL4=MIDDLE_INITIAL,1,36,1

COL5=JOB_ID,1,37,4

COL6=MANAGER_ID,1,41,5

COL7=HIRE_DATE,1,46,22

COL8=SALARY,1,68,10

COL9=COMMISSION,1,78,10

COL10=DEPARTMENT_ID,1,88,3

Sample Exported File

7369 SMITH JOHN Q667 7902 12/17/1984 800 20

7499 ALLEN KEVIN J670 7698 2/20/1985 1600 300 30

7505 DOYLE JEAN K671 7839 4/4/1985 2850 13

7506 DENNIS LYNN S671 7839 5/15/1985 2750 23

7507 BAKER LESLIE D671 7839 6/10/1985 2200 14

Related Topics

About Working with Data Grids

Export Dataset


Export Utility Wizard

This wizard helps you to transfer data objects between databases using Oracle’s legacy export utility. If you have Oracle 10g or later, it may be beneficial for you to use Data Pump instead. See About Data Pump for more information.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To export data

  1. Select Database | Export | Export Utility Wizard.

  2. Review the following for additional information:

    For all Exports

    Information

    Objects to export

    Triggers are only available if you have Oracle 8.1 or above.

    Watch Progress

    If you select Watch Progress (Feedback = 1000) on the last screen of the wizard, the Export Watch window displays and you can immediately view the results of the export. In addition, the Log tab on the Watches window, will let you send the log directly to the printer.

  3. Complete the wizard.

Troubleshooting

The Export Utility wizard is an interface to Oracle's utility, usually named Exp.exe, Exp73.exe, or Exp80.exe and located in your Oracle home's bin folder.

If Toad cannot find this executable, the error "The Oracle Export Utility executable must be specified" displays.

To specify the location of the Oracle Export Utility

  1. Select View | Toad Options | Executables.

  2. Enter the path in the Export box.

    Note: If you do not know where this executable resides, or it is not on your computer, you may need to install the Database Utilities from the Oracle CD.


Data Subset Wizard

This window lets you copy a portion of data from one schema to another while maintaining referential integrity, so that you can work with a smaller set of data.

The wizard creates a script that will copy a specified percentage of data beginning with all parent tables or from all tables with no constraints. You can specify a minimum number of rows. The wizard then continues with tables that have foreign key constraints, the rows copied are those whose parent rows have been copied into the parent tables.

The data is then inserted into the destination tables with INSERT SELECT statements. Because of this, tables containing columns of datatype LONG will not be inserted.

If the destination schema is in a different database, the script is designed to run in the destination database. A database link must exist to the source schema, and there must be select privileges on the source data through that link.

To use the Data Subset wizard

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

  1. From the Database menu, select Export | Data Subset Wizard.
  2. Refer to the following for more information:

    3. Define Source and Target Databases

    Information

    Target Connection

    The target schema name will be included in the object DDL and data inserts. The target connection will add a connection string at the beginning of the script if the Include a Connect Command option is checked on .

    Select Objects to Create in the Script

    Information

    Create these objects and copy the data

    This option assumes the objects are not in the target schema, and the script creates the selected objects and insert data.

    In the Create Objects mode, clusters are excluded. If you want to subset a schema containing clusters, you will have to create the objects first, and then run the wizard with the Do not create any objects, Just truncate tables and copy data option selected.

    Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module. The DBA module is required because this creates a schema script with embedded insert statements.

    How much data do you want to copy?

    Information

    Percentage of Data to move to target

    The percentage or minimum number of rows will be accurate on the parent tables and tables with no foreign key relationships (except for situations with long columns). Data integrity is preserved in the child tables of foreign key relationships based on the rows which were inserted in the parent tables. So, the percentage of rows copied in the child tables will vary based on the data distribution of the individual tables.

    Min # of Rows in Lookup Tables

    Specify a minimum number of rows that you want moved to your target in case the percentage selected yields a lower number than the minimum desired.

    Control Options

    Information

    No Logging

    If checked, this option adds an ALTER TABLE statement before the data inserts for each object, to specify No Logging.

    If checked, the wizard will run faster, but the actions of the script (the insert statements) will be unrecoverable.

    Use Parallel DML

    If checked, this option adds optimizer hints to the insert statements. It also adds an ALTER SESSION statement before the data inserts for each object to enable Parallel DML.

    If checked, the script produced by the wizard will run faster, but you may end up with a few more extents.

    Script Options

    Information

    Include a Spool command

    If checked, the script includes a SPOOL command. A SET ECHO ON command is issued after the SPOOL command. At the end of the script a SPOOL OFF command is included.

    Include a Connect command

    If checked, adds a CONNECT command to the beginning of the script and uses a connection string that is based on the target connection specified on the first wizard screen.

    Make individual Constraint commands

    This option displays only if you have chosen to create Constraints on the Create Objects page. If checked, constraints are created as individual alter table commands. This serves to circumvent an Oracle bug that can create the following error when constraints are not created individually: "ORA-01948 Identifiers name length exceeds max."

    Adjustments to Extents and Tablespaces

    Information

    Extents tab

    The Extents tab lets you specify extents for objects created by the generated script. You can specify PCTINCREASE parameters, make Next Extent=Initial Extent, and scale extent sizes to apply to all objects created that allow storage parameters. The lower part of the screen lets you change extent sizes using IF-THEN statements.

    Note: The options in the Extents/Tablespaces tabs are enabled when the wizard is set to create objects (when you select the Create these objects and copy the data option in the Select Objects to create in the script of the wizard).

    Tablespaces tab

    The Tablespaces tab lets you specify the tablespaces to create indexes, tables, and their partitions. You can place all of an object type (tables. table partitions, indexes, index partitions) into one tablespace or distribute them across different tablespaces based on their size.
  3. Complete the wizard.


Import Table Data

You can import table data without importing table structure. This must be imported into an existing table, although you can use the Create Table feature to create a new table for the import. See Create and Alter Table for more information.

In addition, you can import table data directly into a data grid from the clipboard. To do this the data grid must be editable. See Understand Editable Resultsets for more information.

A video tutorial is also available for this feature. This video opens in a new browser and requires an Internet connection.

Notes:

  • Datasets to be loaded must be small enough to fit in memory. For large datasets, convert your data to a text file (if it is not already a text file) and use the SQL Loader wizard. See SQL*Loader Wizard Overview for more information.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To import table data

  1. Select Database | Import | Import Table Data.

  2. Complete the wizard. Review the following for additional information:

    Select Destination Description

    Truncate table

    Click [image] to truncate table before importing.

    Enable/disable constraints and triggers

    Click [image] to disable or enable constraints before importing.

    Click [image] to disable or enable triggers before importing.

    Select Source

    Description

    Import from

    In addition to the obvious choices, you can also import an old .SMI file from Toad 9.5 or prior. Right-click and select Import settings from SMI file.

    Preview File and Define Files

    Description

    AutoMap

    Data is displayed in the grid, as it will be entered in the Oracle table.

    Mapping Manually

    You can also map columns manually. Click on a column header and then select the column where you want to map the column of data to go.

    Field Mapping Dialog

    If you are importing an XLS file, and have elected to begin on row 2 in the previous screen, then Toad displays the Field Mapping dialog. Select one of the following options:

    • Map fields by matching field names—The default. Toad looks in the first row of the spreadsheet to find the column names, and uses those for the field names.
    • Map fields sequentially—The columns of the spreadsheet are imported into the table in the same order as they display. Column 1 maps to the first table column and so on.

Related Topics

Action Catalog


Import Utility Wizard

This wizard helps you to transfer data objects between Oracle databases using Oracle’s legacy import utility. If you have Oracle 10g or later, it may be beneficial for you to use Data Pump instead. See About Data Pump for more information.

Notes:

  • You can set the utility's path from View | Toad Options | Executables.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To import data

  1. Select Database | Import | Import Utility.

  2. Complete the wizard. Review the following for additional information:

    Import Tables

    Information

    Select Show only users who own objects to limit your schema selection to schemas that have objects.

    This will limit selections for both the from and to user areas.

    File Record Length

    If left blank this value defaults to use the platform's BUFSIZ value.

    Import Users

    Information

    Select Show only users who own objects to limit your schema selection to schemas that have objects.

    This will limit selections for both the from and to user areas.

    File Record Length

    If left blank this value defaults to use the platform's BUFSIZ value.

    Watching Progress

    If you select Watch Progress (Feedback = 1000) on the last screen of the wizard, the Import Watch window displays and you can immediately view the results of the import. In addition, the Log tab on the Watches window, will let you send the log directly to the printer.

Related Topics

Export Utility Wizard

About Data Pump

Import Table Data


SQL*Loader Wizard Overview

You get to this window from the Database | Import | SQL*Loader Wizard menu item.

With the Toad SQL*Loader wizard you can:

  • graphically build a control file for use with the SQL*Loader, a database server application.
  • schedule the SQL*Loader execution as a Windows job for later execution.
  • run the SQL*Loader with the control file running in either the foreground or the background.

You can configure the location of the utility from View | Options | Executables. See Executables for more information.

Troubleshooting

If you have difficulty running SQL*Loader, make sure that you have the correct version installed. You can do this by running the executable with no parameters in a command prompt window. The executable on the server can only be run from the server.

Using the SQL*Loader wizard

The best way to learn to use the SQL*Loader wizard is to actually use it. The SQL*Loader Wizard tutorial lets you do this in a step by step method, starting with the most common uses and moving into the more advanced features. See Create Input File - Basic SQL*Loader Tutorial for more information.

At any time during the process you can load settings from a file or save the current settings.

To use SQL*Loader wizard

  1. From the Database menu, select Import | SQL*Loader Wizard.

    Note: Using "Watch Progress" with an 8.0.x version of SQL*Loader on Windows 2000 causes a 100% CPU usage. It is recommended that you uncheck "Watch Progress" on the last screen of the SQL*Loader Wizard, so that the SQL*Loader is launched outside of Toad.

  2. Complete the wizard.

Related Topics

Save Settings for SQL*Loader

Scheduling SQL*Loader Tasks

SQLLoader Global Options

SQL Loader Field Mapping

Filler Columns


Save Settings for SQL*Loader

At any time during your use of the SQL*Loader Wizard you can save your settings or load previously saved settings. See SQL*Loader Wizard Overview for more information.

To save settings

  1. Click the Save settings button at the bottom of the window to save your settings.
  2. You are prompted for a name for your settings file. You can either add a new name or select one from the drop-down menu. If you select one from the drop-down menu, the new file will overwrite the old one.

The SQL*Loader wizard will keep track of your settings files for you.

To load settings

  1. Click the Load settings button at the bottom of the SQL*Loader wizard to Load a set of previously saved settings.
  2. Select the settings file you want to load.
  3. If the file is complete, leave Proceed to finish after loading checked and click OK. You will be taken directly to the last screen of the SQL*Loader wizard.
  4. If the file is not complete, uncheck Proceed to finish after Loading and click OK. You will remain on current screen of the SQL*Loader wizard and Toad will let you make changes to your settings.

Note: When you load settings, input file and destination table files are cumulative. Rather than overwriting previous settings, Toad appends the new information to the wizard settings.

Related Topics

SQL*Loader Wizard Overview

Scheduling SQL*Loader Tasks

SQLLoader Global Options

SQL Loader Field Mapping

Filler Columns


Scheduling SQL*Loader Tasks

Included in SQL*Loader Wizard is a scheduler that provides the ability to schedule the load as a Windows task. See SQL*Loader Wizard Overview for more information.

To schedule a SQL*Loader task

  1. From the last step of the SQL*Loader wizard, select Schedule and then click Finish. This opens the Scheduler wizard.
  2. Select the time and frequency you want SQL*Loader to run.
  3. Click OK and you are informed that a job has been added.

To see that the task has been added

  1. Open Windows Explorer. On the left side, after your hard drive and CD ROM letters, you will see Control Panel, Printers and Scheduled Tasks (and maybe other things, depending on your system). The screenshot below shows NT 4.0. In Windows 2000, "Scheduled Tasks" displays under "Control Panel" in the tree view.

    2. Click Scheduled Tasks. On the right side you will see the newly added job, as in the image below.

    Right-click and then select Properties and look in the Run field to see just what is going to happen at that time. It should contain something similar to the following:

    D:\ORACLE\ORA81\BIN\SQLLDR.EXE userid=MLERCH/MLERCH@ORA8I control=d:\confile.ctl log=d:\confile.log

Related Topics

SQL*Loader Wizard Overview

Save Settings for SQL*Loader

SQLLoader Global Options

SQL Loader Field Mapping

Filler Columns


SQLLoader Global Options

The Global options and default values screen of the SQL*Loader Wizard lets you enter command line options and some default values. These will be overridden by anything you enter in the Destination Table or Columns fields. See SQL*Loader Wizard Overview for more information.

Any of these options may be left blank. Oracle will then use the default values for them.

"Command Line" options

Skip

Enter the number of logical records to skip at the beginning of your input file, or leave blank to load all of them.

Load

Enter the number of logical records to load. Any records beyond this point will not be entered.

Errors

Enter the number of errors to allow. The default is 50. If there are more than this number of errors when loading your data, the SQL*Loader will stop.

Rows

Enter the number of rows in conventional path bind array or between direct path data saves.

Read size

Enter the size (in bytes) you want to use for the read buffer.

Bind size

Enter the size of conventional path bind array in bytes. The default is dependent on your system. This size, if specified, overrides the default size and any size determined by ROWS.

Stream Size

Enter the size of direct path stream buffer in bytes (Oracle's Default is 256000)

Resumable timeout

If this load will be designated Resumable, enter the wait time (in seconds). The default is 7200.

Resumable name

Enter a text string to help identify a resumable statement.

Column array rows

Enter the number of rows for direct path column array. The default is 5000.

Direct

Check this box to assign this load as a direct path load.

Parallel

Check this box to assign this load as a parallel direct path load. This is more restrictive than a direct path load.

Resumable

Check this box to enable resumable for this load.

Multithreading

Check this box to use multithreading in direct path.

Skip index maintenance

Check this box to specify: do not maintain indexes, and to mark affected indexes as unusable.

Silent

Use the silent options to suppress error messages in the output and log tabs of the Watch dialog as follows:

Header

Hide the SQL*Loader header message that displays in the Output tab. Header messages will still display in the Log file and on the Log tab.

Discards

Hide the message in the log file that corresponds to each record written in the discard file.

Feedback

Hide the messages relating to "commit point reached".

Partitions

Disable writing the per-partition statistics to the log file. This is an Oracle 8i option.

Errors

Hide the data error messages in the log file. These occur when a record generates an Oracle error that writes it to the bad file. Rejected record count still displays, even if the individual error messages are suppressed.

All

Implements all of the keywords. Skip unusable indexes

Check this box to disallow unusable indexes or index partitions. Unchecked (the default) unusable indexes will be allowed.

Load Statement

Database redo Log

Specify whether the load is recorded or not recorded.

Load Type

Select LOAD or CONTINUE_LOAD.

Load Method

Select INSERT, APPEND, REPLACE or TRUNCATE as your load method.

Length

Specify the length type: CHAR, BYTE, CHARACTER.

Byte order

Specify the byte order: Little Endian or Big Endian.

Byte order mark

Specify the byte order mark: check or nocheck.

Character set

Specify a datafile character set other than the default: for example, AL16UTF16 or JA16EUCFIXED.

Read buffers

Specify the number of buffers to be used during a direct path load.

Preserve blanks

Select this checkbox to preserve leading and trailing whitespace if necessary.

Combine Physical Records Area

Use this option to combine physical records. Fill in the various boxes to create the option statement.

  • Concatenate every ____ records to form logical record
  • Continue if:
  • this record = ___ in cols ___
  • next record = ___ in cols ___
  • last non-blank character = _____

Related Topics

SQL*Loader Wizard Overview

Save Settings for SQL*Loader

Scheduling SQL*Loader Tasks

SQL Loader Field Mapping

Filler Columns


SQL Loader Field Mapping

You can automatically map your fields as you specify your destination tables in the SQL*Loader Wizard. See SQL*Loader Wizard Overview for more information.

This provides a graphic display of how your data will map to the columns in your table.

Field Delimiters

Field mapping is done based on the delimiters you set in the field delimiter screen.

To set up field mapping

  1. From the first screen of the wizard, select Build Control File, and make sure that Specify Fields is checked. Click Next.
  2. Enter your input file name and click Next.
  3. Select the method of delimiting you want to use.
  4. At the bottom of the window, specify how many rows of data you want to display in the Number of lines displayed box. This number also defines the number of lines displayed in the Preview Fields tab.

By Field

On the table destination screen, the Field Mapping grid defines the columns in the table, and includes a column for Field. The field column begins without entries. Click Auto Map to fill this column.

When filled, the Field mapping grid displays as follows:

Note that the Field column says "field1" and "field2" rather than defining any data.

Preview Fields

To preview the data and see how it will be included in the columns you have selected, click the Preview fields tab. The results displayed will be similar to the following:

Of course, you may have more columns or more data. The amount of data displayed in the Preview fields screen is set in the Field Delimiters screen as described above.

Related Topics

SQL*Loader Wizard Overview

Save Settings for SQL*Loader

Scheduling SQL*Loader Tasks

SQLLoader Global Options

Filler Columns


SQLLoaderFiller Columns

Filler Columns

When mapping columns to your datafile in the SQL*Loader Wizard, there may be reasons not to include all of the data available in the load. See SQL*Loader Wizard Overview for more information.

You can use Filler columns to skip some of the data in the input file; you also can use a filler column to read data from the input file without mapping it to an actual column in the table (to "hold" a file name).

To use a filler column to skip data

  1. From the Columns area of the Select the destination columns and specify the load parameters for each screen, click Filler.
  2. Select the appropriate filler type:
    • Filler
    • Bound Filler
  3. Enter a column name.
  4. Set any properties or position.

    5. Click OK.

    Note: The filler column is added to the columns grid and designated as FILLER.

Related Topics

SQL*Loader Wizard Overview

Save Settings for SQL*Loader

Scheduling SQL*Loader Tasks

SQLLoader Global Options

SQL Loader Field Mapping


Generate Database Script

The Generate Database Script window lets you create a script to create a new database similar to an original. You can create the script by extracting the definition information from the original database or from a previously saved database definition file.

Caution: This script simply reverse-engineers the DDL for individual objects in the database. This lets you add pieces of this DDL to your own database script. This window does not create a full script to reproduce the selected database, and should NOT be used for backup purposes.

Notes:

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To generate a database script

  1. Select Database | Export | Generate Database Script.
  2. Specify Source and Output for the script.
    3. DDL Filename | You can use variables in the filename. For example, you can include the %DATEFILE% and %TIMEFILE% variables, which inserts the current date and time into the filename when the file is created when you create the schema script.
Definition filename | When you create a definition file, you can use variables in the filename. By default, Toad includes the %DATEFILE% and %TIMEFILE% variables, which inserts the current date and time into the filename when the def file is created. (This ensures that the date and time are inserted accurately if you are creating the def file from an Action.)
Create Individual Object DDL Files | If you choose this option, you must enter the top-level directory for your new files. This is not a filename. Toad will create an individual DDL file for each object in the database.

  3. Click the Objects and Options tab.

    Inc Undoc Parms

    Stands for "Include Undocumented Initialization Parameters". These are the parameters whose names start with "_" and do not display in Oracle's documentation. You must be connected as SYS in order to retrieve these parameters. It is not advisable to alter these parameters unless directed to do so by Oracle support.

    Options

    Notes

    Sort for Creation

    Selecting this ensures that objects are created in an order that avoids problems with dependencies.

  4. Click the Object Set tab. To specify an object set, select Specify Object Set and then click [image].

    Note: You must have one or more object types selected in the Objects and Options tab before you do this.

  5. Click [image] to execute, or save or schedule the selections as a Toad action. See Automation Designer Overview for more information.

    Tip: You can execute actions from the command line. See Execute Actions from the Command Line for more information.

Related Topics

Scheduling a Database Script as a Windows task


Scheduling a Database Script as a Windows task

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To generate a database script

  1. Set up your script options and settings as in Generate Database Script, but don't click Create Script. See Generate Database Script for more information.
  2. Click [image].
  3. Select or create a filename for a settings file.
  4. Enter the information as required for the Add Task wizard. See Add Task Wizard for more information.

Related Topics

Generate Database Script


Generate Schema Script

This window lets you select one or more schemas and build DDL for the selected objects.

Notes:

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To generate a schema script

  1. Select Database | Export | Generate Schema Script.

  2. Select the appropriate options on the tabs. Review the following for additional information:

    Source and Output Tab

    Description

    DDL Filename box

    You can use variables in the filename. For example, you can include the %DATEFILE% and %TIMEFILE% variables, which inserts the current date and time into the filename when the file is created when you create the schema script. You can also insert a user variable.

    Create Individual Object DDL Files

    If this option is selected, Toad will create individual DDL files for each object. You will need to set the following options as well:

    • Use SQL extension for all files - if selected, .sql will be used as the extension for all created files.
    • Use extension as configured in TOAD options - if selected, Toad will check Toad Options | Files | General and use the extension specified for SQL.
    • Use relative path in "build all" script - when selected, Toad will use the relative path. When this option is not selected, Toad will hard code the path names into the script.
    • Top Level Directory box - Specify the top level directory for the saved files.

    File will be used for HTML schema doc generation

    Def files are not compatible between different versions of Toad.

    If this checkbox is selected, the .def file that is produced will include the queries necessary to create a complete HTML schema document.

    If this checkbox is clear, on large databases the generation may go faster, and the .def file can still be used to generate the HTML schema document; however, the resulting HTML file will leave the following items blank:

    • Size and Number of Extents columns in the Table summary, Index summary, and Snapshot summary
    • # of Objects in the Package Summary
    • # of Arguments in the Procedure Summary and Function Summary

    Object Types Tab

            Description

    User information and object types

    Select the user information and object types you want to extract.

    Note: To select or clear all checkboxes, right-click and select the appropriate option.
    Object Set Tab Description

    Add objects to grid

    You must have only one source schema selected before adding objects.

  3. Click [image] to execute, or save or schedule the selections as a Toad action. See Automation Designer Overview for more information.

    Tip: You can execute actions from the command line. See Execute Actions from the Command Line for more information.


Scheduling a Schema Script as a Windows Task

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To generate a schema script

  1. Set up your script options and settings as in Generate Schema Script, but don't click Create Script. See Generate Schema Script for more information.
  2. Click [image].
  3. Select or create a filename for a settings file.
  4. Enter the information as required for the Add Task wizard. See Add Task Wizard for more information.

Related Topics

Generate Schema Script


Automation Designer Overview

You can use Automation Designer to automate and control processes you perform regularly. Connection information, window settings, and queries can be saved, shared, scheduled, and run from the command line or batch files to simplify repetitive tasks.

The Automation Designer makes use of several categories to control Toad. These include:

  • Action -The basic unit of a ToadApp. It consists of the settings used to control one command, such as import table data, FTP a file, or Ping a server.
  • App -One or more actions designed to work together as a mini -Toad application. See Managing ToadApps for more information.
  • Scheduled Item -An app or action that has been scheduled using the Windows Task Manager. See Scheduling Actions and Apps for more information.
  • Execution Log - A log file containing the execution status of recently-run apps. It is automatically generated as you run actions, and contains data up to 7MB. When it reaches 7MB, old data is trimmed back to 5MB, and then it continues accruing. In this way it remains a current log of the most recent action execution. See Execution Log for more information.

Tip: You can add Toad apps and actions to the Project Manager. See Project Manager Overview for more information.

To access the Automation Designer

The Automation Designer is the central location for running and creating Actions and Apps. While actions can be created from and loaded to many of the other windows within Toad, the power of actions is located in the Apps Designer.

Within the Apps Designer you can:

  • Create new actions
  • Organize actions into sets (apps)
  • Run actions and apps
  • Store actions and apps
  • Schedule actions and apps
  • Copy actions and apps to and from the clipboard

To access save/load window snapshot from a Toad window

  1. In the status bar of the window, click [image].
  2. Select Save as Action or Load Toad Action.

In addition, as with SQL Recall, actions are saved automatically when you perform a task that is action-enabled. See Using Action Recall for more information.

Recalling an app gives you the ability to perform a distinct operation or sequence of operations in Toad on demand. Actions that can be used in the Automation Designer are listed in the Action Catalog.

Related Topics

Automation Designer Overview

Action Catalog

Creating New Actions

Action Parameter Files


Running Actions from the Automation Designer

You can run actions from the Automation Designer.

Using this ,method, you can run one or more actions from the same ToadApp. Multiple actions are run in the order they display in list view. See Ordering an App for more information.)

To run actions

  1. Do one of the following:
    • Right-click on the action you want to run
    • Multi-select several actions within the same ToadApp and then right-click.
  2. Select Run Selected Actions.

To run a series of actions (partial App)

  1. Open the ToadApp containing the series.
  2. Select the first action you want to run.
  3. On the toolbar, click [image].

To run an entire App

» Do one of the following:
  • Select the app you want to run and then click [image].
  • Right-click on the app you want to run and select Run.

To run actions with connections

Note: In this case, the connection you assigned to the action will not be used. The action will be executed once, for each connection you select, using that connection.

  1. Select the actions you want to run.
  2. Right-click and select Run with Connections.
  3. Select the connections you want to use. These can be multi-selected using SHIFT or CTRL.
  4. Click OK.


Scheduling actions

Scheduling Actions and Apps

Use the Automation Designer to schedule actions using Toad's Task Scheduler. You can schedule actions or apps. In addition, you can use the scheduler button directly from the Toad window of some functionality.

Using the Automation Designer to Schedule Actions and Apps.

To schedule actions

  1. In the Automation Designer, select the actions you want to schedule.
  2. Right-click and select [image].
  3. Complete the Task Scheduler wizard. See Task Scheduler for more information.

To schedule a ToadApp

  1. In the Automation Designer, select the App you want to schedule.
  2. Click [image].
  3. Complete the Task Scheduler wizard. See Task Scheduler for more information.

Scheduling from a Toad Window

When you have finished scheduling an action in this way, you can view them from the Task Scheduler window, or the Scheduled Items area of the Automation Designer.

To schedule an action

  1. In the status bar of the feature you want to make an action, click [image].
  2. Complete the Schedule Action wizard.

Related Topics

Task Scheduler


Apps and Actions on the Toolbar

You can add ToadApps and actions to your toolbar so you can execute them with one click.

To add actions to the toolbar

  1. Right-click on the main toolbar and select Customize.
  2. Click the Actions tab.
  3. Click on an app in the left hand side to display the actions contained in it.
  4. Drag and drop the action on the toolbar.

To add apps to the toolbar

  1. Right-click on the main toolbar and select Customize.
  2. Click the Actions tab.
  3. Click [All Apps] in the left hand side.
  4. Drag and drop the appropriate app onto the toolbar.

Related Topics

Automation Designer Overview

Creating Apps

Creating New Actions


Search the Automation Designer

You can search the Automation Designer to find apps or actions that you have created. This panel supports both standard searches and regular expressions

To search the Automation Designer

  1. In the Automation Designer's left hand panel, click Search panel.
  2. In the Text to find box, enter the text you want to find.
  3. To search with regular expressions, select the Regular expressions field. See Regular Expression Searches for more information.
  4. Select or clear the Search for apps box as desired. Choose a filter from the Look In field if you want to limit the search to a specific folder.
  5. Select or clear the Search for actions box as desired. Choose a filter from the Look In field if you want to limit the search to a specific app.
  6. Click Search.

Related Topics

Automation Designer Overview


Creating New Actions

You can create new actions from many locations within Toad. You can create them directly from the feature you are using, or from the Automation Designer.

Creating a new action from a Toad window

Toad windows that support actions include a camera button in the status bar of the window. Simply using these features will create an action automatically for you and store it in the action recall area (See Using Action Recall for more information.).

To create or load an action

  1. In the status bar of the feature you want to make an action, click [image].
  2. Select the appropriate option.

Creating a new action from the Automation Designer

You can also create a new action directly from the Automation Designer. At the top of the right pane are tabs containing actions you can create.

To create a new action from the designer

  1. From the Utilities menu, select Automation Designer.
  2. In the Navigation Tree, select Apps and then click the ToadApp node where you want to create the action.
  3. Click the tab that contains the action button and then click the button for the action you want to create. (See Action Catalog for more information on the various available actions.)

    4. Click in the app where you want the action to reside.

    For example, click the Import/Export tab, and then click [image] and then click in the app where you want the import table data action (this includes as a child node). A new action is created at the location where you click.

  4. Double-click the new action and set up required.
  5. Click one of the following:
    • Run - apply changes to properties and run the action
    • Apply - apply changes to properties
    • Cancel - cancel the changes to properties, but leave action in Automation Designer
  6. Right-click the new action, select Rename, and enter a name for the action in the Name box.

Related Topics

Automation Designer Overview

Action Catalog


Using Action Recall

Toad automatically creates an action for you when you use a window that supports them. Toad stores these actions for you in the vault, so that when you need them they can be retrieved.

You can use the Action Recall node the same way you would use the other apps, except that it cannot be deleted. You can, however, clear it.

Setting the number of actions saved in the vault

By default, Toad stores 10 actions per action type (for example, 10 export DDLs, 10 export dataset actions, and so on. However, this number can be changed easily.

To change the default number of actions automatically created per action type

» Select Toad Options | General and change the number in the Toad Actions per action type box.

Clearing the Action Recall Node

You can easily clear out all the actions that have been saved in the vault so that it is easier to navigate.

To clear the action recall node

  1. Click the Action Recall node.
  2. Select the actions you want to remove. (CTRL+A to select all.)
  3. Right-click and select Delete.
  4. Click Yes.

Related Topics

Action Catalog

Automation Designer Overview


Action Parameter Files

Some actions can accept parameter files. These parameter files are saved in an INI format.

You can use the parameter file to override some settings in an action so that you can run various permutations without creating multiple actions.

An action parameter INI file contains property=value pairs for the settings that can be overridden. When originally created, these will correspond to the properties saved within the actions.

To create an action parameter file

  1. In the Automation Designer, right-click on an Action or an App and select Create Parameter file.

    Note: If an action does not support a parameter file, then this option will not be available on the popup menu.

  2. Name the parameter file and save it to a folder. You do not need to save it in the default folder.
  3. Modify the parameter file if necessary. You can save multiple versions of the same file with slightly different names.

Example

The Execute Script action is enabled for parameter files. An ExecuteScript.ini file created as a parameter file might look like the following:

Content of ini File Line | Meaning
[47] | Internal identifier. There will be one of these identifiers for each action within a selected App.
Name=Execute Script1 | This is the name you have given the action so you can find it within a longer App file.
Type=Execute Script | This is the type of action.
ItemCount=2 | Number of items to execute.
Item0=c:\try1.sql | First item to execute.
Item1=c:\try2.sql | Second item to execute.
Output=1{1=SingleFile, 2=SeparateFile, 3=Clipboard, 4=Discard} | Output type. Note: In some cases, explanatory information will be included in braces within the line itself.
Output Location= C:\somefolder\output.txt | Output destination.
Connection=user@database | Connection associated with this action. When a connection is specified in the parameters file, it will override the bound connection of the Action. If this line is not included, then the bound connection is used.

Parameter files for ToadApps will contain multiple [Key] sections: one for each action within the app. These can be removed as needed to use a particular action's default properties.

Running Actions with Parameter Files

Parameter files can be used from within the Automation Designer or from the command line.

If connections are included in a parameter file and/or the command line, Toad will use connections in the following order:

  1. Connections specified on the command-line always override everything else.
  2. If a connection is not present on the command line, then those specified in a parameter (ini) file are used.
  3. If there are no connections on the command-line or defined from the Automation Designer's Run with connections option, then the connection bound to the action is used.

To run an action/parameter file set from the Automation Designer

  1. In the Automation Designer, right-click on the action you want to run and select Run with parameter file.
  2. Select the parameter file you want to use and click OK.

To run an action/parameter file set from the command line

» Enter the command line as you would normally, and then use a pipe to separate the Action/App name from the parameter filename. For example:

toad.exe -a "App->Execute Script1 | c:\data files\ExecuteScript1.ini"

Related Topics

Command Line Syntax

Execute Actions from the Command Line

Running Actions from the Automation Designer


Sharing Actions

One of the advantages to using actions and apps to manage your processes is that they can be shared easily with others.

Sending Actions by email

Sending an action from the clipboard

  1. From the window you want to share (such as Export Dataset) click [image] in the status bar.
  2. Select Save to Clipboard.
  3. In your email, select Paste.
  4. Send your email.

Sending actions from the Automation Designer

  1. In the Automation Designer, select the actions you want to send.

    Note: If you want to send the entire ToadApp, select all the actions in that App tab.

  2. Right-click and select Copy (CTRL+C).
  3. In the email body, press CTRL+V.
  4. Complete and send the email.

Receiving Actions by email

Receiving actions - clipboard to Toad feature window

  1. From the email you receive, copy the action code to your clipboard.
  2. Open the window where the settings reside (such as Export Dataset, or other)
  3. Click the camera button in the status bar.
  4. Select Load from Clipboard and click OK.
  5. Settings are now loaded in your window and you can complete the action as you would normally.

Receiving an action - clipboard to Automation Designer

  1. From the email you receive, copy the action code to your clipboard.
  2. If it is not already open, open the Automation Designer. See Automation Designer Overview for more information.
  3. Create a ToadApp or click the tab for the App where you want the actions to reside. See Creating Apps for more information.
  4. Right-click in the Automation Designer and select Paste (CTRL+V).
  5. Rename the pasted action to something descriptive.
  6. Run the action at will.

Related Topics

Automation Designer Overview


Action Catalog

Toad Features that can be used in the Automation Designer are included in the tabs at the to of the Automation Designer right hand side Designer pane. These include:

Import/Export

  • Copy Table Data
  • Export with Data Pump
  • Import with Data Pump
  • Export Dataset Action
  • Export DDL
  • Generate Database Script
  • Generate Test Data
  • Generate Schema Script
  • Import Table Data

DB Misc

  • ANSI Join Syntax
  • Actionable Query
  • Compare Databases
  • Compare Schemas Action
  • DB Health Check Action
  • Execute Script
  • HTML Schema Doc Generator Action
  • Object Search Action

Utilities

  • Archive Action
  • Email Action
  • Format Files Action
  • FTP Action
  • Ping Action
  • Service Action
  • Execute Shell Action
  • TNS Ping Action

File Management

These actions control your file structure. You can use them to create and move files and directory structures, check to see if files exist, and delete files and directories.

  • Copy File Action
  • Create Directory Action
  • Create File Action
  • Delete Directory Action
  • Delete File Action
  • File Exists Action
  • Move Directory Action
  • Move File Action

Control

These items are used only within the Automation Designer. They can be used to control how an app behaves.

  • File Iterator Action
  • Folder Iterator Action
  • If...Then...Else Action
  • List Iterator Action
  • Log Comment
  • Message Action
  • Pause Action
  • Repeat...Until Action
  • Set Variable Action
  • Test Variable Action
  • Variable Prompt Action
  • While...Do Action

Related Topics

Automation Designer Overview

Creating New Actions

Using Action Recall

Sharing Actions

Action Parameter Files


Import Table Data Action

The Import Table Data [image] action lets you import table data without importing table structure. This must be imported into an existing table, although you can use the Create Table feature to create a new table for the import. See Create Table for more information.

Set Import Table Data properties. See Import Table Data for more information.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


Export DDL Action

The Export DDL ( [image]) action lets you run a query and export the dataset to a file at any time. When setting properties for the Export DDL action, you can run the action by clicking Run at the bottom of the window. Clicking Apply will apply your changes.

The Export DDL properties window options are equivalent to the Export DDL window. To set Export DDL options, please see the Export DDL topic.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview

Export DDL


Export Dataset Action

The Export Dataset [image] action lets you run a query and export the dataset to a file at any time.

The Export Dataset properties window options are equivalent to the Save As (Export Dataset) window.

See Export Dataset for more information about setting options.

Dataset

When you are selecting Save As from the data grid, Toad automatically includes the query that was used to create the dataset.

Note: If you load a previously created action into this window all settings EXCEPT the dataset will be loaded. In this way, you can use the export dataset action to export different datasets without setting options each time.

When setting properties for the Export Dataset action, you will need to insert the query or objects you want to export manually.

To set dataset specifications

  1. Select either Export query or Export objects.
  2. Do one of the following:
    • Enter the query in the box.
    • Click Add and select the objects you want to export.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview

Export Dataset


ANSI Join Converter

ANSI Join Syntax

You can convert one or multiple SQL files to ANSI Join syntax using the ANSI Join action, or using the ANSI button in the Query Builder.

Note: SQL files to be converted must consist of only one query per file.

To convert a query using the ANSI converter action

  1. In the Automation Designer, click the Misc action tab.
  2. Click [image] and then click in the app.
  3. Double-click the new action.
  4. Click Add and select the saved SQL files you want to convert.
  5. Specify the output directory for the converted statements.
  6. Do one of the following:
    • Click Apply to apply property changes
    • Click Run to apply property changes and run the action.

To convert a SQL statement in the Query Builder

» In the Generated Query tab, select the query to convert and click [image].

Note: You can set the Query Builder to create ANSI syntax automatically from Toad Options | Query Builder. See Query Builder for more information.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


Actionable Query

You can create a query that can be used as an action. This Actionable query produces a boolean result, which can then be used to conditionally execute any number of Actions. This is a powerful action whose possibilities are limited only by your creativity.

The actionable query can be a SQL query or an anonymous PL/SQL block.

  • If you choose a SQL query, Toad enforces a boolean result by using the prefix "SELECT 1 FROM DUAL WHERE" before your query.
  • If you choose an anonymous PL/SQL block, use a bind variable named :RESULT, passing it a 1 for a True condition, a non-1 for a False condition.

When you run the action, Toad will return a results message:

  • Query is correct and returned TRUE
  • Query is correct and returned FALSE
  • an error message resulting from an incorrect query

To create an actionable query

  1. From the Automation Designer navigation pane, click DB Misc.
  2. Open the ToadApp tab where you want the query to reside, and then click [image].

  3. Select either:

    • SQL
    • PL/SQL anonymous block
  4. Enter the query in the text box provided.

Restrictions/Validations

The SQL must be valid. The PL/SQL block must use an integer bind variable named :RESULT.

For example:

begin

:RESULT:=-1;

end;

Related Topics

Action Catalog

Creating New Actions


Execute Script Action

Execute Script

Using the execute script action ( [image])you can execute one or more scripts at a time, schedule them to run at a specified time, and so on.

Properties of the Execute Script action let you add any number of scripts to the action, and specify output type and location.

To automate script execution

  1. Click [image] in the DB Misc tab of the Automation Designer.
  2. Double-click the new action.
  3. Complete the fields as necessary.. Review the following for additional information:
    4. Script Source

    Select File list or Text.

    If you select File list, you can execute multiple scripts. Add the scripts and variables you want this action to execute:

    • To add a file, click Add file.
    • To add a variable, click Add Var and then select the variables you want to add. These can be system variables, or variables created by other actions.
    • To add a directory, click Add dir. Toad executes all files in this directory. You can also use a variable to represent the directory.
    Output Select an output option. If you have chosen output to be sent to a file, enter the directory where the file should be located in the Directory field.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


DB Health Check Action

To create a DB Healthcheck Action from the Automation Designer

  1. From the Automation Designer window, select the app you want to contain the health check.
  2. Click the DB Misc tab, click [image] and then click in the app.
  3. Double-click on the action icon and set properties. See Database Health Check for more information.
  4. Click Apply, then Cancel to save your settings and close the window.

Related Topics

Automation Designer Overview

DB Health Check Action


HTML Schema Doc Generator Action

To create an HTML Schema Doc Generator action

  1. From the Automation Designer window, select the app you want to contain the HTML Schema Doc generator action.
  2. Click the DB Misc tab, click [image] and then click in the app.
  3. Double-click on the action icon and set properties as described in HTML Schema Doc Generator.
  4. Click Apply, then Cancel to save your settings and close the window.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview

HTML Schema Doc Generator


Object Search Action

To create an object search action

  1. From the Automation Designer, DBMisc tab, click [image].
  2. Click in the app where you want the action.
  3. Set action properties.

Related Topics

Object Search


Compare Schemas Action

To create a compare schemas action from the Automation Designer

  1. From the Automation Designer, open the app where you want to use Compare Schemas.
  2. Click the DB Misc tab.
  3. Click [image] and then click in the app.
  4. Set properties. See Compare Schemas for more information.
  5. Click Apply.

Related Topics

Compare Schemas

Automation Designer Overview


Email Action

You can create an action that will email specific information to the recipient of your choice. This action can then be scheduled, shared, and treated like any other action. The email action is available only from the Automation Designer toolbar.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To create an email action

  1. Open the app where you want the action to reside.
  2. Select the Utilities tab and click [image].
  3. To rename the action, right-click and select Rename.
  4. Double-click the action to open its properties.
  5. Complete the fields as necessary.Review the following for additional information:
    6. From | Enter your email address. If you have already set the host under Toad Options | Email Settings, those settings are entered for you.
Append clipboard contents | Select to add the contents of your clipboard to the bottom of the email. Note: This appends the contents of the clipboard at execution of the action.
Attachments | Select a file or directory to attach to the email. If you select a directory, Toad attached all files in the folder to the single email. Variables can also represent directories.
SMTP Server and Port | Enter the host and port for your email account. If you have set the host under Toad Options | Email Settings, those settings are entered for you.
  6. Schedule or execute the action.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview

Email Settings


Execute Shell Action

To create an execute shell action

  1. Open the app where you want the action to reside.
  2. From the Automation Designer Utilities tab, click [image].
  3. Click in the app.
  4. Double-click the action and enter the Properties for the action.
  5. Rename the email action to a relevant name.
  6. Schedule or run as desired.

Properties

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Parameters

Enter any Parameters. These specify configurations of the program, and can be combined. Some standard parameters are listed in the macro box at the bottom of the window.

Macros

These variables can be added to the parameters area by selecting and clicking insert.

  • $UID - enters the current Toad User ID
  • $UPW - enters the current Toad User password
  • $SID - enters the current Toad database ID
  • $CWD - enters the current Toad working directory
  • $TMP - enters the windows temporary directory
  • $FIL - enters the file in the active Editor

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


Archive Action

The Archive window lets you create zip files from within Toad. Use the archive action to create archives on a scheduled basis. You can choose to zip or unzip files, append to existing files and so on from this window.

Note: To archive outside of the Automation Designer, select Utilities | Archive.

To create an archive action

  1. Open the app where you want the action to reside.
  2. Click [image] on the Utilities tab in the Automation Designer.
  3. Enter the Properties for the action.
  4. Rename the action.
  5. Schedule or run as desired.

Zip tab

To select files

  • Click Add Files and then select the file or files you want to archive.

To select entire folders

» Click Add Folders and then select the folder or folders you want to archive.

Unzip tab

To extract files

  1. Select the location where you want to extract the files in an existing archive.
  2. Enter the pathname in the Extract to box.
  3. Select when you want to overwrite existing files:
    • Always - always overwrite with the extracted files.
    • Never - never overwrite a file.
    • Newer files - only overwrite if the extracted file is newer than the existing file.
    • Older files - only overwrite if the extracted file is older than the existing file.

Related Topics

Action Catalog

Automation Designer Overview

Creating New Actions


FTP Action

Use FTP actions to save FTP settings and perform specific FTP actions whenever needed without entering all the information repeatedly. You can choose to upload or download from the FTP server, and specify files and directories.

To create an FTP action

  1. Open the app where you want the action to reside.
  2. From the Automation Designer Utilities tab, click [image].
  3. Click in the app.
  4. Double-click the action and enter the Properties for the action.
  5. Rename the action to a relevant name.
  6. Schedule or run as desired.

To set up FTP action properties

  1. Click [image] and enter settings as described in the Server Settings topic.
  2. Select Upload or Download.
  3. Click Add and add any files you want to upload or download.
  4. For upload, enter the absolute path of the remote directory.
  5. For download, enter or browse to the absolute path of the local download directory.
  6. Do one of the following:
    1. Click Run to save and run the action
    2. Click Apply to save changes.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


Ping Action

To create a ping action

  1. Open the app where you want the action to reside.
  2. From the Automation Designer Utilities tab, click [image].
  3. Click in the app.
  4. Double-click the action and enter the Properties for the action (see Ping).
  5. Rename the email action to a relevant name.
  6. Schedule or run as desired.

Related Topics

Ping

TNS Ping

TNS Ping Action


TNS Ping Action

To create a TNS ping action

  1. Open the app where you want the action to reside.
  2. From the Automation Designer Utilities tab, click [image].
  3. Click in the app.
  4. Double-click the action and enter the Properties for the action (see TNS Ping).
  5. Rename the email action to a relevant name.
  6. Schedule or run as desired.

Related Topics

Ping

Ping Action

TNS Ping

Action Catalog

Creating New Actions

Automation Designer Overview


Service Action

The Service Action gives you control of services in a ToadApp. You can start, stop or toggle a selected service using this action.

To create a service action

  1. From the Automation Designer, select the Utilities tab.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image].
  4. Click in the app.
  5. Double-click the new action and set properties as desired.

To set service properties

  1. In the ToadApp containing the service action, double-click the action.
  2. To select the service you want to control, click Select.
  3. Enter the computer name you want to control (leave blank for the local computer)
  4. Click Search.
  5. Select the service from the list of available services.
  6. Click OK.
  7. In the Action box, select one of the following:
    • Start - starts the service
    • Stop - stops the service
    • Toggle - switches a service from started to stopped or from stopped to started.

Related Topics

Action Catalog

Creating New Actions


Format Files Action

To create a Format Files action

  1. From the Automation Designer, click the Utilities tab.
  2. In the navigation panel, select the App where you want formatting to occur.
  3. Click [image].
  4. Click in the app.
  5. Double-click the new action and set properties.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview

Format Files

Formatting Options


Create Directory Action

Use this action to create a new directory (folder) in the hard drive hierarchy. This allows you to create a new directory to store results, logs, and so on created by your ToadApp.

To create a create directory action

  1. From the Automation Designer, select File Management.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

To set create directory properties

  1. Enter the full path of the desired new directory.
  2. Click one of the following:
    • Run - Applies changes, runs the action, and closes the properties window.
    • Apply - Applies changes to the action and closes the properties window.
    • Cancel - cancels changes and closes the properties window.

Tips

  • Wildcards are supported.
  • Variables are supported.

Related Topics

Action Catalog

Automation Designer Overview

Creating New Actions


Delete Directory Action

CAUTION: Using this action will delete files from the selected hard drive without prompting.

To create a delete directory action

  1. From the Automation Designer, select File Management.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

To set delete directory properties

  1. Enter the full path of the directory to be deleted, or click [image] and select the directory.
  2. Click one of the following:
    • Run - apply changes to properties and run the action
    • Apply - apply changes to properties
    • Cancel - cancel the changes to properties, but leave action in Automation Designer

Tips

  • Wildcards are supported.
  • Variables are supported.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


Move Directory Action

Use this action to move a directory within your drive hierarchy. This action can also be used to rename a directory.

CAUTION: Using this action will move files on the selected hard drive without prompting.

To create a move directory action

  1. From the Automation Designer, select File Management.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set action properties as desired.

To set move directory properties

  1. In the Current box, enter the full path of the directory to be moved, or click [image] and select the directory.
  2. In the New box, enter the full path where you want the directory to be located.

    3. Note: This action can also be used to rename a directory. Enter the same basic path in the New box, but with a different directory name.

  3. Click one of the following:
    • Run - Applies changes, runs the action, and closes the properties window.
    • Apply - Applies changes to the action and closes the properties window.
    • Cancel - cancels changes and closes the properties window.

Tips

  • Wildcards are supported.
  • Variables are supported.
  • The destination can be either a folder or a destination file.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


Create File Action

Use this action to create a new file. You can use this to log actions as you run a ToadApp.

To create a create file action

  1. From the Automation Designer, select File Management.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then in the app.
  4. Double-click the new action and set action properties as desired.

To set create directory properties

  1. Enter the full path of the desired new file, including the filename and extension.
  2. Enter any desired contents of the file.
  3. Click one of the following:
    • Run - Applies changes, runs the action, and closes the properties window.
    • Apply - Applies changes to the action and closes the properties window.
    • Cancel - cancels changes and closes the properties window.

Tips

  • Wildcards are supported.
  • Variables are supported within content (will be expanded when the file is created.) See Using Variables for more information.
  • This creates a text file and can include content:

Related Topics

Action Catalog

Automation Designer Overview

Creating New Actions


Delete File Action

Use this action to delete a file within your drive hierarchy.

CAUTION: Using this action will delete files from the selected hard drive without prompting.

To create a delete file action

  1. From the Automation Designer, select File Management.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then in the app.
  4. Double-click the new action and set properties as desired.

To set delete file properties

  1. In the ToadApp containing the delete file action, double-click the action.
  2. Enter the full path of the file to be deleted, or click [image] and select the file.
  3. Click one of the following:
    • Run - apply changes to properties and run the action
    • Apply - apply changes to properties
    • Cancel - cancel the changes to properties, but leave action in Automation Designer

Tips

  • Wildcards are supported.
  • Variables are supported.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


Move File Action

Use this action to move a file within your drive hierarchy. This action can also be used to rename a file.

CAUTION: Using this action will move files on the selected hard drive without prompting.

To create a move file action

  1. From the Automation Designer, select File Management.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then in the app.
  4. Double-click the new action and set properties as desired.

To set move file properties

  1. In the Current box, enter the full path of the file to be moved, or click [image] and select the file.

  2. In the New box, enter the full path where you want the file to be located.

    Note: This action can also be used to rename a file. Enter the same basic path in the New box, but with a different file name.

  3. Click one of the following:
    • Run - Applies changes, runs the action, and closes the properties window.
    • Apply - Applies changes to the action and closes the properties window.
    • Cancel - cancels changes and closes the properties window.

Tips

  • Wildcards are supported.
  • Variables are supported.
  • The destination can be either a folder or a destination file.

Related Topics

Action Catalog

Creating New Actions


Copy File Action

You can use this action to log actions as you run a ToadApp.

To create a copy file action

  1. From the Automation Designer, click the File Management tab.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then in the app.
  4. Double-click the new action and set properties as desired.

To set copy file properties

  1. In the source filespace box, enter or select the full path of the file you want to move, including the filename and extension.
  2. In the destination box, enter or select the directory path where you want to copy the file.
  3. Choose whether or not to overwrite existing files of the same name.
  4. Click one of the following:
    • Run - Applies changes, runs the action, and closes the properties window.
    • Apply - Applies changes to the action and closes the properties window.
    • Cancel - Cancels changes and closes the properties window.

Tips:

  • Wildcards are supported.
  • Variables are supported. See Using Variables for more information.
  • The destination can be either a folder or a destination file.

Related Topics

Action Catalog

Automation Designer Overview

Creating New Actions


File Exists Action

Use this action to check that a file exists. When you run it, if the file exists, the run will be completed, if it does not exist, you will be given a run status of Failed execution.

To create a file exists action

  1. From the Automation Designer, select File Management.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then in the app.
  4. Double-click the new action and set action properties as desired.

To set create directory properties

  1. Enter or select the full path of the desired file, including the filename and extension.

    2. Note: If there is a typo in the path of the file, the file exists action will fail.

  2. Click one of the following:
    • Run - apply changes, run the action, and close the properties window
    • Apply - apply changes to the action and close the properties window
    • Cancel - cancel changes and close the properties window

Tips

  • Wildcards are supported.
  • Variables are supported.

Related Topics

Action Catalog

Creating New Actions


If...Then...Else Action

You can use the if...then...else action to control the flow of your ToadApps. Using this action, you can set up conditions and controls that utilize other actions.

To use the if...then...else action

  1. From the Automation Designer, select the Control tab, and then click [image] and then in the app.
  2. Create the action you want to set as the IF condition.

  3. Drag it into the IF node in the app:

  4. Do the same for the Then and Else nodes. Else is optional.
  5. If necessary, double-click your conditional actions and adjust their properties.

Related Topics

Action Catalog

Creating New Actions


Repeat...Until Action

Use the Repeat...Until action to control the flow of your ToadApps. Using this action, you can have a ToadApp repeat an action until a specified condition is met.

Read this action in English as “Repeat these actions Until any of these actions return False.” In other words, while all the actions under the “Until” node return True, execute all the actions under the “Repeat” node. The moment any action under the Until node returns False, stop execution of the actions under the Repeat node and continue processing the rest of the Toad App, setting the return value of the Repeat..Until action to True. Furthermore, if any of the actions under the “Repeat” node return False, set False as the return value of the main ‘Repeat..Until’ node and halt further execution of the Toad App.

You may use multiple UNTIL actions. You may need only one. It is probable that only one UNTIL action will be used though many are supported.

To use the repeat...until action

  1. From the Automation Designer, select Control, and then double-click [image].
  2. Create the actions you want to repeat, and the actions that you want to test.

    3. Drag the action you want to repeat into the new Repeat node in the app:

  3. Do the same for the Until node.
  4. If necessary, double-click your conditional actions and adjust their properties.

Example

This is an example of one possible use of this action.

  1. Create a Repeat..Until action and name it “Parse Log Files”.
  2. Create an FTP action to download files from the FTP server.
  3. Create Shell Execute action to search for a specific string.

  4. Drag the FTP action under the Repeat node and drag the Shell Execute action under the Until node.

You now have a functional ToadApp which continually downloads files from an FTP server until one of them contains a particular string we are looking for. The moment the string is found execution ends.

Related Topics

Action Catalog

Creating New Actions


While...Do Action

Use the While...Do action to control the flow of your ToadApps. Using this action, you can have a ToadApp repeat an action until a specified condition is met. A While action is similar to a Repeat...Until action, except that the conditional actions are executed before the statement actions are executed. Hence, if any of the conditional actions are false, the statement actions are never executed.

Read this action in English as “While these actions return true, execute (Do) these actions.” In other words, while all the actions under the While node return True, execute all the actions under the Do node. As soon as any action under the While node returns False, stop execution of the actions under the Do node and continue processing the rest of the ToadApp, setting the return value of the While..Do action to True. Furthermore, if any of the actions under the Do node return False, set False as the return value of the main While..Do action and halt further execution of the ToadApp.

You may use multiple WHILE actions. You may need only one. It is probable that only one WHILE action will be used though many are supported.

To use the While...Do action

  1. From the Automation Designer, select Control, and then click [image]. Click again in the app where you want to use the action.
  2. Create the actions you want to test, and the actions that you want to repeat.

    3. Drag the action you want to use as a test into the new While node in the app:

  3. Drag the action you want to repeat into the Do node in the app.
  4. If necessary, double-click your conditional actions and adjust their properties.

Example

This is an example of one possible use of this action.

  • Create a While...Do action and name it Run Maintenance Script.
  • Create a TNS Ping action to download files from the FTP server.
  • Create an Execute Script action to search for a specific string.

  • Drag the TNSPing action under the While node and drag the Execute Script action under the Do node.

You now have a functional ToadApp which executes a maintenance script on the database until the database listener stops.

Related Topics

Action Catalog

Creating New Actions


Test Variable Action

The test variable action can test the value of a Windows, Toad or user-defined variable. Variables themselves cannot be referenced in the "value" section, as this would construe the value as formulaic, which it is not.

Test Variable supports numbers and strings as values. It does not support formulas and variables in the value section. Variables will typically be strings.

Supported operands are <, <=, =, <>, > and >=.

To create a test variable action

  1. From the Automation Designer, select Control.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

Example

This is one possible use of a test variable action:

  • Create a Test Variable action and name it Check Session Count.
  • Enter the variable name in the Variable box. In this case, Session Creation Count.
  • Enter the Variable. (<)
  • Enter the value you want to test.

This tests the value of the user-defined variable, "Session Creation Count," and returns True if the value is less than 4, and False otherwise. This return value can then be used in subsequent actions. If the action returns false (Session Creation count value is less than four) execution of the ToadApp halts.

Related Topics

Action Catalog

Creating New Actions


Set Variable Action

Set the value of a user-defined variable. Windows environment variables and internal Toad system variables cannot be set, only those variables which the user added from the Options | Variables window.

To create a set variable action

  1. From the Automation Designer, select Control.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

Variable Support

Existing variables cannot be used as a variable value, because variable support is not formulaic.

Only numbers and strings can be values. Neither formulas nor variables are supported as variables.

Example

This is one possible use of a Set variable action:

  1. Create a Set Variable action and name it Establish Session Count.
  2. Enter the variable name in the Variable box. In this case, Session Creation Count.
  3. Enter the value for the variable.

This Establish Session Count action sets a value of 5 into the Session Creation Count variable. Subsequent actions can then reference this variable instead of hard-coding the value of 5.

Related Topics

Action Catalog

Creating New Actions


Variable Prompt Action

Use this action to have an app prompt for a variable value before continuing. For example, you could use this action for "on-the-fly" alteration of variable values.

Acceptable variables are provided in a drop-down list in the properties window.

To create a variable prompt action

  1. From the Automation Designer, select Control.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

Related Topics

Action Catalog

Creating New Actions


Message Action

Displays a text box of a particular style (Warning, Error, Information & Confirmation). The text box will contain either an OK/Cancel or a Yes/No button combination. Clicking OK or Yes resumes execution of subsequent actions, clicking Cancel or No stops execution of any remaining actions.

To create a message action

  1. From the Automation Designer, select Control.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

Variable Support

Variables are supported in the Message.

Example

This is an example of a warning message box.

  1. Create a Message action.
  2. In the properties dialog, select the Message Type - Warning.
  3. Select the button combination you want to use. In this case, OK/Cancel.

  4. Enter the message you want to display. You can use environment variables as in the following example:

    %CURRENTUSER% is the active user. Please disconnect session before continuing.

Related Topics

Action Catalog

Creating New Actions


Pause Action

The Pause action pauses execution of further actions by a specified amount of time.

To create a pause action

  1. From the Automation Designer, select Control.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

Example

This Wait for Server action performs a sleep for 3 minutes. It could be used in a loop which includes a Ping to wait an adequate period of time for a server to be started before continuing the execution of the rest of the ToadApp.

» Create a Pause action with the following properties:
  • Pause box: 3
  • Time drop-down: Minutes
  • Rename the action Wait for Server.

Related Topics

Action Catalog

Creating New Actions


Iterate Files Action

File Iterator Action

In the control section of the Automation Designer, you can choose to iterate a file. This provides a means to work through the contents of the file, executing child actions for every line in the Iterate Actions file.

Child actions can reference each line in the file by means of a temporary variable which the iterator creates as it works.

To create a file iterator action

  1. From the Automation Designer, select Control.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

Variable Support

A temporary Variable is created and assigned to each line in the file the user specifies. This temporary Variable is visible only within the context of a File Iterator execution and would typically be used by child actions. Part or all of the File Iterator filename itself can be a Variable.

Example

This simple example uses a master file of script names, with each line in the file designating a different script to execute. The File Iterator action sends each line item to an Execute Script action for execution. This keeps the list of scripts to execute in an external disk file for easy updating, and prevents the need to hard-code it into the Execute Script action itself.

In the properties window for a File Iterator, enter the filename. The output variable is taken from the name you gave the action when you created it. This is the variable that Toad may use for child actions as it steps through the file. Child actions do not necessarily have to reference the file items, making the output variable optional. You can also control the number of times child actions are executed with lines in the file.

For example

  1. The “ScriptCollection.txt” file contains a list of files to execute:

    c:\runme.sql

    c:\AlsoRunMe.sql

  2. Create a File Iterator [image] action, naming it Iterate Script Files.
  3. Add an Execute Script action under the Iterator. See Execute Script for more information.
  4. Modify the Execute Script action properties to reference the line items from the parent action:
    1. Open the Execute Script properties window.
    2. In the File List area, click Add Variable.
    3. Select Use Parent Output Variable.
    4. Click OK.
  5. Click Apply and then click Cancel.

Now when you run Iterate Script Files Toad opens the file ScriptCollection.txt, reading line by line, placing the line into a temporary variable named “Iterate Script files” then execute all child actions for each line. In this case, the Execute Script action will execute

c:\runme.sql

and then

c:\AlsoRunMe.sql

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


Folder Iterator Action

The folder iterator action provides a way to step through all the files in a folder, executing child actions for each file in the specified folder (and optionally, subfolder). Child Actions can reference each file in turn by means of a temporary variable created by the iterator.

To create a folder iterator action

  1. From the Automation Designer, select Control.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

Variable Support

A temporary variable is created and assigned to each filename in the designated Folder. This temporary variable is visible only within the context of a folder iterator execution and will typically be used by child actions.

To use the folder iterator

  1. In the folder iterator properties dialog, the following properties are set:
    • Folder - the directory to iterate.
    • File Types - a semicolon delimited list of file extensions to use as a filter. Iterator's child actions will execute for each file matching the list of extensions. If no file types are specified, all files (*.*) will be iterated.
    • Recurse -select to iterate all child folders as well.
    • Output Variable - this is the name of the temporary variable assigned to each filename. It is the same as the name of the action. Child actions can reference this variable.
  2. Create and drag child actions to the Iterate Folder node. Any number of child actions can be added.

Example

The folder iterator action can be used for many things related to execution of actions for each file in a directory. This simple example will send an email with an attachment for each SQL source file.

  1. First set up the folder iterator action with the directory and file types desired. In this case, we used the directory where we store Toad project files and SQL code:

  2. Create a single action as an iterator child. In this case, an email action (See Email Action for more information):

  3. Set up or edit the email properties as follows:

    4. Notice that the Message contains the temporary Variable “%Iterate Toad Projects%”. At runtime, this Variable will be replaced with the filename of each file in the folder.

  4. You can also add the Variable as an attachment. Click Add var… to display a Select Variable form:

    5. The Use Parent Output Variable drop-down lists the names of all temporary Variables contained by the Action’s parentage.

    Note: Folder Iterators can be nested. If the Email Action had multiple Folder Iterator parents above it, this drop-down would display the name of each. This allows fine control over which parent Variable to use.

  5. If the “Use Standard Variable” radio button is selected, the grid becomes available and the normal list of Variables can be selected.

Related Topics

Action Catalog

Creating New Actions


List Iterator Action

The list iterator action provides a means to step through a list of strings provided by the user, executing child actions for each item in the list. Child actions can reference each item by means of a temporary variable.

To create a list iterator action

  1. From the Automation Designer, select Control.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

Variables

A temporary variable is created and assigned to each item in the list. This temporary variable is visible only within the context of a List Iterator execution and would typically be used by child actions.

Further, any item in the list can itself be a variable.

To use the list iterator

» In the list iterator properties dialog, the following properties are set:
  • List - enter strings to act on directly in the Items box. Separate items with a carriage return.
  • Filenames - enter filenames by either entering the path as above, or by clicking Add filename box and searching for the file.
  • Directories - enter directories by either entering the path as a string, or by clicking Add directory and searching for the directory.

Example

A List Iterator is useful for many things related to execution of actions for each item in a user-provided list. This simple example sends an email with an attachment for each SQL file to every developer in a given list.

  1. In the Properties window for a List Iterator, we built a simple list of strings, organizing it in the order wanted. If something is out of place, you can cut and paste it into the correct location. Note that there is a Variable included in the list.

  2. We added our List Iterator to the Automation Designer, making it a child of a Folder Iterator. This will cause the List Iterator to execute for each file in the specified directory.

  3. In the Properties dialog for the Email Action (Email Developer Source Files) we reference each of the Output Variables from the two parents above it.
  4. In the To field we reference %Toad Developer List%, the name of the direct parent. This will be substituted with each email address in our list.

    5. The Attachments list references the Output Variable from the Folder Iterator Action two levels up. This will be substituted with every filename provided by the Folder Iterator.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


Log Comment

The log comment action inserts a comment into the execution log of the ToadApp.

This can be useful when you want to note why an execution went a specific direction, as in an if...the...else statement, or note when or where something failed.

Variables are not supported within this action.

To create a log comment action

  1. From the Automation Designer, select Control.
  2. Open or create the ToadApp where you want the action to reside.
  3. Click [image] and then click in the app.
  4. Double-click the new action and set properties as desired.

Related Topics

Action Catalog

Creating New Actions


Managing ToadApps

ToadApps (apps) are central to the efficient use of actions. You can use apps to store and manage actions you have created. By ordering the actions within an app, you can run the actions in them from the command line, or use the Windows Scheduler to schedule them to run at a particular time. The order in which they are specified will be the order in which they are run.

  • Creating Apps
  • Naming Apps
  • Viewing App Contents
  • Using Action Recall
  • Ordering an App

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview

Execute Actions from the Command Line

Scheduling Actions and Apps


Copying or Moving Actions

Between ToadApps

To move an action

  1. Cut the action from one app by pressing CTRL+X (or right-clicking and selecting Cut).
  2. Paste the action into the new location by pressing CTRL+V (or right-clicking and selecting Paste).

To copy an action

  1. Copy the action from one app by pressing CTRL+C (or right-clicking and selecting Copy).
  2. Paste the action into the new location by pressing CTRL+V (or right-clicking and selecting Paste).

Within a ToadApp

To move an action

» Drag and drop the action to the new location in the app.

To copy an action

Note: A copied action will always be pasted at the bottom of the action list. You will need to move it if it needs to be in a different location.

  1. Copy the action from one app by pressing CTRL+C (or right-clicking and selecting Copy).
  2. Paste the action into app by pressing CTRL+V (or right-clicking and selecting Paste).

Related Topics

Automation Designer Overview


Linking and Moving Apps

You can move apps from one category to another, and you can link them so that they are present in more than one category.

To move an app between categories

  1. In the right hand pane, if it is not active, click Apps.
  2. Drag and drop the app from one category to the other.

Linking apps

Linking apps does more than just copy the app into multiple categories. A change in a linked app in one category results in the same change in the app in linked categories.

To link apps in multiple categories

  1. In the right hand pane, if it is not active, click Apps.
  2. Hold down the CTRL key, and drag and drop the app from one category to the other.

Related Topics

Automation Designer Overview


Creating Apps

An app is a set of actions that can be run as a unit to automate tasks.

To create an app

  1. If the Automation Designer is not open, select Utilities | Automation Designer from the menu.

    2. Select a category node.

    Note: If you do not select a category node, the app will be created in the Default node.

  2. Right-click and select New.
  3. Enter a name for the new app and then click OK.

Related Topics

Action Catalog

Automation Designer Overview

Creating New Actions


Creating App Categories

You can create Categories of Applications within the Automation Designer. Use these categories to organize your ToadApps. For example, you could have a category for actions used on your Dallas server, and one for those on your Atlanta server. Alternately, you could organize them by type: apps governing import/export for example, or apps related to server control.

To create an app category

  1. From the Automation Designer (Utilities | Automation Designer), right-click in the navigator.
  2. Select Folder | New Folder from the popup menu.
  3. Name your new folder.
  4. Click OK.

Related Topics

Action Catalog

Automation Designer Overview

Creating New Actions


Naming Apps

If you aren't happy with the name you have given a category, an app or an action, you can change it.

Note: You cannot rename Action Recall or the Default category.

To rename a ToadApp

  1. In the tree view, right-click on the node representing the category, app or action.
  2. Do one of the following:
    • Select Properties.
    • Select Rename.
  3. Enter the new name.
  4. Click OK.

Related Topics

Automation Designer Overview

Creating Apps

Creating App Categories


Ordering a ToadApp

Ordering an App

You can change the order of the actions within an app. This is useful if you are planning on running actions as a set from the command line, or on a schedule. By putting them in the order you want them to run, for example, you can define emails that should be sent before, during, and after the process, and can specify actions that belong within other actions (for example, the action that relates to the If, Then, or Else statements).

To order a ToadApp

  1. Activate the app you want to order.
  2. In the right-hand application panel, drag and drop the actions in the list into the order you want them to run.

Related Topics

Viewing App Contents

Execute Actions from the Command Line

Scheduling Actions and Apps


Viewing ToadApps

Viewing App Contents

You can view the actions contained in apps.

To view a different ToadApp

  • In the Apps area of the navigation pane, click on the node corresponding to the app you want to view.

Related Topics

Action Catalog

Creating New Actions

Automation Designer Overview


Project Manager Overview

You can use the Project Manager to easily organize your work area. The window is organized in a tree structure, with every item in the tree being a node that points to a different object. You can combine several different Oracle connections and FTP connections into one project to make it easy to upload, download, and work with your databases. You can add subproject folders to your projects to further organize your work.

If you have recently upgraded Toad and you want to view newly available Project Manager actions, such as right-click menus, select the Configuration screen. See Configuring the Project Manager for more information. Unless you have a highly configured Project Manager environment you may want to consider performing a Reset all defaults to see all the new actions within the window itself.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Access the Project Manager

To access the Project Manager

» From the View menu, select Project Manager.

Tabs and Nodes

The Project Manager has the following panes:

  • Connections—The connection pane ( [image] tab) is an area to work with various connections. You can create new connections, end connections, run scripts from a particular connection, and so on from this area. See Using the Connection Panel for more information.
  • Projects—The Project Manager ( [image] tab) uses the following types of nodes and tabs to let you arrange your work:
    • Project Folder | The overlaying organizational unit is the Project Folder tab. This can contain other project folders, other types of folder, or other content. Multiple project folders can be created and arranged to suit your work style. The connections tab cannot be moved. The order of tabs is preserved when you close and reopen the Project Manager. Hovering your pointer over a project tab will display the full path to the project file. See Project Nodes for more information.
File Folder | Use a File Folder node to represent a folder on a local or network disk. See Adding Folders for more information.
File | Use a folder item node to represent a file on a local or network disk. These can include .sql files, .html files, .doc files, and so on. This node is located beneath a file folder node. See Adding Folder Items for more information.
FTP Folder | Use an FTP folder node to represent a folder on an external FTP server. Contains FTP files. See FTP Folders for more information.
FTP File | Use an FTP file node to represent a file on an external FTP server. This node will always be beneath an FTP folder. See Add FTP Folder Items for more information.
DB Schema | You can add a Database Schema node to represent a connection to a schema on a database. Can contain database objects. See Schema Nodes for more information.
DB Object | Within schema nodes, you can include database object nodes. These represent objects residing on a database. Must be contained in a DB Schema node. See Database Objects for more information.
Task | Use the Project Manager to schedule tasks using the Windows Task Scheduler. See Task Scheduler for more information.
To Do List | Represents an user-created checklist. To do items are added beneath it. See To Do Lists for more information.
URL | Represents an URL and can act like a shortcut to that site.

Acting on Nodes

The Project Manager is highly configurable, letting you easily work with various objects at one time. You can configure its behavior for:

  • Project Manager Drag and Drop Operations
  • Project Manager Double-Click Operations
  • Project Manager Sorting

If you are just starting out with the Project Manager, reading the Working with the Project Manager book (beginning at Using Different Types of Objects Simultaneously) in this help file will give you an overview of the types of things you can do in this window. Then move on to Configure Project Manager, which will give you an idea of how to customize the window to work in the best way for you.

Related Topics

Configuring the Project Manager

Project Manager General Options

Project Manager Associations Options

Project Manager Double-Click Operations

Project Manager Drag and Drop Operations


Configure Project Manager

Configuring the Project Manager

The Project Manager can be configured to work in the way you work. You can specify the command Toad executes when you drag a file onto another file, or onto a node.

Double-clicking is also customizable, as are the menu items that display in the right-click (pop up) menu. See Changing the Default Behavior for more information.

To configure the Project Manager

  1. Click [image] on the Project Manager toolbar.

  2. Select or clear the options you want to configure.

    Note: You can also choose to Reset all Defaults or Use defaults for a particular tab.

  3. Click OK.

Reset all Defaults

Clicking Reset all Defaults at the bottom of this dialog box will reset defaults on ALL tabs.

Use Defaults

Click the Use Defaults button on an individual tab to return to the default settings for that tab only.

Related Topics

Project Manager Overview

Project Manager General Options

Project Manager Associations Options

Project Manager Drag and Drop Operations

Project Manager Double-Click Operations


General Options

Project Manager General Options

General options let you change the options for the entire Project Manager.

To access General options

  1. Click [image] on the Project Manager toolbar.
  2. If it is not selected, click the General tab.

Editor file load options

The default is Load into new window.

Reload into existing window

Select this option to load Editor contents into the existing Editor window.

If this option is selected, you must choose to either append the new data to the data existing in the window, replace the contents of the window entirely, or create a new tab and load the SQL there.

The default is unselected.

Load into new window

Select this option to open a new Editor window in which to load your file. This is the default option for file loading.

Generate Script for Multiple checkbox - if checked and multiple scripts are selected for loading, Toad creates a script referencing the selected scripts as follows (assuming employees 1 through 3 are selected for loading)

@"c:\one\two\employees.sql"

@"c:\one\two\employees1.sql"

@"c:\one\two\employees2.sql"

Default: Selected

Navigate to previous invocation

When selected, if you choose a file to load into the Editor that is already there, TOAD will navigate to that Editor tab. In addition, this option finds the Editor in which the file was previously loaded, brings it to the top, and makes the tab in which its loaded the active tab (navigates not just to the tab but to the SE if there are multiple open).

Prompt each time

When selected, TOAD will prompt you to select one of the above options each time you choose to load a new file.

Export Options

Compress export file (.zip)

When this option is selected, Toad compresses the exported file into a .zip format. The default is unchecked.

Watch progress

When this is selected, Toad watches the progress of long exports.

Default: Selected

FTP server passwords

Save encrypted passwords

When checked, Toad saves the passwords for your FTP sites in an encrypted format.

Default: Selected

To-Do

Past due color drop down

A to do item displays in black text by default. When it is past due, the color changes as an instant reminder. Choose the color you want past due items to be from the drop down color menu.

The default is red.

Server side compression

Utility for 'compress' action

Select the utility you want to use for server side compression from the compress drop down.

Choices are compress, zip or gzip. The default is compress.

Web Browser

You can select the web browser you want Toad to use for web based activity.

Filename

If you know the location of your web browser, you can enter the entire path in the filename box.

Browse

Click the Browse button to locate your web browser using a standard Windows Open dialog.

Find default

Click the Find default button and Toad will find your default browser and enter it in the filename box for you.

Dragging and Dropping

Prompt if multiple actions are available

If you have checked this option, and multiple actions are available, Toad will display a dialog for you to choose the action you want to perform. From this dialog, you can also make the action the default, and turn off prompting.

This is the default.

Use user setting

When checked, Toad uses the value you chose (or the default) on the "Drag and drop operations" tab in the Project Manager Options window.

Refresh folder links

Include subdirectories

When checked, a refresh includes all subdirectories of the folders in the nodes. The entire folder tree will be built in the Project Manager.

Unchecked, only files under the folder's main directory are displayed. Subfolders are not added.

Default: Selected

Refresh after changing properties

When checked, if you set a filter, or otherwise change the properties of a folder, all folder links are refreshed when you click OK. Unchecked, folder links are not refreshed.

Default: Cleared

Prompt before rebuilding

When checked, Toad will prompt you for confirmation before rebuilding any links when you refresh a folder item. If unchecked links will be built without notifying you.

Default: Selected

Shell for remote file execution

You can select a shell for use when executing a file remotely. Select from the drop down menu. The following common shells are available:

  • Bourne shell (sh)
  • Korn shell (ksh)
  • CSH

In addition, you can supply your own shell choice by entering the appropriate shell name in the box.

The default is no shell selected.

Tree

Font

Click the Font button for a standard Font dialog to select the font and font properties Toad uses in the Project Manager.

The default is MS Sans Serif.

SmartExpand

Select this checkbox to only allow one top-level project node to be expanded at one time. Expanding one node will collapse the others.

Default: Cleared

Related Topics

Project Manager Overview

Configuring the Project Manager

Project Manager General Options

Project Manager Associations Options

Project Manager Double-Click Operations

Project Manager Drag and Drop Operations


PM - Associations

Project Manager Associations Options

The Application Properties dialog box is accessible from the Project Manager. See Project Manager Overview for more information.

To set application properties

  1. On the Project Manager toolbar, click [image].
  2. Click the Associations tab.
  3. Click Add, or select an association and click Edit. The Application Properties dialog box displays.

From this dialog box you can easily create or edit associations.

Property Descriptions

Title

Enter the title you want the association to have in the Project Manager.

Program

Enter either the full path name of the program, or click [image] to search for it.

Working dir

Enter the full path name for the directory you want to specify as the working directory for this application, or click [image] to search for it.

Parameters

You can use one or more of the following parameter variables to configure your application:

  • $UID - enters the current Toad User ID
  • $UPW - enters the current Toad User password
  • $SID - enters the current Toad database ID
  • $CWD - enters the current Toad working directory
  • $TMP - enters the windows temporary directory
  • $FIL - enters the file in the active Editor
  • %S (or "%S") - specifies where the filename should display (otherwise Toad uses the standard convention of "app.exe -options filename".

These parameters can be used individually, or combined. For example, if you wanted to automatically open Notepad with the current file in the active Editor, you would enter the information to open Notepad as above, and enter $FIL in the Parameters field.

You could also enter the command: sqlplusw.exe $UID/$UPW@$SID which starts sql plus with the current toad connection.

Extensions

Enter the extensions you want to associate with this application.

Run

Enter the parameters for how you want the application to run when accessed, as follows:

Window type | Specify the window type you want to open: Normal, Minimized or Maximized.
Launch new | Start a new instance of the application when the Project Manager accesses it.
Use existing if possible | If an existing instance of the application is running, Toad will try to use that instance before moving to start the application again.

Icon

Choose an icon you want to associate with files that use this application.

Related Topics

Project Manager Overview

Configure Toad Tools


PM - Drag and Drop Operations

Project Manager Drag and Drop Operations

Use the drag and drop operations screen to configure the action Toad takes when an item is dragged within the Project Manager.

The grid is organized in a simple, "when source is, and destination is, then do this" format. The action performed can easily be set to other possibilities.

To change the action performed on dropping

  1. Click on the action you want to change. An arrow displays in the right of the cell.
  2. Click the arrow to display a menu of possible actions.
  3. Click the action you want to select.

Related Topics

Project Manager Overview

Configuring the Project Manager

Project Manager General Options

Project Manager Associations Options

Project Manager Double-Click Operations


PM - Double-click Operations

Project Manager Double-Click Operations

Use the double-click operations screen to configure the action Toad takes when an item is double-clicked within the Project Manager.

The grid is organized in a simple, "when source is this, then do this" format. The action performed can easily be set to other possibilities.

To change the action performed on double-click

  1. Click on the action you want to change. An arrow displays in the right of the cell.
  2. Click the arrow to display a menu of possible actions.
  3. Click the action you want to select.

Related Topics

Project Manager Overview

Configuring the Project Manager

Project Manager General Options

Project Manager Associations Options

Project Manager Drag and Drop Operations


Adding to Project Manager

Adding Objects to Project Manager

Adding Objects by Dragging and Dropping

You can add objects to your Project Manager simply by dragging them to the node where you want them to reside. This way you can have your Project Manager set up however you like it, and the Nodes named by you.

You must drag the object to a node designed for it. (In other words, tables need to go to a tables node under the correct connection, and so on.) Toad will not let you drag an object to an unacceptable node.

To add objects by dragging and dropping

  1. Select an object, or multi-select several objects in the Object list in the Schema Browser.
  2. Drag to the node in the Project Manager where you want it to reside.

Adding Objects from the Right-Click Menu

Using the right-click menu to add objects has both advantages and disadvantages. Chief among its advantages is that you can create a new project on the fly.

All nodes beneath the new project are created and named for you.

For example, if you add a table called "SPEC" to a new project that you call "Test," you will have the following nodes created for you:

To add objects using the menu

  1. Select an object, or multi-select several objects in the Object list in the Schema Browser.
  2. Right-click and select Add to Project Manager.
  3. From the Select Project dialog box, either select a project name from the drop down menu, or enter a new project name.
  4. Click OK.

Related Topics

Project Manager Overview

Project Nodes

Schema Nodes

Database Objects


Using Different Types of Objects Simultaneously

One of the great advantages to using the Project Manager is that you can work with multiple types of objects at the same time. This lets you drag-and-drop them to access functions.

After you have added a variety of different types of database objects under one or more schema nodes, you can:

  • Multi-select database objects, right-click and choose DDL to clipboard, DDL to file, Load DDL into Editor or Describe (Describe may not be available depending upon the object type)
  • Drag objects onto one another to compare them
  • Drag objects onto a local or remote file folder link to generate a DDL file which will be placed into the local or remote folder
  • Drag objects onto a local or remote file to generate the DDL for the objects and overwrite the destination file with the DDL

Related Topics

Project Manager Overview


Working with Server Directories and Files

Another of the many strengths of the Project Manager is its ability to easily work with FTP server directories and files.

After you have created an FTP folder and added server information to it you can create additional nodes and servers quickly by using the copy nodes feature. You can also right-click and select Rename to rename the node for a more logical representation of what the directory contains, such as Toad UNIX Scheduler log files.

From here you can:

  • Select one or more server nodes, right-click and select Refresh server links. This builds shortcuts to all the files underneath the selected server directories. Whenever you want to get an updated list of the server directory contents simply select refresh to rebuild the nodes.
  • Drag-and-drop server file links to local directories to download the files.
  • Drag-and-drop local file links to server directories to upload the files to the server.
  • Drag files into the trash can to move them to the Recycle Bin.

Related Topics

Project Manager Overview

Copy Nodes Between Projects

FTP Folders


Removing Dead Links

In the Project Manager, you can remove any dead links in your project. These can include nodes which no longer exist in the schema, windows tasks which are no longer present and so on.

When you select a type of link to remove, all dead links of that type will be removed. To remove limited numbers of them, you will need to remove the appropriate nodes manually. When you remove dead links, all subnodes are removed as well as the dead node.

To remove dead links

  1. Click [image] on the Project Manager toolbar.
  2. In the Remove Dead Links dialog, select the types of dead link you want to remove.
  3. Click OK.

Related Topics

Project Manager Overview


Loading Local or Server Files into Toad Windows or External Applications

If you frequently work with files in Toad or other applications you can add links to them in the Project Manager. You can then associate their file extensions with either Toad windows or defined external applications. (See Configure Project Manager for more detailed information about associating extensions.)

Toad windows with which you can associate files include: Editor, Offline Editor, SQL*Loader, Query Builder, TNSNames Editor, Export File Browser and the Project Manager itself. When double-clicking or right-clicking and selecting Load, files that match pre-defined extensions for these windows will be loaded.

Note: To be sure you see all options, click the Add defaults button.

You can use the Associations tab in the Project Manager options to change the default extensions for the Toad windows, or add external applications yourself. For instance, you could add Internet Explorer as an application and associate it with htm and html files.

To access the extension configuration window

  1. From the Project Manager toolbar, click [image].
  2. Click the Associations tab.

To restore all file types you can associate

» In the Options | Associations tab, click Add defaults.

To load multiple files

  1. Select the files in the Project Manager.
  2. Right-click and select Load. If loading into the Editor, a separate tab is created for each item. Pressing the Enter key loads only one file, because the enter key is tied to the double-click event, which can only occur on one node/file at a time.

Related Topics

Project Manager Overview

Project Manager Associations Options

Project Manager General Options


Working with Local Files and Directories

Use Windows Explorer to drag-and-drop folders onto Projects to create links to local folders and files in the Project Manager. You can also right-click a Project and select Add | Folder and Add | Folder Items.

Once you have shortcuts to local folders and files you can:

  • Right-click folders and select Refresh folder links to automatically build a list of shortcuts to all files in that folder
  • Drag files onto one another to perform Toad’s file compare.
  • Drag files and folders onto server directories to upload them. Dragging a folder onto a server folder will upload all the underlying files.
  • Drag files into the trash can to move them to the Recycle Bin.

Related Topics

Project Manager Overview


Changing the Default Behavior

The Project Manager is entirely user-programmable. That is, you can think of the Project Manager as having a number of pre-defined actions. These actions occur during three different types of user operations: Drag & Drop, Double-click and Right-click. You can change the behavior of the Project Manager when you perform one of these operations. This is an overview of the types of actions you can perform. See Configuring the Project Manager for more information, and for specific instructions on changing the action for each operation.

Drag-and-Drop

When specifying the action for a drag-and-drop operation, first think of the node types you are dragging, and the type of node you are dropping onto. You can then tell the Project Manager what you want to happen when the drop occurs. For example, when you drag a file folder item onto a file folder, you can tell Project Manager whether you want the file moved or copied.

Double-Click

There are more possibilities for the double-click operations. The default for many database object types is to open the ‘Describe’ window. But this can be changed, per database object node type, to other actions such as ‘DDL to clipboard,’ ‘DDL to file’ and ‘Load DDL into Editor’. For source code there is also ‘Load into Editor.’

Right-click Menu

The right-click menu is configurable as well. You can select which items display in the menu as well as their order. Note that the bottom portion of the menu is static. Also, for some database object node types, the right-click menu also includes the full Schema Browser right-click menu for that object type.

Related Topics

Project Manager Overview

Configuring the Project Manager

Project Manager General Options

Project Manager Associations Options

Project Manager Drag and Drop Operations

Project Manager Double-Click Operations


Copy Nodes Between Projects

If you have more than one project going at once, and need links to the same files, FTP connections, or schemas, you can copy them from one project to another in the Project Manager.

This Copy feature applies to second-level nodes: Schemas, Folders, and FTP Folders. It copies the selected nodes and all items below them.

To copy nodes between projects

  1. Select the nodes you want to copy. You can use SHIFT or CTRL to multi-select.
  2. Right-click and select Copy from the menu. The Destination Projects dialog box displays. This dialog box has a list of all other Project Folders you have set up in your Project Manager, including the one where the nodes already reside.
  3. Select one or more of the projects. You can use the All or None buttons to select or clear all of the projects.
  4. Click OK. The nodes you have selected are copied to the other projects, and you are returned to the Project Manager.

Related Topics

Project Manager Overview


Project Manager Sorting

You can easily sort the items under any node in the Project Manager.

  1. Select the node you want to sort.

    Note: Select only one node at a time. If multiple nodes are selected, none will be sorted.

  2. Right-click and select Sort. The nodes directly beneath the selected node are now in alphabetical order.

Related Topics

Project Manager Overview

Searching for Nodes


Searching for Nodes

When you have your Project Manager configured and stocked with many files and schemas, you can still find what you have entered. Click anywhere in the left hand tree view and start typing. Toad will search for and highlight the first occurrence of what you type after the cursor.

Related Topics

Project Manager Overview


Formatting Files

Format Files

You can format your files from within the Project Manager, or as an Action in the Toad Automation Designer. This lets you more easily convert scripts, procedures, functions, and so on to fit your company's formatting requirements.

The files are automatically formatted and the results of the formatting process are displayed in the Output window, Formatting Results tab. If there are syntax errors within the code that prevent proper formatting, Toad will list these as well.

Files to be formatted must be included in the Project Manager as nodes. See Adding Folder Items for more information.

Notes:

  • Formatting is not immediately accessible from the popup menu.See Configuring the Project Manager for more information..
  • In version 9.7, the Formatter component was replaced with a new component that supports Oracle 10g and 11g functionality. Some formatter options have moved or changed slightly. See Changes in the Formatter for more information.

To format one file from the Project Manager

  1. In the Project Manager, select the file you want to format.
  2. Right-click and select Format Files.

To format multiple files from the Project Manager

  1. Do one of the following:
    • In the Project Manager, select the files you want to format.
    • Select the folder or project nodes that directly contain the files you want to format.
  2. Right-click and select Format Files.

To create a Format Files action

Note: See Format Files Action for more information.

  1. From the Automation Designer, click the Utilities tab.
  2. In the navigation panel, select the App where you want formatting to occur.
  3. Click [image] and then click in the app.

Related Topics

Formatting Options

Project Manager Overview

Action Catalog

Automation Designer Overview


Checking Files for Syntax

You can check the syntax of your files from the Project Manager tree. You can check multiple files, or check them one at a time.

Results display in the Output window, on the Syntax Check Results tab.

To check files for syntax errors

  1. Do one of the following:
    • Select one or more files from the Project Manager tree.
    • Select the folder or project nodes containing the files you want to check.
  2. Right-click and select Check Syntax.

Related Topics

Project Manager Overview

Format Files

Using the Connection Panel


File to FTP

You can upload a file directly from the Editor to FTP using the Project Manager.

To move a file from Editor to FTP

» From the Editor, click and drag the tab of a loaded file from the Editor to an FTP node in the Project Manager.

Related Topics

Project Manager Overview

FTP Folders


Using the Connection Panel

Click the Connection tab to see the connection panel.

From the connection panel, you can easily manage your connections. You can:

  • Select an active session and drag it into a project folder to create a new schema node
  • Create new connections
  • Execute a quickscript against the selected connections
  • Execute a named sql against the selected connections
  • Copy TNS Names information to the clipboard
  • Create objects across multiple databases

Related Topics

Creating New Connections

Creating Objects in Multiple Databases

Executing Named SQLs

Executing QuickScripts

Copying TNS Names Info to Clipboard


Creating New Connections

You can use the Connection Panel of the Project Manager in several ways to create new connections.

Note: The connection panel is a two-way mirror to the Session Login window. Any connections you create here will be reflected in your connection list and the same in reverse.

To create a new connection

  1. Right-click in the Connection Panel.
  2. Select New Connection.
  3. Log in as usual.

To create a quick connection

  1. Right-click in the Connection Panel.
  2. Select Quick Connect.
  3. Do one of the following:
    • Select All to list all the connections you have available
    • Select a server and then select the connection from the server menu.
  4. If the password has not been saved, you will be prompted to provide login information and the Server Login window displays. Otherwise the connection will be made automatically. See About Database Connections for more information.

Related Topics

Project Manager Overview

About Database Connections


Executing QuickScripts

From the Project Manager's Connection Panel, you can execute a any configured QuickScript against selected connections.

To execute QuickScripts

  1. In the Connection Panel, select one or more connections to execute against.
  2. Right-click and select Execute QuickScript.
  3. Select the script you want to execute.

Related Topics

Project Manager Overview

Running or Loading QuickScripts


Executing Named SQLs

From the Project Manager's Connection Panel, you can execute a named SQL against selected connections. See Project Manager Overview for more information.

To execute named SQLs

  1. In the Connection Panel, select one or more connections.
  2. Right-click and select Execute Named SQL.
  3. Select the SQL you want to execute.


Creating Objects in Multiple Databases

You can create objects in multiple databases using the Project Manager Connection Panel. This is very useful when you need identical objects in various schemas. Create them at once and save time.

When you create an object in multiple databases, the Create window that is opened corresponds to the lowest Oracle version you have selected. Therefore, if you have selected a connection to an Oracle 8i database and another to an Oracle 10g database, the options on the Create window will be 8i compatible. All DB information loaded into the window, such as the schema list and available data types will be loaded from the lower Oracle version.

This means that the Create is owned by the lowest Oracle version and then the generated SQL is run against the other connections selected in the Connection Panel.

To create objects in multiple databases

  1. In the Connection panel, select the connections where you want to create an object.
  2. Right-click and select Multi-database Create.
  3. Select the type of object you want to create.
  4. Enter the appropriate information in the Create window that displays.
  5. Click Create. You can also use the Schedule button to run the scripts against the databases at a later time.


Copying TNS Names Info to Clipboard

From the Project Manager, you can copy TNS Names information for one or more selected connections into the clipboard. From the clipboard you can paste the information wherever you need it.

To copy TNS Names information

  1. Select one or more active connections in the connection panel.
  2. Right-click and select TNS Names info to clipboard.
  3. Paste where needed.

Related Topics

Project Manager Overview


Project Nodes

Project nodes are the heart of the Project Manager window. They are central to easily organizing your files.

Within each project node you can store links to FTP folders, regular folders, connection links, and database objects. Different project nodes can contain links to the same items. This lets you have, for example, one project for development and one for production, possibly containing links to the same files.

Related Topics

Project Manager Overview

Adding a Project Node

Saving a Project

Renaming a Project

Removing a Project


Adding a Project Node

You can add a project node to the Project Manager in two ways.

To add a project node

  1. Do one of the following:
    • Right-click and choose Add Project.
    • Select Project from the Add Item drop-down on the toolbar.

  2. Enter the name you want to use for the Project and press ENTER.

    Note: When you are adding an item from the Schema Browser, you can create a new Project by typing the project name into the Name box instead of choosing from the drop-down list.

Related Topics

Project Nodes

Saving a Project

Renaming a Project

Renaming a Project


Saving a Project

You can save the organization of the Project Manager to a file. This way if you have a project that has gone into maintenance, you can save its settings to a new file, keeping your Project Manager window clear for current projects. Then you can reload it again when you need it. This helps keep your Project Manager window streamlined.

To save a project

» Click [image] on the toolbar to save the contents of the Project Manager with a new filename.

Tip: If you have already saved a project, and just want to update it, you can click [image] on the toolbar instead. The current Project Manager file is also saved automatically when you close the Project Manager window.

Related Topics

Project Manager Overview

Project Nodes

Adding a Project Node

Renaming a Project

Renaming a Project


Renaming a Project

When a project is first added to your Project Manager, it is called Toad Project, but it is created in Rename Mode. You will want to change this to something more appropriate to your work environment. Just type the new name and press Enter.

To change a project name

  1. Do one of the following:
    • Select the project in the project hierarchy and press F2.
    • Right-click the project and select Rename.
  2. Enter a new project name and press ENTER.

Related Topics

Project Manager Overview

Project Nodes

Adding a Project Node

Saving a Project

Removing a Project


Removing a Project

You can also remove a project entirely from the Project Manager.

To remove a project from the Project Manager

  1. Select or multi-select a project or projects, right-click and select Remove from the menu.
  2. Click Yes to remove the Project Node.

This removes the node and any of the links to items beneath it from the Project Manager. It does not remove your files from your hard drive.

Related Topics

Project Manager Overview

Adding a Project Node

Saving a Project


Schema Nodes

You may use several different schemas or users within each project. You can use the Project Manager to access your connections, see if you are connected, and to connect if the connection is not current. You can also configure the Project Manager so that when you drag a schema node into another schema node Toad will automatically run a schema compare on the two.

In addition, you can right-click a schema node for a list of possible actions, including:

  • Opening a Schema Browser window
  • Opening an Editor window
  • Opening a Query Builder window
  • Connecting to the schema
  • Disconnecting from the schema

See Configuring the Project Manager for more information and other configuration options.

Related Topics

Project Manager Overview


Database Objects

Adding

You can add a database object within a schema node. There are several ways to do this, and they depend on the object you are adding. Some objects can be added in one way but not another. See Database Object Functionality for more information and a list of database objects and how to add them to your projects.

  • Right-click the schema name and then select Add | Database Object….
  • Drag-and-drop the object from the Schema Browser to a project node in the Project Manager.
  • In the Schema Browser, select the object you want added, right-click and select Add to Projects window.

For the last two options, Toad will automatically find any schema node within the selected Project node that matches the current schema in the Schema Browser. If an appropriate node is not found, Toad will create one and add the objects under that schema.

Right-click

The right-click menu displays the Schema Browser right-click menu for the database object you have selected. In addition, it adds the selections you have selected from Pop up menus below the Schema Browser selections.

Note Property

You can add a Note to any Database Object Node. This note can be displayed as a hint.

To add a note

  1. Right-click on a database object.
  2. Select Properties.
  3. Enter the note and then click OK.
  4. Hover over the object in the tree to see the node.

Related Topics

Adding Objects to Project Manager


Database Object Functionality

The Project Manager lets you easily add database objects to your projects. However, some objects can be added only from the Object Browser. See Project Manager Overview for more information.

The table below describes the possible database objects, how to add them, and what functionality is associated with them at this time.

For Schema Browser accessibility, unless otherwise noted, you can either drag-and-drop the object into the Project Manager, or right-click and select Add to Project Manager.

Object Type | How to Add to Project Manager | Drag & Drop Operations | Double-click Operations | Popup Menu Operation
Clusters | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Constraint | Object Search/Drag-and-Drop | Y | Y | Y
Columns (table) | Cannot Add | N | N | N
DB Link | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Dimension | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Directory | Object Search/Drag-and-Drop | Y | Y | Y
Function | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Index | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Java Class | Object Search/Drag-and-Drop | Y | Y | Y
Java Resource | Object Search/Drag-and-Drop | Y | Y | Y
Java Source | Object Search/Drag-and-Drop Schema Browser/Drag-and-Drop | Y | Y | Y
Job | Schema Browser/Drag-and-Drop | Y | Y | Y
Library | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Package | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Package Body | Object Search/Schema Browser | Y | Y | Y
Policy | Object Search/Schema Browser/Drag-and-Drop | N | N | N
Policy Groups | Cannot Add | N | N | N
Procedure | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Profile | Drag-and-Drop | Y | Y | Y
Queue | Object Search | Y | Y | Y
Queue Table | Object Search | N | N | N
Recycle Bin | Cannot Add | N | N | N
Refresh Groups | Cannot Add | N | N | N
Resource Groups | Cannot Add | N | N | N
Resource Plans | Cannot Add | N | N | N
Role | Schema Browser/Drag-and-Drop | N | Y | Y
Rollback Segment | Object Search/Drag-and-Drop | Y | Y | Y
Scheduler Job Classes | Object Search/Schema Browser/Drag-and-Drop | N | N | N
Scheduler Jobs | Object Search/Schema Browser/Drag-and-Drop | N | N | N
Scheduler Window Groups | Object Search/Schema Browser/Drag-and-Drop | N | N | N
Scheduler Windows | Object Search/Schema Browser/Drag-and-Drop | N | N | N
Scheduler Schedules | Object Search/Schema Browser/Drag-and-Drop | N | N | N
Scheduler Programs | Object Search/Schema Browser/Drag-and-Drop | N | N | N
Scheduler Chains | Object Search/Schema Browser/Drag-and-Drop | N | N | N
Sequence | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Snapshot | Schema Browser/Drag-and-Drop | Y | Y | Y
Snapshot Log | Schema Browser/Drag-and-Drop | Y | Y | Y
Synonym | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
System Privilege | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Table | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Tablespace | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
Trigger | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y
User | Schema Browser/Drag-and-Drop | Y | Y | Y
User Type | Object Search | Y | Y | Y
User Type Body | Object Search | Y | Y | Y
User Collection | Object Search | N | N | N
View | Object Search/Schema Browser/Drag-and-Drop | Y | Y | Y


Adding Folders

You can add as many folders as you like to a project. Each folder must already exist on your hard drive or the network drive. Adding a folder to the Project Manager maps the folder path.

Note: Refresh folder list functionality is limited for a network folder node. Only the parent directory of the network folder node will be refreshed, but its subfolders and their contents will not be refreshed.

To add a folder

  1. Right-click on a project node in the left pane of the Project Manager.
  2. Select New | Folder.
  3. Do one of the following:
    • Enter the path to the folder in the path box.
    • Click [image] and browse to the folder you want to add.
  4. Add any filters in the Filter box. See Filtering Folder Items for more information.

By default, double-clicking on the folder will open the Windows Explorer to that folder, so you can easily browse through the contents.

You can also add items contained in the folder to the Project Manager window so they are accessible directly. See Adding Folder Items for more information.

Related Topics

Project Manager Overview

Removing Folders

Adding Folder Items

Removing Folder Items

Filtering Folder Items

FTP Folders


Removing Folders

You can remove folders from the Project Manager just as easily as you can add them.

To remove a folder

» Select one or more folders, right-click and select Remove.

Note: The folders are removed from the Project Manager listing. They are not deleted from your hard drive.

Caution: Be sure you select Remove from the right-click menu and not Delete. Delete will delete your folder entirely.

Related Topics

Project Manager Overview

Adding Folders

Adding Folder Items

Removing Folder Items

FTP Folders


Adding Folder Items

Adding folder items to folders you have mapped in the Project Manager makes it easier to open them. You no longer have to open the Windows Explorer, but can open them directly from the Project Manager.

Project Manager automatically names these folders with their entire path name. You can also rename these folders to something more easily remembered within the Project Manager.

To rename a folder

  1. Do one of the following:
    • Right-click the folder and select Rename.
    • Select the folder and press F2.
  2. Enter a new name for the folder and click OK.

The pathname is retained, but the folder name is now more manageable in the Project Manager.

Related Topics

Project Manager Overview

Adding Folders

Removing Folders

Removing Folder Items

Filtering Folder Items

FTP Folders


Filtering Folder Items

In the Project Manager, when adding or viewing the properties of a file folder you can filter the file list displaying in the folder. This can be useful if you have many file folder items displayed, and you need to easily find a specific file.

To change file folder properties

  1. Right-click the file folder and select Properties.

  2. Change the directory information by browsing for it using [image], or by entering a path directly.

  3. Enter filter information in the Filter box using standard DOS wildcard characters.

    For example, *.txt will display only .txt files, fill* will find only files beginning with the letters "fill" and so on.

  4. Right-click and select Refresh folder links from the menu.

    Note: After a confirmation, all current links will be removed, and only those files that match the provided filter will be created as links under the folder. This does not create new links, but only filters existing links.

  5. Returning to the properties dialog box and restoring it to all files (*.*), and again refreshing it, will restore all your links.

Related Topics

Adding Folders

Removing Folders

Adding Folder Items

Removing Folder Items

FTP Folders


Removing Folder Items

You can remove folder items from the Project Manager.

To remove a folder item

» Select one or more items, right-click and select Remove.

Note: The folders are removed from the Project Manager listing. However, they are not deleted entirely.

Caution: Be sure you select Remove from the right-click menu and not Delete. Delete will delete the item entirely.

Related Topics

Project Manager Overview

Adding Folders

Adding Folder Items

Removing Folder Items

FTP Folders


FTP Folders

FTP folders represent connections to a remote server. These are located as sub-nodes to a Project Folder you create. See Project Nodes for more information.You can add a separate folder for each server directory you want mapped.

To add FTP folders

  1. Select the project where you want the FTP Folder to reside.
  2. Right-click and select Add | FTP Folder.
  3. Set up an FTP connection as described in FTP Logon.
  4. Click OK.

To remove FTP folders

  1. Select the folder or folders you want to remove.
  2. Right-click and select Remove from the menu.
  3. Confirm by clicking OK.

FTP Folder Actions

When an FTP folder has been added, you can perform several actions from the right-click menu. Right-click the FTP folder and select from:

  • Browse - This opens an FTP connection and lets you browse the contents of the FTP connection. It uses the client dir as the local directory.
  • Refresh Server Links
  • Add Folder item (See below)

Add FTP Folder Items

FTP Folder items represent files on the remote server. Adding them to your FTP folder tells Toad where they are located, and what they are called. When you act on them, you are connecting to the server, downloading the item and editing it. You can then use FTP to send them back to the server.

To add FTP folder items

  1. Select the FTP Folder where the files are located.
  2. Right-click and select Add | FTP Items from the menu.
  3. Select the files you want to add to your folder. You can easily select all or none by clicking the corresponding buttons.
  4. Click OK. The files are added to the FTP Folder node you had selected.

To remove FTP folder items

  1. Select the folder or folders you want to remove.
  2. Right-click and select Remove from the menu.

Caution: Be sure to select Remove and not Delete Server File. Delete Server File will remove the file from your server directory.

Related Topics

Adding Folders

Removing Folders

Adding Folder Items

Removing Folder Items


To Do Lists

You can create a "To Do" list in the Project Manager to keep track of your projects and what needs to be completed.

To Do items can be listed under a node, or under another To Do item. So if you need to break a task into its component parts, you can create multiple sub-items.

To create a To Do node

» Over a Project Node, right-click and select Add | To Do List. The new list displays with the name selected so you can immediately change it.

To create a To Do item

  1. Right-click on a To Do List or a To Do Item and select Add | To Do Item.
  2. Name the item.
  3. Right-click on the item and select Properties. From here you can:
    • mark the item completed
    • add notes about the item
    • change the due date (the default is three days from the current date)
  4. Click OK to accept the changes to the properties.

Related Topics

Project Manager Overview


Query Viewer

The Query Viewer displays currently running background queries, the database where they are running, their current execution time and the SQL. Queries are automatically displayed in their order of execution. From this window you can cancel queries, or display the Editor page where they are running and view them in detail.

The Query Viewer is available as an individual window within Toad, or you can access it from the dockable panel in the Editor.

To access the Query Viewer

» Do one of the following:
  • From the View menu, select Query Viewer.
  • From the Editor, right click, select Desktop Panels and select Query Viewer.

Related Topics

Finding Queries in Context

Query Viewer Filters

Using the Query Viewer


Finding Queries in Context

Finding queries in context lets you move from the Query Viewer to the Editor tab where the query is running and view it there.

To find a query in context

  1. In the query viewer grid, select the query you want to find.
  2. Click [image].

Related Topics

Query Viewer

Using the Query Viewer


Query Viewer Filters

You can easily filter the Query Viewer grid in order to find specific queries. See Query Viewer for more information.

To filter the viewer grid

  1. From the Query Viewer toolbar, click [image].
  2. Select the method you want to use to filter the grid:
    • SQL contains.
    • Runtimes longer than n minutes.
    • Started in last n hours.
  3. Click OK.


Using the Query Viewer

The Query Viewer displays queries that have run or are currently running, in grid format. See Query Viewer for more information.

The grid view includes columns that display:

  • Database
  • Status
  • Start Time
  • Stop Time
  • Execution Time
  • Type
  • SQL

The panel below the grid includes two tabs. One displays the SQL that is selected in the grid. The other displays any errors that were encountered while running that SQL.

To view SQL

  1. In the grid area of the Query Viewer, click on the SQL entry you want to view.
  2. In the lower pane of the Query Viewer, click the SQL tab.

To view Errors

  1. In the grid area of the Query Viewer, click on the SQL entry you want to view.
  2. In the lower pane of the Query Viewer, click the Errors tab.

Related Topics

Query Viewer

Finding Queries in Context

Using the Query Viewer


Script Manager Overview

The Script Manager is a centralized location in Toad where you can manage your frequently used scripts. Using the Script Manager you can:

  • Organize your scripts into various categories
  • Access scripts easily
  • Execute scripts against multiple connections at once
  • Execute multiple scripts at once
  • Execute multiple scripts against multiple connections

By default, the active connection when you open Script Manager is used as the default connection for executions, unless you specify a different connection in the connections grid. This is also used to check any Toad Security settings you may have active. Therefore, Script Manager cannot be used without an active connection.

Main Script Manager Areas

The Script Manager is divided into a connections grid and three tabs: scripts, output and messages.

Connections grid

The connections grid is tied to the Database Login window. If you execute a script against a connection in the Script Manager, the connection will also become active on your main connections.

Scripts

Use the script area to sort, categorize, load and run your scripts. See Using the Script Grid for more information.

Output

The output area displays the output of the selected scripts. Tabs at the bottom let you navigate between outputs. One tab is created for each script run. In addition, additional sub-tabs are added within the script tabs for each select statement contained in that script.

Messages

The messages area displays any system messages regarding the scripts you run. Messages are separated by a dashed divider line, and contain the script path and the message.

Related Topics

Opening Script Manager

Scripts Provided with Toad

Using the Script Grid


Opening Script Manager

From File Menu

» From the Utilities menu, select Script Manager.

Open Script Manager at Startup

To set Script Manager to open at startup

  1. From the View menu, select Toad Options.
  2. In the left panel, select Windows.
  3. In the Script Manager row, select the Auto open checkbox.

Related Topics

Script Manager Overview


Scripts Provided with Toad

Several scripts for use with Script Manager are provided with Toad. Toad installs a folder called ScriptMgr in the main install directory for easy access to scripts. Script datafile (.sdf) files are generally saved in the user files directory; however, you can save them wherever you wish.

DBA Scripts

The scripts that relate to DBA work are listed in an .sdf (category) file called DBA.sdf. This file is installed in the User Files subdirectory. A folder called "DBA" will be placed in the ScriptMgr folder. The DBA related scripts provided by Toad are installed in this folder. See Properties Files for more information about exact locations.

By default, DBA.sdf expects Toad to be installed in "C:\Program Files\Quest Software\Toad for Oracle", which is the default directory for the installation. If this is your location for Toad, you can load DBA.sdf and proceed to use the scripts.

To set script location if Toad is installed elsewhere

  1. First load DBA.sdf into the Script Manager.
  2. Right-click and select Batch Directory Change to change the directory for the scripts. See Changing Script Directories for more information.

Oracle 8i Data Dictionary scripts

The .sdf (category) file Oracle 8i Data Dictionary.sdf will be installed into the same directory as Toad.exe.

By default "Oracle 8i Data Dictionary" expects Oracle 8i and its associated scripts to be installed in "D:\ORACLE\ORA817", which is a reasonable location for an Oracle 8i installation. If this is your location for Oracle 8i, you can load the Oracle 8i Data Dictionary and proceed to use the scripts.

However, if Oracle 8i is installed elsewhere:

  1. First load Oracle 8i Data Dictionary.sdf into the Script Manager
  2. Click Move and change the directory for the scripts. See Changing Script Directories for more information.

Related Topics

Script Manager Overview

Changing Script Directories

Opening Script Manager

Properties Files


Create New Script Datafile

Script datafiles let you store your scripts for later retrieval. Each datafile can contain multiple scripts. You can use these datafiles to organize your scripts into categories, making it easier for you to find the script you need at any time.

Datafiles are ASCII text files, with one line per script. Datafiles are, by default, stored with an extension of .sdf.

To create a datafile

  1. Open Script Manager. See Opening Script Manager for more information.
  2. In the Script Manager toolbar, click [image].
  3. In the box, navigate to the appropriate directory and then enter the name you want to use for the datafile: for example, "Toad Setup Scripts".

    4. Click Save.

    Note: You are immediately taken to the Add Script Entry window. You do not need to add scripts at this time, you can wait and add them later. See Adding Script Entries for more information.

Appropriate Script Datafile names

All characters used in the name must be acceptable Windows filename characters. For example, you could not name a category SQL*Plus Scripts, because the * is not a recognized character. If you attempt to name a datafile using one of these characters, the file will not be created.

Related Topics

Script Manager Overview

Adding Script Entries


Save Datafile As

You can save the current datafile with a new name.

To save a datafile with a new name

  1. In the Script Manager, open the datafile you wish to rename.
  2. In the Script Manager toolbar, click [image].

  3. Enter the new name for the datafile.

    Note: This does not delete the original datafile.

Related Topics

Script Manager Overview

Deleting a Script Datafile


Deleting a Script Datafile

You can delete script datafiles from the Windows Explorer, as you would any other file.

Related Topics

Script Manager Overview

Create New Script Datafile


Using Connections with Scripts

In the Script Manager, you can use different connections with scripts. These can be saved with each datafile, or as a global value for use with all scripts. If the directory contains the path to Toad, it is stored as a relative directory.

Connections you use for execution can be stored as defaults and saved in the datafile.

To use the datafile defaults

  1. Click [image].
  2. Select Set to datafile defaults.

To save a datafile default

  1. Load the datafile to which you want to add connection defaults.
  2. Click the Script Manager options button.
  3. In the Default Execution Connections area, click Add and add the connections you want these scripts to execute against.
  4. Click OK.
  5. Click [image].
  6. Name the datafile and click Save.

Related Topics

Script Manager Options

Save Datafile As

Script Manager Overview


Using the Script Grid

The script grid in the Script Manager works in much the same way as many of the other data grids in Toad. See Editing Script Entries for more information about editing entries in the grid.

To access the script grid

» Click the Scripts tab.

Reorder Grid

You can reorder the script entries using the arrows above the grid. While clicking in the column header will temporarily sort the grid, using these buttons will permanently change the order. This allows you to specify the order scripts will execute. Selected scripts execute from the top of the permanent grid order to the bottom.

To reorder scripts in the grid

  1. Select the script you want to move.
  2. Click [image] to move the script up in the list.
  3. Click [image] to move the script down in the list.

Print Grid

To print the script grid for a datafile

  1. Open the datafile you want to print.
  2. From the Grid menu, select Print Grid.
  3. Select the options you want and click OK. The grid prints.

Related Topics

Script Manager Overview

Editing Script Entries

Report Link Designer


Add Script Entry

Adding Script Entries

After you have created script datafiles in the Script Manager, you can add scripts to the categories.

To add a script entry

  1. Open the datafile where you want to file the script.
  2. Click the Scripts tab, and then [image].
  3. The Save As dialog box displays. This allows you to browse for the scripts you want to add with this Description and Use. Select the scripts you want (you can multi-select by holding down <Ctrl> as you click them) and then click Save.

    4. Enter a group in the Group box. For example, if you use this script for quality assurance, you can create a QA group: enter "QA".

    Note: More than one script can share the same description. Press Tab or click in the Description box.

  4. Enter a Description of the script. More than one script can share the same Description.

    5. Click Add to continue adding scripts.

    Note: The scripts you have selected are listed in the filenames area of the Add Script Entry dialog box.

  5. Click OK. The scripts are now added to the grid. The Use and Description are the same for all the scripts you added.

Related Topics

Script Manager Overview

Create New Script Datafile


Edit Script Entries

Editing Script Entries

Once scripts have been entered into categories in the Script Manager, you can edit the entries.

To edit entries

  1. From a datafile that contains scripts, click in a script name and click [image] (right-click and select Edit).

  2. Change the description, use, or pathname for the script.

    Note: The script must exist in the new location before you change the pathname.

Related Topics

Script Manager Overview

Create New Script Datafile


Remove Script Entries

Removing Script Entries

To remove script entries

  1. From a datafile that contains scripts, select and highlight the scripts you want to remove.
  2. Click [image] on the Scripts tab toolbar (right-click and select Remove Scripts).

    3. Confirm that you want to permanently remove the scripts from the datafile by clicking Yes.

    Note: This does NOT remove scripts from your hard drive. Only from the datafile you have selected.

Related Topics

Script Manager Overview

Adding Script Entries


Change all Script Directories

Changing Script Directories

You can change the directory for all the scripts in a selected Script Manager category.

To change all script directories

  1. In the script column of the script grid, select a g(top) node.
  2. Right-click and select Batch Directory Change.
  3. Do one of the following:
    • Enter the new pathname of the directory.
    • Click the drill down button and select the correct directory.

  4. Click OK. The directory for all the scripts in this category is changed.

    Note: Using this command does not actually move scripts from one directory to another. If the directory column is pointing to the wrong directory, this procedure allows you to easily point to the correct directory to access your scripts.

Related Topics

Script Manager Overview

Create New Script Datafile


Scheduling Scripts

You can use Script Manager to schedule scripts to be run at a later time or date. Scheduled scripts execute using Quest ScriptRunner. See Execute Scripts with Quest ScriptRunner for more information.

To schedule scripts

  1. In the Script Manager, select the scripts you want to schedule.
  2. Click [image] on the Scripts tab toolbar.
  3. If you have selected multiple scripts, you are asked to decide to combine or not. Click Yes or No.
  4. Complete the scheduling process using the Add Task wizard that displays. See Add Task Wizard for more information.

Related Topics

Script Manager Overview

Task Scheduler

Add Task Wizard


Grouping Scripts

To group scripts

  1. In the Scripts tab toolbar, click the Group by [image] button.
  2. Choose one of the following:
    • Group by <none>

      • Choosing None does not group your scripts at all. They are simply listed in the order you have chosen to display them (this order is, by default, the order they were added to the datafile, but you can change it by using the move up and move down buttons in the script grid toolbar).

    • Group by Use

      • Choosing Use groups all of your scripts by the Use field that you have designated. Each use field is displayed as a node, with scripts listed below it. This is one of the most powerful selection options.

    • Group by Extension

      • Choosing Extension groups all your scripts by extension. Each extension (.sql, .prc, etc) becomes the top node and all scripts are grouped under it.

    • Group by Directory

      • Choosing Directory groups all your scripts by their directory. The directory becomes the top node and all scripts are grouped under it.

Related Topics

Script Manager Overview

Create New Script Datafile


View Script

Viewing Scripts

Once you have scripts entered in your Script Manager, you can view your scripts easily.

To view a script

  1. From the Script Manager, Scripts tab, open the datafile where your script is located.
  2. If necessary, expand the top-level node to display your scripts.
  3. Select the scripts you want to view.

  4. Right-click and select View from the menu.

    Note: A copy of Notepad opens for each script you have checked.

Related Topics

Script Manager Overview

Scripts Provided with Toad


Load Datafile

Loading Datafiles

You can load a datafile of a Script Manager category. This can be useful if someone sends you a category and the scripts used in it.

To load the datafile (category)

  1. In the main Script Manager toolbar, click the Open Datafile [image] button.
  2. Select the datafile you want to load. The extension for datafile is .sdf.

The loaded file displays in the Script Manager. Check the pathnames in the Directory column of the new scripts. If these pathnames do not correspond to how your computer is organized, you will have to either change the pathnames or move the scripts, or the scripts will be inaccessible. See Editing Script Entries for more information.

Related Topics

Script Manager Overview

Create New Script Datafile

Editing Script Entries


Combine Script Entries

Combining Script Entries

You can use the Script Manager to combine two or more scripts into one. The scripts must reside in the same datafile to combine them.

Once combined, the new script is automatically added to the active datafile.

To combine scripts into a single script

  1. From the Script Manager, select the datafile where your scripts reside.
  2. In the script grid, select the scripts you want to combine.

    3. Click [image] on the Scripts tab toolbar.

    Note: the default pathname is the same as that of the scripts you have combined. If you want to put the scripts in a different directory, you can enter a full pathname here.

Related Topics

Script Manager Overview

Create New Script Datafile


Execute Scripts using Options

When you execute a script from the Script Manager you can set various options that define how the script is run.

To select scripts to execute

  1. From the Script Manager, select the datafile you want to work with.
  2. Select the scripts you want to run.

To set options

  1. In the Script Manager toolbar, click [image].
  2. Set options and click OK.

Execute the Scripts

You can execute scripts from the Script Manager within Toad or by using Quest ScriptRunner.

You can execute scripts against any of your databases. If you do not have a live connection, Toad will open a connection and close it when the script has completed running.

To execute the scripts

  1. Select the scripts you want to run.
  2. Do one of the following:
    • Right-click and select Run.
    • Right-click and select Run in Quest Scriptrunner.

Related Topics

Script Manager Overview

Create New Script Datafile


Script Manager Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To set options

  1. From the Script Manager toolbar, click [image].
  2. Refer to the following for additional information:
    3. Option Information
    Execution Options

    Use single file

            Include entire path in the filename.

    Use separate file for each script (autonamed)

    This option creates a separate file for each script. In this case, Toad will name the files for you. You do, however still need to specify the directory where you want the files saved.

    Caution: Files are saved as the original script name, with a .txt extension. If your original scripts had a .txt extension and you choose the directory where they are located, they will be overwritten by the new files.

    Filename

    Can be global or specific to the datafile (.sdf).

Related Topics

Properties Files


Run from Grid

If you do not want to go through the options steps (See Execute Scripts using Options for more information), you can run your scripts directly from the grid, using the Editor, or Quest ScriptRunner.

To run a script from the grid

  1. From the Script Manager, select the category that houses the script you want to execute.
  2. Right-click the script, and select Run from the menu, or click the run button on the toolbar.

    3. SQL Editor or Quest ScriptRunner opens the selected script and executes it.

    Note: If you are running a long script and want to continue working as it executes, you may prefer to select Run using Quest ScriptRunner. This will allow you to run the script in the background and continue working. See Execute Scripts with Quest ScriptRunner for more information.

Related Topics

Script Manager Overview

Execute Scripts using Options


Execute Scripts against Multiple Connections

You can execute your scripts in multiple connections at one time.

The Connections to Use Grid contains the connections you can use when you run scripts. If a connection you want to use is not displayed in the grid, you can add it. If a connection is not active at the time you execute the script, Toad will create a new connection and then close it when the script has executed.

To Execute scripts against multiple connections

  1. In the connection grid, click Add and add the connections you want to use for execution. (Unless you have saved specific connections with the .sdf file you are using)

    Note: Connections are tied to the Database Login window: you must have connected to the server you want to use previously for it to be displayed here.

  2. Click [image] and set the following options:
    1. Select Spool output to file.
    2. Select Use single file.
    3. Enter the filename you want to use for the execution. Because the settings on this window are remembered, you can set this either as a global filename for all scripts, or as a filename specific to the datafile (.sdf) you are using.
    4. Select the connections you want to use.
      • Save and load from each datafile will use the connections you have saved with the datafiles containing your scripts.
      • Save and load from a single list will use the list you created in step 1.
    5. Click OK to apply options.
  3. Click [image] to execute the scripts.

Output

When you have executed a script against multiple connections, output is displayed in the Script Manager window as well as saved to file.

Messages Tab

The messages tab becomes active when scripts are executed. This tab lists errors, and which scripts have been run against which databases Note that these messages are NOT saved to file automatically. If you want a record of the messages tab, you will need to save it manually by copying and pasting into another document.

Output tab

The output window includes tabs for Output and any Grid output provided, as well as environment information.

Each script instance is listed on a tab at the bottom of the window, by script name. This means, for example, if you ran the script version.sql against two databases, there will be two tabs named "version.sql". Clicking on them will provide the output for that execution.

The text file you saved will include detailed output for each execution.


Configure QuickScripts List

The QuickScripts list is a drop-down menu found on the File | Run Script menu. See Running or Loading QuickScripts for more information.

Before you can run a QuickScript, you must configure the QuickScripts List.

To configure the QuickScripts list

  1. Scripts can be selected from more than one datafile. From the Script Manager, select the datafile where the script resides.

  2. In the script grid, click in the On File Menu check box for the scripts you want listed. This adds them to the QuickScript list.

    Note: To list all of scripts in a Use group, select the box for that node. All scripts within it are selected.

  3. Repeat steps 1 and 2 for all datafiles and scripts you want to list.

Related Topics

Script Manager Overview

Create New Script Datafile


Running or Loading QuickScripts

Once QuickScripts are configured from the Script Manager, you can run or load them from the toolbar or the File menu.

To run a QuickScript from the toolbar

  1. On the main toolbar, click [image] (the arrow).

  2. Select one of the datafiles.

  3. Select the script from the list.

    Note: The script is run in a new Editor tab.

To run a QuickScript from the File menu

  1. Select File | Run Script.
  2. Select a datafile from the submenu.

    3. Select the script you want to run.

    Note: The script is run in a new Editor tab.

To load a QuickScript from the toolbar or the file menu

  1. In the Script Manager Options page, make sure Load Only (no execute) is selected. See Script Manager Options for more information.
  2. Follow the instructions listed above for running QuickScripts. Scripts will be loaded instead of run.

To run a QuickScript from other areas in Toad

» In other areas of Toad (for example, Project Manager and Database Browser) right-click and select Execute Quick Scripts to run a selected script.


Toad Server Statistics

You get to this window by the Database | Monitor | Server Statistics menu item.

Use this window to view information about how the Oracle instance is performing. All grids can be exported, printed, sorted, and incrementally searched.

Note: See "Table Does Not Exist" Errors for more information if you have any problems accessing the required tables for this window.

This window displays:

Analysis

Click the Analysis tab to see information analyzing the various statistics, including comments and warning lights.

See How to create your ToadStats.ini file for more information about setting the warning light threshold values.

See Toad Server Statistics | Analysis for more information about required permissions.

Waits

Click the Waits tab to see total waits and timeouts by event.

See Toad Server Statistics | Waits for more information about required permissions.

Latches

Click the Latches tab to see gets, misses, and sleeps data for all latches. See Toad Server Statistics | Latches for more information.

Sessions

Click the Sessions tab to display information on the sessions. More detailed information can be found by clicking one of the sessions in the top grid. Details are displayed in the lower grid.

See Toad Server Statistics | Sessions for more information about required permissions.

Instance Summary

Click the Instance Summary tab to display information about the various statistics. This grid includes the statistic number, statistic name, and value.

See Toad Server Statistics | Instance Summary for more information about required permissions.

Monitor

If you do NOT have the DB Admin module, the monitor tab displays here as well. This monitor tab displays several small graphs that let you monitor memory usage across time. Each refresh adds more data to the right hand portion of the graph. Data left of the vertical blue line shows what was most recently added.

These charts are an overview only. If you need consistently reliable data about the memory usage of your database, using the Database Monitor in the DB Admin Module is recommended.


SQL Tracker

You can use the SQL Monitor to monitor SQL statements that are working on your database. This is a separate utility from Toad, and you can get help for it after you open it by pressing F1, or selecting Help | Contents.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.


UNIX Monitor

The UNIX Monitor lets you monitor database performance with charts and a grid. UNIX Monitor fully supports AIX, HP, Linux, and Solaris. UNIX Monitor supports TRU64; however, the Disk I/O Graph will remain empty for this UNIX version.

The UNIX Monitor mustbe launched and connected in order to work. So, you can launch it in the morning, minimize the window, and later in the day if a threshold is crossed you will be alerted.

Notes:

  • The server must be running Rexecd in order to use this utility. See RExec for more information about RExec; or see your UNIX administrator.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the Toad UNIX Monitor

» SelectDatabase | Monitor | UNIX Monitor.

Requirements

To use the UNIX Monitor, no special permissions are required. However, the user must be able to get through any firewall present. The following commands are used, and need to be installed and enabled on the UNIX machine:

  • RExec - Used to drive the monitor.

    • Note: The server must be running Rexecd in order to use this utility. In addition, some variants of UNIX may handle an rexec as an rlogin. These may automatically execute login files such as ".profile". In this case, extraneous output commands such as echoing "motd" (message of the day) may interfere with Toad's parsing of the output.

  • lostat - Used to get the disk io information.
  • vmstat - Used to obtain cpu information
  • ps - Used to process queues and lists.

Troubleshooting

There are potential connection issues with UNIX that are beyond our control.

As part of the connection process, the rexecd daemon performs a "reverse name lookup" by default. This means the server verifies the rexec source machine’s IP address against its own/etc/hosts file, and denies the connection if the source IP address is not found. For server-to-server rexecs, this makes sense because the servers often have hard coded and well known IP addresses. For network clients, this is often not the case. Few companies want to deal with placing the IP addresses of every PC in each server’s/etc/hosts file. Many companies use DHCP for their network clients. The IP addresses are not well known and are not constant.

The solution is to turn off "reverse name lookup" by editing the /etc/inetd.conf file and adding the –c parameter to the rexecd command. Then either reboot the server or refresh –s inetd.

Refresh rate

To automatically refresh the data in the charts, you must do two things.

To set the automatic refresh

  1. Check the Auto refresh checkbox.
  2. Select a refresh interval from the Refresh rate drop-down menu.

You can manually refresh the data by clicking the Refresh button.

Zoom

To zoom a graph

» Zoom in on a specific area by dragging a rectangle from left to right around the area you want to zoom.

To restore a graph

» Drag a rectangle from the right to left, and the chart will zoom back to 100%.

Connecting

In order to use the UNIX monitor, you must be connected to the UNIX server you want to monitor.

To connect to the UNIX server

  1. To connect, click the Connect button.
  2. Enter the appropriate information in the Server Settings dialog. See FTP for more information.
  3. Click OK to connect.

Viewing Graph History

The graphs take two or three iterations of the selected refresh cycle to initialize and then quickly fill in. After the graphs are full (one hour), the data scrolls off screen but is not cleared. You can see a two hour history using right-click | Zoom. (This is also true for the Database Monitor. See Database Monitor for more information.) Select Zoom.


ADDM/AWR

ADDM/AWR Overview

In Oracle versions 10g and up, the Automatic Database Diagnostic Monitor (ADDM) provides a holistic tuning solution. ADDM analysis can be performed over any time period defined by a pair of Automatic Workload Repository (AWR) snapshots taken on a particular instance, as long as the following requirements are met:

  • Neither snapshots encountered any errors during creation and neither have been purged.
  • There were no shutdown or startup actions between the two snapshots.

ADDM and AWR reporting can document both problem areas and areas of the database that are running smoothly, which is covered in detail by Oracle. See Oracle's documentation for more information.

Toad's ADDM/AWR window in Toad lets you:

  • Generate reports - For more information, see:
    • Generating an ADDM Report
    • Generating an AWR Report
    • Generating an AWR SQL Report
    • Generating an AWR Diff Report
    • Generating an ASH Report
  • Copy reports to clipboard.
  • Print reports.
  • Save reports to file.
  • Manage Snapshots (view stats, create, delete).
  • Manage Baselines (view, create, delete).

ADDM also documents the non-problem areas of the system. For example, wait event classes that are not significantly impacting the performance of the system are identified and removed from tuning consideration at an early stage, saving time and effort that would be spent on items that do not impact overall system performance.

In addition to problem diagnostics, ADDM recommends possible solutions. When appropriate, ADDM recommends multiple solutions for the DBA to choose from. ADDM considers a variety of changes to a system while generating its recommendations.

Notes:

  • Unless you have instructed Toad to make this window accessible, this functionality is disabled by default. You can restore functionality from View | Toad Options | Windows and clicking the Available checkbox in the appropriate row of the grid.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the ADDM/AWR window

» From the Database menu, select Monitor | ADDM/AWR

Related Topics

Generating an ADDM Report

Working with ADDM Reports

Use the QuickFilter (Filter from Memory)


AWR Browser

AWR Browser Overview

The Toad AWR Browser supports AWR in Oracle 10g and newer. It displays performance metrics between AWR snapshots in great detail. You can use this ability to track, compare and organize your statistics.

From the AWR Browser window, you can select snapshots; create new snapshots; select, display and print charts; program custom charts; and various other combinations. The browser window makes it easy to access the power of the data collected by Oracle's AWR feature.

For the most part, the AWR Browser works in the same way as the Statspack Browser, and all but two of the same charts are available. See StatsPack Browser Overview for more information.

Notes:

  • Unless you have instructed Toad to make this window accessible, this functionality is disabled by default. You can restore functionality from View | Toad Options | Windows and clicking the Available checkbox in the appropriate row of the grid.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the AWR Browser

» From the Database menu, select Monitor | AWR Browser.

The Browser Window

The AWR Browser window is divided into three areas: a list of snapshots, a list of charts, and a right hand panel where charts and advice are displayed. These areas work together to display the metrics you need to see.

Snapshot List Area

The snapshot list area lists the snapshots that have been collected by the AWR. To create charts based on these snapshots, you can select or clear the checkbox to the left of the snapshot name. By default, the AWR browser will select up to the most recent 24 hours worth of snapshots with the same database start time.

Chart List Area

Several charts and grids have been built into the window, or you can easily add your own in addition to those provided. Select or clear the checkbox to the left of the chart you want to view or hide. Selected charts are created for the selected snapshots. Right-click to select all, none, and so on.

Chart Display

You can display up to nine charts at a time, in a three by three chart area. See Displaying Charts for more information on configuring the viewing area.

Advice Display

Toad displays advice in the right hand panel. When two snapshots are selected (not checked, but highlighted), click the Advice tab for information about the top wait event during the selected interval. You can also double-click the top waits grid in the chart display area to display advice about that wait.

Related Topics

StatsPack Browser Overview


Generating an ADDM Report

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can easily generate an ADDM report from Toad.

To generate an ADDM report

  1. Select Database | Monitor | ADDM/AWR Reports.
  2. Click the ADDM/AWR Report tab.
  3. Select the appropriate Instance from the Instance drop down box.
  4. Click [image] to select:
    • Starting snapshot
    • Ending snapshot

      • Baseline range

      Note: To shorten the list of snapshots in the data select dialog, you can select Filter by ID and use the QuickFilter box to filter the list.

  5. Click OK.
  6. Click [image] on the Report Generator toolbar. The report displays in the ADDM Report tab below the selection fields.

Related Topics

ADDM/AWR Overview

Working with ADDM Reports

Baseline Template Management

Use the QuickFilter (Filter from Memory)


Working with ADDM Reports

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

After you have generated an ADDM report, you can read it on screen in Toad, or alternately, you may want to work with it in another format.

To copy the ADDM report to the clipboard

» Run an ADDM report, and then click [image] button.

To print the ADDM report

» Run an ADDM report, and then click [image] button.

To save the ADDM report to a file

» Run an ADDM report, and then click [image].

Related Topics

ADDM/AWR Overview

Generating an ADDM Report

Use the QuickFilter (Filter from Memory)


Generating an AWR Report

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can easily generate an AWR report from Toad.

To generate an AWR report

  1. From the Database menu, select Monitor | ADDM/AWR.
  2. Click the ADDM & AWR Reports tab.
  3. Select the appropriate instance from the Instance list.
  4. Click [image] to select:
    • Starting snapshot
    • Ending snapshot

      • Baseline range

      Note: To shorten the list of snapshots in the data select dialog, you can select Filter by ID and use the QuickFilter box to filter the list.

  5. Click OK.
  6. Click [image] on the Report Generator toolbar.
  7. Select the AWR Report - HTML Format tab or the AWR Report - Text Format tab to view the report in either of those formats.

Related Topics

Generating an ADDM Report

Working with ADDM Reports

Use the QuickFilter (Filter from Memory)


Generating an AWR SQL Report

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

If you are using Oracle 10.2 or higher, you can generate an AWR SQL report from Toad.

To generate an AWR SQL report

  1. From the Database menu, select Monitor | ADDM/AWR.
  2. Click the AWR SQL Report tab.
  3. Select the appropriate instance from the Instance drop down box.
  4. Click [image] to select:
    • Starting snapshot
    • Ending snapshot

      • Baseline range

      Note: To shorten the list of snapshots in the data select dialog, you can select Filter by ID and use the QuickFilter box to filter the list.

  5. Click OK.
  6. Click [image] and select a SQL ID.
  7. Click OK.
  8. Click [image] on the AWR Report Generator toolbar.
  9. Select the HTML tab or the Text tab to view the report in either of those formats.

Related Topics

Generating an ADDM Report

Working with ADDM Reports

Generating an AWR Report

Use the QuickFilter (Filter from Memory)


Generating an AWR Diff Report

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

If you are using Oracle 10.2 or higher, you can generate an AWR differences report from Toad.

To generate an AWR Diff report

  1. From the Database menu, select Monitor | ADDM/AWR.
  2. Click the AWR Diff Report tab.
  3. In the Compare This area, select the appropriate instance from the Instance drop down box.
  4. Click [image] to select:
    • Starting snapshot
    • Ending snapshot

      • Baseline range

      Note: To shorten the list of snapshots in the data select dialog, you can select Filter by ID and use the QuickFilter box to filter the list.

  5. Click OK.
  6. In the To This area, select the appropriate Instance from the Instance drop down box.
  7. Click [image] to select:
    • Starting snapshot
    • Ending snapshot

      • Baseline range

      Note: To shorten the list of snapshots, you can select Filter by ID and use the QuickFilter box to filter the list. See Use the QuickFilter (Filter from Memory) for more information.

  8. Click OK.
  9. Click [image] on the AWR Diff Report Generator toolbar.
  10. Select the HTML tab or the Text tab to view the report in either of those formats.

Related Topics

ADDM/AWR Overview

Working with ADDM Reports

Generating an AWR Report

Use the QuickFilter (Filter from Memory)


Generating an ASH Report

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can generate an Active Session History (ASH) report from Toad.

To generate an ASH report

  1. From the Database menu, select Monitor | ADDM/AWR.
  2. Click the ASH Report tab.
  3. Select the appropriate Instance from the Instance drop down box.
  4. Select the Starting date and time from the appropriate boxes.
  5. Select the Ending date and time from the appropriate boxes.
  6. Click [image] on the ASH Report Generator toolbar.
  7. Select the HTML tab or the Text tab to view the report in either of those formats.

Related Topics

ADDM/AWR Overview

Generating an ADDM Report

Working with ADDM Reports


Data Select Dialog

Use the Data select dialog to select the snapshot to use in the selected ADDM/AWR report. See ADDM/AWR Overview for more information.You can use this dialog to select starting and ending snapshots, or a baseline snapshot.

To access data

» In one of the ADDM/AWR report tabs, click a drill-down button to select a snapshot, SQL ID, or baseline.

Filtering the Data Grids

You can filter the data grid using the QuickFilter box at the bottom of the dialog.

To filter the grid

  1. Select the Filter by checkbox.
  2. Enter your filter criteria in the QuickFilter box below the checkbox. See Use the QuickFilter (Filter from Memory) for more information.

Selecting data

Only one row may be selected at one time.

To select data

  1. Select data by clicking on a row in the data grid.
  2. If desired, edit the query, or insert variables.
  3. Click OK.

Editing the SELECT query

When you have selected a row, you can edit the query before it is sent to Oracle. You should limit yourself to editing the WHERE and ORDER BY clauses.

To edit the query

  1. Select data.
  2. Click the Edit Query button.
  3. Edit the Where or Order By clause.
  4. Optionally, click the Check button to check your query for syntax errors.
  5. Click OK.

Related Topics

ADDM/AWR Baseline Management

Creating a Baseline


ADDM/AWR Snapshot Management

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The ADDM/AWR Snapshot Management tab lets you manage your snapshots. The Snapshot Management tab is divided into two areas: collection settings, and snapshot details.

Collection Settings

Collection settings are the settings that Oracle uses to define how often to take a snapshot and how long to keep it. The format is:

+dd hh:mm:ss:nnnnnnn.

Snapshot Interval

Snapshot interval specifies the interval at which Oracle will take snapshots. The default is one hour:

+00 01:00:00:000000

Retention

Retention specifies how long the snapshot will be maintained. The default is seven days: +07 00:00:00.000000

Top N SQL

For the Top SQL to flush for each SQL criteria, you can choose to use:

Default | Uses Top 30 for statistics level TYPICAL, and Top 100 for statistics level ALL.
Maximum | Captures the complete set of SQL in the cursor cache.
Specify | Uses the number you specify: Enter the value into the number box. This value is not affected by the statistics or flush level. It will override system default behavior for AWR SQL collection.

Snapshots

The Snapshots area displays snapshots information in a data grid. In addition, from the toolbar you can:

  • View Snapshot Statistics
  • Create a New Snapshot
  • Drop a Snapshot Range

The options change with the selection you make.

Related Topics

ADDM/AWR Overview

ADDM/AWR Create New Snapshot

ADDM/AWR Drop Snapshot Range

ADDM/AWR Snapshot Management

View Snapshot Statistics

Baseline Template Management


ADDM/AWR View Snapshot Statistics

View Snapshot Statistics

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

From the Snapshot Management tab you can view aggregate Snapshot statistics for snapshots on the current connection. In addition, if you are connected as SYS, you can also deallocate unused AWR space or shrink AWR objects.

To view snapshot statistics

  1. From the ADDM/AWR window, click the Snapshot Management tab.
  2. In the Snapshots area, statistics are displayed in a data grid. Statistics display in the columns to the right of the list of snapshot numbers.

To deallocate unused AWR space

  1. From the ADDM/AWR window, click the Snapshot Management tab.

    Note: You must be connected as SYS to perform this function.

  2. In the Snapshots area, click [image].

To shrink AWR objects

Note: You must be connected as SYS to perform this function.

  1. From the ADDM/AWR window, click the Snapshot Management tab.
  2. In the Snapshots area, click View Snapshot Statistics.
  3. Click [image].

Related Topics

ADDM/AWR Overview

ADDM/AWR Create New Snapshot

ADDM/AWR Drop Snapshot Range

ADDM/AWR Snapshot Management

Baseline Template Management


ADDM/AWR Create New Snapshot

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can create a new snapshot from the ADDM/AWR window. See ADDM/AWR Overview for more information about the ADDM/AWR window.

To create a new snapshot

  1. From the ADDM/AWR window, click the Snapshot Management tab.
  2. In the Snapshots area, click [image].
  3. Select one of the following options:
    • Flush Level: Typical
    • Flush Level: All

  4. Click OK to create the snapshot.

    Note: An information window displays listing the Snapshot ID of the new snapshot: for example, "Snapshot ID 6517 has been created."

  5. Click OK.

Related Topics

ADDM/AWR Overview

ADDM/AWR Drop Snapshot Range

ADDM/AWR Snapshot Management

View Snapshot Statistics

Baseline Template Management


ADDM/AWR Drop Snapshot Range

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To drop a snapshot range

  1. From the ADDM/AWR window, click the Snapshot Management tab. See ADDM/AWR Overview for more information about the ADDM/AWR window.
  2. Select the snapshots you want to drop.
  3. In the Snapshots area, click Drop Selected Snapshots.
  4. Beside the Starting Snapshot box, click [image].
  5. In the Data Select Dialog, select the starting snapshot and click OK.
  6. Beside the Ending Snapshot box, click [image].
  7. In the Data Select Dialog, select the ending snapshot and click OK.
  8. Click OK to confirm.

Related Topics

ADDM/AWR Overview

ADDM/AWR Create New Snapshot

ADDM/AWR Drop Snapshot Range

ADDM/AWR Snapshot Management

View Snapshot Statistics

Baseline Template Management

Data Select Dialog


ADDM/AWR Baseline Management

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can use the Baseline Management tab to view and control various baselines for ADDM/AWR reports. See ADDM/AWR Overview for more information.

You can view established baselines from the navigator on the left side of the window. Baselines are listed by name in the grid. Baselines are listed by Database ID, but the grid can be sorted by any column by clicking in the column header.

To view a baseline

» In the Baselines navigator, click on a baseline name.

The baseline information displays in the right hand area, and includes:

  • Baseline ID.
  • Baseline Name.
  • Starting Snapshot ID.
  • Starting Snapshot time.
  • Ending Snapshot ID.
  • Ending Snapshot time.

Related Topics

ADDM/AWR Overview

ADDM/AWR Create New Snapshot

ADDM/AWR Drop Snapshot Range

ADDM/AWR Snapshot Management

View Snapshot Statistics


Creating a Baseline

You can create a new baseline range of snapshots from the ADD/AWR window.

When creating a baseline, the Baseline ID, starting Snapshot Time and ending snapshot time are set automatically.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To create a new baseline

  1. From the ADDM/AWR window, click the Baseline Management tab.
  2. Click [image].
  3. Enter a name for the baseline in the Baseline Name box.
  4. Enter a starting Snapshot ID, or click [image] and select one from the Data Select Dialog.
  5. Enter an ending Snapshot ID, or click [image] and select one from the Data Select Dialog.
  6. Enter the number of days you want to leave the baseline active in the Expiration box. If you do not want to the baseline to expire, leave this box blank.
  7. Click OK.

Related Topics

ADDM/AWR Overview

ADDM/AWR Baseline Management

Dropping a baseline

Data Select Dialog


Dropping a baseline

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can easily drop a baseline from the ADDM/AWR Reports | Baseline Management tab.

To drop a baseline

  1. In the Baselines grid select the baseline you want to drop.
  2. Click [image].
  3. Choose to either:
    • Drop Baseline only

      • Drop Baseline and all Associated Snapshots

      Note: Dropping all associated snapshots could impact other baselines.

  4. Click OK.

Related Topics

ADDM/AWR Baseline Management

Creating a Baseline


ADDM Baseline Template Management

Baseline Template Management

If you are using Oracle 11g or higher, you can use the ADDM/AWR reports page to track your baseline templates.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Viewing Baseline Template Information

When you view the baseline template information, Toad places all templates into a data grid

To track baseline template management information.

  1. From the Database | Monitor menu, select ADDM/AWR.
  2. Click the Baseline Template Management tab.
  3. You now can sort the template grid by any column desired: click on the column heading to do so.

Creating New Templates

You can create a new baseline template directly from this window. See Oracle's documentation for more information.

To create a new template

  1. From the ADDM/AWR window, click the Baseline Template Management tab.
  2. Click [image].
  3. In the Create Baseline Template window, enter a name for both the template and the baseline in the appropriate boxes.
  4. Select either Expression or Literal for the start time, and select a start date and time from the drop down boxes.
  5. Select either Expression or Literal for the end time, and select an end date and time from the drop down boxes.
  6. In the Expiration box, enter the number of days until the baseline template expires, or leave it blank for no expiration.
  7. If the template will be repeating, select the Repeating checkbox and enter the Day, Hour and duration the template should repeat.
  8. Click OK to create the template.

Dropping a Baseline Template

  1. From the ADDM/AWR window, click the Baseline Template Management tab.
  2. Select the template you want to drop.
  3. Click [image].
  4. Click Yes to confirm.

Related Topics

ADDM/AWR Overview

ADDM/AWR Create New Snapshot

ADDM/AWR Drop Snapshot Range

ADDM/AWR Snapshot Management

Baseline Template Management


Database Browser

This window lets you see information across multiple schemas or servers. You can select multiple schemas or servers; view a variety of summary information for them; perform pings and tnspings on them; or open common Toad windows for them.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Notes:

  • Some V$ synonyms are required for this feature. See V$ Tables Required for more information.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the Database Browser

» SelectDatabase | Monitor | Database Browser.

Tree view

The left side tree view is initially created from your tnsnames file and then saved into a file called DatabaseBrowser.tdb in your Toad directory. You can add or delete server and schema nodes to make the tree more manageable. You can also check the Connected servers only box to display only the connected servers.

Database Nodes

You can set properties for individual nodes by selecting a node, right-clicking it and choosing Properties. You can also perform the following operations on nodes:

  • Connect
  • Disconnect
  • Associate with a schema (valid only for schema nodes)
  • Rename
  • Remove
  • Startup
  • Shutdown
  • Alter
  • View and modify properties, including default schema and choosing to auto connect

These operations can be performed on multiple database nodes at the same time. For instance you can connect to multiple servers by selecting them and choosing Connect. If you choose Connect while on a server node, connections will be created for all the database nodes under that server.

Database Objects nodes

Beneath the database node is a group of object nodes for that database. Click on one of these to open an embedded Schema Browser for that object type in the right hand side of the Database Browser. See About the Schema Browser for more information.

In addition to the standard objects, there is also a Schema Objects node. Click this node to open an embedded schema browser in which you can limit your browsing by schema as well as object type.

Summary Information

Select a node or group of nodes from the tree view. On the right hand side of the window, summary information is displayed for the connections you have selected.

In some cases you can get "roll up" information for all of your databases or servers at once. For example

  • Space Usage tab displays totals for Megs Allocated, Used and so forth
  • Datafile IO tab displays the Total IO of all your selected databases.

Tabs provide access to the summary information as follows:

  • Overview
  • Instance
  • Database
  • Options
  • Parameters
  • Sessions
  • Top Sessions
  • RBS Activity
  • Space Usage
  • Datafile IO

The Instance and Database tabs offer two views: single record and grid view. The single record view is useful on these tabs because of the number of columns displayed.

The Top Sessions tab has a SQL tab at the bottom. This tab allows you to view the full, formatted SQL statement of the current record selected on the Grid tab.


Toad Database Monitor

Database Monitor

The Database Monitor lets you track database performance with nine charts: Logical IO, Physical IO, Event Waits, Sessions, Call Rates,Miss Rates,SGA Memory Usage,Shared Pool, and Indexed Queries %. There is a horizontal scroll bar to allow you to see all the charts.

The Database Monitor must be launched in order to track performance. So you can launch it in the morning, minimize the window, and later in the day if a threshold is crossed you will be alerted. In addition, if you have a Toad Edition that includes Spotlight on Oracle, or Spotlight on Oracle for RAC, the notification icon in the task bar can also be used to launch Spotlight.

Note:

  • This feature requires access to some V$ tables. See V$ Tables Required for more information.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the Database Monitor

» Select Database | Monitor | Database Monitor.

RAC Connection

Within the database monitor, all information is provided by single connections. However, it is summarized or aggregated for all the instances that compose the RAC cluster. For example, looking at SGA memory - if each RAC instance is 150 MB, and you have two RAC instances, this column will display 300MB.

SYS View Warning

When you first log into the Database monitor, you may get a warning dialog box stating that you are missing the "SYS view, X_$KSLLT" view. Without this view, the Latch series on the Miss rates chart will be zero.

  • If this dialog box displays, you can check the "Don’t show this message again" checkbox in the lower left corner and it will not display again. In order to obtain data for the latch series, connect as SYS and execute the following SQL:

    CREATE OR REPLACE VIEW x_$ksllt AS SELECT * FROM x$ksllt;

    GRANT SELECT ON sys.x_$ksllt TO PUBLIC;

  • Click Close to continue using the Database Monitor.

Zoom

To zoom a graph

» Zoom in on a specific area by dragging a rectangle from left to right around the area you want to zoom.

To restore a graph

» Drag a rectangle from the right to left, and the chart will zoom back to 100%.

Save

To save a graph

  1. Right-click the graph you want to save and select Save.
  2. Select the format you want the file to have:
    • XLS
    • HTML
    • Bitmap
  3. Enter a filename for the graph, or use the default.
  4. Click OK.

Related Topics

Database Monitor Options

Database Monitor Email Alerts


Database Monitor Email Alerts

The alerts window displays all alerts that have occurred since you either opened the monitor or last cleared the window. Emails are listed at the bottom of the window.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To view email alerts

  1. On the toolbar, click [image].
  2. Click one of the following:
    • Clear to clear the alerts
    • Close to close the window

      • Save to save the alerts as a text file

      Note: In addition, you can choose to enable or disable alerts. If you have enabled email alerts, you will need to set up your email options from the View | Options | Email window.

Related Topics

Database Monitor

Database Monitor Options

Email Settings


Flushing the SGA Cache

Flushing the SGA or Buffer Cache

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

From the Database Monitor you can flush the SGA or the buffer cache.

» Click [image] and select either Flush SGA or Flush Buffer Cache (Oracle 10g and up only).

Related Topics

Toad Database Monitor


Database Monitor Options

These options control how the Database Monitor displays data.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Refresh rate

The graphs and the monitor refresh at an adjustable interval.

  • Select the appropriate interval from the drop-down Refresh rate menu. If you have checked the auto refresh checkbox, the window will automatically refresh at the interval you select.

You can also refresh the window manually by clicking the Refresh button.

Window

Use the Window box to specify how much graph data to display in the graphs. Options include one, two, six, twelve and twenty-four hours.

Note: The zoom amount will be twice the selected number.

TNS Ping checkbox

If checked, Toad will ping the Oracle server (using TNS ping) before it runs the query to refresh the data on the charts.

Ping checkbox

If checked, Toad will perform a TCP/IP ping to the Oracle server before it runs the query.

Related Topics

Database Monitor

Database Monitor Email Alerts


Database Probe Overview

The Toad Database Probe is a real-time monitoring window that offers a large collection of alerts. You can also create your own alerts.

The database probe does not automatically do a full refresh upon opening. If you would like it to do so, you can change the probe Settings.

Notes:

  • This feature requires access to some V$ tables. See V$ Tables Required for more information.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the database probe

» Select Database | Monitor | Database Probe.

Read the Probe Information

The probe window is divided into five zones, or collections of display controls. These roughly correspond to the layout of the window. See Database Probe Settings for more information.

The database probe has its own toolbar as well as status bar. A warning icon can display to the left of each data control when an alert is tested and fired and you have chosen that area of the screen to show an icon.

To read an alert

  1. When an alert fires, the warning icon [image] displays to the left of the data control.
  2. Click the icon to display a dialog box revealing details about the alert.
    • The group box caption shows the name of the alert.
    • The detail window shows the alert description.
    • Below the detail window the alert expression displays.
    • A checkbox offers the possibility to turn the alert off.

The Database Probe alert definitions and options are stored in an INI file called "DatabaseProbe.INI". Information gathered from the database regarding the alerts is displayed as follows:

  • The information displayed reflects standard Oracle statistics. See Oracle's documentation for more information.
  • The result of number/number represents used/max
  • For example, 2/170 is 2 total sessions out of a possible 170.
  • - represents either a NULL value or "invalid for the current connection version"

Upgrade Definitions and Options

The Database Probe alert definitions and options are kept in an INI file called "DatabaseProbe.INI". Future upgrades to Toad may include an updated DatabaseProbe.ini file as well. If you have made changes to your alerts, you may want to back them up in a separate file. When a new DatabaseProbe.ini is provided, you can compare the files and only add the parts of the new ini file that you want to include in your alerts. See Compare Files and Objects for more information.


Database Probe Toolbar & Status Bar

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Toolbar

Icon | Command
 | Select a different session.
 | Refresh all five zones and reset the refresh timers. The drop-down offers a list of each zone. Selecting an individual zone will refresh just that zone.
 | Flush SGA or Flush Buffer Cache (Oracle 10g only).
 | Open Quest Spotlight (if you have it installed) to the active connection.
 | Display the Settings dialog box.

Status bar

The status bar displays the names of queries as they are executing during zone refreshes. It also displays the connection string for the active window connection.

Related Topics

Database Probe Overview


Database Probe Settings

From the Settings dialog box of the Database Probe, you can change several types of settings for the Database Probe. These include refresh rates, alerts, and several miscellaneous settings.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access settings

» Click [image] on the DB Probe toolbar.

Settings tab

Refreshes

The Refresh tab of the Settings window allows the user to set a refresh rate or no refresh at all. The available refresh rates are 15 seconds, 30 seconds, 1 minute, 5 minutes, and 15 minutes.

Note: The Lock checkbox in the SGA area is only applicable on non-Windows servers.

  • DBWR, LGWR, ARCH, Phys reads/writes
  • Files
  • Overhead

Gauges

Use the Gauges area to set the colors used for alerts, and warning levels for the Redo logs and data files.

Active Alert Count

The Active Alerts count displays the number of active alerts. An alert can be active or inactive. It is only active alerts that potentially impact the performance of a zone refresh.

Alerts

The Alerts tab of the Settings dialog box displays all the alerts currently in Probe, including

  • active or inactive (Only active alerts are tested during their relevant zone refresh.)
  • name
  • description

An alert is a user-defined event. It reads the data on the main window and issues a warning by a display icon. An alert consists of an expression representing a formula. The formula is then used to determine whether to fire the alert.

For example, you may want an alert to fire if the number of active sessions matches the number of total sessions. An Alert can be inactive; inactive alerts are not tested when operands are refreshed. Alerts can be tested, fired, and extinguished.

You can add alerts, edit or delete selected alerts, activate or deactivate them individually or all at once.

Activate or deactivate alerts by clicking in the checkbox in the Active column. Alternately, click the Activate All or Deactivate All buttons to the right of the alert grid.

Tested

When a refresh occurs on an operand that is being used by an alert, then the alert for that operand is tested. This means the alert expression is evaluated.

Evaluation consists of a process whereby the operand identifiers in the expression are replaced with their on-screen data values and any embedded queries within the expression are executed and the resulting value is substituted.

  • If the resulting expression evaluates to TRUE, then the Alert is fired.
  • If it evaluates to FALSE, the Alert is extinguished.

Fired

This happens when an alert is tested and evaluates to TRUE. When an alert fires, the warning display icon for it becomes visible.

Extinguished

This is what happens when an alert is tested and evaluates to FALSE. When an alert is extinguished the warning icon for it is hidden.

Alert Map

You can check the map of alerts by clicking the Show Map button.

The Alert Map is a convenient way to see the operands on the main window that have alerts associated with them. When the cursor is passed over alert icons, the alert expression for it is displayed as the hint text.

Related Topics

About Data Pump

Import with Data Pump

Export with Data Pump


Adding and Editing Alerts

See Database Probe Overview for more information.

Note: This feature is available in the Professional Edition and higher, or with the optional DB Admin Module.

To add an alert

  1. From the Database Probe window, click [image] on the toolbar.
  2. Click the Alerts tab.
  3. Click Add. Enter the information in the dialog box to create an alert as described below.

General Area

Name

Enter the alert name. This is used to identify the name of the alert for display purposes within the Alerts grid in the Settings dialog box. Alert names must be unique.

Active

This determines whether the alert is tested during relevant zone refreshes.

Alert position

This is the on-screen position of the icon, displaying when the alert fires. A drop-down list of possibilities is offered. Alternately, you can choose from a graphic display:

  • Click [image], to access the Alert Icon Selection window. This window looks like the main probe window but with all available alert icons visible.
  • Click on one of the available icon positions to use. The current one, if one has already been selected, blinks.

When an icon is clicked, this dialog box is closed and the name for that icon is chosen in the Alert position drop down.

Note: Only unused alert positions or inactive alert positions are available choices.

Description

Enter a description of the alert.

Refreshes before computing

Each alert is associated with one or more zones. The zone(s) associated with an alert is determined by the Probe operands used in the Alert Expression. When an alert is associated with more than one zone, the zone with the fastest refresh rate determines when the alert fires. This value determines how many actual refreshes of that zone must occur before the alert is tested.

For example, if the alert is associated with a zone. This zone is refreshed every 15 seconds and you may not want the alert to be tested every time (testing each time can slow down the refresh). It may be more useful to have the alert tested every 2 minutes, and you would enter an 8 here.

Expression Builder

Expressions are the driving force behind an alert; the expression tells Toad what should be tested when it tests an alert.

An alert expression consists of one or more Probe operands, one or more queries (must be enclosed in double-quotes), and operators listed. The relational operator in the center of the expression determines how the sides of the expression are compared to each other to determine if the evaluation is true.

  • Each operand, query, and operator in the expression must be separated by spaces.
  • Query SELECT statements must be enclosed in double-quotes and must return a numeric value in the first field. This value is then used as the substitution value in the expression. An example of this is the provided alert named "Mismatched Redo Log Size".

To use the expression builder

  1. Drag-and-drop one or more Probe operands from the treeview into the left and/or right sides of the expression.

    Note: Operands are grouped by zone. Operators can also be dragged and dropped, or typed directly.

  2. Choose a relational operator.
  3. Click Test to test the expression to see if the math expression evaluator can turn the string expression into a mathematical formula.

Related Topics

Database Probe Overview


Index Monitoring

Oracle versions 9i and later provide a means of monitoring indexes to determine whether or not they are being used. You can then drop unused indexes to eliminate unnecessary statement overhead.

The Index Monitoring grid displays information such as monitoring status, start time, end time and usage. Whenever you enable monitoring, Toad resets these statuses for the specified index. You can always see your own indexes. To see another user’s indexes you must have access to the SYS.OB$, SYS.IND$, SYS.USERS$ and SYS.OBJECT_USAGE views and the ALTER ANY INDEX privilege.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access Index Monitoring

» Select Database | Monitor | Index Monitoring.

Related Topics

Deactivating Index Monitoring

Activating Index Monitoring


Activating Index Monitoring

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can monitor all indexes, or only selected indexes.

To monitor all indexes

  1. From the Database menu, select Monitor | Index Monitoring.
  2. Select a schema from the Indexes Owned By drop down menu.
  3. Click [image] and select Begin monitoring all indexes.

To monitor selected indexes

  1. From the Database menu, select Monitor | Index Monitoring.
  2. Select a schema from the Indexes Owned By drop down menu.
  3. Select one or more indexes in the data grid.
  4. Click [image] and select Begin monitoring selected indexes only.

Related Topics

Index Monitoring

Deactivating Index Monitoring


Deactivating Index Monitoring

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

When you have completed monitoring for a period, you can turn off Index Monitoring.

To deactivate index monitoring on all indexes

  1. From the Database menu, select Monitor | Index Monitoring.
  2. Select a schema from the Indexes Owned By drop down menu.
  3. Click [image] and select End monitoring all indexes.

To deactivate index monitoring on selected indexes

  1. From the DBA menu, select Index Monitoring.
  2. Select a schema from the Indexes Owned By drop down menu.
  3. Select one or more indexes in the data grid.
  4. Click [image] and select End monitoring selected indexes only.

Related Topics

Index Monitoring

Activating Index Monitoring


Instance Manager

The Instance Manager is designed to allow you to check on the status of the various databases you can access. All databases in your TNS Names file are displayed.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the Instance Manager

» From the Database menu, select Database | Monitor | Instance Manager.

Refresh Rate

Select the time interval for automatically refreshing your data. If the Auto refresh data checkbox is unchecked, it doesn’t matter what is selected here, as the data will not be refreshed.

Auto refresh data

Checked, this option automatically refreshes the data according to the rate you have set in the Refresh Rate drop-down. Unchecked, you will have to refresh the data manually, no matter what is set in the Refresh Rate box.

Polling Priority

The thread cycling through the database will be assigned the operating system priority you select from the drop-down. If you select Idle the thread will only execute when the system is idle; Windows will not interrupt other threads.

Start

Click this button to start monitoring the info about your databases. If you have Auto refresh cleared, you can use this button to monitor selected databases manually. When Toad is gathering , this button changes to read Stop so that you can stop polling.

Tabs

In addition, there are three tabs to see the status.

The Status tab displays the status of the Node, Listener and Database. See Instance Manager - Status Tab for more information.

The Status change history displays any changes made to your databases in a grid format.

The Detail log displays all reports from the Server Manager or SQL.

Buttons

You can Startup or Shutdown a database using the Startup or Shutdown button at the bottom of the Status Tab.

Note: The database to be shutdown/started requires a password file and remote_login_passwordfile=EXCLUSIVE must be set in the pfile (typically INIT.ORA or INIT<sid>.ORA. If you have created the database with the New Database Wizard, it will already have this file built. If you created the database in another manner, you will need to be sure it has the password file set properly.

In addition, you can:

  • Build init.ora... - This button builds an init.ora file for the currently selected username.
  • Refresh current - This button manually refreshes the display of current connections.

Related Topics

Instance Manager - Alter

Instance Manager - Shutdown

Instance Manager – Startup

Instance Manager - Status Tab


Instance Manager - Status Tab

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The Status tab in the Instance Manager displays the status of your databases.

Data Status

Toad pings the Listener, the Node, and the Database and displays the results as follows:

Icon

Meaning

Unknown. Toad can’t determine the status. For example, no database connect information is specified, and Instance Manager cannot test the status of the database.

Could not connect.

  • Database: an Oracle test connection failed.
  • Listener: tns ping did not return a response.
  • Node: unable to ping the server.

Connected.

  • Database: the database is started, mounted, and open.
  • Listener: tns ping successfully pinged and listener is up.
  • Node: server successfully pinged and node up.

Started. This checkmark is only seen in the Database column, when the database has been started, but not mounted or opened.

Mounted. This checkmark will only be seen in the Database column, when the database has been started and mounted, but is not currently open.

You can select one of the various database connections accessible from your machine and adjust the Startup, Shutdown, or Alter information for checking the instances.

Grouping databases

You can group your databases in the grid to more easily differentiate them. For example, you could group by whether or not you are monitoring the database so that you have a smaller grouping to watch.

To group the data grid

» Drag the header of the column you want to group by into the Group by area at the top of the data grid.

Checking a Database

In order to retrieve information about a particular database, you must enter login information for that database. Toad will use this information to check that the database is up. The connection will then be immediately closed.

To enter login information

  1. In the grid, click in the logon info for database test column and then click the drop-down arrow for the appropriate database.
  2. Select one of the previous connections OR select New.
  3. If you selected New, the New connection dialog box displays.
  4. Enter the appropriate information in the Username and Password boxes and then click OK.
  5. Click Refresh to force Instance Manager to check the database immediately.

Related Topics

Instance Manager

Instance Manager - Alter

Instance Manager - Shutdown


Instance Manager - Startup

Instance Manager – Startup

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can start databases from the Instance Manager in several different modes. Be aware, however, that Instance Manager uses SQL*Plus to start up and shut down databases.

To start a database

  1. From the Instance Manager’s Status tab, select the server/database you want to start.
  2. Click Startup.

    3. Enter a username and password that can connect as SYSDBA or as SYSOPER.

    Note: Passwords are only saved if View |Toad Options | Oracle |Save passwords for Oracle connections is checked.

  3. Select SYSDBA or SYSOPER from the drop-down.

    4. Select the startup options you want to use.

    Open

    Select open to open a database completely. This is the standard selection and allows all authorized users to log in and use the database.

    Mount

    Select Mount if you want to mount the database but not actually Open it. Mount allows you to do some basic Oracle alterations that you cannot perform if the database is completely opened.

    Nomount

    Select Nomount if you want to put the database into the started mode.

    Force

    If you try to Startup an instance of a database that is already running, the command will result in an error. In some cases, however, you may want to restart a database, for example during debugging or under abnormal circumstances.

    To do this, check the Force box. This will shut down the current Oracle instance using the Shutdown mode Abort. Then Toad will continue with its startup procedures.

    Exclusive

    If Exclusive is checked, the database can only be mounted and opened by the current instance. It cannot be opened simultaneously by multiple instances. Exclusive cannot be used with SHARED, PARALLEL, OR NOMOUNT.

    If no mounting option is specified, EXCLUSIVE will be assigned by default.

    Unchecked, the database can be opened simultaneously by multiple instances, making SHARED, PARALLEL and NOMOUNT possible.

    Enter the full pathname for the parameter file you want to use, or click Browse and select it from the browse window.

    Note: If you have shut down this database from Toad, Toad has saved the parameter file in the Toad directory. This file is the default pathname when you restart the database.

  4. Click OK.

Related Topics

Instance Manager

Instance Manager - Alter

Instance Manager - Shutdown

Instance Manager - Status Tab


Instance Manager - Shutdown

In order to shut down a database, you must have SYSDBA or SYSOPER privileges. Be aware, however, that Instance Manager uses SQL*Plus to start up and shut down databases.

Notes:

  • This feature requires access to some V$ tables. See V$ Tables Required for more information.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To shut down a database

  1. From the Status tab, select the database you want to shut down, and then click Shutdown.

    2. Enter the Username and Password in the appropriate boxes and select either SYSDBA or SYSOPER from the drop-down menu.

    Note: Passwords are only saved if View | Toad Options | Oracle | Save passwords for Oracle connections is checked.

  2. Choose the Oracle mode you want to use to shut down the database: Normal, Immediate, or Abort
  3. Click OK. The dialog box closes and the database shuts down. This is displayed in a status line in the lower right corner of the Instance Manager window as it is occurring.

When the Database has been shut down, an entry is made in the Status change listing, and the Server Manager or SQL report is appended to the Detail Log.

When you shut down a database, Toad creates a folder called DBA in the Toad directory. In that folder, Toad stores an .ora file for the parameters that are not default parameters. In addition, a file called startupshutdownlog.txt is created and contains the contents of the detail tab.

When Instance Manager performs a shut down, it queries the v$parameter table to build an INIT.ORA file for subsequent startups. This file is stored in Toad\DBA and is named pfile_SID.ora (where SID is the database alias). To perform this query, a temporary database connection is created, using the shutdown connection information provided on the "shutdown" dialog box.

Note: On 7.3.4 clients, if the database is not already open, in other words, if it is unmounted or mounted, this SYSDBA/SYSOPER temporary connection is not supported. Thus, on 7.3.4 clients you cannot shut down a database that is not open. ALTER operations continue to work, however, because they use server manager only, and do not attempt to create this temporary database connection.

Related Topics

Instance Manager

Instance Manager - Alter

Instance Manager – Startup

Instance Manager - Status Tab


Instance Manager - Alter

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Using the Alter command from the Instance Manager allows you to alter the state of the selected database.

In order to alter the status of a database, you must have SYSDBA or SYSOPER privileges.

To use the alter command

  1. From the Status tab, select the database you want to change status, and then click Alter.

    2. Enter the Username and Password in the appropriate boxes and select either SYSDBA or SYSOPER from the drop-down menu.

    Note: Passwords are only saved if View | Options | Oracle | Save passwords for Oracle connections is selected.

    Choose the operation you want to perform on the database. You can either Mount or Open the database.

    Note: If the database is in Start mode, you must manually mount the database before you can open it. In order to open the database, mount it, then select it in the Status tab and select Alter again to open it.

Related Topics

Instance Manager

Instance Manager - Shutdown

Instance Manager – Startup

Instance Manager - Status Tab


Session Browser Overview

The Toad Session Browser lets you easily view and work with sessions. Information on all sessions is organized in grid form, and the session that opened the Session Browser is displayed in red. From the Session Browser you can:

  • Organize session views
  • View detailed information, including advice about selected waits.
  • Kill sessions
  • Start traces
  • Stop traces
  • View locks being held or acquired by sessions
  • View transaction information for online rollback segments

Tip: To hide, rename, and rearrange the tabs that display on the right-hand side, right-click a tab and select Configure.

To access the Session Browser

» From the Database | Monitor menu, select Session Browser.

Related Topics

Kill or Disconnect Sessions

Trace Sessions


Flip the Session Browser Layout

The Session Browser default is laid out in two vertical panes, the left containing the tree view and the right containing details. If this makes it too difficult to view all the provided information, you can flip the layout so that the panes are on top of each other.

If you choose to flip the form layout, references to the left pane will now refer to the top pane, and right pane to the bottom pane.

To flip the form layout

» From the main Session Browser toolbar, click [image].

Related Topics

Session Browser Overview


Viewing Sessions

There are potentially thousands of sessions in a database at any one time. It is therefore practical to organize and present them for easier management.

The left side of the Session Browser displays one or more columns queried from V$SESSION. From this panel, you can

  • Group the rows returned from V$SESSION in seven different ways
  • Filter the rows to display a smaller subset of rows

Related Topics

Session Browser Overview

Filtering Sessions

Grouping Sessions


Grouping Sessions

Grouping sessions in the Session Browser is a matter of choosing which field you want to use to view sessions.

For example, you choose to view all the sessions for a given user, and the left pane tree will be organized by user.

You can group your sessions by

  • program through which the session is running
  • user
  • session status
  • server on which the session is running
  • session type
  • resource consumer group
  • operating system user

To group sessions

» Do one of the following:
  • Right-click in the top pane and choose Group by.
  • Select the drop-down on [image].

The tree will refresh and group sessions according to the column you have chosen, with the caption of the first column updated to reflect the new organization.

Related Topics

Session Browser Overview

Filtering Sessions


Filtering Sessions

You can filter the sessions shown in the top panel of the Session Browser in two ways: user defined filters or static filters.

User Defined Filters

User defined filters represent either a condition or a subquery which is performed on the result set. You define the criteria and name it. It is then saved to disk in a file called Toad_SESSBROWFILTERS.INI which resides in the same directory as TOAD.INI. See Properties Files for more information about locations of these files.

Static Filters

You can also choose a static filter. A static filter is a pre-defined, read-only filter which is used in combination with a user-defined filter.

Related Topics

Session Browser Overview

Editing a User Defined Filter

User Defined Filters


Session Browser: User Defined Filters

User Defined Filters

User defined filters in the Session Browser represent either a condition or a subquery which is performed on the result set. You define the criteria and name it. It is then saved to disk in a file called Toad_SESSBROWFILTERS.INI which resides in the same directory as TOAD.INI. See Properties Files for more information about locations of these files.

To create and manage user defined filters

» Click [image] on the Sessions tab.

Note: If there is a filter in effect, this button will be red.

Left Side Panel

The left side of the Filters dialog box displays a list of currently defined filters.

Minimum version

When a filter is created, the list of columns which have been included in the expression is parsed and checked against the known list of columns for the various Oracle versions.

If you choose a column which is not in an earlier version of Oracle, the expression will be evaluated and the minimum Oracle version required will be stored as part of the filter. When a user opens the Session Browser, only filters which are valid for the current Oracle connection are presented in the drop down filter list at the top of the window.

Right Side Panel

The right side shows the filter expression as it has been evaluated by the Session Browser, and in essence represents the query which will be executed to populate the top panel tree view in the Session Browser. This area is read-only.

For convenience, the name and location of the filters INI is shown in the status bar of this window.


Adding a User Defined Filter

You can define your own filters to organize your sessions in the Session Browser.

To add a filter

  1. Click [image] on the toolbar.
  2. Click Add.
  3. Enter a name in the Filter Name box. This should be descriptive enough that the filter is easily identifiable.
  4. Enter the expression in the Expression box.
  5. When you have created the expression, click Test to build a query around it and show the results in the Filter Test window. This is a simple way to ensure you have built a query expression with correct syntax and that you are getting the result set you expect.
  6. When you have a filter completely defined, click OK to save it to the Toad_SESSBROWFILTERS.INI file. See Properties Files for more information about locations of these files.

Features of the Add Filter dialog box

Expression box

You can enter text manually or use the selection boxes beneath it to drag-and-drop or double-click elements to include in the expression.

Columns

The columns tree displays all the columns for each of the three views that can be included in the filter. When selecting columns from the tree view, an alias is prefixed onto the column name according to its originating view.

View | Prefix
V$SESSION | .s
V$PROCESS | .p
V$SESS_IO | .io
Note: If you manually type columns into the expression box, this alias convention must be followed for the filter to work.

Lookup

The lookup button performs a distinct select of the values for the column on the underlying view. For example, if you want to restrict the sessions returned for a list of users, you could select the Username column under the session tree view node and click Lookup.

You can have multiple lookup windows open at once. This window can be useful for large lists or for number columns on which you want to perform a range check, as it will display the lower and upper limits currently in the database.

To use lookup

» Select a column in the columns area and click Lookup.

A small stay-on-top window displays, containing the values found in the column. From this small window you can:

  • double-click values to copy them to the expression box
  • drag and drop values into the expression box
  • multi-select and then drag-and-drop the selected values into the expression box
  • choose to close the window immediately after making your selection.

In the case of string values, the values will be delimited by single quotes when copied to the expression box.


Editing a User Defined Filter

You edit a user defined filter in the Session Browser in much the same way as you add a new one. Any part of the filter can be edited, including the name.

To edit a user defined filter

» From the Session Browser Filter dialog box, select the filter you want to edit and then click Edit.

When the Edit Filter dialog box displays, you can use the same tools described in the Adding a User Defined Filter topic.

Related Topics

Session Browser Overview

Filtering Sessions


Deleting a User Defined Filter

You can delete a user defined filter in the Session Browser, whether it is one you have created or a standard filter provided with Toad.

To delete a user defined filter

  1. From the Session Browser Filters dialog box, select the filter you want to delete and then click Delete. See Filtering Sessions for more information.
  2. Click OK.

    3. Note: If you edit or delete standard filters they will be removed from the toad_sessbrowfilters.ini file. It is recommended that you keep a backup of this file if you change these. (See Properties Files for more information about locations of these files.)

Related Topics

Session Browser Overview

Filtering Sessions


Static Filters

In the Session Browser, a static filter is an internal condition which can be applied on its own or in conjunction with a user defined filter.

To apply a static filter:

  • On the Sessions tab, click [image] (click the arrow) and select one of the following:
    • Exclude NULL and SYSTEM OS Users
    • Exclude parallel slaves
    • Exclude background TOAD sessions

When you select a static filter that filter is marked with a check and the filter icon turns red.

You can select more than one static filter at a time, and they can be combined with a user defined filter (in which case they are included as an AND condition at the end of the user defined filter expression). See Adding a User Defined Filter for more information.

Exclude NULL

( (s.USERNAME is not null) and (NVL(s.osuser,''x'') <> ''SYSTEM'') and (s.type <> ''BACKGROUND'') )

Exclude slaves

(s.ownerid = 2147483644)

See Parallel Slave Processes for more information.

Related Topics

Session Browser Overview

Adding a User Defined Filter

Parallel Slave Processes


Parallel Slave Processes

Oracle can parallelize certain SQL operations. This involves breaking the task into smaller units, each of which are handled by a separate process. These separate processes show up in the V$SESSION view yet they cannot be killed or traced, as they are owned by the processes which spawned them. On the left side tree view they display as subnodes under the process which owns them.

Parallel slave processes are the only nodes which display on the third level in the tree.

Note: When a top-level node in the treeview (such as program name) is selected, the detail tabs do not automatically show information for the sessions for parallel slaves. If you want to see details for a parallel slave, you will need to select the master session or the slave itself.

When a parallel slave process is fetched from the pool of available slaves, they display in V$SESSION until the task is complete and then they return to the pool.

An example query which creates these processes might be:

select /*+ parallel(x,4) parallel(y,4) */ * from all_objects x, all_objects y;

Slaves display in V$SESSION with an ownerid which is not equal to 2147483644. That is, all non-slave sessions have an ownerid of 2147483644. For slaves, the value of ownerid is a 4 byte value, the low-order 2 bytes of which represent the session number of the owning session and the high order bytes are the query coordinator.

There is a static filter which can prevent these from displaying in the tree. See Static Filters for more information.

Related Topics

Session Browser Overview

Static Filters


Selecting Columns to Display

Most of the columns from V$SESSION can be included for display in the left side tree view of the Session Browser.

If you have selected more than one column, you may need to scroll to view them. Columns may be rearranged by dragging and dropping them in the location you want. However, the first column cannot be repositioned, and you cannot drag a column to replace the first column.

To display V$SESSION columns

  1. Select the Sessions tab.
  2. Do one of the following:
    • Right-click in the top panel tree view, select Visible Columns and then select the column you want to display. From the right-click menu, columns must be selected individually.
    • Click [image] on the toolbar to select multiple columns at once.

Calculated V$SESSION column

Included in the list is one calculated column as well: Last_call. This is computed as:

SYSDATE-Last_call_et

Last_call_et is the number of seconds since the last session call and Last_call is a more useful presentation of this value. Last_call essentially tells you how idle a connection has been.

Related Topics

Session Browser Overview


Viewing Sessions Detail Information

The right side of the Session Browser reflects detail information for the selected sessions on the left side. You can select one session, or multiple sessions to view aggregate information.

To view sessions information

» In the top panel, click the Sessions tab. Select one or more sessions.

Related Topics

Session Details

Process Details

IO Details Tab

Waits Details

Current Statement Details

Open Cursors Details

Access Details

Locks Details

RBS Usage Details

Long Ops Details

Statistics Details


Session Details

Session details in the Session Browser are provided using the following query:

SELECT * FROM V$SESSION WHERE {currently selected left side SIDs}

You can use the tabs at the bottom of the Session page to select single view or multi- view.

Single Record View

The single SID view provides you with more columns of information about the selected session.

To view information for a single record

  1. In the left panel, select the session you want to view.
  2. On the right panel, click the Session tab.
  3. At the bottom of the page, click the Single tab.

Multi Record View

The multi-record view provides you with aggregate information for all selected sessions.

To view information for multiple records

  1. In the left panel, multi-select the sessions you want to view. All sessions must be within the same node.
  2. On the right panel, click the Session tab.
  3. At the bottom of the page, click the Multi tab.

Related Topics

Session Browser Overview

Viewing Sessions Detail Information


Process Details

Process details in the Session Browser are provided using the following query:

SELECT * FROM V$PROCESS WHERE {currently selected left side process addresses}

If you select a single session from the top panel, you can use the tabs at the bottom of the Process page to select single view or multiple view.

Single Record View

The single record view provides you with more columns of information about the selected session.

To view information for a single record

  1. In the left panel, select the session you want to view.
  2. On the right panel, click the Process tab.
  3. At the bottom of the page, click the Single tab.

Multi Record View

The multiple record view provides you with aggregate information for all selected sessions.

To view information for multiple records

  1. In the left panel, multi-select the sessions you want to view. All sessions must be within the same node.
  2. On the right panel, click the Process tab.
  3. At the bottom of the page, click the Multi tab.

Related Topics

Session Browser Overview

Viewing Sessions Detail Information


IO Details

IO Details Tab

IO details in the Session Browser are provided using the following query:

SELECT * FROM V$SESS_IO WHERE {currently selected left side SIDs}

If you select a single session from the top panel, you can use the tabs at the bottom of the IO page to select single view or multi- view.

Single Record View

The single record view provides you with more columns of information about the selected session.

To view information for a single record

  1. In the left panel, select the session you want to view.
  2. On the right panel, click the IO tab.
  3. At the bottom of the page, click the Single tab.

Multi Record View

The multi- record view provides you with aggregate information for all selected sessions.

To view information for multiple records

  1. In the left panel, multi-select the sessions you want to view. All sessions must be within the same node.
  2. On the right panel, click the IO tab.
  3. At the bottom of the page, click the Multi tab.

Related Topics

Session Browser Overview

Filtering Sessions


Waits Details

You can use the waits details to provide possible tuning considerations for your database in the Session Browser.

The page consists of various columns selected from V$SESSION_WAIT and V$SESSION_EVENT.

Note: The WAIT_TIME column will contain a value of -2 on platforms that do not support a fast timing mechanism. If you are running on one of these platforms and you want this column to reflect true wait times, you must set the TIMED_STATISTICS parameter to TRUE. Remember that doing this has a small negative effect on system performance

To view details about waits

  1. If it is not active, click the Sessions tab.
  2. Select a session or multiple sessions.
  3. In the details area (right panel), click the Waits tab to view the resources or events for which the selected sessions are waiting.

You can sort the waits data by clicking in the column header.

Related Topics

Session Browser Overview

Viewing Sessions Detail Information


Current Statement Details

Use this page of the Session Browser to see the current SQL statement for the selected session. You can only view data for one selected session at a time. If you select more than one session, the message "Multiple sessions selected" will display in the data area.

To view statement details

  1. Select a session from the top panel.
  2. Click the Current Statement tab to display the current statement for the selected session.
  3. Click the Explain Plan tab to display the explain plan for the current statement, for tuning or troubleshooting purposes.
  4. Click the Information tab to display data from the V$SQL view, which contains statistical data on the shared SQL area.

Related Topics

Session Browser Overview

Viewing Sessions Detail Information


Open Cursors Details

Use this page of the Session Browser to see data from V$OPEN_CURSOR, which lists cursors which each selected session has opened and parsed. It can show data from multiple sessions at once.

To view open cursors details

  1. Select one or more sessions in the left panel tree view. The statements containing the cursors opened and parsed display in the bottom panel.
  2. Click the Explain Plan tab to see an explain plan for the currently selected statement in the Open Cursor data grid above it, for tuning or troubleshooting considerations.
  3. Click the Information tab to see data from the V$SQL view, which contains statistical data on the shared SQL area.

Related Topics

Session Browser Overview

Viewing Sessions Detail Information


Access Details

This page of the Session Browser displays data from V$ACCESS, and lists objects in the database currently locked by the selected sessions.

To view access details

  1. Select one or more sessions in the top panel tree view.
  2. Click the Access tab.

Related Topics

Session Browser Overview

Viewing Sessions Detail Information


Locks Details

User locks and system locks are displayed in the locks details page of the Session Browser. For user locks, transaction, user and blocking locks are shown. This data is queried from V$LOCK.

Note: Information displayed by the following procedure is individual database information. See Viewing Locks Aggregate Information for more information about viewing aggregate locks details.

Types of Locks

In the locks page, locks are separated into two groups: Transaction, DML & PL/SQL locks; and Blocked or Blocking locks. Blocking and Blocked locks are dependent upon the transaction selected in the top area.

In the bottom part of the page you can choose to see locks that are blocking you or locks that are blocked by you for the selected user.

To view lock details

  1. Click on the Sessions tab, if it has not been selected.
  2. Select one or more sessions from the sessions tree view in the top panel.

    3. In the bottom panel, click the Locks tab.

    Note: You may have to scroll through the tabs on the bottom panel to see the Locks tab.

To view user locks

» At the bottom of the Locks page, select the User tab.

To view system locks

» At the bottom of the Locks page, select the System tab.

Related Topics

Session Browser Overview

Viewing Locks Aggregate Information

Viewing Sessions Detail Information


RBS Usage Details

Select this Session Browser tab to display transaction information for online rollback segments for the selected sessions. It is queried from SYS.V_$TRANSACTION and SYS.V_$ROLLNAME.

Information provided by this procedure is for individual RBS usage information. See Viewing Locks Aggregate Information for more information about aggregates.

To view RBS usage details

  1. Click on the Sessions tab, if it has not been selected.
  2. Select one session from the sessions tree view in the left panel.

    3. In the right hand panel, click the RBS Usage tab.

    Note: You may have to scroll through the tabs on the right hand side to see the RBS usage tab. Flipping the layout can alleviate this. See Flip the Session Browser Layout for more information.

Related Topics

Session Browser Overview

Flip the Session Browser Layout

Viewing Locks Aggregate Information

Viewing Sessions Detail Information


Long Ops Details

The Session Browser displays data from V$SESSION_LONGOPS for the currently selected sessions in the Long Ops Details page. Oracle defines long ops as operations that run for longer than six seconds in absolute time, including some backup and recovery functions, statistics gathering, and query execution. See Oracle's documentation for more information.

To view Long Ops details

  1. Click on the Sessions tab, if it has not been selected.
  2. Select one or more sessions from the sessions tree view in the top panel.

    3. In the bottom panel, click the Long Ops tab.

    Note: You may have to scroll through the tabs in the bottom panel to see the Long Ops tab.

Percent Column Calculation

The Percent column is calculated as:

decode(totalwork, 0, 0, round(100 * sofar/totalwork, 2))

Related Topics

Session Browser Overview

Viewing Sessions Detail Information


Statistics Details

This tab of the Session Browser displays data from V$SESSTAT, which is session statistics for the currently selected sessions.

To view statistics details

  1. Click on the Sessions tab, if it has not been selected.
  2. Select one or more sessions from the sessions tree view in the top panel.

    3. In the bottom panel, click the Statistics tab.

    Note: You may have to scroll through the tabs on the bottom panel to see the Statistics tab.

You can sort the waits data by clicking in the column header.

Related Topics

Session Browser Overview

Viewing Sessions Detail Information


Viewing Locks Aggregate Information

User locks and system locks are displayed here, depending on the tab you select at the bottom of the Session Browser.

Note: Information displayed here is aggregate database information. See Locks Details for more information about viewing locks details for individual sessions.

Types of Locks

In the locks page, locks are separated into two groups: Transaction, DML & PL/SQL locks; and Blocked or Blocking Locks. Blocking and Blocked locks are dependent upon the transaction selected in the top area.

In the bottom part of the panel you can choose to see locks that are blocking you or locks that are blocked by you for the selected user.

User Locks

Ttransaction, user and blocking locks are shown for user locks. This data is queried from V$LOCK. As the row in the Transaction Lock grid changes, the user and blocking lock grids are updated for the selection.

In addition, you can use the drop down filter to limit the grid to displaying:

  • All Locks (Show All)
  • Blocking Only
  • Blocked Only

To view user locks

  1. At the top of the Session Browser, click the Locks tab.
  2. At the bottom of the panel that displays, click the User tab.

System Locks

To view system locks

  1. At the top of the Session Browser, click the Locks tab.
  2. At the bottom of the panel that displays, click the Session tab.

Related Topics

Session Browser Overview

Locks Details


Viewing RBS Usage Information

Viewing RBS Usage Aggregate Information

This Session Browser page displays transaction information for online rollback segments, queried from SYS.V_$TRANSACTION and SYS.V_$ROLLNAME.

Note: Information on RBS Usage presented here is aggregate database information.See RBS Usage Details for more information on individual RBS Usage.

To view RBS usage information

» At the top of the top panel, click the RBS Usage tab.

Related Topics

Session Browser Overview

RBS Usage Details


Viewing Waits

The main waits tab in the Session Browser displays information about events and waits. The top panel displays aggregate information, while the bottom grid displays details of the selected events.

Changing the View

You can change the groupings of how waits are displayed.

To change the wait view

  • On the Waits tab, click the appropriate sub-tab to view waits grouped by:
  • Last 60 seconds
  • By Session
  • By Wait

Advice

You can view advice on some waits by double-clicking them in the lower panel. Waits that have advice available are highlighted with a blue color and an underline:

Related Topics

Session Browser Overview


Kill Sessions

Kill or Disconnect Sessions

Your ability to kill sessions in the Session Browser depends on your permissions status. For most non-slave sessions, you can kill sessions in one of the following ways.

  • Kill a selected session
  • Use multi-select and kill multiple sessions at once
  • Kill a top level node, which kills all sessions below it

For example, you can kill all sessions for a selected user. You can even multi-select top level nodes and kill all those and their sub-nodes.

See Parallel Slave Processes for more information on slave sessions.

To kill a session

  1. Filter and/or group the sessions so you can easily see the sessions you want to kill.
  2. In the top panel tree view, select the session, multiple sessions, or node you want to kill.
  3. Do one of the following:
    • In the toolbar, click [image].
    • Right-click and select Kill Sessions.
  4. Click OK to confirm your choice and kill the sessions.

To disconnect a session

  1. Filter and/or group the sessions so you can easily see the sessions you want to kill.
  2. In the top panel tree view, select the session, multiple sessions, or node you want to kill.
  3. Do one of the following:
    • In the toolbar, click [image].
    • Right-click and select Disconnect Sessions.
  4. Click OK to confirm your choice and disconnect the sessions.

Queries Used to Kill Sessions

For later versions of Oracle, the following query is used:

ALTER SYSTEM DISCONNECT SESSION <sid, serial#> IMMEDIATE

For earlier versions of Oracle the syntax is:

ALTER SYSTEM KILL SESSION <sid, serial#>

Related Topics

Parallel Slave Processes

Filtering Sessions

Grouping Sessions


Trace Sessions

You can turn tracing on or off for the selected sessions in the Session Browser.

Toad uses the following procedure to trace sessions:

SYS.DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION( sid, serial#, TRUE/FALSE )

Note: The trace file is written to the INIT.ORA parameter user_dump_dest which is typically the bdump directory on the server. If you cannot locate them there, check your Oracle Parameters to see if the pathname for user_dump_dest has been changed.

To turn trace on

  1. Filter and/or group the sessions so you can easily see the sessions you want to trace.
  2. In the top panel tree view, select the session, multiple sessions, or node.
  3. Do one of the following:
    • In the toolbar, click [image].
    • Right-click and select Start Trace.
    • In the confirmation window, click OK.

To turn trace off

  1. Filter and/or group the sessions so you can easily see the sessions you want to trace.
  2. In the top panel tree view, select the session, multiple sessions, or node.
  3. Do one of the following:
    • In the toolbar, click [image].
    • Right-click and select Stop Trace.
    • In the confirmation window, click OK.

Related Topics

Session Browser Overview

Filtering Sessions

Grouping Sessions


SGA Trace/Optimization

The SGA Trace/Optimization window displays SGA information for you so that you can easily optimize your database.

You can view information, utilize client-side filtering of the grid, and check session currently executing the selected query.

To access SGA Trace/Optimization

» From the Database menu, select Monitor | SGA Trace/Optimization.

Use this window to view information about SQLs executed and how they performed.

Requires access to the V$ Oracle Dictionary views. See V$ Tables Required for more information.

There are four tabs in this dialog box:

  • SQL Shared Pool
  • Execution Stats
  • SQL
  • Explain Plan

Statistics Area

In the statistics area you can view Execution stats and the SQL within the shared pool. In addition, you can:

Search for SQL | Enter text of the SQL you want to limit the shared pool area to SQL starting with the letters you enter.
Hide Zero Stats | When checked any stats with a value of 0 are hidden in the execution stats area.
Select an Instance | If you are on a RAC system, you can limit the display to a particular RAC instance.

Execution Stats

Execution stats are displayed in the left side panel. This panel shows information about the selected SQL statement in the SQL Shared Pool tab.

SQL Shared Pool

The Shared Pool SQL is displayed at the top of the right hand side. This panel shows information about the SQL Shared Pool. You can also filter the SQL statements you want to view using the SGA Trace Toolbar. See SGA Trace Toolbar for more information.

SQL tab

This shows the entire SQL for the selected SQL statement in the SQL Shared Pool tab.

If you get the "SQL Body Unavailable" message when clicking on the SQL tab, then the SQL is not present in Oracle's SGA (System Global Area), which is a pool of the most recently used SQL statements. Not all SQL statements can be retained in the SGA forever, because it is a limited size. The least frequently used statements are discarded in favor of new ones.

From the toolbar on this tab you can do the following:

Button | Command
 | Copy script to Clipboard
 | Load script in Editor
 | Tune Statement using SQL Tuning/Optimizer

Explain Plan tab

This shows the Explain Plan for the selected SQL statement in the SQL Shared Pool tab. The total cost of the statement is displayed in the Total cost for statement label. If the cost information is not available because of rule-based optimization, then this label will be blank. You can also right-click and select Explain Plan options for this Explain Plan. See SGA Trace Explain Plan Options for more information.

Sessions tab

The sessions tab displays any active sessions that remain in the SGA pool.

Related Topics

Explain Plan Overview

SGA Trace Explain Plan Options


SGA Trace Toolbar

You can perform several commonly used commands from the SGA Trace Toolbar.

Icon | Command
 | Change active session. In the drop down list, the active session is denoted by a checkmark.
 | Filter by statement type, grants or parameters.
 | Filter by users or cursors.
 | Refresh grids
 | Load selected statement in Editor
 | Flush SGA


SGA Trace Explain Plan Options

There are two special options for using the Explain Plan that display on the right-click menu of the Explain Plan tab in the SGA Trace window. See SGA Trace/Optimization for more information.

Always set session to statement user

This option performs an "ALTER SESSION SET CURRENT_USER=..." before it runs the Explain Plan.

Use connected user/schema

This does not perform the ALTER SESSION command.

Example

You are logged in as user DBAUSER and select a session belonging to the SCOTT user in the Kill/Trace window. You see that SCOTT has run the statement "Select * from EMP". Under Toad Options | Oracle | General | Table name, you have set the name to Toad_PLAN_TABLE. See General Oracle Options for more information.

Always set session to statement user

Set this option and do an Explain Plan. When Toad does the Explain Plan, Oracle makes the following two assumptions:

  • The EMP table belongs to SCOTT.
  • The Toad_PLAN_TABLE also belongs to SCOTT, unless there is a public synonym called Toad_PLAN_TABLE and SCOTT does not have a Toad_PLAN_TABLE. The Server Side Objects wizard creates a public synonym to Toad_PLAN_TABLE when it installs the Explain Plan objects to the Toad schema, but not when it installs the Explain Plan objects to a private user schema.

If you don’t have a Toad_PLAN_TABLE public synonym but you want to make sure that Oracle always looks for the plan table in a certain schema, you can include the user name with the plan table in the options – for example, DBAUSER.Toad_PLAN_TABLE.

Use connected user/schema

Set this option and do an Explain Plan. When Toad runs the Explain Plan, Oracle also makes two assumptions.

  • The EMP table belongs to you (DBAUSER in this example).
  • The Toad_PLAN_TABLE belongs to DBAUSER.

If you are explaining the statement "SELECT * FROM SCOTT.EMP", then Oracle knows that the EMP table belongs to SCOTT, regardless of the option you choose.


StatsPack Browser Overview

The Toad Statspack Browser supports Statspack in Oracle 8i and newer. It displays performance metrics between statspack snapshots in great detail. You can use this ability to track, compare and organize your statistics.

From the Statspack browser window, you can select snapshots, create new snapshots, select, display and print charts, program custom charts, and various other combinations. The browser window makes it easy to access the power of the data collected by Oracle's Statspack feature.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the Statspack Browser

» Select Database | Monitor | Statspack Browser.

Using the Statspack Browser

In order to use the Statspack Browser in Toad, you must have Oracle's Statspack package installed on the database in question. It is not automatically installed with Oracle, so you may need to install it. See Oracle's documentation for more information.

If you do not have the privileges on the PERFSTAT schema, or the PERFSTAT schema does not exist, Toad will notify you when you try to open the Statspack Browser.

The Browser window

The Statspack Browser window is divided into three areas, including a list of snapshots, a list of charts, and an area where the charts are displayed. These areas work together to display the metrics you need to see.

Snapshot List Area

The snapshot list area lists the snapshots that have been collected by the Statspack. To create charts based on these snapshots, you can select or clear the checkbox to the left of the snapshot name. By default, the Statspack browser will select up to the most recent 24 hours worth of snapshots with the same database start time.

Chart List Area

Several charts and grids have been built into the window, or you can easily add your own in addition to those provided. Select or clear the checkbox to the left of the chart you want to view or hide. Selected charts are created for the selected snapshots. Right-click to select all, none, and so on.

Chart Display

You can display up to nine charts at a time, in a three by three chart area. See Displaying Charts for more information on configuring the viewing area.

Related Topics

ADDM/AWR Overview

Displaying Charts

Creating a New Snapshot


Working with Statspack Snapshots

The Snapshots area of the Statspack Browser gives you the power to select, create, group and schedule snapshots.

Statspack Snapshots Toolbar

Button | Command
 | Change active session. In the drop down list, the active session is denoted by a
 | New snapshot. See Creating a New Snapshot for more information.
 | Change snapshot parameters. See Changing the Statspack Parameters for more information.
 | Find snapshot job in Schema Browser, or schedule the job. See Finding Job Schedules for more information.
 | Save selected shapshot group. See Saving a Selected Snapshot Group for more information.
 | Load a snapshot group. See Loading Saved Snapshot Groups for more information.
 | Refresh just the snapshot listing.
 | Refresh the entire browser.
 | Refresh just the charts.

Related Topics

StatsPack Browser Overview


Viewing Snapshot Information

You can view groups of snapshot information using the charts provided in the Statspack Browser, or charts and data grids you program yourself. See Generating Programmed Charts and data grids for more information.

You can adjust the visible columns in the snapshot display by right-clicking the column header and choosing the columns you want to see. The columns can be reordered by dragging and dropping. In addition, you can sort by any column: click the column by which you want to sort.

In addition, you can see more detailed information for a specific chart using the Detailed Hint command. Hover your cursor over the snapshot you want to see and the hint will display detailed information. If it does not, check to make sure detailed hints are activated as described below.

To activate detailed hints

» Right-click in the Snapshot area and select Detailed hints from the popup menu.

Selecting Groups of Snapshots

You can select groups of snapshots in multiple ways. In order to save a group, snapshots must be chosen by selecting the checkbox to the right of the snapshot in the list.

You can select groups of snapshots by:

  • automatically by right-clicking over the list of snapshots and choosing a pre-defined grouping.
  • by selecting the checkbox to the left of the snapshot entry.

Viewing advice for snapshot intervals

Toad displays advice in the right hand panel. When two snapshots are selected (not checked, but highlighted), click the Advice tab for information about the top wait event during the selected interval. You can also double-click the top waits grid in the chart display area to display advice about that wait.

Related Topics

StatsPack Browser Overview

Generating Programmed Charts and data grids


Creating a New Snapshot

You can create a new Statspack snapshot directly from the Statspack Browser.

Snapshots created in this manner take a single snapshot. Parameter value fields display the default values for each parameter. These are either the values set by Oracle, or the default values you have set using the Change Statpack Parameters command.

To create a new snapshot

  1. Open the StatsPack Browser.
  2. In the Snapshots area (upper left corner) select New Snapshot from the toolbar.
  3. Make any necessary changes to the default parameters.
  4. Click OK.

Related Topics

StatsPack Browser Overview

Changing the Statspack Parameters


Deleting a Snapshot

You can delete a snapshot that you no longer need directly from the Statspack Browser.

To delete a snapshot

  1. In the Snapshot tree, select the Snapshots you want to delete.

    2. Note: The delete is performed on selectedsnapshots, not on checked snapshots.

  2. Right-click and select Delete selected snapshots.
  3. Confirm the deletion by clicking OK.

Related Topics

StatsPack Browser Overview


Commenting on Snapshots

You can add comments to snapshots in the Statspack Browser, which are displayed in the detailed hints, and in the comments field of the snapshot.

To comment on snapshots

  1. Select the snapshots you want to comment.

    Note: The snapshots that will be commented are those that are selected by highlighting, not those that have check marks.

  2. Right-click and select Comment Selected Snapshots.
  3. Enter a comment and then click OK.

Related Topics

StatsPack Browser Overview

Working with Statspack Snapshots


Changing the Statspack Parameters

Oracle sets basic thresholds for Statspack Snapshots. See Oracle's documentation for more information. Within Toad's Statspack Browser you can change these default parameters so that each time you create a snapshot your custom parameters are set without needing to reset them.

To change Statspack parameters

  1. Click [image] in the snapshot area of the Statspack Browser.
  2. Click on the value you want to change and make your changes.
  3. Click OK to save your new defaults.

Related Topics

StatsPack Browser Overview


Finding Job Schedules

You can use Toad's Statspack Browser to find a scheduled Statspack job within the Schema Browser, where you can then work with them and edit, reschedule, and so on.

To find a job

» Right-click in the snapshot area and then select Find Collection Job in Schema Browser.

Note: Toad searches procedures for the string STATSPACK.SNAP within the code, allowing you to name your job in a way meaningful to you.

  • If there are statspack collection jobs in multiple connections, Toad will find the one in the connected session and stop looking.
  • If Toad cannot find a statspack collection job, Toad will open the Create Scheduler Job window, pre-filled in for a collection job that runs every half hour on the half hour.

Related Topics

StatsPack Browser Overview


Saving a Selected Snapshot Group

It can be beneficial to save groups of selected snapshots. When you do this, you can come back to charts created from these snapshots easily and quickly. For example, you might save a group called "Peak hours: Date" You could have several of Peak Hours charts over several weeks, and later come back to compare the different groups.

To save a snapshot group

  1. In the Statspack Browser, select the snapshots you want to group together.
  2. Click [image] on the toolbar.
  3. Name your group and click OK.

Related Topics

StatsPack Browser Overview


Loading Saved Snapshot Groups

You can load snapshot groups that you have previously saved.

When you load a snapshot group, all snapshots remain available, but the loaded snapshots are selected and the remainder are cleared.

To load a saved snapshot group

» In the snapshot area of the Statspack Browser, click [image].

Related Topics

StatsPack Browser Overview


Generating Programmed Charts

Generating Programmed Charts and data grids

Several popular charts and data grids are programmed into Toad's Statspack Browser. You can choose one chart or you can choose multiple charts to view at one time. See Displaying Charts for more information about the effects of viewing multiple charts.

To generate a programmed chart or data grid

  1. From the snapshot area, select the snapshots you want to include in your chart.
  2. Select the charts you want to see for this group from the list in the Charts and data grids area.
  3. As you select charts, the charts will display in the Chart area to the right. See Displaying Charts for more information.

Related Topics

StatsPack Browser Overview

Displaying Charts

Viewing Snapshot Information

Loading Saved Snapshot Groups


Displaying Charts

There are several ways you can configure charts and data grids from the Statspack Browser.

You can generate and display as many charts as you have available, but you can configure the window to display a total of nine at a time. Any more and scrolling is necessary to view them.

If you have many charts open in the viewing area, you can double-click the chart name in the tree view. Toad will navigate to the chart in the display area.

Configuring the viewing area

The more charts or data grids you view per screen, the smaller the actual chart. If the charts you want to see are very detailed, you may want to configure your viewing area to only display two or even one chart at a time.

Charts are displayed in the order in which they were checked. Newly checked items are added to the end of the display.

You can change the order of the chart/grid display.

To configure the viewing area

» In the Chart display toolbar, select the number of columns and rows you want to display. Each of these values may be from 1 to 3.

To change the order of the chart/grid display

» In the chart display area, right-click and select Change Chart Order.

To enlarge a chart

» In the chart display area, right-click over the chart you want to enlarge and select full-screen.

Viewing Series within Charts

Some charts can be very complicated, depicting many different series of data within them. In such a case, you can click the name of a series in the legend and that data will be highlighted in the chart.

For example, in this image, the OS CPU (System) series is selected, and the corresponding line in the chart is bold.

To restore it to normal display mode, click the item in the chart again.

Synchronizing Wait Times Charts

The Top Waits grid will synchronize with the Wait times by Event chart. When both are displayed in the display panel, the Wait times chart graphs whatever is selected in the Top Waits grid.

Refreshing the viewing area

You can add snapshots to your chart view at any time. Select them from the chart list.

To display the data including the new snapshot data

» Click [image] on the chart display toolbar.


Creating New Charts

You can develop new charts and grids that reflect the information you need to extract from statspack snapshots and the Statspack Browser.

To create new charts

  1. At the bottom of the Chart area, select the sub-node where you want the chart or data grid to reside.

    2. Note: If you do not choose a node, the new chart will be created directly in the Custom node. You can then drag it to its final category.

  2. Enter a name for the chart or grid in the Node Name box.

    3. Note: The parent node is displayed. This is the node that you have selected in step 1. If it is not correct, you can drag the chart to the correct parent node later.

  3. Select the type of output.
  4. Select the minimum version of Oracle.
  5. Click Next.
  6. Enter the query you want to use to base your chart upon. Click Example to see an example query for the chart type you have selected.
  7. Click Next.
  8. Enter the titles for your chart: which information is required will differ depending on the type of chart or grid you have selected.
  9. Click Next.
  10. Check the preview output. This should display the chart the way you want it.
    • If the chart is incorrect, click Back and make changes.
    • In the chart is correct, click Finish to create it.


Reorganizing the tree view

Reorganizing the Custom Tree View

The custom node of the chart and data grid area of the Statspack Browser can be organized and reorganized as you want it.

You can add categories (sub-nodes); edit them; drag and drop charts and data grids between them; and delete them altogether.

To add a category

  1. Select a node in which to create the category and then click [image].

    Note: If you do not select a custom node, or you have a built-in category selected, the new category will be created within the main Custom node.

  2. Enter a name for the category in the Name box and click OK.

To edit a category name

  1. Select a category in the Custom node, and then click [image].
  2. Make changes and then click OK.

To Reorder categories in the Custom Node

» Drag and drop categories to the node where you want them to reside.

To delete a category

  1. Select the category you want to delete.

  2. Click the Delete button and then click OK.

    Caution: If you delete a category with charts in it, all charts will be deleted as well. There is no undo option.

Related Topics

StatsPack Browser Overview


Printing and Exporting Charts and Grids

You can print or export created charts and grids. You can export grid or chart information from the Statspack Browser directly to MS Excel, or copy to the clipboard to paste it elsewhere.

To print charts or grids

» In the Chart and Grid display area, right-click and select Print.

To export charts or data to Excel

» In the Chart and Grid display area, right-click over the chart you want to export and select either:
  • Send data to Excel - Sends the data for the selected chart to an Excel worksheet.
  • Send all charts to Excel - Opens Excel and sends the data for all active charts to a worksheet.

Related Topics

StatsPack Browser Overview


Top Session Finder

This window lets you find the sessions in the database that are consuming the most resources. Oracle tracks hundreds of statistics for each session in the database, and the Top Session Finder lets you easily sort the sessions by their usage of any combination of parameters.

To access the top session finder

» From the Database menu, select Monitor | Top Session Finder.

Modes

There are two modes for viewing data: single parameter mode and multiple parameter select mode. You can select which mode to view from the Options area. See Top Session Finder - Options for more information.

Single Parameter Mode

Clicking the parameter name will list each database session in descending usage order of the selected parameter. Weights for parameters are not used in this mode.

Multiple Parameter Select Mode

The multiple parameter select mode includes a Stored Profile drop-down and a Weight column next to the parameter column. You assign weights to two or more parameters, and the sessions are sorted by the weighted sum of the statistics

The weights help reflect a true picture of resource usage. For example, if you are doing a session run on sorts, you might want to assign a weight of 100 to the resource intensive disk sorts and a weight of 1 to memory sorts. To assign or change a weight, click in the weight column and type the new weight. Click the List Sessions green arrow button at the top of the window, and the sessions will be listed in order of the weighted usage of the selected (weighted) parameters.

A right-click menu lets you Reset all weights to zero.

Stored Profile drop-down

The Stored Profile drop-down lets you recall and store profiles. Some profiles are already included.

When you first enter the multiple parameter select mode, the Overall profile is selected by default. It has weights assigned to CPU usage, memory usage, session logical reads, network traffic, and redo usage. The drop-down includes other built-in profiles including CPU, Cursors, Memory, Network Traffic, and Redo. These profiles can easily be modified.

You can create new profiles using the Create New Profile button and save profile settings using the Save Profile Settings button. You can save the current settings to a new profile by clicking the Create New Profile button and then saving the settings to the new name. The Delete button lets you delete the selected profile. The profiles are stored in a file called Topsess.ini, so if you want to revert to the default settings, just delete that file. (See Properties Files for more information about locations of these files.)

Related Topics

Top Session Finder - Options

Top Session Finder - Viewing Data

Finding a Specific Session


Top Session Finder - Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To display the options for the window

» Click [image].

Short Parameter List

If selected, the parameter list is shortened to approximately 35 statistics that will be checked more often such as CPU and cursors. This provides an alternative to going through the entire list of parameters. When cleared, the parameter list includes everything in the v$statname.

Exclude Inactive Sessions

If selected, only sessions marked as "ACTIVE" in v$session will be included.

Exclude Sessions Inactive for the past ___ Minutes

If selected, only sessions that have been active within the specified time period will be included. This can be used to exclude "idle" connections.

Limit Pie Chart to top ___ sessions

Use this option to limit the pie chart to show only a portion of sessions. The pie chart can handle a maximum of 1050 sessions.

Related Topics

Top Session Finder

Top Session Finder - Viewing Data

Finding a Specific Session


Top Session Finder - Viewing Data

The data can be displayed in a Dataset (data grid) or a Pie Chart.

Dataset tab

In single parameter select mode, click a parameter in the list, and the grid displays each database session in descending usage of the selected parameter. It also displays session specific information such as machine name and logon time. See Single Parameter Mode for more information.

In multiple parameter select mode, after you press the List Sessions button, the grid displays a list of SIDs (System Identifier Names) that are connected to the database instance, session specific information for each SID listed, and it also displays the unweighted value of each statistic along with the weighted sum of all statistics. See Multiple Parameter Select Mode for more information.

Some columns might not be populated. For example, you could optionally populate the action column if you have populated the module column. In the following:

dbms_application_info.set_module('abc','def')

"abc" would display under the Module column and "def" would display under the Action column.

Right-click options

If you right-click in the dataset grid the menu includes:

  • Print Grid
  • Export Grid

Pie Chart tab

The biggest slice of the pie chart protrudes slightly from the rest of the pie for easy identification.

  • In single parameter select mode the pie chart displays the percentage of selected resource usage.
  • In multiple-parameter select mode the pie chart displays the percentage of weighted resources. If you left-click a slice, information for that session will display.

Right-click options

If you right-click a slice, a right-click menu includes:

  • Print.
  • Save As Bitmap File.
  • Copy image to clipboard.
  • Find selected session in Session Browser.
  • Info on session, info on another session (useful for when a slice is too thin to click).
  • Remove skinny slices.

The Remove skinny slices item will prompt you for a percentage. Any session using less than that percentage of the pie will be removed from the pie. However, this does not actually remove rows from the data grid.

Related Topics

Top Session Finder

Top Session Finder - Options

Finding a Specific Session


Finding a Specific Session

To find a specific session in the Session Browser

  1. In the Top Session Finder, select the session you want to locate.

  2. Right-click and select Find Selected Session in Session Browser.

    Note: The Session Browser will open with the session selected.

Related Topics

Top Session Finder

Session Browser Overview


Optimize SQL Statements

Use the Optimize Current SQL feature to optimize a single SQL statement. Toad searches for faster alternatives and allows you to compare them to the original statement and each other.

When searching for alternative rewrites, Toad may use several different methods to optimize the statement. For example, it may add a hint or change the SQL of the statement. The rewrites do not change the meaning of the query, but they do alter the execution plan.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Notes:

  • Press ESC to cancel an optimization in progress.

  • This feature is available in the Xpert Edition and higher.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To optimize the current SQL statement

  1. Right-click a SQL statement in the Editor and select Optimize | Optimize Current SQL.

    Tip: You can send a SQL statement to the optimizer from several other locations by clicking [image] when it is available. You can also select Database | Optimize | Optimize Current SQL to open a blank optimization window.

  2. Complete the following fields:
    3. Database type | Select General (OLTP or mixed) or Data Warehouse. If you are unsure what type of database you have, select General (OLTP or mixed).
Search depth | Select a search level from 1 (lowest) to 5 (highest) to determine how thoroughly Toad searches for the fastest alternatives. In general, the lower levels lead to fewer alternatives, take less time to generate, and may not find the best alternative possible. However, the lower levels are often appropriate for simple SQL statements or to quickly return results for complex SQL statements. Tip: If Toad does not find a better alternative, you can increase the search depth and search again.
Stop if optimization exceeds | Select this option to stop searching after the specified number of minutes. If Toad has not finished searching by the specified time, it will stop and present any alternatives it has found.

  3. Review the results.

    If Toad found better alternatives, it links the best one at the top of the Alternatives pane. If Toad did not find a better alternative, try the following options:

    • Select the Options tab, increase the search depth, and click [image] to search again. If the search depth is already maximized, then Toad cannot find a better alternative.
    • Click [image] to send the statement to SQL Optimizer. SQL Optimizer has more advanced optimizing options and may be able to find an alternative even if Toad did not. See Using SQL Optimizer with Toad for more information.

  4. Review the following for additional information:

    Left-Hand Side | Description

    Alternatives pane

    Lists all of the alternatives that Toad tested. If Toad found a better alternative, the alternative is linked at the top of the pane. You can sort the alternatives by selecting an option in the View by field.

    Options pane

             Displays the selected optimization options. You can change the selections and run the optimization again to search for a better alternative. Once you select new options, click [image] on the toolbar to search again.
    Right-Hand Side | Description

    Statement to Tune tab

             Displays the original SQL statement. You can edit or replace the statement. If you selected Database | Optimize | Optimize Current SQL, this tab is blank.

    Alternative Detail tab

    Displays alternative SQL statements. Toad automatically displays the best alternative statement, if it found one. You can select a different alternative to view in the Alternative field.

    This tab also includes execution statistics with comparisons to the original statement and the explain plan for the statement. See Explain Plan Overview for more information.

    Compare Alternatives tab

             Displays the original SQL statement compared to the best alternative, if Toad found one. You can select a different alternative for either side in the Alternative field. The tab also displays the explain plan and execution statistics for each statement.

Related Topics

Optimization


DBMS_REDEFINITION Wizard

DBMS_REDEFINITION is a package supplied by Oracle. Using DBMS_REDEFINITION you can redefine and rebuild tables online. See Oracle's documentation for more information.

The DBMS_REDEFINITION Wizard is an interface to DBMS_REDEFINTION. The Toad interface is limited to Oracle 10 and newer.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To use the DBMS_REDEFINITION wizard

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

  1. From the Database menu, select Optimize | DBMS_REDEFINITION wizard.

  2. Refer to the following for more information:

    Select Tables

    If you use "Create Like" to create an interim table, when you click OK to execute the create table command, the table will be created and entered in the Interim Table Name field.

    Order By

    You can move selected columns from pane to pane, or move them up and down in the Desired Order list.

    Start/Sync

    Set the degree of Parallelism before you click Start. This applies to both start and sync.

  3. Complete the wizard.


Estimate Index Size

Use this window to estimate how much disk space a particular index occupies. You can enter indexes into the grid and then choose to estimate the size of all or some of them.

Note: Estimates can be done on bitmap indexes as well. However, if the column used is not a good candidate for bitmap indices, the estimate will be several times too small. This occurs because the bitmap indices columns are much larger than they should be. You should attempt to choose good candidate columns to achieve accurate bitmap index results.

To access the index size estimator

» Select Database | Optimize | Estimate Index Size.

Load and Scan Indexes

When you load indexes, the avr_row_len column in dba_indexes (if your indexes have been analyzed), and the DDL row size are loaded into the grid automatically. If you want indexes scanned to achieve those averages, you will need to see step 4 below. Scans can be slow, so it is not done automatically.

Note: These estimation values are based on how much disk space the index data occupies. These values differ from the EXTENTS values displayed on the Schema Browser | Indexes page | Stats/Size tab, because EXTENTS are containers that store data. Extents are created with a certain container size (for example, 1MB). Each extent could be empty, half full, three quarters full, or full. In all of these cases the EXTENT size remains the same, 1MB, but the amount of disk space occupied by data changes.

To load and scan indexes

  1. Click the drop-down arrow on [image] on the Estimate Index Size toolbar.
  2. Select one of the following options:
    3. Load my Indexes | Load all indexes from the currently connected schema
Load Indexes Like | Add a LIKE clause to the query that selects and loads the indexes.
Load Indexes by User | Select an index owner and loads the indexes from the appropriate schema.
Load Indexes by Tablespace | Select a tablespace and load all indexes contained in it.
Load Indexes by Table | Select a table and load all the indexes for that table.
Import Grid from Text file | Load indexes and open a grid that you have previously saved.
  3. When the indexes are in the grid, check the box next to the indexes you want to estimate.
  4. Click [image] on the toolbar. A confirmation dialog box displays, letting you change the percentage of rows scanned if necessary. The default is 10 percent. When finished, the Average Row length and the Estimated Size are entered into the grid.

    5. Caution: This may take a while because the virtual storage size for all data must be summed and averaged. The more data you have in the index and the higher the percentage you choose, the longer this will take.

Using the Grid

When you have scanned sizes into it, the grid works like a spreadsheet. You can change the values of:

  • num_rows
  • pct_free
  • ini_trans
  • block_size

Estimated index size will update as soon as you click outside of that row on the grid.

Saving the grid

If you need to leave before you are finished, you can save the grid to a text file and reopen it later.

To save the grid to a text file

  1. Click the drop-down arrow on [image].
  2. Select Export grid to text file.
  3. Enter a name for the file and click Save.


Estimate Table Size

Use this dialog box to estimate how much disk space a particular table occupies (or will occupy after more rows are loaded into it). You can enter tables into the grid and then choose to estimate the size of all or some of them.

To access the table size estimator

» From the Database menu, select Optimize | Estimate Table Size.

Load and Scan Tables

When you load tables, the avr_row_len column in dba_tables (if your tables have been analyzed), and the DDL row size are loaded into the grid automatically. If you want tables scanned to achieve those averages, you will need to see step 4 below. Scans can be slow, so it is not done automatically.

Note: These estimation values are based on how much disk space the table data occupies. These values differ from the EXTENTS values displayed on the Schema Browser | Tables page | Stats/Size tab, because EXTENTS are containers that store data. Extents are created with a certain container size (for example, 1MB). Each extent could be anywhere between empty and full. In any case, the EXTENT size remains the same, 1MB, but the amount of disk space occupied by data changes.

To load and scan tables

  1. On the Estimate Table Size toolbar, click the drop-down arrow on [image].
  2. Select one of the following options:
    3. Load my tables | Loads all tables from the currently connected schema.
Load tables Like | Add a LIKE clause to the query that selects and loads the tables.
Load tables by User | Select a table owner and loads the tables from that schema.
Load tables by Tablespace | Select a table and load all the tables contained in it.
Import Grid from Text file | Load tables and open a grid that you have previously saved.
  3. When the tables are in the grid, check the box next to the tables you want to estimate.
  4. Click [image] on the toolbar. A confirmation dialog box displays, letting you change the percentage of rows scanned if necessary. The default is 10 percent. When finished, the Average Row length and the Estimated Size are entered into the grid.

    5. Caution: This may take a while because the virtual storage size for all data must be summed and averaged. The more data you have in the table and the higher the percentage you choose, the longer this will take.

Using the Grid

There are four ways of estimating table size. These numbers are defined as follows when you click Scan on the toolbar.

  • Avg Row Len (Scan) calculates avg row len based on the data that is currently in the table
  • Avg Row Len (Stats) pulls the avg row length that stored by Oracle the last time the statistics on the table were gathered (based on data in the table at the time the stats were gathered).
  • Max Row Len (DDL) pulls the maximum row length, based on the types and number of columns.
  • If none of these methods are applicable, you can enter your own number in the Avg Row Len (User). For example, if you have sample data, but you know that the sample data has values in the fields that are too small, then you might take a scan, and then put a number slightly larger than Avg Row Len (Scan) into Avg Row Len (User).

When you have scanned sizes into it, the grid works like a spreadsheet. You can change the values of:

  • Num Rows
  • Pct Free
  • Ini Trans
  • Block Size
  • Avg Row Len (User)

Estimated table size will update as soon as you click outside of that row on the grid.

Estimating Index Size

To estimate index size

  1. Check tables that have indexes you want to estimate.
  2. Right-click and select Launch Index Size Estimator for Indexes on Checked Tables.

Saving the grid

To save the grid to a text file

  1. Click the drop-down arrow on the Load tables [image] button.
  2. Select Export grid to text file.
  3. Enter a name for the file and click Save.


Explain Plan

You can easily view previously run explain plans and compare them against a new one.

In order to view previously run explain plan history you must have Save previous explain plan results selected in the options page. See Saving Explain Plans for more information.

The history page is divided into two panels. The top area lists all saved explain plans. When you select one of these plans, it displays in the bottom panel, with the SQL statement directly above it.

The displayed explain plan can be viewed and manipulated in the same way as an explain plan in the Editor. See Explain Plan Overview for more information.

To display explain plan history

» Select Database | Optimize | Explain Plan.

Related Topics

Explain Plan Overview

SGA Trace Explain Plan Options

Explain Plan Results

Comparing Explain Plans


Pin Objects in SGA

When the Oracle SGA fills, Oracle overwrites parts of the buffer with new data. Pinning a PL/SQL object in the SGA will keep Oracle from overwriting it. If you frequently use a particular PL/SQL object you have loaded from your database, pinning it to the SGA will improve Oracle performance.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To pin an object

  1. Select Database | Optimize | Pinned Code.

    2. Note: Each PL/SQL object in the SGA cache is listed in the upper grid, as well as its owner and whether or not it is pinned.

  2. The tree view on the bottom lets you browse all the source code for the schema as displayed in the drop-down. You can select source code for pinning that is not currently in the SGA cache.
    • If the object is in the SGA cache, select the object in the upper grid.
    • If the object is not in the SGA cache, select the appropriate schema from the drop-down in the middle of the page and then select the object from the tree view.
  3. Click [image] on the toolbar.

To unpin an object

  1. Select the pinned object in the SGA cache grid.
  2. Click [image] on the toolbar.

Flushing the SGA Cache

The SGA is the shared SQL pool where Oracle caches the most recently executed statements. This results in faster reprocessing. The Flush the SGA button removes everything that is not pinned from the SGA cache.

To flush the SGA cache

» Click [image].

Refreshing the SGA Cache view

To refresh manually

» Click [image].

To auto refresh

  1. In the Pinned Code toolbar, Refresh (secs) field, enter the number of seconds you want to wait between refreshes. The default is 5.
  2. Check the Auto Refresh box.


Repair Chained Rows

To access repair chained rows

» From the Database menu, select Optimize | Repair Chained Rows.

When data for a row in a table cannot fit into a single data block, it is stored in a chain of data blocks (more than one data block). The original row of data points to the new block or blocks of data. A result of chained rows is that Oracle must scan more than one block of data to retrieve information. The repair chained rows function basically rejoins rows of data blocks that were split across more than one block.

In order to use the Repair Chained Rows functionality, you will need to have a Chained Rows table defined as described by Oracle. If there is no repair chained row table (chained_rows), Toad notifies you and gives you the option to create one.

Analyze tab

Click the ADD button to display a Select Tables to Analyze menu where you can select the schema (from drop-down) and tables (from a list of tables in the schema) to analyze. Click the checkbox preceding the tables to select or unselect the tables. Select All and Select None buttons help with quick selection.

Caution: The Chained Rows table field contains the name of the table where Toad tells Oracle to store the row ids of the chained rows that are found. It is NOT the table to analyze. Remember, Toad will truncate the chained rows table before it analyzes the tables in the list.

Data tab

After you have analyzed your tables, click the data tab to display the schema, table name, and the number of rows chained in the table.

Repair tab

Note: You might need to increase the existing tables' data block size to eliminate chaining completely.

Clicking repair:

  1. Creates an intermediate, temporary table (Toad_tmp_xxxx) in your default tablespace

    2. Note: This temporary table is dropped if there are no errors. If there are errors, the table remains so you can troubleshoot.

  2. Copies chained rows to it
  3. Deletes the chained rows from the existing tables
  4. Copies the rows back into the existing tables.

You can also select a rollback segment from the drop-down.

Results display beneath each repaired table.

Results tab

The results tab lists any tables not repaired and the reasons.


Rebuild Table

Use this function to rebuild a table, optionally dropping columns, and/or renaming columns.

This window will create a complete script to rebuild a table, after which you can further edit to customize, if desired.

To rebuild a table

Note: You must own the schema you are browsing in order to rebuild a table from it.

  1. From the Database menu, select Optimize | Rebuild Table.
  2. Select a table to rebuild.

    3. Note: You must be logged on as the table owner: therefore you cannot change owners from the owners drop-down list.)

  3. Check the desired options on the Options tab.
  4. On the Table Storage and Index Storage tabs, select storage parameters.

    5. Note: You can either use the original storage parameters or use the current table size as the initial extent, which will combine all extents together into one extent, for faster disk performance.

  5. On the Columns tab, double-click a column on the upper list to exclude it (drop it) from the table.

    6. Note: To rename a column, click to select it, wait until after the mouse double-click time, then click it again. Enter the new name for the column.

  6. Click the SQL tab.

    7. Note: The rebuild table script will be constructed and displayed. Now you can either save the script to a file, or copy it to the clipboard.


Unix Kernel Parameters

If you are managing a database on a Unix server, updating some critical kernel settings can improve database performance. From this screen you can quickly generate the steps you need to modify your UNIX kernel and the critical kernel parameters to greatly increase Oracle performance. Oracle provides detailed information on these parameters. See Oracle's documentation for more information.

You will need to FTP the output to the UNIX server, paste the parameter values where they need to go, and manually perform the indicated steps to reconfigure the UNIX kernel.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access UNIX Kernel Parms

» Select Database | Optimize | UNIX Kernel Parms.

Options

UNIX Type

Specify the variant of UNIX your database server is running. This setting directly controls generation of both the steps and parameters. For example, different UNIX variants accomplish kernel configuration differently. Likewise, different UNIX variants implement different parameters and recommended settings.

Concurrently Active Databases

Specify how many databases will be up and running at the same time for that database server. For example, a database server may have production database instances for the following three database applications: Payroll, Accounting and HR. In this example the database server will have three concurrently running database instances.

Concurrent Processes Per Database

Specify the average number of processes to be concurrently active at any given moment per database. For example, the Payroll application may average 40 concurrent users, the Accounting application may average 100 concurrent users, and the HR application my average 100 concurrent users. The average concurrent process count would be 80 (40 + 100 + 100 = 240 / 3 = 80).

Average Degree of Parallelism

Specify what degree of parallel operations should be supported. This should only be used on servers with excess CPU bandwidth (for example, SMP, MMP and NUMA architectures) and/or excess disk IO bandwidth (e.g. RAID, SAN and NAS). You must have either tables or indexes with a default degree of parallelism greater than one or DML with hints. Assuming these conditions are met, Oracle will consume much more in resources as it spawns additional processes to perform parallel operations. The UNIX kernel must be configured to support these additional needs.

Calculate

Click Calculate and Toad will produce the parameter modifications to optimize performance.


Windows Registry Settings

If you are managing a database on a Windows server, updating some critical registry settings can greatly improve overall database performance. For example, you can run any of the industry standard database benchmarks, such as the TPC, using Quest's Benchmark Factory® for Oracle and obtain a raw score for your Windows server and its Oracle database. Then you can change the settings of the Windows Registry and run the benchmark again so as to obtain a new score.

You could manually define these settings using REGEDIT, but the registry keys and values are somewhat obscure. The Windows Registry Parms window lets you define these settings easily and quickly.

Notes:

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

  • When you update registries, changes will not take effect until you reboot your computer.

To update Windows Registry settings

» Select Database | Optimize | Windows Registry Parms.

Note: It is recommended you check all four checkboxes (two in Memory Management and two in NTFS fileSystem) and then select the IO Page Lock Limit that best corresponds to the size of your Windows server. The more memory your server has, the higher you can set the value. You'll have to experiment to be sure, but most servers should benefit from a value of 8K or larger.

Reading Registries

This screen works with both local and remote Windows registries. Remote registries must be configured to permit remote registry access.

Note: Accessing remote registries requires the remote computer name to be entered in the form of \\computername. The double backslash prefix is mandatory.

Registry Export Files

These text files can be opened and modified with any text editor. Double-clicking on them from within the Windows Explorer will update the local registry with their content. This is useful when you want to create the files locally and then copy them to remote servers for manual application.

To create a registry export file

» Click Create ".Reg" file to produce a Windows standard registry export file.


Analyze All Objects

You can analyze multiple tables, indexes, and partitions, see chained rows, and see the data Oracle stores as the result of the analysis. If you are using Oracle 10g or above, you can lock and unlock the table and schema stats that you are working with. You can override the lock by using the Force option.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access analyze all objects

» Select Database | Optimize | Analyze All Objects.

Note: When using this dialog box to analyze selected tables from the tables object list, this collects statistics so that COST based query optimization can be used and the optimizer can run better queries. When you first open this window, the grids in the tabs are empty.

Analyze Tables and Indexes Tabs

Note: See Set Options below for information on the default settings for this basic analysis, and information on how to personalize this analysis.

To analyze tables or indexes

  1. Click the appropriate tab.
  2. Load the grid by clicking [image] or selecting a method for loading data from the drop-down beside it.
  3. Select one or more objects in the grid using the checkboxes.
  4. Click [image] on the toolbar. Confirm if necessary.

Columns(Histograms) Tab

From this window you can:

  • Delete statistics using dbms_stats
  • Export/import/copy statistics

Chained Rows Tab

To view chained rows

» On the toolbar, click [image].

Note: You must have select privileges on the CHAINED_ROWS table to use this feature.

To repair chained rows

» After chained rows data is displayed in the grid, click [image] on the toolbar.See Repair Chained Rows for more information.

Set Options

Analysis of objects can be customized. Click the Options tab to customize them and select Use Analyze or Use DBMS_STATS.

Toad saves the options you set in this window so if you do the same Analyze or DBMS_STATS command repetitively; you do not have to reset all of your options each time. For details on these options see either:

  • Analyze Options
  • DBMS_STATS functions


Analyze Options

The analyze functions area of the Analyze All Objects window lets you choose what type of analyze statement you want to create. Some of these options allow you to include a "For Clause" and some do not.

Note:This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.s.

Option

Description

Compute Statistics

This is the most detailed and accurate method of analyzing a table. Statistics are computed from data in the table.

Estimate Statistics

You can use Estimate Statistics to save the time and resources required to compute them. Some statistics may be slightly different than their computed counterparts.

You can change the number of the sample Oracle uses to create that estimate and whether that refers to rows or percentages in the boxes beneath the Analyze Functions area.

This is the default setting.

Delete Statistics

Use Delete Statistics to delete all analyze statistics from your table. This leaves the table as if it had never been analyzed.

List Chained Rows

If a table has chained rows, select the table and analyze using this function to display the chained rows in the Chained Rows tab.

Note: This feature requires you have an appropriate Chained Rows table defined.

Validate Structure

Select this option to validate the structure of a table or index. If all is well, the analyze command proceeds. If there is a problem, Toad will display the ORA- error.

Related Topics

Analyze All Objects

DBMS_STATS functions


DBMS_STATS functions

The DBMS_STATS functions area lets you choose what to collect and how to arrange and organize the DBMS_STATS you collect from the Analyze All Objects window. See Analyze All Objects for more information.

Using DBMS_STATS gives you many options for collecting information.

Note:This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Option

Description

Do not invalidate dependent cursors

If this is unchecked, and Oracle has execution plans for queries against tables you analyze, it will discard them and create a new execution plan. When checked, it will keep and use the old execution plans.

Block Sample

Oracle will randomly sample blocks of data as opposed to rows. Random block sampling is more efficient, but if the data is not randomly distributed on disk, then the sample values may be somewhat correlated. This option is only pertinent when doing estimate statistics.

For all … Hidden … Indexed Columns
  • Indexed columns - Collects data on all indexed columns.
  • Hidden columns - A table can have a maximum of 1000 columns. When you create an object table (or a relational table with columns of object, nested table, varray, or REF type), Oracle maps the columns of the user-defined types to relational columns. This creates the effect of "hidden columns" that count toward the 1000-column limit.

Copying Statistics - On different databases

If the schemas are on different databases, then Toad uses the following procedure to copy statistics.

  1. Creates a temporary table to hold stats
  2. Exports the stats to that table
  3. Copies the stats to the other database
  4. Imports the stats from the table to the schema (Use the drop-downs to choose a tablespace.)

Copying Statistics - On the same database

If the schemas are on the same database, then Toad does not create a temporary table. The entire copy can be done with PL/SQL blocks.


Profilers

Toad can facilitate profiling of your code in many ways. It provides graphic access to the data provided by the DBMS_Profiler package, and, in Oracle 11 and later the information provided by the DBMS_HPROF package.

You can view the information from the two profilers either in the desktop panel area of the Editor window, or in more detailed, graphical form in the Profiler Analysis window. See Profiler Analysis for more information.

For information about the two profilers and how to use them in Toad, see the following:

  • Line Item Profiler Analysis Overview
  • Hierarchical Profiler

Related Topics

Profiler Analysis

Hierarchical Profiler


Profiler Analysis

The Profiler Analysis window provides data on profiler runs that is consistent with the data displayed in the Profiler tab of the Editor. You can open the profiler window from the Toad menu, or by clicking the details button on the Profiler Editor tab toolbar.

The top half of the window is a graph of the showing the percent of time required to run each component of the procedure.

Note: If you can see the pie chart labels but not the pie chart itself, resize the window horizontally to give it more space to draw.

In addition, labels on the chart show actual execution time for the fastest, slowest, and average unit or line of code.

The bottom half of the window lists the runs, including Run Number, Procedure, Timestamp, Comment, and Total Time to execute. You can sort on the columns by clicking on the column headers.

To access the Profiler Analysis window

» From the Database menu, select Optimize | Profiler Analysis.

Run Details

Opening a run

Selecting displays the graph for all units within that run. Expanding a run in the tree view will list the details of the run including Unit Type, Owner, Unit Name, and Total Time to execute.

Opening a unit

You can also select a specific unit of the selected run.

When drilling down on a unit, we see the lines of code executed and profiled. The column headers include Line Number, Passes (how many times each line of code was executed), Total Time to execute the line, Min Time, Max Time, and the line of Code itself. The graph changes to display the information within that unit.

Analysis Toolbar

Between the top half of the window and the bottom half, there is a toolbar of functions:

Button

Command

Collapse all nodes.

Expand all nodes.

Open a selected procedure or line item in the Editor. (This can also be achieved by double-clicking the selected procedure.)

Refresh data - If you switch to other windows to execute procedures for profile analysis, and switch back to the Profiler Analysis window, click to requery the profiler tables.

Filter by schema.

Delete a selected run from the profiler tables.

Display as a pie chart.

Display as a bar chart.

Rotate chart.

Graph properties - Change the visual display of the graph and/or group together values below a certain percentage or value. This is useful when you have several small pie wedges or bars.

In the Graph Properties dialog box, you can also set the background color gradient, for example, from Blue to Black left to right.

Hiding Profiler Data

If you right-click the list, you can temporarily hide some data so that a better analysis of the remaining data can be performed. For example, if a particular statement takes 95% of the overall execution time, hide it, and the remaining statements, which were under 1% each will blow up to a larger relative percentage on the graph.

Displaying in Editor

If you select a valid unit in the tree view, right-click and select display in Editor, the Editor displays the selected unit.


Toggle PL/SQL Profiling

To toggle PL/SQL Profiling

» From the Session menu, select Toggle PL/SQL Profiling.

Related Topics

Profiler Analysis

Setting Up the Line Item Profiler

Setting up the Hierarchical Profiler


Editor Profiler Tab

Within the Editor, the Profiler tab displays profiler runs, as root nodes, and profiler units as child nodes. The latter are the actual code units that were executed during a profiler run. They can include anonymous blocks, procedures, functions, and packages executed while the profiler run data was being collected. In the line item profiler, child nodes contain the actual line data. In the hierarchical profiler, child nodes contain sub program calls.

This tab provides an overview of the data, but does not offer the graphs that the Profiler Analysis window does.

Navigating the Editor Profiler

Selecting a line item within the nodes automatically opens the referenced SQL source and displays the line referenced by the profiler.

Note: Because each Editor tab is associated with a separate Profiler instance, navigating through your code this way may reset the node display in the Profiler tab.

To display the Profiler Analysis window for the current data

» Click Details.

Executable line indicators

When you open a profiler run or unit into the Editor and have the option show executable line indicators in gutters selected, executable line indicators display as follows:

Indicator | Meaning
Blue dot with green square | Line was executed
Blue dot with red circle | Line was not executed

If Toad cannot determine when the unit was last executed, then the standard blue dot line indicators will display.

Related Topics

Profiler Analysis

Editor Profiler Nodes

Editor Profiler Tab Toolbar


Editor Profiler Nodes

Each level of node within the Profiler Analysis window has a slightly different meaning to the column contents. See Profiler Analysis for more information.

Column | Contents
Profiler Runs |
Run Comment | Root node is designated by the profiler run comment, followed by the user that executed the profiler run in parentheses. For example, AA_TEST_1 (MICHAEL).
Total Execution Time (secs) | Total time (in seconds) it took to execute all units included in that run.
Avg Execution Times | This will be blank for this level.
Run Date | The date and time that the run was completed.
Profiler Units |
Run Comment | Unit owner followed by the unit name. The unit type is also discernable by the icon for that node. If the unit says anonymous block it is not an object that actually displays in your database.
Total Execution Time (secs) | Total time (in seconds) it took to execute that unit.
Avg Execution Times | Average Execution time (in seconds) for a particular profiler Unit. Note: For the Line Item Profiler, this column will be blank for this level.
Run Date | The last DDL time (for non-anonymous blocks only) This is the date and time that the object was last modified and committed to the database. Last DDL time is queried from the ALL_OBJECTS view.
Note: If a unit displays in red, it was last modified after the profiler run was executed, and Toad cannot display the profiler line map in the Editor for that object.
Profiler Data Lines (Only displayed in the Line Item Profiler |
Run Comment | The line number of that line in the unit's source code.
Total Execution Time (secs) | The execution time of that line for all passes (executions) followed by the number of executions in parentheses. For example, if the line in question is within a loop then it may be executed numerous times.
Avg Execution Times | Average execution time (in seconds) for one execution of that line.
Run Date | Source text for the line.

Related Topics

Editor Profiler Tab

Editor Profiler Tab Toolbar

Setting Up the Line Item Profiler

Setting up the Hierarchical Profiler


Editor Profiler Tab Toolbar

Icon | Command
 | Refresh data.
 | Remove selected profiler run from the database.
 | Collapse all nodes.
 | Expand all nodes.
 | Display the Profiler Analysis window with details of this profiler run. Profiler Analysis

Related Topics

Profiler Analysis

Editor Profiler Tab

Setting Up the Line Item Profiler

Setting up the Hierarchical Profiler


DBMS Profiler Filters

Profiler Filters

You get to this window from the Profiler Analysis window, Filter toolbar button. See Line Item Profiler Analysis Overview for more information.

Use this window to filter in or out schemas for a specific user.

To hide schemas

» Select schemas in the right hand side and click > to hide.


Line Item Profiler Analysis Overview

Oracle8i provides a Probe Profiler API to profile existing PL/SQL applications and to identify performance bottlenecks. The collected profiler (performance) data can be used for performance improvement efforts or for determining code coverage for PL/SQL applications. Application developers can use code coverage data to focus their incremental testing efforts.

The profiler API is implemented as a PL/SQL package, DBMS_PROFILER, that provides services for collecting and persistently storing PL/SQL profiler data.

Caution: Statistics may not be collected properly if you are running the Profiler on an Oracle server on a Tru64 platform.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Using DBMS_PROFILER

Improving application performance is an iterative process. Every iteration involves the following:

  • Exercising the application with one or more benchmark tests, with profiler data collection enabled.
  • Analyzing the profiler data, and identifying performance problems.
  • Fixing the problems.

To support this process, the PL/SQL profiler supports the notion of a run. A run involves executing specified SQL commands through benchmark tests with profiler data collection enabled.

To start a run

» Click [image] in the main Toad toolbar so that it is in the depressed position.

To end a run

» Click [image] in the main Toad toolbar so that it is in the non-depressed position.

DBMS_PROFILER Session

A typical session involves:

  • b>Starting profiler data collection in session.
  • Executing PL/SQL code for which profiler/code coverage data is required
  • Stopping profiler data collection.

Some PL/SQL operations, such as the very first execution of a PL/SQL unit, may involve I/O to catalog tables to load the byte code for the PL/SQL unit being executed. Also, it may take some time executing package initialization code the first time a package procedure or function is called. To avoid timing this overhead, you should warm up the database before collecting profile data. Warming up involves executing SQL once without gathering profiler data.

Collected Data

With the Probe Profiler API, you can generate profiling information for all named library units that are executed in a session. The profiler gathers information at the PL/SQL virtual machine level that includes the total number of times each line has been executed, the total amount of time that has been spent executing that line, and the minimum and maximum times that have been spent on a particular execution of that line.

The profiling information is stored in database tables. This enables the ad-hoc querying on the data: It lets you build customizable reports (summary reports, hottest lines, code coverage data, and so on) and analysis capabilities.

Using DBMS_PROFILER with the Java debugger

Toad lets you use the Profiler in connection with the Java debugger as well as when debugging PL/SQL. Output, however is different.

When you profile Java code, all of the code is wrapped into an Anonymous Block, and then only that block is profiled. When debugging PL/SQL you are given the time per statement. In JDWP debugging, Toad returns the time for the entire procedure.


Setting Up the DBMS Profiler

Setting Up the Line Item Profiler

You can set up the line item profiler to run from the Toad schema, or any private user’s schema. Each case has a different script to run, as explained in the steps below.

Note: The minimum Oracle database version required for the PL/SQL Profiler is Oracle8i.

The SYS.DBMS_PROFILER package

Make sure you have the SYS.DBMS_PROFILER package. If this has not been loaded, you will need to create it as follows.

  1. Login to an Oracle database through Toad as SYS.
  2. Load the Oracle home>\RDBMS\ADMIN\PROFLOAD.SQL script into the Editor.
  3. From the SQL Editor menu, select Execute as Script (F5).
  4. Make sure that GRANT EXECUTE on the DBMS_PROFILER package has been granted to PUBLIC or to the users that will use the profiling feature.

Install Profiler Server Side Objects

To install the server side objects required for the profiler

» Run the Server Side Objects Install wizard. See Install Server-Side Objects for more information.

Related Topics

Line Item Profiler Analysis Overview


Using the DBMS Profiler

Using the Line Item Profiler

This section explains how the profiler works, and some of the options you can use to filter and delete data to create a customized profile. See Setting Up the Line Item Profiler for more information if you have not yet set up the profiler.

Note: If you are using an Oracle 11g database, you have the option of using the Line Item Profiler or the Hierarchical Profiler. To use the line item profiler, from View | Toad Options | Execute/Compile | Behavior, clear the Use hierarchical profiler on Oracle 11g and newer checkbox.

To use the Profiler

  1. Start Toad.
  2. Click [image] on the main Toad toolbar to turn on profiling.

    3. Note: Execute a procedure from the Schema Browser or the Editor using the Execute (lightning bolt) button. Set Profiler descriptions on the Set Parameters window. You will be prompted to enter a description of the procedure being executed. This displays in the Profiler Analysis window or the Editor Profiler tab when you are analyzing the results. Run the procedure several times to get some data into the profiling tables.

  3. Click [image] to turn off profiling.

    4. Note: Be careful to not leave the profiler toggled on when you switch to other Toad windows. Otherwise, profiler data will be collected from the queries Toad performs to populate those windows.

  4. Do one of the following:
    • Click the Profiler tab beneath the Editor
    • Select the Database | Optimize | DBMS Profiler Analysis menu item. The Profiler Analysis window displays. For more information on reading the information provided, see Profiler Analysis.

Anonymous Blocks and Lines Not Executed

By default, anonymous blocks and lines not executed are not displayed. You can display them by right-clicking in the tree-view and selecting them from the popup menu.


Hierarchical Profiler

The hierarchical profiler is available beginning with Oracle 11g. The PL/SQL hierarchical profiler organizes data by subprogram calls, and stores the results in database tables letting you create custom reports. See Oracle's documentation for more information.

Information provided includes:

  • Number of calls to the subprogram
  • Time spent in the subprogram
  • Time spent in the subprogram and descendent subprograms
  • Detailed parent-child information


Setting up the Hierarchical Profiler

You can set up the hierarchical profiler to run from the Toad schema, or any private user’s schema. Each case has a different script to run, as explained in the steps below.

Note: The minimum Oracle database version required for the PL/SQL Profiler is Oracle 11g.

The DBMS_HPROF package

Make sure you have the DBMS_HPROF package. See Oracle's documentation for more information.

  1. Login to Oracle through Toad as SYS.
  2. Make sure that GRANT EXECUTE on the DBMS_HPROF package has been granted to PUBLIC or to the users that will use the profiling feature.

Install Profiler Server Side Objects

There are several database tables and other data structures that are required to use the analyzing functionality of the hierarchical profiler.

To install the database objects

  1. Login to Oracle through Toad in the schema where you want the database objects created. These can be created in each individual schema, or alternately, this can be executed in a common schema (such as Toad) and synonyms can be made as described in step 4.
  2. From the Oracle home, RDBMS/ADMIN directory, load the DBMSHPTAB.SQL script into the Editor.
  3. From the SQL Editor menu, select Execute as Script (F5).
  4. If you have created them in a common schema, create Synonyms to the following objects and either grant them to each schema requiring them, or make them PUBLIC.
    • DBMSHP_FUNCTION_INFO (table)
    • DBMSHP_PARENT_CHILD_INFO (table)
    • DBMSHP_RUNS (table)
    • DBMSHP_RUNNUMBER (sequence)
  5. Check to make sure each schema using the Hierarchical profiler has the WRITE privilege on the directory that specified when you start profiling.

Related Topics

Hierarchical Profiler


Using the Hierarchical Profiler

Note: If you are using an Oracle 11g database, you have the option of using the DBMS Profiler or the Hierarchical Profiler. From View | Toad Options | Execute/Compile | Behavior, select Use hierarchical profiler on Oracle 11g and newer.

To use the Hierarchical profiler, there are several steps you will need to take:

  • Set up the profiler.
  • Set parameters for your code, checking the Hierarchical profiling options as well as code variables.
  • Toggle Profiling on (on the main toolbar, make sure that [image] is depressed on the toolbar).
  • Filter and View analysis in the Profiler tab below the Editor.

    • Or

    View analysis charts in the Profiler Analysis window.

Note: If the Profiler tab is not visible, you can display it by right-clicking in the tab area and selecting Desktop Panels | Profiler.

Related Topics

Hierarchical Profiler

Setting up the Hierarchical Profiler

Setting Hierarchical Profiler Parameters

Hierarchical Profiler Filters


Setting Hierarchical Profiler Parameters

Like the Line Item Profiler, the Hierarchical profiler has parameters that can be set from the Editor parameter page. Options set here persist on a per object basis.

To view and change parameters

  1. Click [image] on the Debugger toolbar in the Editor, or execute the procedure to open the parameters window.
  2. Click the Profiler tab.
  3. In the Hierarchical Profile area, make changes to the parameters described below.

Parameters

Note:This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.s.

Parameter | Information
Directory | Select the directory from the pre-defined list of Oracle directory objects. The list of possible directories is derived directly from your database, and cannot be altered here. Note: You must have WRITE privileges on the directory you use.
Limit call depth to n levels | If desired, limit the call depth to the specified number. Entering a "1" will give you only a top-level profile. Entering a higher number will give greater depth to your analysis.

Related Topics

Line Item Profiler Analysis Overview

Hierarchical Profiler


Hierarchical Profiler Filters

You can filter the results of your hierarchical profiling session. This can be useful in making sure that you only see the results that are useful for you. See Hierarchical Profiler for more information.

Toad will automatically filter out the system information that is added when the profiler is active. You can manually turn these on if you want to see that information.

To create a filter

  1. From the Profiler tab at the bottom of the Editor, right click over the grid and select Filter.

    2. Note: If you do not see the filter option, make sure you are actually using the Hierarchical Profiler.

  2. Click Add to add a new filter to the filter grid. Enter the criteria you want to use to hide data. You may use the % wildcard within the filter.
  3. Enable or disable any filters desired by selecting or clearing the Enable box.
  4. Repeat steps 2 and 3 if necessary.
  5. Click OK.


Oracle Tuning Advisor Overview

If you are using Oracle 10g and higher, you can tune using the Oracle Tuning Advisor. Or, if you have the SQL Optimizer module, you can use Quest's SQL Optimizer. See Using SQL Optimizer with Toad for more information.

The Oracle Tuning advisor window provides a tabbed interface where you can create tuning tasks, drop tuning tasks, and set automatic tuning configuration.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Notes:

  • Unless you have instructed Toad to make this window accessible, this functionality is disabled by default. You can restore functionality from View | Toad Options | Windows and clicking the Available checkbox in the appropriate row of the grid.

  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To access the Oracle Tuning Advisor window

» Select Database | Optimize | Oracle Tuning Advisor.

Related Topics

Creating Oracle Tuning Tasks

Viewing Oracle Tuning Tasks


Creating Oracle Tuning Tasks

You can use Toad to access the Oracle Tuning Advisor and create tuning tasks. See Oracle's documentation for more information.

Toad's Tuning Advisor window provides a means to view, create and delete tuning tasks. The Tuning advisor can be accessed from several places within Toad. In most cases, Toad will open the advisor after creating a new SQL Tuning job from selected code.

To use the Oracle tuning advisor from existing code

  1. Put your cursor within the statement you wish to tune, or highlight the code you wish to tune.
  2. In the toolbar, click the [image] drop down.
  3. Select Oracle Tuning Advisor.
  4. Make any changes to parameters and click OK.

    5. Notes: Results are displayed in the Oracle Tuning Advisor window.

Creating a Tuning Task from the Tuning Advisor Window

You can also create a tuning task from the tuning advisor window. You might want to do this if you had several files that you wanted to tune, or if you have been reviewing results from tuning another piece of SQL code.

To create a tuning task from the window

  1. From the Database menu, select Optimize | Oracle Tuning Advisor.
  2. Click [image] in the left pane.

Related Topics

Oracle Tuning Advisor Overview

Viewing Oracle Tuning Tasks


Viewing Oracle Tuning Tasks

When you create a tuning task from another location in Toad, when you click OK you are taken directly to the results tab of the Oracle Tuning Advisor. See Oracle Tuning Advisor Overview for more information.

You can view previous results directly from the Oracle Tuning Advisor window.

To view tuning results

  1. If the Oracle Tuning Advisor is not open, from the Database menu, select Optimize | Oracle Tuning Advisor.
  2. In the left hand side of the window is a list of all Oracle tuning tasks that have been created. Click on the one you want to view.
  3. If the Results tab is not active, click on it to view results.
  4. Change the level of results you can see by selecting the desired level in the Level box.

Viewing SQL Profiles

You can view SQL Profiles from the SQL Profiles tab. In addition, you can modify or delete the SQL Profile.

To view SQL profiles

  1. From the Oracle Tuning Advisor, in the right hand side of the window, click the SQL Profiles tab.
  2. Select a profile to display details for it in the lower panel.

Viewing Tuning Scripts

You can also view a recommended script for altering your code to suit the Tuning recommendations presented in the Results tab. For any tuning result there may or may not be a suggested script available for viewing. If there is no script, you will see the message "There are no recommended actions for this task under the given filters."

In addition, you can also choose to send the script to the Editor, or execute it directly from the advisor. Click the appropriate toolbar button to perform one of these actions.

To view tuning script

  1. From the Oracle Tuning Advisor, select the tuning task you want to view.
  2. In the right hand side of the window, click the Script tab.

Related Topics

Oracle Tuning Advisor Overview

Creating Oracle Tuning Tasks


Rebuild Multiple Objects Overview

From the Rebuild Multiple Objects window you can analyze indexes in order to determine which ones need to be rebuilt, and then to rebuild those indexes. You can also rebuild multiple tables at a time, if necessary.

To access Rebuild Multiple Objects

» Select Database | Optimize | Rebuild Multiple Objects.

Indexes

In addition to the basic examine and rebuild features of this window, you can also perform the following on your indexes:

  • Move indexes into various tablespaces based on the size of their extents.
  • Adjust extent sizes to minimize the number of extents.
  • Adjust extent sizes to a standard, to minimize the number of extents and decrease tablespace fragmentation.
  • Specify criteria before analysis

When you rebuild multiple indexes, you will generally work in the following order:

  1. Load a list of indexes.
  2. Select criteria and indexes and analyze the index. See Examining Indexes for more information.
  3. Rebuild indexes as necessary.See Rebuild Indexes for more information.

Tables

You can easily rebuild several tables at once. In addition, you can use Conditional Thresholds to limit rebuilds to rows that meet certain criteria. See Conditional Thresholds for more information.


Email Notification - Rebuild Multiple Indexes

Email Notification - Rebuild Multiple Objects

You can choose to have email notification when you have completed rebuilding indexes. This can be useful if the rebuild will take some time. Set the indexes to rebuild, and Toad will notify the appropriate person when they are complete.

To set email notification

  1. Click the Email Notification tab, and check the appropriate boxes. Choose to notify by email, and then check either HTML results or plain text summary to specify what to include in the email. HTML email is the default.
  2. Set email options. Select View | Options | Email Settings and set the appropriate options for recipients and email accounts as described in Email Settings.

Related Topics

Email Settings

Rebuild Multiple Objects Overview


Examining Indexes

Once you have selected a list of objects in the grid, you can examine them to determine if they need rebuilding. Tables do not need examining, however, you can set Conditional Thresholds to limit the number of tables you look at for rebuilding purposes. See Conditional Thresholds for more information.

To examine indexes

  1. Select the indexes you want to examine. Click a grid row to check the boxes to the left of the index owner.
  2. Click the Thresholds and Performance Options tab and set any standard thresholds. See Standard Thresholds for more information. These define when an index needs rebuilding. This tells Toad what parameters to look for in the index.
  3. Click [image] on the toolbar.

When Toad is finished examining your indexes, it displays a recommendation in the index list, in the row under the index listing. These recommendations display as follows:

No Rebuild Recommended

Rebuild Recommended - and a description of why

You can now rebuild some or all of the indexes. See Rebuild Indexes for more information.

Related Topics

Rebuild Multiple Objects Overview

Conditional Thresholds

Standard Thresholds

Rebuild Indexes


Rebuild Indexes

Once you have examined your indexes, or if you know already which ones you want to rebuild, you can rebuild the indexes. When you rebuild indexes, you can also change storage clause parameters. See Storage Clauses for more information.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Rebuild Recommended Indexes

When you examine the indexes in your index list, some of them may be marked Rebuild Recommended. These can be rebuilt at one time, with no other marking necessary.

To rebuild recommended indexes

» From the Indexes tab toolbar, click [image].

The indexes that have been analyzed and marked for rebuild are rebuilt and the status of the index is displayed below the index name in the grid.

Create Script to Rebuild Recommended Indexes

You do not have to rebuild indexes immediately. You can create a script to do it for you later.

To create script to rebuild recommended indexes

» From the Indexes tab toolbar, click [image]. The script is copied to the clipboard. You can paste it into the Editor and save it for use later, if you want to run the rebuild from the command prompt. See Run Rebuild Objects from the Command Prompt for more information.

Rebuild Checked Indexes

You can also select indexes manually to be rebuilt.

To rebuild checked indexes

  1. On the Indexes tab, select the indexes to rebuild, by checking the box in the left-hand column of the grid.
  2. On the toolbar, click [image].

    3. Note: The status of the index is displayed below the index name in the grid.

Create Script to Rebuild Checked Indexes

You do not have to rebuild indexes immediately. You can create a script to do it for you later.

To create script to rebuild checked indexes

» From the Indexes tab toolbar, click [image]. The script is copied to the clipboard. You can paste it into the Editor and save it for use later, if you want to run the rebuild from the command prompt.

Related Topics

Run Rebuild Objects from the Command Prompt


Loading and Clearing Tables

Loading and Clearing Tables and Indexes

You can load tables and indexes into the Table list (of the Rebuild Multiple Objects window) in several ways. Loading tables and indexes is cumulative. By selecting different Load Tables (Indexes) buttons on the toolbar, you can build a custom list. See Rebuild Multiple Objects Overview for more information.

Load My...

This option loads all tables in the active schema into the Table list. If there are any partitioned indexes, each partition is a placed in a separate row of the grid.

To load tables

  1. Click either the Tables or Indexes tab, and then click Load My… on the toolbar.
  2. When you have loaded the tables or indexes, the button is disabled. You can enable the button again by Clearing the entire list as described below, or by changing active sessions within this window.
  3. If you change active sessions within this window, the list is immediately cleared.

Load... Like

To create and use a like clause

  1. Click either the Tables or Index tab, and then click Load … Like on the toolbar.
  2. Choose the Table Owner from the drop-down menu.
  3. Enter the condition you want the index or table name to be LIKE. The text you supply will be directly used in an Oracle query. This field is case sensitive, and the following wildcards characters apply:
    • % For multiple characters
    • _ For a single character
  4. Select a schema, or multi-select several schemas using the CTRL or SHIFT keys.
  5. Click OK.

Load by User

If you have the DBA role, you can also load tables belonging to more than one schema.

To load tables by user

  1. Click either the Tables or Indexes tab, and then click Load … by User on the toolbar.
  2. Select a schema, or multi-select several schemas using the CTRL or SHIFT keys.
  3. Click OK.

Load by Tablespace

If you have the DBA role, you can load tables belonging to a particular tablespace.

To load tables by tablespace

  1. Click either the Tables or Indexes tab, and then click Load … by Tablespace on the toolbar.
  2. Select a tablespace, or multi-select several schemas using the CTRL or SHIFT keys.
  3. Click OK.

Reload

To reload

  1. Click the Tables or Indexes tab.
  2. From the grid, right-click and select Reload all.
  3. All storage information is reloaded and updated to its current state.

Clear Selected Rows

To clear selected rows

  1. In either the table or index grid, select the indexes you want to remove. Use CTRL or SHIFT to multi-select.
  2. Right-click the grid and select Remove Selected Rows from the menu. A confirmation dialog box displays.
  3. Click Yes to remove the rows.

Clear Entire List

To clear entire list

» Click either the Tables or Indexes tab and then click [image]. The index is cleared, and the Load my … button is enabled, if it had been disabled.


Table Rebuilding

After you have loaded and selected your tables, you can either rebuild them immediately or create a script to rebuild them later.

To rebuild selected tables

» After selecting your tables, click [image].

Toad will display a status report in the grid when finished. Status for tables that were rebuilt successfully displays in green, while if there were problems, the status report will be in red.

To create a rebuild script

» After selecting your tables, click [image]. The script is copied to the clipboard, and you can paste it in the Editor.

Related Topics

Loading and Clearing Tables and Indexes

Rebuild Multiple Objects Overview


Standard Thresholds

When rebuilding multiple objects, you can set thresholds for your examinations. There are two types of thresholds: standard and conditional. See Conditional Thresholds for more information about conditional thresholds used to limit the Index list.

At least one standard threshold must be set in order to Examine selected indexes.

Standard thresholds are found in the middle of the Thresholds tab, in the area labeled Mark Indexes for Rebuild only if:. By default, all three thresholds are marked.

Height >

Height grows when there are splits to the index. If the height is high, consider rebuilding the index to reduce these splits.

The default for this option is 4, but Toad can look for a height greater than any number you specify.

? Deleted Rows >

If you have deleted rows in the database, the markers for those deleted rows still take up space in the index. Rebuilding the index to eliminate these markers can speed up usage.

The default percentage is set to 25. You can adjust this up or down as needed.

% Storage used < and % Storage used >

If your index has too much storage space for the amount of information it stores, or if it uses too much of the storage space it has, it can also slow down database performance. Use these two options to select an optimum range for storage space for your index, and mark those indexes that do not comply with your choice for rebuilding.

Related Topics

Rebuild Multiple Objects Overview


Conditional Thresholds

When rebuilding multiple objects, conditional thresholds let you eliminate indexes in your index list from consideration before you analyze them. This lets you shorten your index list immediately, without taking the time to run a full analysis on every index.

To use conditional thresholds

  1. From the Thresholds tab, set conditional thresholds as described above.
  2. Click the Indexes or Tables tab, right-click the grid and select Remove items that fail consideration thresholds. Failed items are removed from the grid, letting you analyze only the indexes you want to analyze. See Examining Indexes for more information.

Setting Conditional Thresholds

In the Thresholds tab area labeled "Consider Objects for Rebuild only if:" select one or more of the following options.

Size is greater than

This option lets you eliminate any tables or indexes where the size of the index is less than the specific amounts. Toad will only analyze sizes greater than what you specify. You can specify this number in MB or KB.

# Extents is greater than

This option lets you eliminate any indexes where the number of extents is lower than the specified amount.

Using Conditional Thresholds

Use conditional thresholds when you have a long index list and you do not want to run a full analysis on the entire list.

Related Topics

Rebuild Multiple Objects Overview

Examining Indexes


Performance Options

When rebuilding multiple objects, the Performance options let you set parameters that affect the performance of your object rebuilding session. Performance options are located in the bottom section of the Thresholds and Performance Options tab. See Rebuild Multiple Objects Overview for more information.

Tables and Indexes

Use ‘Online’ option

If you check this option, Toad can rebuild or move the table or index while it is in use.

Parallel

Check this command to use the PARALLEL keyword when rebuilding indexes. When checked, the following checkboxes become active.

  • Degree - Check this box and set the degree in the number field beside it.
  • Alter indexes to noparallel after rebuild - When checked, Toad issues an "alter index … no parallel command" after the index has been rebuilt.

Refresh Index Data

These radio buttons allow you to choose how you refresh the index data after a rebuild.

  • Do not refresh index info after rebuilds - This option does not reload the index data at all.
  • Refresh info for each index after each rebuild - This option reloads the data for one index immediately after that index has been rebuilt.
  • Refresh info for all indexes after all rebuilds are complete - This option reloads index data for all rebuilt indexes after all the selected indexes have been rebuilt. This is the equivalent of choosing "Reload all" from the right-click menu.
  • Rebuild associated indexes with tables - Select this box if you want to rebuild any indexes that are associated with the tables you have selected.

Indexes Only

Nologging

Check this command to use the NOLOGGING keyword when rebuilding indexes. When checked, the following checkbox becomes active.

Alter indexes to logging after rebuild

When checked, Toad issues an "alter index … logging command" after the index has been rebuilt.

Change Sort Area Size for this session to:

This command allows you to set the index sort area size for the rebuild session. This can be set in KB or MB, and set in increments of one. The default is 10 MB.

After Rebuilds, change sort area size to:

This checkbox lets you set the sort area size to a specified size after the rebuild session.


Storage Clauses

During any rebuild of multiple objects, whether it was a recommended or a manual rebuild, you can change storage clause parameters. Use this to keep extent sizes fairly uniform and appropriately sized or to move indexes to another tablespace.

You can adjust the storage clause as follows:

  • Specify the PCTINCREASE
  • Set Next Extent = Initial Extent
  • Scale Extent Sizes by a specified percentage, specifying the minimum and maximum sizes
  • Define Extent Size

Change Extent Sizes

In addition, you can Change Extent Sizes. If you opt to use this feature, make sure you examine the index before you use it. Because the %used is a factor, this value can only be obtained by examining the indexes. Note that this is not the PCTUSED storage parameter. This refers to the actual percentage of allocated storage space for the index being used.

This option overrides any options set in the top part of the window.

To adjust extent size to minimize # of extents

When this option is selected, the new extent size for each index is calculated as follows:

  1. Working size=total size * % used.
  2. This working size is then passed through the "Make Extent this size, or "Just Round All Extent Sizes to the Nearest Power of..." algorithm, as selected. The resulting value is the new initial_extent size. It is also the new next_extent size. Pctincrease is set to zero.
  • If you do not want to run the working value through either algorithm, select the "Just Round" and set the number to use as the closest power of 1. This is not recommended however, as it will result in each index being a different size, and this is a good way to fragment your tablespaces.
  • If you have configured to adjust tablespaces base on extent sizes, Toad uses the new calculated size, not the original size.

Caution: If some indexed tables are used as large temporary tables, and are usually empty, but are sometimes filled, they may be marked as "rebuild recommended" when you examine them, because they have zero percent used. In this case, if you use Adjust Extent Sizes during the rebuild, the index will be built with small extents that may not hold all your data later. Avoid this by either using global temporary tables, or do not rebuild indexes with a percent used of zero.

Tablespaces

From this tab, you can choose to move all indexes to different tablespaces, or selectively dependent upon their size.

  • If you choose to move indexes to a tablespace based upon the size of the index, and have chosen "By Index Size" on the Extents tab, size is based on the total size of the index.
  • If you choose to move indexes to a tablespace based upon the size of the index, and you have chosen "By Extent Size" on the Extents tab, then the size is based on the INITIAL extent size, as opposed to the NEXT extent size.

Related Topics

Rebuild Multiple Objects Overview


Search for Options

You can search the options lists for the option you want. This can be useful if you remember a basic option, but cannot remember where it falls in the categories.

To search for an option

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Enter search terms in the Search field.
  3. Click Search.
  4. Select a result and press ENTER or double-click it. The page with with the result displays and the result temporarily flashes in a bold font.
  5. To close the search results area, click the arrow beside the Search button.


Data Grids - Data

Data Grid Options: Data

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set data grid options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Data Grids | Data.

  3. Set the options. Review the following for additional information:

    Behavior | Use these options to...

    Use Read-Only Queries

    Return read-only resultsets, which prevents them from being edited.

    Note: Data grids are editable only if you include ROWID in the query or run an EDIT statement. See Understand Editable Resultsets for more information.

    Default: Cleared

    Confirm record deletions

    Have Toad prompt you before deleting a record. This option also affects the data grids on the Schema Browser "Data" tabs.

    Default: Cleared

    Warn of cascading constraints on deletions

    Have Toad check for an "ON CASCADE DELETE" foreign key constraint. This constraint may cause rows from other tables to be deleted as well. If it is present, Toad warns you before deleting.

    This option applies only to the Schema Browser.

    Default: Cleared

    Preview CLOB and LONG data

    Preview CLOB and LONG data in the data grids. Checking this option can sometimes cause performance problems.

    Default: Cleared

    Deferred LOB read

    Read LOBs as they are displayed. This results in faster initial load, but slower grid performance.

    Note: This option is ignored when Preview CLOB and LONG Data is cleared.

    Default: Cleared

    Stop data fetches when available memory becomes less than n MB

    Set the number of megabytes that triggers Toad to stopping data fetches. This number includes all available memory, both physical and pagefile.

    Display | Use these options to...

    Trim string data in CHAR and NCHAR columns

    Trim trailing spaces and show only actual data.

    Default: Cleared

    Display large numbers in Scientific Notation

    Display numbers with over 15 digits in scientific notation. Numbers with more than 15 decimal places are displayed rounded to the 16th place.

    This option can affect exporting to MS Excel. When selected, numbers are sent to Excel formatted as numbers, with a possible loss of precision. Clear this option to maintain precision.

    Notes:

    • You must select this option if you use an Oracle 8.0 client. If this option is not selected for this client, you may receive an "OCI-22061: invalid format text [TM9]" error.
    • This option is set at the time that you establish your connection in Toad. If you change the option, you must log off and make a new connection to update the grids.

    Default: Selected

    Date format

    Click [image] to fully customize the date format. For example, you can select:

    • The order of the day, month, and year (month-day-year or day-month-year)
    • The separator (month.day.year or month/day/year)
    • The date format (2, 02, or FEB for February)

    Default: Format selected in the Windows Control Panel

    Sliding window for entering two digit years

    Change the sliding window value for using the current century in two-digit dates. It is the current system date minus the number of years specified in the sliding window option. The range of choice is 0 to 49.

    For example, if you specify a 30 year window and enter 1/1/87, the date produced will be January 1, 1987. If you enter 1/1/57 (which is outside of the 30 year window), the date produced is January 1, 2057.

    Default: 30

    Refresh grid data | Use these options to...

    Before Edits

    Select to refresh the data grid before edits, which helps keep the data grid in sync when you or other users make changes.

    Note: Certain situations exist where a record level refresh is not possible because the record no longer exists, or its ROWID has changed. For these situations, you may want to disable some or all of the data grid refresh options.

Related Topics

Data Grid Options: Visual


Data Grids - Visual

Data Grid Options: Visual

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set data grid options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Data Grids | Visual.

  3. Set the options. Review the following for additional information:

    Behavior | Use these options to...

    Tabs

    Tab through one record.

    Note: You cannot tab through multiple records unless Tab through is also selected.

    Default: Selected

    Tab through

    Tab through more than one record.

    Default: Cleared

    Row select

    Select an entire row when you click in a data grid cell. If this option is cleared, Toad only selects one cell.

    Default: Cleared

    Immediate edit

    Display an editor drop-down when you click a cell in the data grid. If this option is cleared, you must select the cell twice to place the grid in edit mode.

    Default: Cleared

    Confirm sorts when clicking on column header

    Display a Sort Options dialog when you select a column header. This allows you to select how you want to sort the data in that column.

    Default: Selected

    Column sizing | Use these options to...

    Size to header

    Size all columns to the width of the column headers. If the data is wider than the header, it is truncated.

    Default: Cleared

    Size to data

    Size all columns to the width of the data contained in them. You can also select the following options:

    • Allow columns narrower than header width—Select to be able to make columns narrower than the width of the column header. This can allow you to fit more data on the screen. If this option is not selected, columns will never be narrower than the header for the column, although this may be narrower than the data contained in it. The default is cleared.
    • Allow columns wider than grid width—Select to allow columns to be wider than the grid width. This prevents column widths from becoming excessively wide due to LONG data. The default is cleared.

    Default: Selected

    Preview column max lines

    Set the number of lines included in the preview column. Select any number of extra lines from zero to five (0-5).

    Default: 1

    Display | Use these options to...

    Show focus rectangle

    Display a rectangle around an item in the grid, which persists when you click outside of the grid.

    Default: Cleared

    Show grid selection

    Highlight selected items in the data grid, which persists when you click outside of the grid.

    Default: Selected

    Grid line width

    Set the thickness of the lines between rows on the data grid. The measurement is in points.

    Default: 1

    Show group summaries

    Display a summary of the group contents beside the group heading when the data grid is grouped by a column header.

    Default: Selected

    Null column text

    Enter text to display in null fields, such as {NULL}. By default, null fields are blank.

    Default: <this field is empty>

    Styles | Use these options to...

    Active style

    Select a display style for the data grid. If you upgraded from a previous version, Toad automatically stores and applies your previous settings as the Legacy style. You can click Edit Styles to customize a style or create a new one.

    Default: Legacy

Related Topics

Data Grid Options: Data


Data Types

The Data Types Options page is accessed through the View | Toad Options | Data Types item. The options that are checked will display as items in the Data Types drop-down in the Create Table and Alter Table windows.

Types are listed in the Native Oracle Types panel and the ANSI Types panel. Select All and Select None buttons are in each panel. You can check and uncheck the individual types. The types checked are the only ones that will be included in the Table Data Types drop-down.

In addition, there are checkboxes for:

Include Object Types (Oracle 8)

This option is available on Oracle 8 databases and above.

Default: Cleared

Cache Object Type list per Connection

Caching the object type list prevents Toad from having to query and load everything in DBA_TYPES whenever you open the create/alter table (or index) screen. Memory usage of this cache should be insignificant. You may want to clear the cache manually if you just created some new object type and want to start using it in the create table screen. The cache automatically clears when the session is ended.

Include Byte/Char spec when creating DDL scripts from 9i databases

This option is available on Oracle 9i databases and above. For example, the script generated from SCOTT.EMP would have these differences:

Checked | Unchecked
CREATE TABLE EMP ( EMPNO NUMBER(4), ENAME VARCHAR2(10 BYTE), JOB VARCHAR2(9 BYTE), MGR NUMBER(4), HIREDATE DATE, SAL NUMBER(7,2), COMM NUMBER(7,2), DEPTNO NUMBER(2) ) | CREATE TABLE EMP ( EMPNO NUMBER(4), ENAME VARCHAR2(10), JOB VARCHAR2(9), MGR NUMBER(4), HIREDATE DATE, SAL NUMBER(7,2), COMM NUMBER(7,2), DEPTNO NUMBER(2) )

Default: Selected


DBA Options

Access this window through the View | Toad Options | DBA menu item.

Tablespace map

This area allows you to modify colors and set fragmentation levels used on the Tablespace Map. See Tablespace Map for more information. You can add multiple fragmentation levels.

To add new fragmentation levels

  1. Click Add to add a new Fragmentation level.
  2. Select the fragmentation percentage. You can either type the number in the box or select it by clicking the up and down arrows until the correct number displays. The cells whose segments equal to or exceeding this fragmentation level will be colored the color you choose.
  3. Click [image] to select the color to highlight cells whose segments equal or exceed the fragmentation level you have set. The color selection dialog box displays. Click the color you want to use and click OK.
  4. Click OK to add the level and close the Add Level dialog box.

To edit colors or fragmentation levels

  1. To edit a color choice or fragmentation level, click the item you want to change and click Edit.
    • If you have selected a fragmentation level, the Add Level dialog box displays.
    • If you have selected another option, the Color Selection dialog box displays.
  2. Make the desired changes and click OK.

Delete

You can delete Fragmentation Levels that you have added. You must retain at least one fragmentation level. You will not be able to delete the last fragmentation level.

To delete fragmentation levels

» Select the level you want to delete and click Delete.

Note: No warning will display. The fragmentation level is simply removed from the list.

Show segment names on grid hint

If this box is checked, the segment names will display when you run your mouse over the Tablespace Map.

Default: Selected

Remember legend window state

Check this box to remember the state of the legend window when you close the Tablespace map. When checked, opening the map again will leave the legend where you had it last. (Visible or hidden).

Default: Selected

Remember segments window state

Check this box to remember the state of the segments window when you close the Tablespace map. When checked, opening the map again will leave the segments window where you had it last, either visible or hidden.

Default: Selected

Remember filters window state

Check this box to remember the state of the filters window when you close the Tablespace map. When checked, opening the map again will leave the filters window where you had it last, either visible or hidden.

Default: Selected

Confirm before overwriting Export/Import Files

When these options are checked, Toad will prompt you to confirm that you want to overwrite a file when you Export or Import.

Unchecked, Toad will overwrite the file without asking.

The defaults are checked.

Refresh Instance Manager database version during every poll

This determines whether the Instance Manager queries for the database version every time it polls a database. Normally, the database version for a database does not change, so there is no need to refresh it once it has been retrieved. However, this option will allow you to refresh the database version in case of a database upgrade.

Default: Cleared


Debugger Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set Debugger options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Debugger.

  3. Set the options. Review the following for additional information:

    General | Use these options to...

    Enable Trace Output while debugging

    Create trace information while the Debugger is running, which helps debug the Debugger interactions with the database. This is normally unchecked and is used for tech support or DBA.

    Default: Cleared

    Enable DBMS Output before debugging session

    Display DBMS_OUTPUT in your debug session. If the DBMS_OUTPUT window is not visible and there is DBMS output data, you need to open it to view your output.

    Default: Selected

    Enable DBMS_JAVA Output

    Includes data from system.out.println calls from Java stored procedures in the DBMS output window.

    Default: Selected

    Step through package initialization

    When you have a package that includes package variables, the first time you execute a procedure in the package the variables are initialized. Select this option to step to the lines of code where the variables are declared and initialized. If the option is cleared, the Debugger does not step into the package initialization.

    Default: Cleared

    Break on exceptions

    Stop the Debugger when it hits a procedure exception (such as zero divide) and display a message. You can then continue debugging the exception handler code or stop.

    Default: Selected

    Debug session timeout

    Limit the amount of time that the Debugger waits for the database to respond with debug information. For a slow database, poor network speeds, or connection by modem, increase the number of seconds.

    Default: 180 seconds

    Debugger

    Select the debugging package you want to use.

    Default: DBMS

    Transaction Control

    Select how Toad deals with transactions in the Editor:

    • Commit – a COMMIT statement is added to the anonymous block that is used to execute or debug code in the Debugger. Triggers do not default to rollback: they obey the settings for this option.
    • Rollback – a ROLLBACK statement is added to the anonymous block that is used to execute or debug code in the Debugger.
    • Prompt – when you finish executing/debugging code in the Debugger, Toad will prompt you to answer the question "Commit changes to debug session?" Answer Yes to commit, No to rollback.

    Note: If the object has its own rollbacks/commits, the Debugger can only Rollback or Commit anything done since the last commit was performed.

    Default: Commit

    Compile Dependencies

    Select whether to compile procedures called by your procedure with debug information just before the debugging begins.

    Default: Prompt

    Display | Select how debugging items display. Select the item in the box at the left, and then specify foreground and background colors for that object.


Editor - Behavior

Editor Behavior Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set Editor behavior options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Editor | Behavior.

  3. Set the options. Review the following for additional information:

    Edit Use these options to...

    Apply commit/rollback to all tabs (threaded queries)

    Apply commit or rollback selections made in the Editor to all tabs, not just the active one.

    Default: Cleared

    Auto Indent

    Automatically indent lines after you have indented one. Use this option with optimal fill and Tab Stop settings to specify how the indent is created.

    Default: Selected

    Backspace unindent

    Un-indent a selection when you press BACKSPACE. When unselected, pressing the backspace key will delete the selected text.

    Default: Cleared

    Backup Editor every n minutes

    Have Toad back up Editor contents at the specified interval. You can access the backup files from File | Recover Documents.

    Default: 3 minutes

    Block select

    Select a block of text and drag it with your mouse.

    Default: Selected

    Close Editor when session ends

    Only close the Editor when you end the session, not if it is disconnected via idle timeout or other unintentional disconnections.

    If this field is cleared, when a session ends the Editor detaches from the session and remains open.

    Default: Selected

    Cursor beyond end of line

    Allow the cursor to extend beyond the end of line. This is especially useful when using the block select option, as you can make your block as large as you need it.

    Default: Cleared

    Double click line select

    Select a line by double-clicking it.

    Default: Cleared

    Find text at cursor

    If checked, when opening a Find and Replace dialog box, Toad will automatically look for the word currently under the cursor. Otherwise, Toad will default to the word you searched for most recently.

    Default: Cleared

    Group redo

    Group undo

    Redo or undo text changes in groups of keystrokes. Groups are marked by a carriage return or by the change from typing to backspacing.

    Default: Cleared

    Preload objects on "Load Object from DB" window

    Bypass the Object Type filter and display all objects .

    Default: Selected

    Scroll past last line

    Have the ability to scroll until the last line in the Editor is at the top. If cleared, Toad stops scrolling as soon as the last line is visible in the Editor.

    Default: Selected

    Undo after save

    Roll back changes when you select Undo, even after a save or any other action that prevents undoing changes.

    Use lower case object names from select windows

    Return selected column names in lowercase instead of uppercase.

    Note: Only uppercase object names obey this option. Mixed-case and lowercase object names do not change case, regardless of the option. Mixed case names must be double-quoted and cased correctly, as opposed to the situation where an uppercase name is submitted to Oracle in lowercase and automatically interpreted as uppercase.

    Default: Cleared

    Use single Editor instance for PL/SQL if possible

    Have Toad attempt to locate an Editor that contains PL/SQL when loading it from outside of the Editor.

    This will cycle through all open Editors and find one that contains PL/SQL. If found then Toad uses that Editor. PL/SQL is determined to exist in an Editor if the parser has successfully identified a procedure, function, package, package body, type, type body, trigger, or Java source object within it. If multiple Editor windows contain PL/SQL then the first one found is the one chosen. If no Editor is found Toad will open a new Editor window.

    Default: Cleared

    Additional word characters

    Treat specified characters as a word character. For example, by default Toad treats all underscore characters as part of the object name. This can be useful if you often double click object names.

    Assume you double-click "EMP" in a table named EMP_HIRE_DATE. If this options is selected, Toad selects the whole table name; if this option is cleared, Toad only selects "EMP".

    Default: Underscore ( _ )

    Tabs

    Description

    Tab stops

    Enter the number of spaces entered when you press TAB.

    Default: 4

    Block indent

    Enter the number of spaces you want to use for an indent when you use the block indent command.

    Default: 4

    Optimal fill

    Begin every automatically indented line with the minimum number of characters possible, using tabs and spaces as necessary.

    Default: Cleared

    Languages

            Description

    Language

    The Languages area allows you access to the language management windows, where you can make changes to the language parsers in the Toad Editor. See Language Management Overview for more information.

    Code Templates

    Opens the Language Management screen and activates the Code Template tab. See Code Completion Templates for more information.

    Syntax Highlighting

    Opens the Language Management screen and activates the Syntax Highlighting tab. See Syntax Highlighting for more information.

    Additional Options

            Description

    Key Mapping

    Select shortcut keys for various Editor commands. These shortcuts are superceded by any shortcuts specified on the Shortcut Keys options page. See Shortcut Keys Options for more information.

    Tip: If you want to use the navigation keys as shortcuts, select the Use navigation keys as shortcuts field in the bottom of the Key Mapping window.

    Auto Replace

    Select options for auto replace. For example, you can choose to replace all instances of "teh" with "the" automatically.


Code Assist Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set Code Assist options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Editor | Code Assist.

  3. Set the options. Review the following for additional information:

    Toad Insight Objects | Use this option to...

    Object list

    Filter the Toad Insight lists by object type. Check the object types you want to include.

    Tip: Public synonyms can return tens of thousands of results on some databases, significantly decreasing performance. If this object type is unimportant to you, you can clear this object type to improve performance.

    Code Snippets | Use this option to...

    Snippets list

    Add, edit, or remove any of the code snippets. See Code Snippets for more information.

    Toad Insight | Use these options to...

    Cache Code Insight results

    Cache database objects after their initial fetch for a session. This option is helpful when the network connection is slow or the list of retrieved objects is very large. This option is recommended for databases with relatively static objects, but not recommended for databases where objects are frequently dropped or created.

    Tip: The results popup has a refresh button so you can reload cached results.

    Default: Selected

    Delay popups N milliseconds

    Enter the number of milliseconds after which to display the pick list popup. The timer is triggered by selected keystrokes, and if you type before the end of the timer the popup will not display.

    Default: 1500 milliseconds (1.5 seconds)

    Check syntax as you type

    Underline syntax errors with a wavy red line.

    Note: Selecting this option may cause the Editor to parse slower.

    Default: Cleared

    SQL Recall | Use these options to...

    Save only valid statements

    Select to save only SQL statements that executed successfully. This option prevents the list from containing misspelled column names, SQL clauses, and other erroneous statements.

    Default: Selected

    Write statements to disk prior to execution

    Write SQL statements to the disk before execution. This allows you to keep your SQL statement and recall it if something goes wrong in the execution.

    Default: Cleared

    Make Code | Use these options to...

    Language list

    Select the language syntax for Toad to convert a SQL statement into (Make Code Statement function) and out of (Strip Code Statement function). You can also create your own Make Code template. See Creating Make Code Templates for more information.

    Default: VB

    Variable name

    Enter the variable name you want to use for MakeCode commands.

    Default: SQL

    Strip Code copies to clipboard

    When selected, if you choose to strip code, the code you strip is copied to the clipboard so that you can easily undo the operation. If you go on to strip additional statements, or perform other tasks that place data on the clipboard, the code is overwritten: only the most recent action is saved.

    Default: Selected


Editor - Display

Editor Options: Display

These options can be found at View | Toad Options | Editor - Display.

General

Highlight execution line when not debugging

When selected, the line being executed will be highlighted as it is executed. This can be very useful when stepping through code. If unchecked, execution will occur without highlighting the entire line.

Default: Cleared

Lock results tab

When selected, the active results tab will remain active between Editor tabs.

When unchecked, each Editor tab can have a different results tab active.

For example:

You have an Editor opened with two tabs. You make the Data Grid results tab active on Tab 1 and switch to Tab 2 and make DBMS Output results tab active on there.

  • If Lock Results Tab is selected, when you switch back to Tab 1 the DBMS Output results tab is active, since it was locked as the focused tab.
  • If Lock Results Tab is not selected, when you switch to Tab 1 the Data Grid tab is active because it was the last used results tab for Tab 1.

Default: Selected

Persist display of execution time

When checked, the leftmost area of the status bar displays the execution time of the last executed query. If this option is cleared, the execution time is shown until the caret position is changed in the Editor. At that time the display changes from execution time to the LINE:COL position of the caret.

Default: Cleared

Persist dynamic highlighting when not focused

Keep dynamic highlighting when you move focus into another panel or window within Toad.

Default: Selected

Persist selection when not focused

Keep the selected code highlighted when you move focus into another panel or window within Toad.

Default: Selected

Persist selection when using navigation keys

Keep the selected code highlighted when you use arrow keys to navigate.

Default: Cleared

Show word wrap indicator

When selected, visual indicators (arrows) display at the end of lines that have been wrapped to the next line in the Editor .

When unselected, no indicators are present.

Default: Cleared

Show control characters

Display control characters (such as spaces, tabs, carriage returns) within your code.

Default: Cleared

Show current line focus rectangle

Display a rectangle around the line of code that has focus in the PL/SQL tab.

Default: Selected

Show executable line indicators in gutter

When this option is checked, a blue dot displays in the gutter of lines that have executable code.

Default: Selected

Show line numbers

When checked, line numbers will display to the left of your code. When unchecked, no line numbers will display.

Default: Selected

Show results tab toolbars

If checked then any toolbars that results tabs have will show. If clear then they are not shown.

When checked, this option displays the toolbars in the Debug windows. Uncheck this option to hide the toolbars in the Debug windows.

For example, the Editor Data Grid tab has a toolbar with VCR style navigation bars and this toolbar will be shown or not shown based on this option.

Default: Selected

Use multi-line Editor tabs

This option lets you choose whether all of the tabs will display in one line (unchecked) or whether they will be shown in multiple rows when the list of tabs is too wide for the window (checked).

Default: Cleared

Syntax Highlighting

Highlight table names

If checked, will show table names in the Editor window, using the syntax-highlighting feature. If unchecked, table names will display in black text.

Default: Selected

Highlight view names

When checked, view names will be highlighted.

Default: Cleared

Highlight stored procedure names

When checked, stored procedure names will be highlighted.

Default: Selected

Use when printing

When checked, syntax highlighting will be printed.

Unchecked, code will be printed in plain text.

Default: Selected

Fonts

Editor

Set the main Editor font.

Line number

Use this to set the font for line number display.

Gutter and Margin

Use these to set the width and position of visible gutters and right margins.

Visible gutter width:

Set the width of the gutter to the left of your code. Default: 50

Visible right margin position:

Set the position of the right margin on your screen to make your coding area wider or narrower.

Default: 80

Background Color

Set the background color for the windows in your Editor. You can select from any of the default Windows settings or specify your own color scheme.

The default is Window background, which corresponds to the Window Background setting for Windows.

Hex Editor Bytes per line: n

Use this option to specify how many bytes per line will display.

The default is 20.


Editor - Open/Save

Editor Options: Open/Save

These options can be found at View | Toad Options | Editor - Open/Save.

Opening Files

File splitting was designed to accommodate users with multiple PL/SQL objects in a single file. This feature lets you load multiple objects from one file and save package specs and bodies to one file.

When a file is loaded, the Editor checks to see whether more than one PL/SQL object is created in the file. If so, the Editor takes action depending upon which of the options listed below is set.

The default is Prompt to split files.

Automatically split files when multiple objects separated by "/"

This option will automatically split files when Toad comes across a "/". Toad assumes you want to split different objects onto different tabs.

Each section using a forward slash as a statement terminator will be placed in a separate tab.

See Editor Options: Open/Save for more information about saving files that Toad has split.

Prompt to split files

When this option is checked, Toad will ask if you want to split a file into separate tabs. Splitting the file is recommended, but you can choose at the prompt to keep the file as one.

Never split files

When this option is checked, Toad will always load files into one tab and never split a file into body and spec.

Saving Files

When a package spec and body are both loaded from database into the Editor, and you choose to save to file, Toad’s behavior depends on these options.

If only the spec or only the body is loaded, then only the object that is loaded will be saved to file.

The default is Never combine spec/body.

Automatically combine spec/body when saving object to file

Puts spec and body into the same file.

Prompt to combine spec/body

Prompts you every time you close the files.

Never combine spec/body

Saves only the object on the currently active tab.

Use file splitting tags "/* <TOAD_FILE_CHUNK */"

This option lets you re-save your split files into one file. Toad inserts the tag in the location where the file was split as a remark, so that it can easily split the file back out into separate tabs later. This allows you to save your files as single files, but still compile them and work in separate tabs within Toad.

Note: If file splitting tags are used, Toad will not scan the document to split the file at "/". Using the file splitting tags is more efficient for future file splitting, but it should not be used if the file might be modified outside of Toad to include additional PL/SQL objects.

Default: Selected

Save to separate files after splitting

If you have chosen to split a file into multiple tabs, Toad’s treatment of the file depends upon this option to separate files after splitting.

  • Unchecked: Keeps the original filename and load the contents of the file into separate tabs, so that there is one tab per object. Toad then keeps track of the fact that the tabs are all associated with the same file. You can choose whether or not to use "Toad file splitting tags". See Editor Options: Open/Save for more information.
  • Checked: Split the contents of the file into separate tabs so that there is one tab per object, but don’t associate the tabs with any filename. This lets the user specify the filename when saving the tab.

Default: Cleared

File Loading/saving

Prompt for reload on activation if timestamp has changed

If checked, this allows editing in an external Editor. When an Editor window containing a file is reactivated (gets focus), Toad will check the date stamp of the file to see if it was modified by the external program. If the file was modified, Toad will display a prompt dialog box that will say that the file date/time has changed and ask you if you want to reload it. Select Yes, and the file will reload.

Default: Cleared

Prompt to save on Editor close

If checked, Toad will prompt you to save any text you typed in the Editor.

Note: Even if this option is cleared, a loaded and modified file will always prompt you to save the contents.

Default: Selected

Format files when opened

If selected, this option will automatically format any file opened in the Editor, using Toad's built-in formatting capabilities. Formats can be customized using the View | Formatting Options window.

Default: Cleared

Object Loading

Owner Name

Select when to include the owner name when listing an object.

  • Always include - always include the owner name automatically. For example, JSMITH.TABLENAME. This is the default.
  • Never include - never include the owner name automatically. For example, TABLENAME.
  • Include on loads from other schemas - include the owner name automatically only when the object is loaded from a different schema.

Packages/Types

  • Load Spec and Body as pair (Package or User Type) - If this option is checked, when you load a package or a type spec or body into the Editor, the associated spec or body will also be loaded. The default is checked.
  • Separate Tabs - When checked, the spec and body will be loaded in separate tabs. When unchecked, the associated spec or body will be loaded into the same tab. The default is checked.


Editor - Printing

Editor Printing Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Note: Quest ScriptRunner (QSR) has the same printing options.

To set printing options

  1. Select View | Toad Options | Editor | Printing.

    Note: Select Edit | QSR Options | Printing in QSR.

  2. Set the options. Review the following for additional information:

    Hide collapsed

    Omit collapsed (folded) text from the printed output.

    Default: Cleared

    Transparent

    Removing highlighting in the printed output. See Highlighting Tab for more information.

    Note: This option is not available in QSR.

    Default: Cleared

    Block staples

    Include block staples in the printed output. See Draw block staple for more information.

    Default: Cleared

    Header

    Include a header and footer when you print the Editor contents. You can use tags to include specific information:

    • #page# - Include the page number.
    • #title# - Include the filename.
    • #date# - Include the date.
    • #time# - Include the time.
    • #datetime# - Include both date and time.

    The header and footer can contain multiple lines. They are saved in EditorHeader.txt and EditorFooter.txt, in the \User Files folder.

    Header default: #title#

    Footer default: #datetime# and Page #page#.

    Footer


Email Settings

These options can be found at View | Toad Options | Email Settings.

Global Settings

These are the settings that are applicable for all of the email windows. Enter your SMTP server information and user name here. The default port number is 25. You can change it if the port you use is different from the standard. If a password is required you can select that and enter it as well.

You can also send test email to test settings you have configured.

To send Test Mail

  1. Fill out your email settings. All required fields (*) must be entered.
  2. Click the Send Test Mail button. Toad will either send the test mail, or notify you as to why it could not be sent.

Window Settings

Set email options globally for the various Toad tools and managers that allow email notification from this options page. These tools and managers include:

  • Analyze Objects. See Analyze All Objects for more information.
  • CodeXpert (CX) Results. See Email Results for more information.
  • Database Comparison. See Compare Databases for more information.
  • Database Monitor. See Database Monitor for more information.
  • Health Check. See Database Health Check for more information.
  • Instance Manager. See Instance Manager for more information.
  • Rebuild Multiple Objects. See Rebuild Multiple Objects Overview for more information.
  • Schema Comparison. See Compare Schemas for more information.

To select settings

  1. In the Windows box, click the Toad window you want to adjust. For example, click Health Check. Health check is highlighted, and the rest of the boxes display the options for the Health Check window.
  2. The Subject and the From Name boxes have default entries. These can be changed.
  3. You will need to enter the Reply To address and the From Address.
  4. You can also change the priority from Normal.

To add recipients

You can add an email address to the To, CC or BCC boxes.

  1. Do one of the following:
    • Click the "+" (plus) button.
    • Press <Insert> on the keyboard. An Add Recipient dialog box displays.
  2. Enter the address and click OK. The address displays.

To delete recipients

  1. Do one of the following:
    • Highlight one or more email addresses in the To, CC or BCC box and click the "-" (minus) button.
    • Press Delete on the keyboard. A confirmation dialog box displays.
  2. Click Yes and the addresses are removed.

To copy settings

You can copy all of the settings from one window to another:

  1. In the Window box, select the name of the window that has the appropriate settings.
  2. Drag it to the name of the window you where you want to assign those settings. A confirmation dialog box displays.
  3. If the windows are correct, click Yes to copy the settings. This copies all setting except the Subject line.

In addition, you can copy any of the recipient addresses between the To:, CC:, or BCC: boxes by clicking and dragging them.

To clone settings

You can copy all settings except the subject from one window to all other windows that require email settings.

» From the Toad Options | Email Settings page, click Clone Settings. A confirmation dialog box displays.


Executables

Access this page from the View | Toad Options | Executables menu item.

It contains boxes for the paths of the following executables:

  • SQL*Plus
  • SQL*Loader
  • Import used in the Import Utility Wizard)
  • Export (used in the Export Utility Wizard)
  • TKProf
  • TNS Ping (used in the Database Monitor window)
  • Wrap
  • Export Pump
  • Import Pump
  • RMAN
  • Ping (used in the Database Monitor window)
  • Editor (external editor)
  • XML Editor (external XML Editor)

Auto#detect paths for current Oracle Home

You can click the find [image] buttons to use the autofind feature and the executable location will be filled in or you can click the drilldown button to search through your directories.


Execute/Compile

Execute and Compile Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set execute and compile options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Execute/Compile.

  3. Set the options. Review the following for additional information:

    Behavior | Use these options to...

    Poll for DBMS Output when detected

    Have Toad automatically poll for DBMS Output if output is detected when executing a script.

    Default: Cleared

    Prompt for substitution variables

    Have the Editor prompt you for variable values when it encounters a substitution variable in the SQL to be executed. Variable formats are: &VAR, &&VAR, and :VAR.

    Default: Selected

    Save proc parameters between sessions

    Save debuggin parameters for PL/SQL objects to your ToadParams.ini file.

    Default: Selected

    Use hierarchical profiler on Oracle 11g and newer

    Have Toad default to the newer hierarchical profiler rather than the line item profiler if you are connected to an Oracle 11g database or later.

    Default: Cleared

    Compiling | Use these options to...

    Compile Spec and Body as pair (Package or User Type)

    Compile the spec and then the body if you have both loaded in the Editor. This option is especially useful if you use file-splitting for packages and want to compile both objects at the same time.

    Default: Cleared

    Default to "Compile with Debug"

    Have the Toggle button begin in the on position each session.

    Default: Selected

    Use "CREATE" instead of "CREATE OR REPLACE" when loading database objects

    Prevent Toad from overwriting an existing object. The compile fails if the objects already exists.

    Default: Cleared

    Notification when compile process is complete

    Play the ToadLOAD.WAV (croak sound) when a procedure finishes compiling.

    Default: Cleared

    Set optimizing compiler value

    Execute the following query on a new connection and also when the options window options are applied for any 10g connections:

    ALTER SESSION SET plsql_optimize_level=X

    The values set the level of optimization that Oracle uses to compile PL/SQL library units. See Oracle's documentation for more information.

    Default: 2

    Set Modified Flag off after compiling from database

    Toggle the Modified flag whenever you compile source from the database, allowing you to tell when source has been modified.

    Note: It is strongly recommended that if you are using Team Coding features you leave this selected.

    Default: Selected


Files - General

These options can be found at View | Toad Options | Files - General.

File Types:

Nearly all - but not all - of the File Open, File Save and Export file dialog windows displayed through Toad are for the purpose of manipulating SQL files. The grid dialog box lets you customize the file extensions that display in the system dialog box windows. To add another filter, begin typing in a blank row. To delete a filter, highlight the text and press the DELETE key.

The default filters include:

File Type | Filter
Function | *.fnc
HTML | *.html, *.htm, *.asp, *.xml, *.xsl, *.xsd
Ini | *.ini
Java Source | *.jvs
Java | *.java, *.jvs
Package Body | *.pkb
Package | *.pks
PL/SQL | *.sql, *.prc, *.fnc, *.pks, *.trg, *.vw, *.tps, *.tpb
Procedure | *.prc
RMAN | *.rcv
SQL | *.sql
Text | *.txt
Trigger | *.trg
Type Body | *.tpb
Type | *.tps
View | *.vw
All Files | *.*

To create a file association

  1. Click Add.
  2. Enter a description in the type box.
  3. Enter the extensions you want associated with that type in the Extensions box.

    4. If you want these associated with Toad on a windows level, check the "Open with Toad" checkbox.

    Note: This creates a Windows file association for the specified file extensions. If you double-click in the file explorer on a *.SQL file, for example, then Toad will startup automatically.

  4. Click OK.

Save source files in Unix format

Save CR-LF character pairs as LF, making the source compatible with Unix.

Default: Cleared

Use Universal Naming Convention (UNC) for file and folder names

If checked, Toad will convert file and folder names to UNC. This affects all open/save dialogs and the Project Manager.

Default: Selected

Number of files to save in recently used file lists

This option designates how many recently used files to maintain in the files list. Less recently used files over this number of files will drop off the list.

The default is 10.


Files - Open/Save Dialogs

These options can be found at View | Toad Options | Files | Open/Save Dialogs.

These fields control the "Favorites" box on the open/save dialogs. You can specify favorites or remove them from your list here as well as from an Open/Save dialog.

Favorite Folders

Manage your favorite directories from this option window.

You can Add, Edit, or Delete entries. If Sort alphabetically is not checked, you can select a directory and move it up or down in the list.

Sort Alphabetically

If this is checked, all directories will be listed in alphabetical order. This makes them easier to organize. If unchecked, entries are listed in the order in which they were added, and you can rearrange the order

Default: Selected


General

General Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set general options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select General.

  3. Set the options. Review the following for additional information:

    General | Use these options to...

    Flash the output window when messages are written to it

    When this option is checked, if Toad is the active application the output window will flash when messages are written to it.

    Default: Cleared

    Default encoding

    Set the default encoding of Unicode files. Unless manually changed in the affected window, Toad uses this setting for encoding saved files in places where you can specify encoding (for example, Save As dialogs and Editor tabs).

    Default: ANSI

    Application data directory | Use these options to...

    Folder

    Set the default installation directory for new installs. This enables roaming profile support by default.

    Use Default activates to your main application data folder.

    Use Local Default activates your local application data folder, which does not support roaming profiles.

    Note: You must restart Toad for a change in this option to become active.

    Numeric characters | Use these options to...

    Decimal and Thousand Separator

            Use these options to set the decimal and thousands separator for display purposes. Both must be set, and they must be different.

Related Topics

Oracle Transaction Options


Network Utilities

Network Utilities Options allow you to set some of the parameters for using the tools provided by the Network Utilities window.

These options can be found at View | Toad Options | Network Utilities.

Adding and Editing Host, User names, and Default Directories

You can add, edit and delete Host and User names for use in several windows. These names will display in the drop-down menus in Telnet, Rexec, and Ping. You can set a default directory for each host.

  • Click Add to add new host information in the Server Settings window. Add your host, user name and directory and then click OK. You can have more than one user per server host. See FTP for more information.
  • Select an existing Host name and click Edit to change it. The host information dialog box displays. Make changes and click OK.

  • Select an existing Host name and click Delete to delete it. The name is deleted.

    Caution: When deleting an existing Host and User name, there is no warning. If you click Delete, the selected name will be deleted immediately.

FTP ASCII Extensions

You can define FTP extensions for ASCII files to control the transfer mode while using FTP. If you have listed an extension under ASCII, then files of that type by default will be sent using ASCII. Any extensions not listed in this box will be sent using binary. Add additional extensions by clicking Configure and selecting from the list. You can also add new extensions by clicking Configure | Add New.

FTP View Extensions

You can assign extensions that will open in the Editor when you fetch them using the FTP feature. Any extensions not listed will be sent but not opened in the Editor. Add additional extensions by clicking Configure and selecting from the list. You can also add new extensions by clicking Configure | Add New.

Telnet and SSH

Font

You can change the font used for the telnet utilities.

  1. In the appropriate area (Telnet or SSH), next to the Sample Telnet font, click Font.
  2. Select the font formats you want to use when using the telnet utility. Click OK. The sample Telnet font changes to the font you have chosen, and the next time you telnet, this font will be used.

Background Color

You can change the background color used for the telnet utilities.

  1. In the appropriate area (Telnet or SSH), next to the Sample Telnet font, click Color.
  2. Select the background color you want to use when using the telnet utility. Click OK. The background of the sample Telnet font changes to the color you have chosen, and the next time you telnet, this color will be used.


General Oracle Options

These options can be found at View | Toad Options | Oracle - General.

Passwords

Save passwords for all Oracle connections

Normally, only the schema and database are saved to the TOAD.INI file for each new Oracle connection. Checking this option will save the passwords, too. Be sure you work in a secure environment where your TOAD.INI file will not fall into the wrong hands. All passwords in Toad are encrypted using AES encryption.

This option can be toggled from the Save Passwords checkbox on the Server Login window as well. See Save Connection Passwords for more information.

Default: Cleared

Remember passwords for Oracle reconnects

If this option is checked, then Session | Test Connections will not prompt for a password. To remember passwords when you close Toad, see Save passwords for Oracle connections, above.

If this option is unchecked, then Session | Test Connections will prompt for a password, and the Database Login window will prompt for a password every time you connect, unless Save passwords for Oracle connections is checked.

Caution: Checking this option keeps your passwords in Toad’s memory if a connection is broken. This may be a security risk.

Default: Selected

Newline format for character data

These options apply to the Popup Text Editor in the data grids. See Popup Editors for more information.

Windows style (convert all newlines to CR/LF)

If selected, when Toad reads data from Oracle into the data grids, it will retrieve it without converting LF's or CRLF's. But when the text from a column is opened in the popup text editor, any linefeeds found in the text will be converted to CRLF's, and if the data is altered, Toad will post any CRLF's or LF's it finds in that data as CRLF's.

The default is cleared.

Unix style (convert all newlines to LF)

If selected, when Toad reads data from Oracle into the data grids and the popup text editor, it will read linefeeds (LF) as carriage return-linefeed pairs (CRLF). Then if data in the text columns is altered, Toad will post any CRLF's or LF's it finds in that data as LF's.

Default: Selected

Explain plan

Schema

This is the schema name that will be used when writing out and fetching Explain Plan data.

The default is the windows logon name.

Table

This is the table name you want Toad to use when saving Explain Plan results. See Install Server-Side Objects for more information.

The default is "Toad_PLAN_TABLE".

Save previous Explain Plan results (requires Toad tables)

If checked, will save the Explain Plan outputs in the Toad tables, viewable in the "Database | Optimize | Explain Plan" window.

Default: Cleared

Chained rows

Schema/Table boxes

This option allows you to choose the schema and tablename for chained rows by entering it in the box.

The default tablename is CHAINED_ROWS. See Repair Chained Rows for more information.

Caution: The Chained Rows table is where Toad tells Oracle to store the row ids of the chained rows that are found. It is NOT the table that you are supposed to analyze. Remember, Toad will truncate the chained rows table before it analyzes the tables in the list.

DBMS Output

DBMS Buffer Size

Set the size of the DBMS buffer here. When the buffer exceeds this size you will receive a buffer overflow error. If you are using Oracle 10g, this buffer size is automatically set to unlimited and disabled from change.

DBMS Output Font

Click this button to set the font for DBMS output displays. See DBMS Output Window for more information.

Default Schema

Default schema for connections to: current connection

You can enter a default schema in this box. When a connection is made to this database, the Schema Browser will open to this default schema if it exists on the Database.

If the schema does not exist on the connected database, the Schema Browser will open to the connected schema.

This option can also be changed using the Schema Browser popup menu | Set current schema as default or Clear default schema.

The default is no schema selected.

Default schema for connections to: current schema@current connection

You can enter a default schema in this box. When a connection is made to the database, the Schema Browser will open to the specified schema if it exists on the Database.

If the schema does not exist on the connected database, the Schema Browser will open to the connected schema.

This option can also be changed using the Schema Browser Popup menu | Set current schema as default or Clear default schema.

The default is no schema selected.

Used in

Click the Used in button to specify which windows will obey the default schema options. All default to OFF except the Schema Browser.

Double Quote Object Names

If you select:

These will be enclosed in double-quotes

Minimal
  • Mixed case words
  • Reserved words
  • Words starting with any non-alpha character
  • Words containing any non-alphanumeric character, except #, $, or _

Non-ASCII

Everything minimal double-quotes, plus words containing non-ASCII characters

All

Everything

OCI Array Buffer size

This option lets you set the size of the OCI Array buffer.

When a SELECT query is executed, Toad retrieves the rows from the Oracle server. Toad retrieves the rows in blocks. The number of rows retrieved in each block is the number of rows you specify with the OCI Array Buffer Size option.

You can set the buffer up to a value of 999. The disadvantage to a higher setting of OCI Array Buffer Size is that Toad must allocate memory to hold that many rows prior to each fetch. If that many rows are actually fetched, there is no loss. On the other hand, if not that many rows are retrieved, then some memory is allocated that will not be released until the cursor is freed. Overall, this amount of allocated memory is generally unnoticeable.

The default is 500.

Related Topics

Oracle Optimizer Hints


Oracle Optimizer Hints

These options can be found at View | Toad Options | Oracle Optimizer Hints.

This option screen lets you select the best optimizer hint for the DDL queries that Toad executes. You can choose between Default, /*+ CHOOSE */, /*+ RULE */, and /*+ FIRST_ROWS */.

Optimizer hints for several DDLs are built into Toad. You can edit these, or add others if necessary.

The screen is laid out in grid format, with the DDL, Oracle version and rule.

All Others

At the bottom of the window is a drop-down field. Use this to select an optimizer hint to use for any view not specified in the main Optimizer hint grid. For example:

  • Toad is about to run a query against DBA_TABLES on Oracle 8i.
  • First it looks in the grid: if dba_tables for 8i is specified in the grid, then it will use the hint specified there.
  • If dba_tables for 8i is NOT specified, Toad will use the hint specified by the "all others" combo box.

To edit an optimizer hint

  1. Put the grid into Edit mode by checking the Edit checkbox at the bottom of the window.
  2. Click in the Optimizer Hint column of the record you want to edit.
  3. From the drop-down, select the hint you want to use.

To add an optimizer hint

  1. Put the grid into Edit mode by checking the Edit checkbox at the bottom of the window.
  2. Click [image] at the top of the window. A new record is inserted above the location of your cursor in the grid.
  3. Click in the View Name column of the new record and then select the view name from the drop-down list.
  4. Click in the Oracle Version column of the new record and then select the Oracle version from the drop-down list.
  5. Click in the Optimizer Hint column of the new record and then select the optimizer hint you want to use from the drop-down.
  6. Click [image] at the top of the window to complete your edit.

Related Topics

General Oracle Options

Oracle Transaction Options


Oracle Transaction Options

These options can be found at View | Toad Options | Oracle - Transactions.

Execute queries in threads (Creates a separate session)

When checked, Toad will create a separate session specifically to execute queries. A new session will be created for each query being run from the Editor, Schema Browser, or Object Search window.

Default: Cleared

Execute scripts in Toad session

When unchecked, Toad will create a separate session specifically to execute scripts.

When checked, Toad will execute scripts within the main session.

This provides considerably more flexibility for how scripts perform. For example, you can now execute a script with a DISCONNECT command in it:

  • If the option is checked, it will disconnect the Main Toad session.
  • If the option is unchecked, the disconnect will execute correctly in its separate session, having no adverse affect on the main Toad session.

Default: Cleared

Commit after every statement

Commit every time a statement is run, after any posted edits are made in the grid, and after a row is deleted in the grid.

Default: Cleared

Use a separate connection when Toad itself is generating transactions

When Toad is putting data into the Explain Plan tables, this setting will force Toad to use a separate connection.

Note: When using this option and connecting to a RAC instance, you must have the TNSNAMES entry for the instance where the server directed the transaction. Or, you must connect directly to an instance of the cluster without letting the server assign an instance.

Default: Cleared

When Closing Connections

Commit, rollback, or prompt when closing connections. This field is disabled if you select Commit after every statement.

Note: Oracle commits after any DDL modifications.


Proc Templates

This option lets you add and remove templates. You can add as many or as few as you need.

To access proc templates

» Access this option from View | Toad Options | Proc Templates.

To add a template

Note: Templates must be created before you add them. Include the CREATE OR REPLACE statement. The macro %TriggerOpts% will receive the trigger options you select when creating a new trigger.

  1. Click Add.
  2. Select the Object type for this template.
  3. Click in the Display Name field for the new template and edit the name to something descriptive.
  4. Enter the filename of the SQL file that contains your template, or select it.
  5. Click OK.

Note: There are two template types that you can use only within packages. These are Package Function and Package Procedure. You can create and edit these templates from the Toad Options | Proc Templates page, but you cannot access them directly from the Create PL/SQL Object window. See Using Templates within Packages for more information.

To delete a template

  1. Select the template you want to remove by clicking on it.
  2. Click Delete. A confirmation dialog box displays.
  3. Click OK to remove the template.

To edit a template

You can easily edit a template through an external editor (configure from Toad Options | Proc Templates).

  1. Select the template you want to edit by clicking on its name.

  2. Click Edit File. The external editor opens with the template loaded.

    Note: you must have an external editor specified in Toad Options | Executables to use the edit feature. See Executables for more information.

  3. Edit your template and save it.

Substitution variables

This lets you add and remove template substitution variables. These variables are used to populate the New Procedure templates with default values or values in addition to the Toad defined variables (for example, %DATE%, %TIME%). You can add any substitution string you like and a default value for that string.

Value for %username% variable

This value you enter in the box will be substituted automatically for %USERNAME% when new procedure templates are read up into the Editor.

The default is blank.

Related Topics

Create New PL/SQL Object


Query Builder - General

Query Builder

These options can be found at View | Toad Options | Query Builder.

Behavior

Automatic AutoJoin

When selected, this feature will automatically check foreign key constraints and join tables that are dropped into a model with other tables. If this option is unchecked, then you can manually join tables with the table popup menu.

Default: Selected

Include schema in generated SQL

When checked, this feature will always precede the table name with the schema name (such as, myschema.mytable) in the generated SQL. Schema names are always used if the table belongs to a different login.

Default: Cleared

Automatically Select All Columns

When checked, this feature automatically selects all columns when a table is added to the Query Builder. If unchecked, no columns are selected, and must be selected manually.

Default: Cleared

Allow Cartesian Joins

This option, when checked, lets you allow cartesian joins between tables.

Default: Cleared

Warn

When selected, Toad will warn you when you have created a cartesian join.

The default is selected, but only in effect if Allow Cartesian Joins is selected.

Use ANSI Syntax

If checked, the join syntax will be ANSI if the database is 9i or higher.

If the database is less than 9i, ANSI syntax will not be used in any case as versions earlier than 9i do not support ANSI syntax.

Default: Selected

Open full screen from Schema Browser

This option, when checked, has Toad open the Modeler in full screen mode instead of minimized when opened from the Schema Browser.

Default: Cleared

Limit visible columns to n when adding tables to the model area

When checked, this option limits how many columns display in the table model at one time. Other columns are available by scrolling. This can be useful if you want to model large numbers of tables.

Default: Cleared

Display

Use these drop-down boxes to change the color of the joins in your model. In this way you can easily view join types:

  • Inner join
  • Outer join
  • Auto join

Object Font

Click this option to change the font used in the Query Builder for displaying the names of objects.

Functions

This is the list of functions displayed in the Field Definition dialog boxes.

  • To add a function to the list, enter it in the box and click the Add button. Added functions display at the bottom of the list.
  • To remove a function from the list, select it and click the Remove button.

Caution: Removing a Function happens immediately, without warning. However, the text remains in the box. If you click ADD immediately after removing a function you can restore it.


RMAN Templates

This screen provides a central location to list your RMAN templates and the path to them so that you can run them from Toad.

To add a template to the list

  1. Click Add.
  2. Enter the display name for this template. This is the name that Toad will display when you choose to Generate an RMAN script.
  3. Enter the full path to where the template resides, or click [image] and navigate to it.
  4. Click OK.

To delete a template from the list

  1. Select the template you want to delete.
  2. Click Delete.
  3. Confirm that you want to delete the template by clicking Yes.

To edit a template

  1. Select the template you want to delete.
  2. Click Edit File.
  3. When the file opens in your external editor, make your changes, and then save the file.

Related Topics

Execute RMAN Scripts from Toad

Working with RMAN Templates


Schema Browser Data Tab Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set Schema Browser data tab options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Schema Browser | Data Tab..

  3. Set the options. Review the following for additional information:

    Field Description
    Save layouts

    When checked, Toad automatically saves the Data tab grid layouts with respect to column order, and columns to exclude.

    Note: Sorting and Filtering are a function of the data filters and are automatically saved, whether or not this option is checked.

    Default: Cleared

    Set focus to grid after selecting table, view, or materialized view

    If this option is selected and you have the data tab selected in the right hand side, when you change tables in the Schema Browser focus will remain on the table data grid.

    Default: Cleared

    Highlight columns populated by sequence/trigger pair

    When a sequence/trigger pair has been created, selecting this option highlights any columns populated by that method. This option is only applicable in the Schema Browser data grids, not those in the Editor, although the trigger/sequence pair will still populate the column there.

    See Automatically Increment Columns with Sequence/Trigger Pair for more information.

    Default: Selected

    Enable value lookup for foreign key constraints

    When checked, you can look up foreign keys in the data grids.

    Default: Selected

    Include disabled FK constraints

    This option is only available when Enable FK lookup is checked.

    When checked, this option includes disabled Foreign Key constraints in the data grid lookup window. See Foreign Key Lookup for more information. If unchecked, only enabled constraints will display when you perform a look up.

    Default: Selected

    Use NOPARALLEL hint

    On tables that have parallelism (degree or instances <> 1), Oracle runs multiple processes when you query them. In this case, the processes are not removed until the cursor is closed (in other words until you close the Schema Browser or move to a different table). Since the Schema Browser Tables Data page does not do any heavy processing, these processes can be better used elsewhere.

    When checked, Toad will use the NOPARALLEL hint in the data grids, making the queries consume less of Oracle's resources.

    Default: Cleared

    Don't select BLOB/CLOB fields in data grids

    When checked, the data panel of the data grids will not display BLOB or CLOB fields. This can save loading time. When unchecked, the field is selected and displayed.

    Default: Cleared

    Warn after n fetches (n records)

    When selected, Toad warns you when n number of fetches have been made. Each fetch retrieves the number of records specified in the OCI Array Buffer size field on the Oracle - General options page. See General Oracle Options for more information.

    Default: Cleared No warnings are given.

    Fetch 25 rows at a time through db links

    Use this option to limit how many rows Toad fetches through a db link. Limiting this can improve performance.

    Default: Cleared

Related Topics

Schema Browser Left-Hand Side Options

Schema Browser Right-Hand Side Options

Schema Browser Types Tab Options


Schema Browser Left-Hand Side Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set Schema Browser left-hand side options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Schema Browser | Left-Hand Side.

  3. Set the options. Review the following for additional information:

    History

            Use this options to...

    Restore history on connection

    Have Toad remember your Schema Browser history when you disconnect and reconnect.

    Default: Selected

    Filters | Use this options to...

    Filters

            Select one of the following options:
    • Save Filters per logon username— Select to have Toad automatically save your filter settings per schema (user). For example, if you have a SCOTT schema in two different databases, Toad would use the same filter for both SCOTT schemas. When you open the schema, Toad remembers and applies the last filter that you used for it; however, you can always clear the filter or apply a different one.
    • Save filters per connection—Select to have Toad automatically save your filter settings per connection. In contrast to Save filters per logon username, if you have two SCOTT schemas in two different databases, Toad would use a different filter for each schema. When you open the schema Toad, remembers and applies the last filter that you used for it; however, you can always clear the filter or apply a different one.
    • Don't save filter changes and start with default filter—Select to always load the default filter, regardless of the filter that was previously applied. Then, click Default Filter to set default filters, or select Session | Schema Browser Filters.

    If you select Save filters per logon username or Save filters per connection and there was no previous filter applied, Toad applies the default filter for the object type. If there is no default filter, Toad displays all objects.

    Default: Show filters per logon username

    Visual | Use these options to...

    Tab/drop-Down icons

    Display an icon associated with the object on the object tab or beside the name in the drop-down object list.

    Default: Cleared

    Item hints

    Display a pop up hint describing the object when you hover over an object on the left hand side.

    General

            Use these options to...

    Fetch table names from Oracle as needed

    Automatically refresh the table name list when something changes. If cleared, the table name lists is not refreshed you refresh it manually.

    Default: Cleared

    Milliseconds for list search timer on LHS lists

    Enter the length of time that Toad waits between keystrokes when you type an object name and before it goes to it on the left-hand side. This option applies to tabs that allow multi-selection of objects and are not tree views.

    Default: 900 milliseconds

Related Topics

Schema Browser Data Tab Options

Schema Browser Right-Hand Side Options

Schema Browser Types Tab Options


Schema Browser Right-Hand Side Options

The options on this page are found on the View | Toad Options | Schema Browser | Right Hand Side page.

Packages

Sort package procedures

If this is checked, when you expand the hierarchical view of packages in the Schema Browser, procedures and functions in the specification and body display in alphabetical order.

When unchecked, they display in the order they display in the code.

Default: Cleared

Show Body when Package Name is Selected

Default: Cleared

Omit SYS objects from Procedure Dependencies List

Default: Selected

Compile Mode…

Click this button to select how Toad refreshes the Schema Browser when you compile an object from the following options:

  • Refresh items one by one
  • Refresh entire Left Hand side when complete
  • Don't ask before compiling in the Schema Browser (unchecked)

The default is Refresh items one by one.

Tables - Columns Tab

List primary key columns

When checked, Toad will display the list of Primary Key columns, on the Tables/Columns tab, to the right of the Show Comments drop down list. For some tables with long column names, and/or compound primary keys, this label might not be long enough. Toad now places a small black triangle next to each column in the columns list that is a Primary Key column.

Default: Selected

Include hidden columns

When checked, Toad will display hidden columns as well.

Default: Cleared

Show Column length info with Column data type

If checked, columns will show, in the columns tab, in the format "VARCHAR2(20)" including max length, scale, and precision (if applicable). If unchecked, length, scale, and precision will display in separate columns in the grid.

Default: Selected

Allow extra lines for column comments

If checked, the comments are shown in the grid and are wrapped so that you can see the full text of the comments. The rows of the grid are resized so that the full column comments are shown.

If unchecked, the columns take up one row each, and are no longer wrapped, so only what fits on one line is shown.

Default: Selected

General

Show Create/Alter dates

If checked, create and update dates for an object selected on the left panel in the Schema Browser will display at the top of the right panel. Unchecked, these dates do not display.

Default: Selected

Update RHS on database object selection in LHS

If this option is selected, when you select an object from the Objects panel in the left hand side, Toad will automatically refresh the details in the details pane. If this is unchecked, details will not be refreshed until you refresh them manually.

Default: Selected

Only show top-level grants for Users, Roles, Sys Privs, and Resource Groups tabs

When unchecked, the entire hierarchy of dependencies is displayed for all grants, regardless of level. For example, if you have been granted a DBA role, you will be able to expand that role and see the grants indirectly provided by this role (for example, CONNECT).

If this option is checked, only grants that have been directly granted to the user are shown. Checking this option greatly improves the loading time of those Schema Browser tabs, but clearing it gives you a detailed view of what privileges a user/role has been given.

Default: Cleared

When copying column names to clipboard

Items separated by commas

When this option is selected, the list of objects will be pasted all on one line, separated by commas.

One item per line

When this option is selected, the list of objects will be pasted on multiple lines, one object to a line. This is the default behavior.

Related Topics

Schema Browser Data Tab Options

Schema Browser Left-Hand Side Options

Schema Browser Types Tab Options


Schema Browser Types Tab Options

These options can be found at View | Toad Options | Schema Browser - Types tab.

Capitalize keywords during code generation

If checked, when code is generated to create the objects, keywords will be capitalized.

Default: Selected

Autoload Tables Based On Object

If checked, will automatically load and display the tables based on the selected object and display them on the Properties tab.

Default: Cleared

Autoload Columns Implementing Object

If checked, will automatically load and display the columns implementing the selected object on the Properties tab.

Default: Cleared

Autoload Dependencies

If checked, will automatically load and display the objects that the selected object is dependent upon.

Default: Cleared

Name New Objects

This is the name that will be given to a new object, until you rename it to something more meaningful. For each successive object, a number will be appended to this name, for example, NEWOBJECT1, NEWOBJECT2, and so on.

Name New Attributes

This is the name that will be given to a new attribute within a given object, until you rename it to something more meaningful. For each successive attribute, a number will be appended to this name, e.g., NEWATTRIB1, NEWATTRIB2, etc.

Name New Methods

This is the name that will be given to a new method within a given object, until you rename it to something more meaningful. For each successive method, a number will be appended to this name, e.g., NEWMETHOD1, NEWMETHOD2, etc.

Name New Collections

This is the name that will be given to a new collection of objects, until you rename it something more meaningful. For each successive collection, a number will be appended to this name, e.g.: NEWCOLLECTION1, NEWCOLLECTION2, etc.

Default Method Restrictions

Select the desired method restrictions: WNDS, WNPS, RNDS, and/or RNPS.

The default is all items unselected.

Default Attribute Type

This is the default data type for a new attribute.

The default is VARCHAR2.

Default Method Type

This is the default method type for a new method when the New Method button is clicked. Alternate method types can be selected from the drop down menu.

The default is Procedure.

Default Function type

This is the default function type for a new function.

The default is INTEGER.

Related Topics

Schema Browser Data Tab Options

Schema Browser Left-Hand Side Options

Schema Browser Right-Hand Side Options


Script Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set script options

  1. Select View | Toad Options | Scripts.

    Note: Select Edit | QSR Options | Scripts in QSR.

  2. Set the options. Review the following for additional information:

    Login Scripts | Use these options to...

    glogin.sql

    Glogin.sql (traditionally for group login settings) and login.sql (user’s personal login settings) are Oracle standards and used by SQL Plus as well as other applications. See Oracle's documentation for more information. TOAD supports these for Editor script executions. These boxes are read-only. Toad uses a SQL Plus algorithm to locate them.

    Note: glogin.sql is executed first and then login.sql is executed. Therefore, any settings in login.sql take precedence over any settings that coexist in glogin.sql. For example, if SET LINESIZE 100; resides in glogin.sql and SET LINESIZE 150; resides in login.sql then 150 would be used for LINESIZE.

    login.sql

    Script output | Use these options to...

    Show script grids

    Display results from queries that return row results in a grid (in the script output area).

    Default: Selected

    Maintain Script History

    Display a History tab in the script output area. The History tab displays output for all the scripts run during this session, or until the history tab is cleared.

    Default: Cleared

    Miscellaneous Script Options | Use these options to...

    Restore SET defaults prior to script execution

    Restore the settings in the default settings file every time a script is executed in the Editor. If this options is cleared, Toad loads the settings at the Editor startup and any changes persist for all executions that follow.

    Default: Selected

    Ignore specified ORA-errors in scripts

    Always ignore specific ORA errors whenever you execute a script. Click Edit to change the list of errors to ignore. When you add an error, enter the five-digit error code. For example, enter 00057 for ORA-00057.

    Tips:

    • Click Information to display the Knowledge Xpert description of the error.
    • You can also ignore errors when they occur during script execution by clicking Ignore This Error in the error dialog. Then, click Yes when you are prompted to ignore the error for all future scripts.

    Default: Cleared


Source Control Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set source control options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Source Control.

  3. Set the options. Review the following for additional information:

    Third Party File Based Source Control | Use these options to...

    Default Provider

    Enable file-based source control and select a source control provider. Then, click Provider Options to configure options for the selected provider.

    Toad uses this provider by default, but you can select a different source control provider for each database. See Enable Version Control with Team Coding for more information.

    Note: This list is populated from your computer's registry. If you do not have a source control provider installed, this field displays <none>.

    Default: <None>

    Team Coding | Use these options to...

    Disable login prompt on connection

    Prevent the source control provider login from displaying when you connect to a Team Coding enabled database. This option is applicable only when Team Coding is configured to work with a third-party provider.

    Default: Cleared

    Automatic Check-Out

    Check out an item when you open it.

    Default: Cleared

    Automatic Check-In

    Check in an item when you close it.

    Default: Cleared

    Schema Replacement for Stored Code

    These options work in two ways. When selected:

    1. When you use the Import to database function to import code from one schema to another in the Code Control Groups window anywhere the original schema's name displays in the code, Toad replaces it with the destination schema. See Import Objects for more information.
    2. If you have a user mapped to a code control group, where the master owner's schema displays in the code, Toad replaces it with the mapped user's schema name in the mapped user's schema.

    For example, If you check out an object into the mapped user's schema and change it, then check it in, the copy in the source control repository will be updated, with the master user's schema instead of the mapped user's schema.

    Default: Selected

    Schema Replacement for Triggers

    Schema Replacement for Views


Startup

Startup Options

These options can be found at View | Toad Options | Startup.

Show login window

When checked, the login window is displayed at startup to let you log in to an Oracle instance.

Default: Selected

Allow multiple copies of TOAD to be loaded

When checked, you can open multiple copies of Toad at one time.

Unchecked, only one copy of Toad can be open on your desktop at any one time.

Default: Selected

Check for Access to DBA Views

If you have access to the DBA views, such as DBA_TAB_COLUMNS, then check this option. At session startup, Toad will see if DBA views are available to that particular user schema. If so, Toad will query the Oracle Dictionary using the DBA views instead of the ALL views such as ALL_TAB_COLUMNS. DBA views are much faster than ALL views because the DBA views do not have the security checks. No security checks means faster queries.

Note: If you are running the DB Admin Module, Toad will always query to see if you have the DBA role, SELECT ANY TABLE, or specific access to the DBA view.

Default: Selected

Play Toad Wave File

If checked, Toad will "croak" when starting.

Note: If you are using any software which places the sound device in exclusive/locked mode, Toad will hang on startup. If you are experiencing this, or having sound card problems, uncheck this option.

Default: Selected

Download Toad Tips once a month

When selected, Toad will access the Toad internet site and download any new ToadTips for you once a month. This will not turn Toad Tips back on if you have told Toad to hide them.

Default: Selected

File To AutoLoad on startup

This file will automatically be loaded into the first Editor window that displays after a database Login. Click [image] to choose a file.

The default is blank (display no file).

File to AutoExecute on new connections

This lets you set application info upon startup. The selected script file will execute after each new connection and the output displays after the normal "do you want to see output" prompt.

Related Topics

Windows


Toolbars

Toolbar Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

Tip: To search for a partial or complete option name or value, use the Search field at the bottom of each Options page. See Search for Options for more information.

To set toolbar options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Toolbars/Menus | Toolbars.

  3. Set the options. Review the following for additional information:

    Behavior Use these options to...

    Auto-save current desktop

    Select to automatically save the current desktop layout. If you have multiple desktops open, the last one active is the one that is saved. See Customize the Editor Layout for more information.

    Default: Selected

    Display

            Use these options to...

    Show window titles on Window Bar

    Select to display the window title on the Window bar (for example, "Editor"). If this field is cleared, Toad only displays the icon for that window type. See Display Connection and Window Bars for more information.

    Default: Selected

    Show connect strings on Window Bar

    Select to display the schema username, the @ symbol, and the database alias in the window caption on the applicable windows. If this field is cleared, Toad displays the schema username.

    Default: Cleared

    Show only buttons for current connection on Window Bar

    Select this option to have Toad only display windows that use the active connection, instead of including windows for all open connections. See Display Connection and Window Bars for more information.

    Default: Cleared

    Multi-Line Window Bar

    Select to allow the bar to span multiple lines when you have many open windows/connections.

    Default: Cleared

    Multi-Line Connection Bar

    Quick connect/disconnect drop-down count

    Enter the number of connections that are listed in [image] drop-down in the standard toolbar.

    Default: 9

    Connection Bar button

            Click to set the fonts for the descriptions in the bar. You may want to change the font or the font size so that your descriptions fit on the buttons or are easier to read.

    Window Bar button

    Visual Style

    Select the visual style you want to use in Toad's display.

    Default: Enhanced


Toolbars/Menus - Shortcuts

Shortcut Keys Options

Use this page to reset shortcut keys, change the shortcuts for various commands, or print your list of shortcuts.

To access the shortcut key options

  1. Click [image] on the standard toolbar.

    Tip: You can also select View | Toad Options.

  2. Select Toolbars/Menus | Shortcuts.

Related Topics

Print List of Shortcut Keys

Customize Shortcut Keys


Variables

Define New Variables

Use the Variables options window to set any user variables and values that you want to use on a regular basis. In addition, there is a list of system variables that you can use within ToadApps, settings, and other places throughout Toad.

To add a new variable

  1. From View | Toad Options, click Variables.
  2. Click the Add button.
  3. Enter the variable name in the Variable column in the grid
  4. Enter any value you want to include.
  5. Enter a Description of the variable in the Description column.


Windows

These options can be found at View | Toad Options | Windows.

Behavior

The windows options let you specify which settings Toad should save for each major window. You can check individual windows to:

  • Available - makes the selected Toad feature available for use. Clearing the checkbox hides it from general use, although you can come back to the options window and select it at any time.
  • Save Size - saves the window size as you set it
  • Save Position - saves the last window position
  • Auto open - opens the window upon making a connection
  • One/connection - only opens one of that window per connection
  • One/Toad - only opens one of that window per instance of Toad

Auto-open bring to front

If you have several windows selected for auto open, you can choose which of them you want to be active on opening Toad.

Describe windows

Select the way you want Describe windows to behave. The default is Grouped.

Grouped All object descriptions are grouped in the Describe Objects window, instead of each description displaying in a separate window.

MDI

If selected, the F4 popup Object Describe windows will be created as an MDI child window. This means that they will be accessible from the Windows menu, and you can open as many as you want and they will not get lost behind the main Toad window.

Note: MDI stands for multiple document interface. In an MDI application, more than one document or child window can be opened within a single parent window. This is common in applications such as spreadsheets or word processors - one window, usually called the MDI parent or MDI container, contains many other windows, usually called child forms.

Stay on top

If selected, the Describe window will stay on top of all other windows in Toad until you close it. This is the default.

Scroll pinned windows at n millisecs

When selected, pinned windows will scroll out and open when rolled over by the pointer at the rate specified.

You can specify the rate at which a pinned window will open. The default is 300 milliseconds.

Display

Show USER@DATABASE in captions

When selected, the User and database is displayed in window captions. Unchecked, only the window title is displayed.

Default: Selected

Use Alias instead of database (set in login window)

Default: Cleared

Show spec and body in package describes

If checked, both the spec and the body will be included in the describe.

Default: Cleared


Formatting Options

You can set how Toad formats code when you select Formatting Tools. See Format Code for more information.

To set formatting options

  1. Select View | Formatting Options.
  2. In the left panel, select the node that corresponds with what you want to set.
  3. If you select a high-level node, the right panel will display a description of the kind of formatting included under that node. If you select a detail node, the settings will display in the right panel.
  4. Make your changes. Option nodes that have been changed are displayed in bold type.
  5. Click [image].
  6. Close the window.

To reset all options to default settings

» Click [image].

Changes in the Formatter

In Toad 9.7, the Formatter component was replaced with a new component that supports new Oracle functionality. Some formatter options have moved or changed slightly.

When loading a Formatter Plus options file, the new component preserves options as much as possible. If no exact match is possible then the following matches are made:

Formatter Plus option

Converted as follows

Parenthesis "open and close brackets in stacked lists" on same line

In the new group "Position around Multi-line Lists" a closely matching option is selected

Style of Parameter declaration and passed parameters

Parameter declarations and Parameters list arrangements

Wrap or Stack on 1 column, or Stack on Overflow on 99 columns

AND-OR and Plus-Minus-Mul-Div "operators right and aligned"

"operators right"

AND-OR: Align top level OR or AND with keywords

Not converted, but the user can select a new radio button:

  • Operators left
  • All conditions aligned when stacked
  • Operators aligned with the DML keyword

SELECT keywords left aligned

Keywords aligned LEFT (DML statements tab)

SELECT align lists at column

Middle margin (DML statements tab)

SELECT INTO style

SELECT list arrangement (similar)

SELECT TABLE, ORDER BY, GROUP BY, RETURNING style

Table Reference, ORDER BY and GROUP BY list arrangements (similar)

INSERT column values style

VALUES list arrangement (similar)

Default list arrangement (Other Lists tab) set to Stack on Overflow

Related Topics

Format Code

Format Files


Language Management Overview

The Toad Editor is an extremely powerful editor, and parts of this power come from its ability to manage language use. You can choose to have the Editor parse in PL/SQL, Java, C++, HTML, or any number of other languages, including custom language.

Toad takes the source, and parses it according to the categories you have set up, breaking it into Tokens (parts of code defined by type). It then applies the rules you have set in order to apply such things as syntax highlighting and code folding.

Managing these languages has an effect on many areas of Toad. Syntax highlighting is based upon defined command words, as is code folding and the make code functionality. The ability to set up sub languages means that you can define capitalization effects that apply only to your PL/SQL code, and not embedded java, perl, or other languages.

The Language Management area of Toad Options provides you the ability to set language and highlighting rules, define tokens (including statements, comments, and other defined areas), set up code templates and sub languages, among other things.

To access the language management window

  1. Select View | Toad Options | Editor | Behavior

    2. In the Language Management area, select the language you want to edit and click one of the following:

     | Edit the selected language.
Add | Create a new language.
Delete | Delete the selected language.
Clone | Create a new language based on the selected one.
Code Templates | Go directly to the Code Templates tab.
Syntax Highlighting | Go directly to the Syntax Highlighting tab.

Language Management Tabs

The component parts of languages can be edited from several tabs in the language management area. Information on these tabs is interrelated, and settings in one tab can affect settings in the others. This creates extremely powerful and configurable parsing capability.

Tabs include:

  • General tab
  • Highlighting Tab
  • Tokens Tab
  • Parser Tab
  • Rules Tab
  • Sub Languages Tab
  • Code Templates Tab
  • Grammar


Syntax Highlighting

The Editor supports flexible syntax highlighting. The highlighting is language-specific, and is configurable in the Language Management area of the Toad Options.

The list of reserved words used in each language is also customizable. If during a Toad session you have used any window or function that retrieves the table names for the active Oracle session, table names will be colored as well.

Syntax highlighting is based on your selection of languages. You can do this from either the options window, or from the Editor itself.

To select a language for highlighting

» Do one of the following:
  • From the Toad Options | Editor - Behavior page, in the Language Management area, select the language you want to apply and then click OK.
  • In the editor, right-click and select Language. From the menu provided, select the language you want to use.

Syntax Highlighting Table names, Views and Procedures

Toad can syntax highlight the table names, views and procedures in the current schema.

If the highlight table names (or views, or procedures) option is selected Toad will load and highlight these objects from your schema automatically. If it is not checked when you make a connection, but you turn it on while you are working, names will be highlighted as soon as you load them (by opening the Object Palette, or pressing CTRL+. or so on). If not checked, they will not be highlighted even when the object palette is loaded, loaded in the Schema Browser, and so on.

To highlight table names

» Select View | Toad Options | Editor | Display, and then select Highlight Table names in the Syntax Highlighting area.

To customize table names colors

  1. Select View | Toad Options | Editor | Behavior, and then select the language you want to use in the Language Management area.
  2. Click Syntax Highlighting and in the Styles list select Toad_UserTables.
  3. Change the styles as described in the Highlighting tab topic. See Highlighting Tab for more information.
  4. Click OK.

Syntax Highlighting SYS View Names

Toad can also syntax highlight SYS View names (for example, ALL_TABLES).

To initially populate SYS view names

» Using either the SYS schema or a schema with the DBA role, open the Schema Browser window to the Views tab, and if necessary select SYS from the username drop-down list.

Toad queries all SYS views, and caches the list in Toad for Oracle\User Files\DATABASE_ALIAS\SYSVIEW.TXT.

If you want to reload the list, simply delete the appropriate SYSVIEWS.TXT file and repeat the above steps. Be aware that different databases have different lists of SYS views, e.g., Oracle 8i, Personal Oracle, and so on.

To customize table names colors

  1. Select View | Toad Options | Editor | Behavior, and then select the language you want to use in the Language Management area.
  2. Click Syntax Highlighting and scroll down in the Styles list to Toad_SYSViews.
  3. Change the styles as described in the Highlighting tab topic. See Highlighting Tab for more information.
  4. Click OK.

Parser Scripts

The primary configuration for syntax parsing and highlighting in Toad comes from a parser script file that is loaded at runtime. This is the lexer.lib file, and is edited when you use the Language Management options. See Language Management Overview for more information.

You can modify the list of reserved words.

To modify reserved/keywords

  1. From Language Management | Rules tab | Keywords, click the Conditions tab.
  2. Modify keywords in the tokens panel. You can delete words, add new words, make words case sensitive, and so on.

You may want to add too that they should go to the reserved words rule (check that name, not sure that is what it is called exactly) and go to the conditions tab to modify the list of words

Removing Reserved and Keywords

If you want to add or remove Oracle SQL Reserved words, PL/SQL Reserved words, or Oracle keywords from the lists that are syntax highlighted, it can be done from the Language Management | Rules tab. Highlighting options may be changed from the Language Management | Highlighting tab.

Language Types

Language types are defined in the Toad Options | Editor - Behavior | Language Management area. You can create a new language by cloning one of the provided ones, or manually. The general tab specifies which file extensions are used with which language.

Related Topics

Language Management Overview

Object Palette

Rules Tab

Highlighting Tab


LM - General

General tab

Within the Language Management options area, the general tab defines the basic areas of the language you are editing. See Language Management Overview for more information.

Within this tab, you can specify file extensions that will automatically use this language when opened, the default block comment and style for the text; and the line style you want to use.

Name

The name box contains the name you want to use for this parser. For example, if you are coding in PL/SQL, there is a PL/SQL language defined.

File extensions

Any file extensions entered in this box will affect how Toad parses the code that you are opening. For example, the SQL, FNC, PKB file extensions will always be opened and parsed with the PL/SQL language unless you specify otherwise.

Block comment

Enter the default marker for creating a block comment. This is the marker that Toad will use to view the following text as a comment.

Default Style

This is the default text style you want to use for text when working in this language. For the most part, the token that identifies this style should be default.

Line Style

This style applies when the line is active (the cursor is located in it) in the Editor.

Related Topics

Language Management Overview


Highlighting Tab

Within the Language Management options area, use the highlighting tab to configure highlighting settings for specified styles. These styles can then be applied to tokens or rules as necessary. See Language Management Overview for more information.

In the styles list, you can add, edit, delete, copy from (clone) or disable styles.

Note: The default highlighting style cannot be renamed or removed.

Style Settings

Style type

Select a style type for this style setting. The default is default, which means that it reverts to the style set in the default style. You can choose a custom font, which allows you to change all of the font settings as described below, or a limited custom font, such as background/foreground (which lets you set only the background and foreground colors).

Background

Choose a color for the background of the text.

Font color

Select a color for the text itself.

Capitalization effect

Select the capitalization format you want for the text:

  • Unchanged
  • Uppercase
  • Lowercase
  • Initial Caps

Custom Font

If you have selected Custom Font under Style type, click the Custom Font button to set the font.

Font Style

Select one or more of the following styles:

  • Bold
  • Italic
  • Underline
  • Strike Out

Borders

You can choose to place a border on one or more sides of the text in the selected style. In this area, select the line type and thickness for each border (left, right, top or bottom) and the color Toad should make that border.

Related Topics

Language Management Overview


LM - Tokens Tab

Tokens Tab

Within the Language Management options area, use Tokens tab to define tokens that can be used within rules and parser specifications. These are specific language constructs: for example, PL/SQL has Strings, Integers, Comments, etc.

Related Topics

Language Management Overview


LM - Parser Tab

Parser Tab

Within the Language Management options area, use the parser tab to define the way in which Toad finds tokens within the code. See Language Management Overview for more information. The window is separated into three areas: Categories, Parse, Advanced.

Toad uses regular expressions to define where a token starts and ends. Tokens must be defined in the Token tab before they can be applied to a category.

Categories area

The category list contains the categories that are available for definition. They will be parsed in the order they are listed. When working through code, Toad will stop attempting to match the definitions as soon as one of the rules met.

In this area, you can:

  • Add new categories - create a new category that you can define as desired.
  • Edit a category - display an edit dialog so you can rename the category.
  • Delete a category - delete the selected category. No warning is issued.
  • Copy from a category - display the copy from dialog. Select the language and any categories you wish to include in the definition. You can choose multiple categories.
  • Disable a category - disable the selected category until you enable it.
  • Move categories up or down in the list - change the priority of a selected category.

Parse tab

Use the parse tab to specify the regular expression test for the selected category, and set the token type and default highlighting style. See Examples of Regular Expressions for more information.

Select a category and the details for that category are displayed here.

Regular expression test

Edit or add a regular expression in this box. This expression will define what Toad looks for when attempting to apply the category to code.

Evaluates to token type

Select a token type from the drop-down list. See Tokens Tab for more information.

Default Highlighting style

Select a default highlighting style to be used on this category of code. The default highlighting style will be applied only if the code does not also satisfy any rules as defined on the Rules tab. See Rules Tab for more information.

Advanced tab

While the settings on the Parse tab provide enough information to locate simple tokens, you may want to narrow the focus even more. The advanced tab provides methods to require specific parents, or to enable only within a certain character position.

Parent block

Use the parent block box to set the range for a parent limitation. When this is set, the category only applies to sections of code that begin with the selected range. By default, this affects code where the code either directly follows the parent range, or is included in another range nested within that parent range.

You can also specify the following amendments to this:

Strict

Only includes code that fits the regular expression defined on the Parse tab, and that directly follows the parent range. For example, is directly within a "CREATE OR REPLACE procedure" definition: not within an IF clause within that CREATE category.

Not a parent

Only includes code that fits the regular expression defined on the Parse tab, and is NOT part of the specified parent block.

Enabled from character position: _____ to ______

When a range of character positions is included, only code which fits the defined regular expression, the parent rules (if any) and is between those character positions will be included in the category.

Related Topics

Language Management Overview

Regular Expression Searches


LM - Rules Tab

Rules Tab

Within the Language Management options area, the rules tab contains all rules applied to tokens after parsing is complete. See Language Management Overview for more information. These rules supersede any previous designations of categories, defaults, or tokens. As such, code folding is determined by these rules, as is much of the syntax highlighting specifications.

Rules can have multiple conditions, or only one. All conditions are applied in numerical order, from 1 to 2, and so on.

Rules are, like Parser categories, applied in the order they are listed in the Rules Names list. If a higher priority rule is satisfied, Toad will not apply later rules.

Conditions tab

The conditions tab provides an area for you to specify the conditions to define the rule selected in the rules list. You can specify any number of conditions.

To add a new condition

  1. Click + in the Condition: area.
  2. Select one or more token types where the condition should apply.
  3. Select an operator.
  4. Select the tokens you want bound by the condition.
  5. Repeat until all conditions you want established have been added.

To delete a condition

  1. Select the condition you want to delete in the condition list.
  2. Click the - button.

Properties tab

The properties tab is the active tab by default. This tab specifies the rule type, style, and highlighting to apply if the rule is met.

Rule type

Specify the type of rule. This can include tag detector, line separator, range start or range end.

Change token type

You can use this option to change the identifier to a different token type. For example, for syntax highlighting purposes, you can take an "IF" token and apply "SELECT" highlighting to it.

Style

Select the style you want to apply to code that matches this rule. Styles are defined on the Highlighting tab.

Range Highlighting

Select any range highlighting you want to apply to this code. Range highlighting is defined by the styles on the Highlighting tab.

Collapsed text string

When you collapse text for code folding, the node created can have a collapsed text string displayed upon it for identification. Enter this string here. You can have Toad display the first token, or any token after by using the syntax:

%s0%s-1

where 0 is the first token, -1 is the next, -2 is the third, and so on. Anything after the last number will be displayed in its entirety.

For example, if you have a range beginning with "IF", %s0woo! will display as "IF woo!" when you fold the code.

Active Highlighting

Toad can highlight a range when it is active. When this is activated, highlighting will take place when the caret is positioned as specified.

Caret position box

Specify the caret position when Toad should highlight the code as active. You can choose it to be marked active when the caret is in the range, always highlight it, or highlight when the caret is within specific tokens. Use this drop-down to select the desired caret position.

Select minimal range

When checked, if ranges are nested, Toad will only highlight the first range where the caret is located, ignoring any parent ranges. When unchecked, Toad will highlight the entire range, including any parent ranges.

Draw block staple

Select to draw a grey staple around the range of code that can be folded. Click here to see an example.

Default: Selected

Self Closing Range

A self closing range is useful if you have a type of range where there is no consistent end of range marker.

When checked, Toad will not look for a close range rule to close the range. Instead, the close of the range is defined by the start of the next range.

Default: Cleared

Advanced tab

While the settings on the Parse tab provide enough information to locate simple tokens, you may want to narrow the focus even more. The advanced tab provides methods to require specific parents, or to enable only within a certain character position.

Parent block

Use the parent block box to set the range for a parent limitation. When this is set, the category only applies to sections of code that begin with the selected range. By default, this affects code where the code either directly follows the parent range, or is included in another range nested within that parent range.

You can also specify the following amendments to this:

Strict

Only includes code that fits the regular expression defined on the Parse tab, and that directly follows the parent range. For example, is directly within a "CREATE OR REPLACE procedure" definition: not within an IF clause within that CREATE category.

Not a parent

Only includes code that fits the regular expression defined on the Parse tab, and is NOT part of the specified parent block.

Gramma

If you have created specific grammar, you can add individual gramma to the rule. Select the gramma you want to use from the drop-down list.

Range Offset

Range offsetting changes what Toad considers the beginning (or end) of a range for code folding purposes. Ranges are defined by starting and ending tokens.

For example if you have a string of tokens as follows:

Token | A | B | C | D | E | F
Range Position | 2 | 1 | 0 | -1 | -2 | -3
Token | G | H | I | J | K | L
Range position | 3 | 2 | 1 | 0 | -1 | -2

The Range starts at "C", then the token type C is position 0 for start of range.

The Range ends at "J", then the token type J is position 0 for end of range.

If you have set the beginning range offset at B, then Toad will hide all tokens to the right of it when you fold the code.

Cancel next rules

When this is set, Toad will cancel further processing of rules conditions when the condition is met. When it is clear, Toad will process all rules in order.

Relative to end of condition

This sets the parsing relative to the end of the condition: for example, if the condition specifies "CREATE OR REPLACE FUNCTION", when checked, Toad sets the 0 position at FUNCTION (the end of the condition). When unchecked, Toad will set the 0 postion at CREATE (the beginning of the condition).

Related Topics

Language Management Overview


LM - Sub Languages Tab

Sub Languages Tab

Within the Language Management options area, the Sub Languages tab defines any languages you want to use within the primary language. For example, PL/SQL can have Java embedded within it. If you have styles and rules defined that will change the capitalization of PL/SQL, you do not want it to affect Java in the same way, since Java is case-sensitive. In this case, you can set up a sub language of Java so that Toad can differentiate between the two and use different highlighting and code folding rules as appropriate.

To set up a sub language

  1. From the editing screen of the main language, select the Sub Languages tab.
  2. In the Sub Language box, select the language you want to embed.
  3. Select a default style for the sub language. This can be any style defined on the Highlighting tab, or <none>.See Highlighting Tab for more information.
  4. Use the parent block box to set the range for a parent limitation. When this is set, the category only applies to sections of code that begin with the selected range. By default, this affects code where the code either directly follows the parent range, or is included in another range nested within that parent range.
    • Select Strict to include only code that directly follows the parent range. For example, is directly within a "CREATE OR REPLACE procedure" definition: not within an IF clause within that CREATE category.
    • Select Not a parent to include only code that is NOT part of the specified parent block.
  5. Choose to start at the beginning or end of the text.

    6. Set the start and end conditions.

    Note: These should be regular expressions that define a starting marker and an ending marker for the language you want to embed.

Related Topics

Language Management Overview

Highlighting Tab


LM - Code Templates

Code Templates Tab

Within the Language Management options area, you can set up and delete code templates from this tab. See Language Management Overview for more information. Different code templates can be developed for different languages.

To add a template

  1. From the Toad Options | Editor - Behavior page, select the language where you want to add a code template and click Code Templates.
  2. Click Add.
  3. Enter a shortcut name and a description. Click OK.
  4. Click in the Editor window below the template list and enter the text you want to be included. You can include substitution variables and cursor placement as described in Code Completion Templates.
  5. Click OK.

To edit a template

  1. From the Toad Options | Editor - Behavior page, select the language where you want to add a code template and click Code Templates.
  2. Select a completion template and then click Edit.
  3. Change the shortcut name and a description. Click OK.
  4. Click in the Editor window below the template list and edit the code template.
  5. Click OK or Apply.

Advanced Templates

An advanced template allows you to use pipe characters literally in the code template. A simple (not advanced) template uses the pipe character to determine caret placement when the template has been inserted into the Editor.

An advanced template uses <caret> to determine where the caret will go. Advanced templates also support inserting data from clipboard. Clipboard data is inserted where <paste> displays.

To use the advanced template

  1. In the View | Toad Options | Editor - Behavior page, click Code Templates.
  2. In the template grid, select the advanced checkbox beside the template you want to use in the advanced mode.

Related Topics

Language Management Overview

Editor Behavior Options

Code Completion Templates


LM - Grammar

Grammar

Within the Language Management options area, the grammar tab is used for more detailed specifications than you can make easily from the rules tab. See Language Management Overview for more information.

In fact, you can create a rule with no conditions, and from the Advanced tab select a gramma from the list, making it your only rule. See Advanced tab for more information.

To access the grammar demo

  1. From Toad Options | Editor | Behavior, in the Language Management area select Pascal.
  2. Click Edit.
  3. Click the Grammar tab.

Related Topics

Language Management Overview

Rules Tab


Code Completion Templates

Code Completion Templates use a manual keystroke (CTRL+SPACE) to perform the substitution. Code templates are more than a single phrase and can contain line feeds, substitution variables and a cursor position indicator.

You can edit the Code Completion templates directly in the Language Management, Code Templates tab. See Code Templates Tab for more information.

Example

One of the code templates defined in Language Management is:

entire cursor block (crbl)

DECLARE

CURSOR c1 IS

SELECT | FROM WHERE;

c1rec IS c1%ROWTYPE;

BEGIN

OPEN c1;

LOOP

FETCH c1 INTO c1rec;

EXIT WHEN c1%NOTFOUND;

END LOOP;

CLOSE c1;

END;

Where:

  • "crbl" is the macro for the template (the text YOU type)
  • "entire cursor block" is the description of the template
  • everything following until the next template is the body of the template

Note: Do not leave spaces between the end of the template description and the final right bracket! NT4.0 API calls to manage profile strings have a bug that will cause reading of the templates file to fail.

Keyboard Shortcuts

The default keyboard shortcut for Code Completion templates is CTRL+SPACE. Enter the template name (such as crbl) and press the shortcut to expand it.

Using a Template

When you enter the name of a template and press the shortcut key, Toad follows the following procedures:

  • If the name you have entered does not match any of the names on the code template list, a drop-down listing of available code templates displays so you can choose the correct template.
  • A dialog box displays listing the substitution variables and prompting you to enter values.
  • Expands the code and replaces variables.
  • Removes the cursor placement marker, and places the cursor there.

To use the code template

» Type the macro (for example, crbl) and then press CTRL+SPACE to load the body of the template and place the cursor at the position of the vertical pipe character. If the word or phrase under the cursor does not match an existing macro exactly, a drop-down list of all macros is displayed.

Cursor Placement

If Toad finds a single pipe ( | ) in the template body, then when the substitution of the template is complete, the cursor is positioned at that point in the code. The pipe is removed, as it is used only as a marker for the cursor position. Only one pipe can be used this way in a code template.

Substitution Variables

The Code Completion templates also support substitution variables. Enter the substitution variable in the form of an ampersand followed by a valid simple Oracle identifier. For example, &1 is not a substitution variable, but &a is.

When a template containing substitution variables is selected, you will be prompted to enter values. Any occurrence of the substitution variable is then replaced with the entered value.

Editing the Code Template List

Toad provides a list of default templates. As you use this feature, however, you will create templates that work better for your purposes, and you will want to edit the default templates.

You can edit and add templates to suit your needs in the Language Management window.

Related Topics

Aliases

Auto Replace Substitutions

Language Management Overview


Auto Replace Substitutions

A substitution is a text phrase that corresponds to replacement text. For example:

  • If you specify a substitution pair of ACT = ACTIVITY_CENTERS, when you type ACT and press space (or other word delimiters), ACT is automatically replaced by ACTIVITY_CENTERS
  • If you specify a substitution pair of NDF = NO_DATA_FOUND and you type NDF and press a delimiter, NDF is automatically replaced by NO_DATA_FOUND

Auto Replace Substitutions are different from aliases in that you can use any group of characters to define and complete the replacement. Aliases do not change the text in the SQL. They are a method of referring to a table by a different name. Substitutions will actually change the text within your code to match the target keystrokes.

To edit Auto Replace entries

  1. From the Toad Options | Editor - Behavior page, click Auto Replace.
  2. Make changes in the Auto Replace grid.

Using Substitutions

When auto-replace is active, Toad uses several characters as auto replace activation keys. Toad will automatically replace an activation key with the substitution value when it reaches a terminator, for example the space key. For example, "teh" is by default set to replace with "the" in the Editor. Or, you can enter "pack" and Toad will expand it to "package".

An activation key will cause a matched "replace" string immediately before the cursor to be replaced by the "with" substitution value. For example, if you have dept = DEPARTMENT in your auto replace file, you can enter the following:

dept[space] and the Editor will expand to DEPARTMENT .

Or, you can enter dept: and the Editor will expand to DEPARTMENT:.

Or you can enter dept; and the Editor will expand to DEPARTMENT;.

Note: The activation key is always included in the expanded substitution.

You can edit this list of keys in the box if you have other needs.

Importing and Exporting Files

Also from the Editing options window, you can import and export auto substitution files.

Toad comes with a handful of substitution pairs. You can edit and add to the list from the Auto Replace dialog. You can then export the settings to a text file. Alternately, you can create or edit a substitutions file manually and then import it.

Export

Saves the auto replace settings to a separate text file. If you make many changes to your auto replace settings, it is recommended that you export them regularly for back up.

Note: If you do not export your settings to a file before you import a file, they will be lost.

Import

You can import a text file into Toad. This file can be created independently or by exporting the settings you have created in Toad.

Importing a file overwrites the current settings.

Editing a substitutions file

Because it can be tedious to add large amounts of information to the substitution file directly from the interface, you may want to edit or create a text file directly.

Use the format of string=replacement string. For example:

aax=AAX_ACCESSGROUP_APPLICATION

aca=ACA_ACTIVITY_ACTION

acc=ACC_ACTIVITY_CATEGORY

acd=ACD_ACTION_DESCRIPTION

acp=ACP_ACTIVITY_CONTACT_PARTIC

Related Topics

Aliases

Code Completion Templates


Toad Control Files

Control Files

You can view information about the Control files record sections for your database by selecting: Database | Report | Control Files from the main menu bar. The Control Files window displays.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

The control file contains information about the associated database that is required for the database to be accessed by an instance, both at startup and during normal operation. A control file's information can be modified only by Oracle; no database administrator or end-user can edit a database's control file.

A control file contains information including:

  • database name
  • timestamp of database creation
  • names and locations of associated datafiles and online redo log files
  • tablespace information
  • datafile offline ranges
  • log history
  • archived log information
  • backup set and backup piece information
  • backup datafile and redo log information
  • datafile copy information
  • current log sequence number
  • checkpoint information

When you create a database, Oracle creates the database name and timestamp. The database name is taken from either the name specified by the initialization parameter DB_NAME or the name used in the CREATE DATABASE statement.

Whenever a datafile or an online redo log file is added to, renamed in, or dropped from the database, the control file is updated to reflect this physical structure change. These changes are recorded so that:

  • Oracle can identify the datafiles and online redo log files to open during database startup.
  • Oracle can identify files that are required or available in case database recovery is necessary.

Therefore, if you make a change to your database's physical structure, you should immediately make a backup of your control file.

Control files also record information about checkpoints. Every three seconds, the checkpoint process (CKPT) records information in the control file about the checkpoint position in the online redo log. This information is used during database recovery. It marks entries not necessary for database recovery because they have already been written to the datafiles.


Report Link Designer

You can change how you want to print from a data grid on the Report Link Designer.

To access Report Link Designer

  1. Select Grid | Print Grid.
  2. Click Print Preview.
  3. Click [image].

Using the ReportLink Designer

Use this dialog box to select grid print options, and then print the grid contents to paper.

There are five tabs on this screen: Options, Colors, Fonts, Behaviors, and Miscellaneous.

Any changes you make on these tabs are previewed in the right panel.

Title Properties

Clicking Title Properties opens a dialog box that lets you set a title for your report, and specify where it will print (such as the top of every page). Click the Properties tab to set the font, color and alignment of the title.

Options Tab

Show

  • Bands - When checked, Toad adds a blank band (bar) to the top of the grid. The default is unchecked.
  • Header - If checked, the column headers are included in the printout. If unchecked, column headers are not included. The default is checked.
  • Footers – Not applicable to data grids
  • Group Footers – Not applicable to data grids

Preview

If checked and if you have activated Preview Current Column, the preview columns will print. See SQL Results Grid for more information.

If unchecked, or if checked and you have not activated Preview Current Column, the preview columns will not print.

Default: Cleared

Grid

  • Node Grid - If checked, will print the column lines in a data grid. If unchecked, the column lines will not print in the data grid. The default is checked.
  • Grid - If checked, the grid lines (the lines between the rows and columns) will print. If unchecked, the grid lines will not print. The default is checked.

Colors tab

The Colors Tab lets you set colors. You can set colors for the grid background, the preview column, the band, the header, and the grid line. The Transparent checkboxes remove the colors and disable the associated color drop-downs.

  • Group Node and Group Footers (and their color choices) are not applicable to data grids.
  • Extended Management by Colors – Not implemented at this time

Fonts tab

The Change Font button lets you change fonts for the selected area of the grid. This includes band, font, header, and preview.

Behaviors tab

The Behaviors tab lets you change where bands and headers are placed, how much of the selection prints, whether or not any nodes automatically expand. You also have the option of choosing to use three-dimensional effects. The Graphics area is currently not applicable to any printable grid in Toad.

Miscellaneous tab

The Miscellaneous tab lets you choose effects for tree view grids and checkmarks.

Related Topics

Reports Manager Overview


View Dependencies Report

This feature allows you to:

  • View the database objects that reference a selected database object or
  • View the database objects that the selected object is dependent on.

There is also a tab to view the dependencies on all objects. Indented objects are dependent on outer objects.

To access the View Dependencies window

» From the Database menu, select Database | Report | Dependencies.


Print/Export Reports from the Command Line

You can easily print or export your reports from the command line, saving you the trouble of opening the FastReports page every time you want to rerun a report.

This feature also lets you schedule when you run your reports.

Supported "save to file" extensions

The supported extensions are:

  • .pdf
  • .txt
  • .xls
  • .bmp
  • .rtf
  • .jpg
  • .gif
  • .csv
  • .htm(l)

Supported Parameters

You can add as many parameters as you need. Valid parameter types are: String, Number, Date, or Substitution (substitution replaces text before the query is executed). String, Number, and Date types are regular bind variables.

To print or export from the command line

  1. From the Editor, enter your query and then design your report. See Report Builder Wizard for more information.
  2. Save the report definition to a .fr3 file.
  3. In the lines before or after your query, enter the following comments:

    4. --ParamName: parameter name if you want to include parameters.

    --ParamType: parameter type of the above ParamName.

    --ParamValue: value of the parameter.

    --repeat Param options above if more than one.

    --ReportFile: full path to your .fr3 file.

    --Print (if you want to print).

    --Save To File:full path to the export file you want to create.

    --CloseToad (if you want Toad to close when you are done).

  4. Save your query with the lines you added to a file.
  5. Call from the command line as follows:

    6. c:\toad\toad.exe connect=scott/tiger@orcl rep=c:\your_query_file.sql

    Remember to change the connect string and filename.

Examples of SQL files for printing

One Parameter

SELECT *

FROM SCOTT.EMP

where empno>=:x

order by 1

--Paramname:x

--ParamType:number

--ParamValue:7700

--ReportFile:c:\emp.fr3

--Save To File:c:\emp.pdf

--CloseToad

Multiple Parameters

SELECT *

FROM * &y

WHERE empno>=:x

order by 1

--ParamName:x

--ParamType:number

--ParamValue7700

--ParamName:y

-- ParamType:subst

-- ParamValue:scott.emp

-- ReportFile:c:\emp.fr3

-- Save To File: c:\emp.pdf

-- CloseToad


ER Diagram

The ER (Entity Relationship) diagram lets you quickly diagram a table and graphically see the dependencies and joins to other tables. The ER diagram functionality is a subset of the Toad Data Modeler functionality and as such is a powerful diagramming tool.

Note: Toad provides additional features to perform a full data model on your table structures. See Integration with Toad Data Modeler for more information.

To Access the ER diagram:

» Do one of the following:
  • Select Database | Report | ER Diagram.
  • Right-click a table and select ER Diagram from the Schema Browser - Tables page.

Note: The Create Object Scripts feature is only available in the commercial version of Toad with the optional DB Admin Module.

Related Topics

Creating an ER Diagram

Reading the ER Diagram


Creating an ER Diagram

You can create a new ER diagram in different ways.

To create a New Diagram

  1. From the toolbar, click [image].
  2. Click [image].
  3. Select the Schema you want to use.
  4. Select the number of levels of referential tables you want to load.

    5. Note: The more levels of referential tables you load, the more complicated the diagram will become, and the longer Toad will take to create the diagram.

  5. Select the Table you want to diagram.

    6. Note: Referential tables to the level specified will be selected when you select your table.

  6. If you want to exclude referential tables, click in the Ignore column of the tables you want to exclude.

From a Few Tables

  1. From the Object Palette, select the tables you want to add to a new ER diagram.
  2. Drag the tables into the ER diagram window from the source window.

    3. Note: Joins between objects are automatically displayed; however, if a dependent table is not included in the diagram in this way, it will not be diagrammed. To be sure to find all dependencies, add objects as described in To create a new diagram.

Related Topics

ER Diagram

Reading the ER Diagram


Reading the ER Diagram

Within the ER Diagram, each object listing contains the name of the table and the schema where it resides (in the title bar), the columns in the table, the column type, whether the column is indexed, and any icons selected in the Display Options area when the diagram was created. See ER Diagram for more information.

Shapes contain the objects included in that diagram. Lines connect objects where one table is dependent on the other. Formatting can be selected based on either IE or IDEF1X notation.

Working with the graphic model

  • Right-click on an object and select Schema Browser Menus to display the popup menu from the Schema Browser.
  • F2 toggles full screen mode.
  • F4 or double-click performs a Describe, if Toad supports Describes on that object type.

Notation Format

The diagram can be created using either IE or IDEF1X notation. Each of these formats provides different information and a different format for the graphical model. Select the notation you are used to using.

To change the notation

» From the ERD toolbar, click either:
  • for IE
  • for IDEF1X

Adding new tables to the model

After you have created a diagram, you may want to add other tables to it. For example, in a production system the database may have several tables that are used, some of them may not be connected to other tables in the system. However, since it is part of the same system, you may want those in the diagram too. You can drag tables to the diagram from the Schema Browser, Query Builder, or Project Manager at any time and click the find dependencies button to find any joins.

Highlight Attributes in Parent/Child objects

Hover over a foreign key constraint to highlight attributes (from keys) in parent and child objects.

Related Topics

ER Diagram

Creating an ER Diagram


Navigating the ER Diagram

Navigating the Diagram

The ER diagram can be manipulated and arranged to display the entity relationships in a way that is appropriate for your situation. The basic ER diagram can be navigated in the left hand pane, by clicking the Model tab.

Left Hand Side

Model tab

The model tab contains a tree structure that includes every object and area in the diagram. The top node on the tree is Workspaces, a listing of all workspaces you have created. Click on a workspace, and the Workspace tab populates with the objects contained in that workspace. In addition, in the right hand pane the selected workspace is brought to the forefront and becomes active.

You can also drag items from a node on the model tab to a workspace area in the right hand side. As long as the object remains in the Model, referential relationships can be found for that object and added to the diagram.

Workspace tab

The workspace tab contains a tree structure describing the active workspace.

  • Double-click on an item in one of the nodes to select it in the right hand side.
  • Select an item and press F4 to DESCRIBE it.

Right Hand Side

Workspaces

A workspace containing All Items is always created with your model. You can also create new workspaces to subdivide the objects as needed. You can create additional workspaces that are subsets of the main diagram. In this way, you can split a large project into smaller sections that are easier to browse and view.

To create a new workspace

  1. In the tab bar, click [image].
  2. From the All_Items Workspace navigator, or the Model navigator, drag items to the new workspace.

Or

  1. In a workspace, select the objects you want to separate into a new workspace.
  2. Right-click and select Add to Workspace | New Workspace.
  3. Name the new workspace and enter any notes you want to explain it.

Related Topics

ER Diagram


Integration with Toad Data Modeler

Toad for Oracle users can use Toad Data Modeler to:

  • define Toad for Oracle as a default editor for generated SQL scripts
  • load Toad for Oracle aliases
  • open Toad for Oracle projects in TDM3
  • import Toad for Oracle ER diagrams to TDM3
  • use Toad for Oracle icons in TDM3

Toad Data Modeler supports the following database platforms: Oracle, MS SQL, DB2, MS Access, MySQL, PostgreSQL and Sybase ASE.

If you have Toad Data Modeler installed, you can send your saved ER diagrams to the Data Modeler for deeper analysis.

In addition, working from Toad Data Modeler, there are several additional points of integration to Toad for Oracle. See your Toad Data Modeler help file for more information.

To launch Toad Data Modeler

  1. From Toad's ER Diagram window, click [image] and load a saved ER diagram.
  2. Note: If you have just created a diagram, you must save the file in order to export it to Toad Data Modeler.
  3. Click [image] . The ER diagram is opened as a Toad Data Model.

Related Topics

ER Diagram


Workspace Format

Format the workspace to suit your needs. Each workspace page can be formatted individually. In addition, each object within a workspace can be formatted individually, including lines, notes, and model titles.

The workspace format allows you to change general display options and options for shape and object. Options displayed are directly related to the object or workspace selected.

Option Type | Description
General | Format colors for display, types of lines, and rename the object or workspace.
Shape | Use these options to specify design of the shapes containing objects in the diagram.
Objects/DBObject | Use the object option to change how the objects display, including what portions of the object display.

To format a workspace

  1. Click on the workspace tab that you want to format.
  2. Right-click and select Workplace Format.
  3. Make changes to display options.
  4. Click OK.

To format a workspace object

  1. Within a workspace, right-click on the object you want to format.
  2. Select Workplace Object Format.
  3. Make changes to display options.
  4. Click OK.

Related Topics

ER Diagram

Navigating the Diagram

Reading the ER Diagram


Explain Plan Overview

Explain Plan is an Oracle function that analyzes SQL statements for performance issues. The Explain Plan determines the execution plan Oracle follows when executing a specified SQL statement. It inserts a row describing each step of the execution plan into a specified table. If you are using cost-based optimization, this statement also determines the cost of executing the selected statement.

The results of the Explain Plan include:

  • Order that Oracle will search and join tables
  • Types of access employed (index search or full table scan)
  • Names of indexes used.

Toad uses the Windows User name plus the date and time to generate a unique statement id for the Explain Plan. If the user has a longer than normal user name, you may need to expand the Statement_ID column of the Plan table.

If you have not set up the Explain Plan tables, or the plan table specified in Toad Options | Oracle | General, Toad will ask you to do so. If you do not want to store previous Explain Plan results, disable the option Save previous Plan results in the Toad Options | Oracle | General window. This will keep Toad from asking you repeatedly to create the table.

Note: If you do not set up the Explain Plan tables, you will not be able to recall previous Explain Plan results.

See Explain Plan Results for more information on Explain Plan results.

Viewing the Explain Plan for the Current Statement

To view the explain plan

» Click [image] on the Editor toolbar executes the Explain Plan for the current statement (either the entire window, or any highlighted portion). Results are then displayed in the Explain Plan tab below the Editor.

Results

Results can be displayed in several formats. By default, the plan is displayed in a tree view. You can also choose to display the plan information in plain English, or one of two graphical modes. In addition, you can view the explain plan one record at a time.

To view in single record view

» Right-click over the Explain Plan and then select Single Record View. See View a Single Record for more information.

To change the display format

  1. Right-click over the Explain Plan and then select Display Mode.
  2. Select the display format you want to view.

Executing Explain Plan

You can run an Explain Plan on a statement inside a full script as well as on a single SQL statement.

Execute Explain Plan on SQL Statements

If you attempt to activate an Explain Plan and you have not created the needed Toad temp tables, Toad displays an error message telling you the table or view does not exist.

This does not affect the display of the Explain Plan window accessible from Database | Optimize | Explain Plan.

Only the Explain Plan histories are stored in Toad_PLAN_SQL and Toad_PLAN_TABLE

To execute Explain Plan on a SQL statement in the SQL Editor

» Place the cursor on a SQL statement. Select Editor | Explain Plan Current SQL (CTRL+E)

Troubleshooting

Toad expects to find an Explain Plan table with columns to match the most recent specification from Oracle.

If you get "Invalid Column" errors when executing Explain Plan, you can recreate the explain plan tables using the Server Side Install wizard.


Explain Plan Results

The Explain Plan treeview lists the contents of the Toad_PLAN_TABLE for the given statement id. The query used to retrieve information for this treeview is based on the one given by Oracle in utlxplp.sql. Please see Oracle’s documentation of the Explain Plan table and its columns for more information.

Explain plan results can be displayed in several formats:

  • Tree
  • Plain English
  • Graphic
  • MS Graph

In addition, in tree view, you can choose how you display some of the columns, or even to display them at all. By displaying them as columns rather than inline with the main plan you can create a display that is customized to your needs.

To change the display mode

  1. Right-click over the Explain Plan and then select Display Mode.
  2. Select the display format you want to view.

Adjusting Content

Use the Execution Plan Preferences dialog to adjust the content of the Explain Plan. Choices you can make from this dialog include making several of the columns visible or hiding the information altogether, and also choosing to display the information inline with the tree view or in columns to the left of it.

You can only adjust content in the tree view.

To adjust content

  1. Right-click in the Explain Plan and select Adjust Content.
  2. Select or clear the checkboxes in the Visible column to display or hide the associated information.
  3. Select or clear the checkboxes in the As Column column to view the associated information inline with the plan or in a column to the left of the plan.
  4. Rearrange columns by dragging the column where you want it directly on the Explain Plan. In this way you can put columns in any order, or to the right of the plan.

Related Topics

Explain Plan Overview

View a Single Record


Object Usage

From the explain plan, you can view object usage for the query you have run. See Explain Plan Overview for more information.

The Object Usage window displays the Operation, option, object type, object owner, and object name of the objects used.

Arrange data:

  • Reorder columns by dragging their headers into the order you want.
  • Sort columns by clicking on the column header.
  • Group data by a column type by dragging the column header into the area above the grid.

To view Object Usage

  1. Run an explain plan.
  2. Right-click over the explain plan window and select Object Usage.

Related Topics

Explain Plan Overview

Explain Plan Results


Printing and Copying Explain Plans

When you have run an Explain Plan, you can print it from the grid or from the Explain Plan window, or copy it to the clipboard to paste into other documents.

When you copy or print the Explain Plan to the clipboard, it is copied or printed just as it is displayed, whether hierarchical, plain text, or graphical.

See Explain Plan Overview for more information about using the explain plan.

To copy to clipboard

  1. Run an Explain Plan.
  2. Select the Display Mode you want to use.
  3. Right-click in the Explain Plan and select Copy to Clipboard.

To print

  1. Run an Explain Plan.
  2. Select the Display Mode you want to use.
  3. Right-click in the explain plan and select Print.
  4. Select your printer settings and then click OK.


Viewing Previous Explain Plan Results

This window displays the results from previous calls to Explain Plan. The format of these Explain Plans is the same as if you had just run the plan on your SQL. See Explain Plan Overview for more information. Viewing previous plan output lets you compare different results for similar statements or for revisions of the same statement as you tune them.

Previous plan results remain in the Toad tables until cleared by the user using the CLEAR button on the Explain Plan window.

To access previous explain plans

» Do one of the following:
  • From theb Database menu, select Optimize | Explain Plan.
  • Click [image] on the main toolbar.


Saving Explain Plans

There are two ways to save Explain Plans from Toad.

You can save them automatically for viewing from Database | Optimize | Explain Plan or you can save them to an XML file. The latter will allow you to compare a current or historic Explain Plan to the saved file in the future.

To save Explain Plans automatically

  1. From the Toad Options screen, select the Oracle | General page.
  2. Select the Save previous Explain Plan results box.

To save Explain Plans to an xml file

  1. Run an Explain Plan.
  2. Right-click over the plan and select Save to XML file.
  3. Choose a location, name your file and then click OK.

To load an xml file

  1. Right-click in the Explain Plan area.
  2. Do one of the following:
    • Select Load from XML file and then select the file to load and click OK.
    • Drag the xml file from Windows Explorer to the Explain Plan window.

Related Topics

Comparing Explain Plans

Explain Plan Overview

General Oracle Options


Comparing Explain Plans

You can compare a currently run Explain Plan, or an Explain Plan that has been saved to the plan table with one you have saved to an XML file. This can be useful if you are comparing variations of the same SQL. See Explain Plan Overview for more information.

Each side of the screen can be connected to a different database, so you can use this feature to compare a plan for the same SQL from two different databases.

Comparing Explain Plans displays a side-by-side comparison view of the plans you are comparing. The Explain Plans are compared using the Difference Viewer. (See Viewing File Differences for more information.) No highlighting is provided to show differences. However, the status area above the left side panel will display either Plans Match in blue or Plans Differ in red as required.

For differences to be highlighted, you must view the explain plans in tree view.

To compare Explain Plans

  1. Select an Explain Plan to compare, from either:
    • A current plan run in the Editor
    • An Explain Plan opened from the View | Explain Plan window.

    Right-click over the plan and select Compare to another Plan.

    Note: The differences viewer opens with the selected plan in the left side.

  2. In the right-panel toolbar, click the Open Plan button and select a saved plan for comparison.
  3. Click OK.

Related Topics

Explain Plan Overview

Viewing File Differences


HTML Schema Doc Generator

This window lets you select one or more schemas from the left panel and create HTML documentation describing the schemas using the Begin HTML Schema Doc Generation button at the top of the screen. Hyperlinks throughout the final HTML document let you jump between sections of the documentation.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To access the Schema Doc Generator

» Do one of the following:
  • From the Database menu, select Report | HTML Schema Doc Generator.
  • From the Automation Designer, select the DB Misc tab and click [image].

All options are saved to and loaded from the TOAD.INI file. Schema selections are saved and loaded on a per-database basis.

Sources tab

Schemas available to document are listed on the left of the window. Check one or more schemas to document.

Right-click the schema list to choose from several default selections.

Use the right pane to create schema documentation from the .def files. These def files are created in the Generate Schema Script window. See Generate Schema Script for more information.

Note: You must check "Def file will be used for HTML Schema Doc generation in Generate Schema script to include all parts of the schema."s

To use this feature, the def file name must match the schema name. In other words, for the schema called SCOTT, your def file must be called SCOTT.DEF.

Content tab

This tab contains checkboxes that let you select what to include in your HTML document. They are divided into Object Summaries and Object Descriptions. By default, all checkboxes are checked. See the following for additional information:

Option Information
Content Tab
Object Summaries

Privileges

Object privileges will include the Object Owner, as well as the name and grantable or non-grantable privileges. System privileges will include the privilege and whether there is an Admin option for that privilege

Counts of all objects

Counts the not only the number of objects of the selected type in the schema but also miscellaneous details such as number of table columns and table partitions
Format Tab

One file per schema

Each schema is written to its own file. If more than one schema is selected, an additional HTML page will be created that is a link between the schema documents.

Use Existing CSS file checkbox

Most of the style options are written to a CSS (Cascading Style Sheet) file. If you want to use your own customized version of the CSS file, select this option and specify the file name or URL. When this option is selected, the options that write to the CSS file are disabled.

Indent HTML files

When checked, the HTML code in the files will be indented with spaces so it can be more easily read. When the option is unchecked, no indentations will be made in the HTML code, so the resulting files are smaller and can be read faster by computers. This option does not change the way the HTML documents are displayed when viewed through a browser.

Page Breaks before Tables

When checked, Toad will insert a page break before each table. This makes a change to the CSS file, not to the HTML file, and has no effect unless the HTML docs are printed.

Lowercase Tables

Displays HTML tables entirely in lowercase. This option changes the CSS file, not the HTML file.
Aliases for Schema Names Tab

Grid

The grid automatically enters the source choices you have made on the Sources tab. If you leave this area blank, then schema names and database names will be included in the HTML document Toad generates.

If you fill in an alias for any schema, that schema name will be replaced by your alias throughout the HTML document.

You might want to use an alias if:

  • Your schema name is different from the application name and you want to see the application name displayed.
  • You want to extract an HTML doc from more than one def file of the same schema. If you do not use an alias, the file names will overwrite each other because they will be the same. Using an alias, the file names will be different.
  • Readers of the HTML docs shouldn't know your schema or database name.

Related Topics

Action Catalog

Generate Schema Script


Scheduling Schema Doc Generation as a Windows Task

If you are likely to use these settings repeatedly, you may want to set them up as an action or part of a ToadApp in the Automation Designer. See Automation Designer Overview for more information.You can schedule the generation as a Windows task directly from the Schema Doc Generation window as well.

To generate a schema doc task

  1. Set up your script options and settings as in HTML Schema Doc Generator, but do not execute the command.
  2. Instead, click [image] in the status bar.
  3. Enter the information as required for the Add Task wizard. See Add Task Wizard for more information.

Related Topics

Automation Designer Overview

Creating New Actions

HTML Schema Doc Generator


Master/Detail Browser

Use the Master/Detail browser to view or edit data from multiple tables, snapshots, views or queries linked by foreign keys or a user-defined master-detail relationship. This is typical of a database setup from an Entity/Relationship diagram, where one table's objects are related to another table's objects by a linking field or fields.

For example, you could start with the DEPARTMENT table, and display details. Select a department record in the Master grid, and the detail grid will display employee records for that department only. If multiple tables are linked by foreign keys, you can add additional details beneath the first.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

To access the Master/Detail Browser

» From the Database menu, select Report | Master/Detail Browser.

Navigator

To the left of the Master Detail Browser is the Master Detail Navigator. As you add detail tables, they are added to the navigator under the original table. Using the navigator can make it much easier to control very detailed sets of master/details.

Within the navigator, you can hide or display the schema name and delete detail nodes.

You can use the navigator to find the grid for a specific detail table.

To find a detail

» In the Navigator, click on the node for the detail you want to view.

Note: In the Master Detail browser, the grid for that detail flashes in the lower grid pane.

Single Grid Mode

You can set Toad to display only one grid at a time by checking the Single Grid Mode box on the Master/Detail toolbar. Use the navigator to select which grid you want to see.

Related Topics

Master/Detail Browser Toolbar

Selecting the Master Object

Adding Detail Datasets


Master/Detail Browser Toolbar

From the Master/Detail browser toolbar you can add details, save a master/detail relationship, open a relationship, edit the query used for the master relationship and more. See Master/Detail Browser for more information.

Button | Command
 | Change active session. In the drop down list, the active session is denoted by a
 | Open Master/Detail relationship
 | Save current Master/Detail relationship
 | Minimize Toolbars for maximum grid area
 | Optimize Dataset Heights
Single Grid Mode | Toggles single grid mode
 | Generate Report.
 | Sort/Filter selected tables
 | View/Edit the query for the master dataset
 | Refresh the grids
 | Add detail to the selected dataset. See Adding Detail Datasets for more information.
 | Make grid smaller
 | Make grid larger
 | Remove this detail from the relationship
Type: | Object type contained in the grid.
Single Grid Mode | Displays only one grid at a time: use the navigator to select the grid to display.
 | Select Foreign Key - select a detail table to display, based on foreign key.


Generating XML Output

You can generate XML output from a master-detail relationship. From the master-detail grids, you can send a query to the Editor that will generate the output. Output will be created in XML Form, one XML document per row. See Master/Detail Browser for more information.

This feature is available only in Oracle 9iR2 and newer, and when the Master-Detail relationship consists of one master and one detail.

To generate XML output

  1. From the Master Detail browser, open or create a relationship that consists of one Master and one detail.
  2. Right-click on the master grid, and select Send XMLGEN Query to Editor.
  3. Switch to the Editor window in Toad.
  4. Execute the query to generate XML output.

    5. Toad creates an XML document for each row in the master dataset, with each XML document containing all corresponding detail rows.

To save XML output to disk

  1. Right-click on the Editor grid and choose Export BLOBs (longs, raws).
  2. Select the XMLDATA column from the Export this Column drop down.
  3. Enter or select a directory where you want the files stored in the Export Path box.
  4. Select the method of naming your files:
    • Use sequentially numbered files
    • Export to files named for the value in this column (select the column)
  5. Click OK.

Related Topics

Master/Detail Browser

Execute Scripts


Selecting the Master Object

Before you can add details, you first need to select the master object for the relationship view.

To select a master object

  1. From the Database | Report menu, select Master Detail Browser.
  2. In the Type box, select the type of object you want to use.
  3. In the owner box, select the schema that contains the object.
  4. In the Name box, select the name of the object.

    5. The grid populates with the contents of your selected object.

Related Topics

Adding Detail Datasets


Adding Detail Datasets

You can easily add detail datasets to a master grid, or to a detail grid.

If you choose Other as the dataset type, (not Table(FK)), then the [image] drop down will include Reverse Foreign Keys. This lets you define the master-detail relationship by going through a foreign key in reverse.

To add a dataset

  1. From the Master/Detail Browser, open a master object. See Master/Detail Browser for more information.
  2. On the master toolbar, click [image].

  3. Behavior is determined by number of foreign keys:

    One foreign-key defined detail

    Added automatically.

    Multiple foreign-key defined details

    Choose from a list of available tables and click OK.

    No constraints defined

    Define a relationship in the Define Master-Detail Relationship dialog.

Related Topics

Master/Detail Browser

Master/Detail Browser Toolbar

Selecting the Master Object

Defining a Master/Detail Relationship


Defining a Master/Detail Relationship

If there is no foreign key specified, you can create a Master/Detail relationship by hand.

To define a master/detail relationship

  1. From the Master/Detail browser, select a master object. See Selecting the Master Object for more information.
  2. Click [image].
    • If there is no defined detail dataset, the Master/Detail Define Relationship dialog displays. Continue with step 3.
    • If there is only one defined detail dataset, it is displayed. In the Type drop-down, select Other, and then click [image].
  3. In the Master area, select the columns you want to link and click the > arrow to move them to the Key Columns list.
  4. Select any columns you do not want to link from the Key Columns grid and click the < arrow to remove them.
  5. In the detail area, select the Object type containing the dataset you want to link.
  6. Select the schema containing the dataset.
  7. Select the Object Name containing the dataset.
  8. In the Available Columns grid, select the column you want to link to the selected column in the Master Table.

    9. Note: These must be in the same order as the Key columns in the Master area.

  9. Click OK.

To close without making changes

» Click Cancel.

To delete the master-detail relationship

» Click Clear and Close.


Reports Manager

Reports Manager Overview

The Reports Manager lets you easily manage reports that have been previously created, including several that Toad provides for you. You can Open, run, and print from the Reports Manager window, without dealing with design screens. If you want to create a report from scratch, you can open the Report Builder wizard from this screen.

To access the Reports Manager

» From the Database menu, select Report | Reports Manager.

Using Reports Manager

When you first begin using the Reports Manager, you will need to import the reports you want to use. Importing queries and fr3 report definitions from a single file is much easier than running the query separately each time you want to run a report. Having a single file creates portability between versions of Toad: you only need to move one file to have queries, comments and report layout for the report.

Queries are displayed in the report manager supply the data to the reports, and can be edited from the Reports Manager.

There are advantages to accessing the report builder from the reports manager rather than directly from the Editor:

  • A report needs two things - a query and a report definition file (the .fr3 file). The reports manager gives you a convenient way to organize them, clone them, share them, etc. When you run and re-run reports from the Editor, you need to remember the query (or remember where you saved it).
  • The reports manager allows you to create master/detail datasets to report on. This cannot be done in the Editor, however you can create them from the Master/Detail Browser and then create a report.

The Reports Manager is divided into two areas. The left hand side contains a list of loaded reports for you to select. The right hand side contains information about the selected report, including options to view the Master Dataset (query), Comments you have added, or the Detail dataset. Parameters are listed in the grid at the bottom of the right hand side.

Report History

The last report you viewed will remain open when you close the Reports Manager and reopen it.

Reports area (Left hand side)

The reports area organizes your reports within various categories. You can move the reports between categories, add, or delete them from your reports file.

When you expand a category and close the window, Toad will remember that it has been expanded and open it that way the next time you use the Reports Manager.

The Reports area is also multi-select enabled. This means that you can select more than one report from the list and then act on them at once. When you have multiple reports selected you can Change Categories, Export, Print, Delete them.

Report Information area

The right hand side, or report information area, displays the query on which the selected report was based, any comments you have entered for the report, parameters that need to be entered before Toad can run the query, and displays Index columns, if applicable.

Scheduling Reports

You can schedule reports by using the command line interface. See Print/Export Reports from the Command Line for more information.

Related Topics

Reports Manager Toolbar

Copying a Report

Changing a Report's Category

Import/Export Reports

Print/Export Reports from the Command Line


Reports Manager Toolbar

Use the Reports Manager toolbar to manage your reports and the queries associated with them easily and quickly.

Button | Command
 | Change active session. In the drop down list, the active session is denoted by a
 | Export Report (Save report file as).
 | Import Definition File.
 | Import all definition files in a directory.
 | Copy Report.
 | Change category.
 | Edit selected report.
 | Run selected report.
 | Print report.
 | Create command line file.
 | Schedule selected report.
 | Create a new report.
 | Delete selected report.

Related Topics

Reports Manager Overview

Creating a Master/Detail Dataset

Changing a Report's Category

Copying a Report

Import/Export Reports


RM_Creating a Report

Creating a Report

Creating a report in the Reports Manager consists of several parts. See the following for more detailed information:

  • Changing a Report's Category
  • Queries
  • Report Builder Wizard

To create a report

  1. Click [image] on the reports manager toolbar.
  2. Enter or select the category name you want to use for the report and click OK.
  3. Name the report and click OK.
  4. In the right pane, enter the query for the Master Dataset, and for any detail datasets.
  5. Click [image] and create a report.

Building a Report on Ref Cursor Output

You can create reports with simple queries, but you can also create reports that are built upon a ref cursor. Results should be assigned to an output parameter of type "cursor". Within the Reports Manager, RefCursor output is only supported as the master dataset (with no detail).

Example Query for RefCursor Output

DECLARE

P_RECORDSET Types.cursor_type;

BEGIN

GETEMPRS ( P_RECORDSET );

:rcP_RECORDSET := P_RECORDSET;

END;

Related Topics

Reports Manager Overview

Reports Manager Toolbar

Changing a Report's Category

Queries

Report Builder Wizard


RM_Queries

Queries

The basis for a report in Fast Reports is the query. You can easily generate a report from the data grid using the Report Builder wizard; from the Create Report toolbar button in the Reports Manager and then import it into the Reports Manager (See Import/Export Reports for more information); or you can build your query directly in the Reports Manager.

Queries can include variables that are specific to Toad as well as variables of the standard type.

Some of these include:

Variable | Reference
<DA> | Use <DA> and the Reports Manager will automatically convert it to sys.dba_ or sys.all_, depending on your privileges in the current connection when the report is run.
Current Schema | You can create a variable of the Current Schema type to automatically substitute the currently active schema name.
Shortcuts to the Data dictionary | See Parameters for more information.

Related Topics

Report Builder Wizard

Reports Manager Overview


RM - Parameters

Parameters

You can use the Parameters area of the Reports Manager to include the parameters for the query you have created.

Value (Literal)

The value (literal) parameter is a bind variable. This only works with Date, Number or String parameter types. You must enter a literal value such as 4, 'hello', or 03/23/2006 1:34:25 PM (the same date format that shows up in the grids).

Value (Expression)

Can be more useful. This is like a substitution variable, but more expansive. You can use this anywhere in the query.

You could use this as a variable for a table name in the from clause, the select list, or somewhere in the where clause. It can be a subquery, a list, anything. Toad just substitutes an expression into the query. Since it's a substitution variable, parameter type doesn't really matter. Except for the "special" parameter types (the ones from "Cluster" on down the list).

Special Parameter Types

Cluster parameter types and the remainder of the parameter list are shortcuts into the data dictionary. The ones classed as "list" are designed to return multiple values, and the others return single values.

String Parameter

For example, if your query looks like this:

select *

from user_tables

where table_name = :tn

You could specify a STRING parameter type for table, but then you'd have to type in the table name yourself. If you'd rather choose it from a list, change the parameter type to "Table". Then, under "Value (Expression)", click the "..." button and you'll get a list of tables.

Table List Parameter

If you want to report on multiple tables, make your query like this:

select *

from user_tables

where table_name in (:tn)

Change the parameter type to Table List, and when you click [image], you can select multiple tables.

Other Parameter Types

Other parameter types work the same way, so:

  • Current Schema - Automatically uses the currently active schema in your query.
  • Schema - Lets you pick a single user name.
  • Schema List - Lets you pick multiple schema names.
  • And so on.

Related Topics

Reports Manager Overview

Reports Manager Toolbar


RM - Creating a Master/Detail Dataset

Creating a Master/Detail Dataset

When working in Reports Manager, after you have created your master dataset, you may wish to add a detail dataset. This adds information to your report.

There are many examples of master-detail datasets in the sample reports, particularly in the Tables and Index Reports and Stored Program Reports categories.

To create a master-detail dataset

  1. Add a report and enter the master query (for example, SELECT * from SCOTT.DEPT).
  2. Click [image] and enter details.
  3. Enter SQL for the detail dataset (for example, SELECT * FROM SCOTT.EMP).
  4. Rename the detail dataset if desired.
  5. Define the key fields to link the master and detail datasets by clicking [image] on the detail dataset tab.

Related Topics

Reports Manager Overview

Reports Manager Toolbar


RM - Copying a Report

Copying a Report

You can copy (clone) a report in the Reports Manager. This creates an identical query and .fr3(report definition) file. Using this method, you can create similar reports quickly.

To copy a report

  1. In the Report Name area, select the report you want to copy.
  2. Click [image].
  3. If you want to put your new report in a different category, select the new category from the New Category drop-down.
  4. Enter a new name for your report in the New Report Name box.
  5. Enter a new filename for the report definition file in the New Report Definition File Name box.
  6. Click OK.

Related Topics

Reports Manager Overview

Reports Manager Toolbar


RM - Adding RunInfo data to a Report

Adding Run Info Data to a Report

To add RunInfo data to a report

  1. Select the report where you want to add RunInfo.
  2. Click [image].
  3. In the menu, select Report | Data.
  4. Check the RunInfo box in the Select Report Datasets dialog.


RM - Changing a Report's Category

Changing a Report's Category

You can change the category where you have filed one or more reports in the Reports Manager. This can be useful if your categories are changing, or if you have misfiled a report as you imported it.

To change a report category

  1. Select the report or reports you want to change. You can multi-select between categories, but all reports will be changed to the same category.
  2. Click [image].
  3. Do one of the following:
    • Select the new category from the Category drop-down.
    • Type a new category name into the Category box instead of selecting one.
  4. Click OK to change the category.

Related Topics

Reports Manager Overview

Reports Manager Toolbar


RM - Importing/Exporting Reports

Import/Export Reports

You can import or export a report from the Reports Manager file. This makes it easy to add new reports to the samples provided, and to export your reports into a file that can be shared with other users.

You can import or export more than one report at a time.

To import a file

  1. Click one of the Import buttons:

    Import Report Definition file(s)

    Import all Report Definition Files in a Directory (includes subdirectories)

  2. Select the file or folder by browsing for it in the Open file dialog.
  3. Click OK to import the file or folder.

Exporting files

You can export one or more files.

To export a file

  1. Select the file (or files) you want to export.
  2. Click [image] and choose one:
    • Export Selected Reports
    • Export All Reports
    • Export All Reports in Current Category
  3. Name your file and specify where to save it.
  4. Click Save.

Related Topics

Reports Manager Overview

Reports Manager Toolbar


Scheduling a report as a Windows Task

To generate a report task

  1. In the Reports Manager, select the reports you want to schedule. Reports Manager Overview
  2. Click [image].
  3. Select or create a filename for a command line report settings file and then click OK.
  4. In the Schedule Reports window, select a report output format.

    5. Note: If you have selected Email or File you must enter a recipient or an output directory, respectively; also select a format for the output.

  5. Select an action for Toad to perform after the report is created.
  6. Click Schedule.
  7. Enter the information as required for the Add Task wizard. See Add Task Wizard for more information.


Report Builder Wizard

When you create a single dataset report Toad provides a report builder wizard to make it easier to create your report. You can then import this report into the Reports Manager and expand it into a Master/Detail report, generate it repeatedly on different schemas, and otherwise work with it. See Reports Manager Overview for more information.

To create a report using the wizard

  1. In the Editor, run the query you want to use for the report.
  2. Right-click and select Report.
  3. Complete the wizard.

To create a report without using the wizard

  1. In the Editor, run the query you want to use for the report.
  2. Right-click and select Report.
  3. When the Report Builder displays, click Cancel.
  4. Create your report using Fast Report.

For additional help using the Report tool, see the Fast Report online User Manual.


Spool SQL

Database | Spool SQL command will either display all SQL to message boxes on screen or send it to a file (<USER FILES DIR>\DEBUG.SQL) depending on your choice from the menu.

To spool SQL effectively

  1. From the Database menu, select Spool SQL and where you want to send the code (to Screen or to File).
  2. Select a function from Toad. The SQL Toad used to perform that task is spooled to either the screen or the specified file. See Output Window for more information on Spool SQL to Screen.


Wrap Code

Wrap Utility

Toad's Wrap Utility provides an easy way to access Oracle’s Wrap Code utility. The utility encrypts PL/SQL code. This window is connection independent so you do not need an open database session to use it.

Note: You must use valid PL/SQL for the utility to wrap the code. If the contents of the Input Text and Wrapped Text tabs are the same, there is probably an issue with your code.

To use the Wrap Utility

  1. Select Utilities | Wrap Utility.
  2. Enter code in the Input Text tab or click [image] to open a file.
  3. Click [image].
  4. Click [image] to save the wrapped text or [image] to send it to the Editor.

Troubleshooting

To use Toad’s Wrap Utility interface, it must be able to find the Oracle Wrap Code utility. To assure that Toad can find the utility, check to see that one of the following is true:

  • The Wrap Utility is in a recognized Windows path.
  • You have added the path to Toad’s list from the View | Toad Options | Executables page. See Executables for more information.


Service Manager

Access this window by selecting the Utilities menu, then select Service Manager.

The Service Manager can maintain a static list of services on your local machine and other networked computers that you can batch start/stop easily. This list is stored in the Services.ini file.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Adding Services

You can add a new service to your service manager list.

To add from the local computer

  1. Click Add.
  2. Click Search without entering anything in the Computer Name box. A list of possible services displays.
  3. Select the services you want to add to your Toad service manager. You can multi-select by using SHIFT and CTRL+clicking.
  4. Click OK to add the selected services to the services list.

To add from a networked computer

  1. Click Add.

    2. Enter a computer name in the Computer Name box (for example, testmachine, or \\testmachine) and click Search.

    Note: You must have administrator rights to the remote machine for the services to display.

  2. Select the services you want to add to your Toad Service Manager. You can multi-select by using SHIFT and CTRL+clicking.
  3. Click OK to add the selected services to the services list.

Removing Services

To remove a service

» Select a service from the service list and click Remove.

Refresh

To refresh the service list

» Click Refresh to refresh the service list. If there has been a change in the status of a service (for example, a running service has stopped) the status column will be updated.

Starting and Stopping Services

Once the services are included in the services list, you can easily start and stop them.

To start services

» Select the services you want to start and then click Start. Services will be started in the order they display on the list.

To stop services

» Select the services you want to end and then click Stop. The services stop in the order they display in the list.


Configure Toad Tools

You can configure Toad to open external tools for you and then execute them from the Main Toolbar. In order to open an external tool from within Toad, you first need to add it to the Tools list. See Execute Toad Tools for more information.

Automatically Add Tools

Toad can help you automatically add some tools for select applications.

To automatically add tools

  1. Click the arrow beside [image] on the main toolbar and select Configure.

    2. Note: If you previously executed an application from this button, the icon for the application you executed displays instead of the icon displayed in this step.

  2. Click Auto Add and select the applications you want to add.

  3. To add Toad for Data Analysts, complete the following additional steps:

    1. Select Toad for Data Analysts in the Toad Tool Options window and click Edit.

    2. Enter the following information in the Parameters field:

      /TOADUSER=$UID/TOADPASSWORD=$UPW/TOADDATABASE=$SID/TOADFILE="$FIL"

Manually Add Tools

Adding a tool manually is the same as adding a shortcut. If the tool is included in the Auto Add feature, you should add it to your External tools in that way to ensure that it will work properly.

To add a tool manually

  1. On the main toolbar, click the arrow on [image].
  2. Select Configure from the drop-down menu.

    3. Note: If you previously have executed an application from this icon, the above icon will not display. Instead, you will see the icon for the application you executed.

  3. Click Add.
  4. Enter the Title of the tool. This is what will be displayed in the tool list, so choose something you will recognize. For example, enter Notepad.
  5. In the Program box, enter the full path name for the executable. You can enter the path directly or you can click and browse for the full path name. For example, enter the path name for Notepad: C:\WINNT\system32\notepad.exe.
  6. Enter the Working Directory for the tool. Click in this box and Toad automatically enters the directory where the tool is located. If necessary, you can change this directory.
  7. Enter any Parameters. These specify configurations of the tool, and can be combined. Some standard parameters are listed in the macro box at the bottom of the window.
    • $UID - enters the current Toad User ID
    • $UPW - enters the current Toad User password
    • $SID - enters the current Toad database ID
    • $CWD - enters the current Toad working directory
    • $TMP - enters the windows temporary directory
    • $FIL - enters the file in the active Editor

    For example, if you wanted to automatically open Notepad with the current file in the active Editor, you would enter the information to open Notepad as above, and enter $FIL in the Parameters box.

    You could also enter the command: sqlplusw.exe $UID/$UPW@$SID which starts sql plus with the current toad connection.

  8. From the Run drop-down, you can opt to run the tool in a normal window, a minimized window, or a maximized window.
  9. Enter any Shortcut keystrokes you want to use for the tool.
  10. If an icon has not been chosen, click the arrow. Select an icon from the drop-down menu.

Edit List of Tools

To edit a tool

  1. On the main toolbar, click the arrow on [image]. Select Configure from the drop-down menu.

    2. Note: If you previously have executed an application from this icon, the above icon will not display. Instead, you will see the icon for the application you executed.

  2. Select the tool you want to edit and then click Edit.
  3. Make desired changes to the settings (described above in Add a tool manually) and then click OK.

To delete a tool

  1. On the main toolbar, click the arrow on [image].
  2. Select Configure from the drop-down menu.

    3. Note: If you previously have executed an application from this icon, the above icon will not display. Instead, you will see the icon for the application you executed.

  3. Click the name of the tool you want to delete.
  4. Click Delete. Confirm to delete.

To change the order of the list

Tools display in the drop-down list in the order in which they are listed in the Tool Options dialog box.

  1. On the main toolbar, click the arrow [image]. Select Configure from the drop-down menu.

    2. Note: If you previously have executed an application from this icon, the above icon will not display. Instead, you will see the icon for the application you executed.

  2. Select the tool you want to move by clicking on its name.
  3. In the right panel, click the green up arrow to move the tool up in the list, or the down arrow to move it down in the list. When the list is in the order you want it, click Close.


Execute Toad Tools

Toad can open external tools for you and then execute them from the main toolbar. Tools must be configured in order to use this feature. See Configure Toad Tools for more information.

To execute a tool

  1. Click the drop-down arrow on [image] on the main toolar.

    2. Note: If you previously have executed an application from this icon, the above icon will not display. Instead, you will see the icon for the application you executed (See below).

  2. Select the tool you want to execute. The tool opens in a new window.

When you execute an external tool from the toolbar, the Toad Tools button changes to the icon for the tool you last executed. You can then click directly on the button to open that tool again, instead of choosing it from the drop-down list.


FTP

FTP (File Transfer Protocol) is the most common means of file transfer on the Internet. Toad has included FTP support primarily so that Oracle scripts can be sent over TCP/IP connections. Toad FTP can support a file size of up to 4GB.

Notes:

  • You can use Toad or Windows variables in the directories. See Define New Variables for more information.
  • Secure FTP only supports binary transfers, not ASCII.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To transfer files

  1. Select the Utilities | FTP.
  2. Click
  3. Select the server settings. Review the following for additional information:

    4. Use Default Port

    Select to use the default port to connect:

    • 21 for FTP/Rexec connections
    • 22 for SSH connections

    Passive (for firewalls)

    Select to direct the server into passive mode, where only the client initiates connections. This feature is especially useful if the server is behind a firewall. Many firewalls do not let the FTP server open a connection from outside to the higher ports where the FTP client control expects them.
    Private Key File

    If you have chosen a Secure FTP/SSH connection, enter your private key in this box.

    Filter

    Enter any filters that you want applied to the files on the server side. These are standard Windows filters, such as *.doc or *.*.

  4. Click the arrows or double-click files to select files.


Java Manager Overview

If you are running Oracle 8i or above, Toad’s Java Manager can help you easily access the LOADJAVA and DROPJAVA utilities. The Java Manager consists of two tabs: Load Objects and Unload Objects.

This makes it easy for you to load and unload java classes and resource files to and from the database. The LOADJAVA utility creates several tables used to track the objects and the options used. DROPJAVA cleans up these tables and unloads the code from the database.

To access the Java Manager

» From the Utilities menu, select Java Manager.

Related Topics

Drop Java Objects

Load Objects


Load Objects

The Load Objects tab in the Java_Manager window lets you easily set options and load objects using Oracle’s LOADJAVA utility. See Java Manager Overview for more information.

To load objects

  1. Select files to load.
  2. Select loading options.

  3. Click Load. The files are loaded using Oracles loadjava.bat utility file.

    Note: In order to load java objects, you must be running Oracle 8i or above, and the Oracle utility file loadjava.bat must be installed in your Oracle home directory.

Select Files to Load

The first step in loading java files is to create a list of the files you want to add to the database. You can both add files to this list and remove them from it before you commit to loading them.

Note: If you close the Java Manager after adding files to this list and before loading them, the list will be lost.

To add files

  1. Click Add.
  2. Select the files to add to your list and click Open.
  3. If you have files in other directories, repeat these steps until they are all listed in the Files to load: area of the Load Objects tab.

To remove files

If you find you have put a file on the Files to load list that should not be loaded, you can still remove it at this point.

» Select the file, and click Remove.

Select Loading Options

The options area at the bottom of the tab allows you to set options for loading the files you have selected. These options apply to all selected files.

Create public synonym

If this option is selected, a public synonym will be created when the Java code is loaded. You can check this by looking at the Synonyms page in the Schema Browser.

Resolve

The resolve option instructs Oracle to resolve all of the external references in the objects you load. This allows Oracle to mark objects valid if the references are resolved successfully. The Resolve option uses the specification defined in the Resolver box to look for references. If the Resolver box is blank, Oracle will look first in your schema and then look for public synonyms.

Definer

The Definer option creates the class to run with the privileges of the logged in user instead of the privileges of the user that owns the class. This is equivalent to the "-definer" option of LOADJAVA.

Force loading of classes whether or not they were previously loaded

If you load a class using Java Manager, then drop the class using the DROP JAVA statement, or from the Schema Browser, you must select this option when you reload the class again. This is because dropping the class from other than the Java Manager leaves entries in tables created by Oracle. Oracle sees these entries and believes that the class is already loaded.

Resolver

This box lets you enter the specification for where Oracle will look when it resolves external references for the objects being loaded. The resolver specification should be in the form:

"((name_spec schema_spec) [(name_spec schema_spec)]…)"

Encoding

This option lets you tell the java compiler what encoding is used for the source file being loaded. Select the appropriate encoding type from the drop-down. If this option is left blank, then Oracle assumes you are using latin1.

Schema

This option lets you specify which schema will own the objects to be loaded. If this option is left blank, objects will be placed in the connected user’s schema. To load into your own schema, you must have Create Table and Create Procedure privileges. To load into another user’s schema, you must have Create Any Table and Create Any Procedure privileges.

Grant access to other users

To grant execute on loaded objects to users other than the schema owner, include them in this list. Enter users as a comma-delimited list.

Related Topics

Drop Java Objects

Java Manager Overview


Drop Objects

Drop Java Objects

Use the Java_Manager to drop objects. If you have used the Java Manager to load your java, it is a good idea to also use it to drop the java objects. This is because when Oracle’s LOADJAVA utility runs it creates several tables. Using the Java Manager to run the DROPJAVA utility will clean up these tables and leave your database more efficient. See Java Manager Overview for more information about the Java Manager.

To drop java objects

  1. Select files to drop.
  2. Select drop options.
  3. Click Drop. The files are dropped using Oracle's dropjava.bat utility file.

    4. Note: In order to drop Java objects, you must be running Oracle 8i or above, and the Oracle utility file dropjava.bat must be installed in your Oracle home directory.

Select Files to Drop

The first step in dropping java files is to create a list of the files you want to drop from the database. You can both add files to this list and remove them from it before you commit to dropping them.

Note: If you close the Java Manager after adding files to this list and before dropping them, the list will be lost.

To add files

  1. Click Add.
  2. Select the files to add to your list and click Open.
  3. If you have files in other directories, repeat these steps until they are all listed in the Objects to drop: area of the Drop Objects tab.

To remove files

If you find you have put a file on the Files to load list that should not be dropped, you can still remove it at this point.

» Select the file, and click Remove.

Select Drop Options

The options area at the bottom of the tab allows you to set options for dropping the files you have selected. These options apply to all files on the Objects to drop list.

Drop synonym

If this option is selected, any public synonym that relates to the Java object will be dropped as well. You can check that this has occurred by looking at the Synonyms page in the Schema Browser. See Schema Browser: Synonyms for more information.

Encoding

This option lets you tell the java compiler what encoding is used for the source file being dropped. Select the appropriate encoding type from the drop-down. If this option is left blank, then Oracle assumes you are using latin1.

Schema

This option lets you specify which schema owns the objects being dropped. If this option is left blank, objects will be removed from the connected user’s schema.

Related Topics

About the Schema Browser

Schema Browser: Synonyms


Network

Network Utilities

The Network Utilities command allows you to access the Network Utilities window. From this window, you can work with IP Addresses, Telnet to another account, use RExec commands, or Ping a server from the various tabs.

To access the Network Utilities options

  1. From the Utilities menu, select Network Utilities.
  2. From the tabs, select the Utility.
  3. Fill in any required fields and click the appropriate command buttons.

Related Topics

FTP

IP Addresses

Ping

RExec

Telnet

TNS Ping


Telnet

Telnet (Telecommunications Network) is a protocol for connecting to another computer and establishing a session there, where you can issue commands. The protocol is specified in Internet RFC 854.

The Telnet tab is used to communicate with servers implementing the Telnet protocol. It provides telnet capability through a simple interface. It functions like a terminal emulator, although at this time only displayable characters and the <Enter> key are supported (control characters, including backspace, are not currently supported).

To use telnet

  1. Select Network Utilities and click the Telnet tab.
  2. Enter the Host Name or IP address in the drop-down box and click Connect.
  3. Toad connects to the host computer.

    4. Note: In the window, login information displays. After the word "Login:" enter your login name, press ENTER. The remote machine will then request your password. Enter it, and press ENTER.

When you are connected to the host computer, the top panel in Toad is a console that displays messages from the server and the commands that you type in. The lower panel shows the Telnet commands sent and received as part of the protocol.

The right-click menu lets you Clear the screen or copy information to the Clipboard.

The Save Output button allows you to save information using the Save As window.

Related Topics

Network Utilities


RExec

The RExec command allows you to execute only one UNIX command at a time from a UNIX server. Instead of using telnet to log on for an extended period, you enter the appropriate information into the RExec tab and tell Toad to execute one command. Toad executes that command, provides the results to you, and closes your connection.

Note: The server must be running RExecd in order to use this utility. In addition, some variants of UNIX may handle an RExec as an rlogin, which may automatically execute login files such as ".profile". In this case, extraneous output commands such as echoing "motd" (message of the day) may interfere with Toad's parsing of the output.

To use RExec

  1. Select Utilities | Network Utilities.
  2. Click the RExec tab.
  3. Click in the Host/IP field and then enter the Host name or its IP Address.
  4. Press Tab or click in the Username field and then enter the username you will use to connect.
  5. Press Tab or click in the Password field and then enter your password.
  6. Press Tab or click in the Command field and then enter a UNIX command such as LS or WHO.
  7. Click Execute.

    8. Toad logs in, executes the command, logs out and displays the results in the main panel.

    Note: If the command you enter requires additional information, such as the command "bc", you will need to enter it in the results window and press ENTER to see results.

The right-click menu lets you Clear the screen or copy information to the Clipboard.

Large Commands in the RExec Box

If you have a very large command to enter in the RExec command box, you can double-click the box. This will open a small text editor that lets you see the entire command as you enter it.

Related Topics

Network Utilities

FTP

IP Addresses


Ping

The Ping tab allows you to check the availability of a server. This uses ICMP to contact other machines on the network and let you know whether it was successful or not.

The Ping tab is accessible from the Network Utilities menu item, or you can create a Ping action.

To ping a server

  1. Enter the Host name or the IP address in the Host name/IP field.
  2. Select the interval to check the server. This interval is in milliseconds.
  3. Click Start. Toad pings the server you specified repeatedly, at the specified interval, until you click Stop. Results display in the lower portion of the window.

The right-click menu lets you Clear the screen or copy information to the Clipboard.

Related Topics

Network Utilities

Ping Action

Automation Designer Overview

TNS Ping


TNS Ping

TNS Ping is an Oracle utility that tries to determine whether a TNS Listener is running for one of the connection strings in the tnsnames.ora file. Given a connection string, TNS Ping looks in the tnsnames.ora file to determine the name or IP address of the machine running Oracle, connects and checks for the Listener. The TNS Ping tab allows you to check the availability of a server using the TNS Ping utility.

To use TNS Ping

  1. To use this utility, open the TNS Ping tab. The TNS Ping tab is accessible from the Network Utilities menu item, or create TNS Ping action.
  2. Select the host name.
  3. Click TNS Ping. Toad pings the listener and the results are displayed in the window.

If the listener is found, Attempting and then OK displays in the results area. If no listener is found, No Listener displays.

The right-click menu lets you Clear the screen or copy information to the Clipboard.

Related Topics

Network Utilities

TNS Ping Action


IP Addresses

Use the IP Addresses tab to check the IP Address of a Host name/URL. Alternatively, you can check the Host name of a specific IP Address.

To find an IP address

  1. The IP Addresses tab is accessible from the Network Utilities menu item. See Network Utilities for more information.
  2. Select the IP Addresses tab.
  3. At the top of the tab, your local host name and IP address are displayed. These cannot be changed.
  4. In the lower part of the screen enter a host name, IP Address, or URL in the Host/IP/URL box.
  5. Click Find. The IP address for the server is displayed in the table below the box. If you entered an IP address, it is displayed in the same manner.

Right-Click Menu

You can right-click in any of the boxes and have access to often-used commands.

  • Select Clear to clear the results.
  • Select Clipboard to copy the contents of the box to the clipboard. You can now paste it in other parts of Toad or other applications.

Related Topics

Network Utilities


SSH

Secure Shell allows you to log into another computer over a network, execute commands in a remote machine, and move files from one machine to another, utilizing password/id and data encryption. It provides strong authentication and secure communications over unsecured channels, and is a secure replacement for TELNET, RLOGIN, RSH, and RCP.

Secure Shell authenticates using one or more of the following:

  • Password (the /etc/passwd or /etc/shadow in UNIX)
  • User public key (RSA or DSA, depending on the release)

There are two versions of Secure Shell available: SSHv1 and SSHv2. They are two entirely different protocols, which encrypt at different parts of the packets, and are therefore not compatible.

SSHv2 is more secure and is therefore the current development standard.

The SSH tab is located in the Network Utilities window. In addition to the setup area there are three panels on this tab. The top panel displays messages (not SSH commands) to you (the user) from the server. The second panel displays the command that you type in, as well as a Send button for the command that has been input. The bottom panel displays the SSH commands sent and received as part of the protocol.

To connect with SSH

  1. From the Utilities menu, select Network Utilities.
  2. Click the SSH tab.
  3. In the Connection Properties area, enter the:
    • Host name
    • Port (the default is 22)
  4. Select either SSH version 1 or version 2.
  5. In the Authentication Properties area, enter the
    • User name
    • Password
    • Private key file for PUBLICKEY authentication type
  6. Click Connect.


Task Scheduler

The Toad Task Scheduler is an easy-to-use interface to the Windows Task Scheduler. Using this interface, you can create, edit and run tasks.

For detailed information on the Windows Task Scheduler, please see your Windows documentation.

Task toolbar

Button | Command
 | New Task - Opens the Windows Task Wizard to create a new Windows task.
 | Delete Task - Removes the selected tasks from the Task Scheduler.
 | Run Task - Executes the task immediately, regardless of scheduled time.
 | Task Properties - displays the Windows properties of the selected task. You can then edit or add to them.
 | Delete old tasks.
 | Refresh Task list.

Related Topics

Add Task Wizard

Viewing Task Properties

Scheduling a Task


Add Task Wizard

Use the Add Task wizard to easily add tasks with multiple parameters to your Windows Task Scheduler.

To add a task to the Windows Task Scheduler

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

  1. From the Utilities menu, select Task Scheduler.
  2. Click [image] on the scheduler toolbar.
  3. Refer to the following for more information:
    4. Parameters | The command-line arguments you want to pass to the application when it starts.
Working Directory | If you do not enter a working directory, Windows will use the directory that contains the application executable.
User information | The user account is the account for the Windows Operating System, not Oracle user information.
  4. Complete the wizard.

Related Topics

Task Scheduler

Viewing Task Properties

Scheduling a Task


Viewing Task Properties

After you have scheduled a task, you may need to view or edit its properties. You can do this from the Task Scheduler screen in Toad. See Task Scheduler for more information.

To View Task Properties

  1. Select Task Scheduler from the Utilities menu.
  2. Select a task from the task grid.
  3. Click [image] .
  4. Click the tab of the properties you want to view.
  5. When finished, click OK.

Related Topics

Task Scheduler

Add Task Wizard

Scheduling a Task


Scheduling a Task

To edit an existing task schedule

  1. From the Utilities menu, select Task Scheduler.
  2. Select the task you want to edit in the Task grid.
  3. Click [image].
  4. Click the Schedule tab.
  5. Click the Edit button.
  6. Make changes to your schedule, and then click OK.
  7. Click OK again to save your changes.

Related Topics

Task Scheduler

Add Task Wizard

Viewing Task Properties


Unix Scheduler Overview

The Toad UNIX job scheduler allows DBAs to conveniently manage the installation, scheduling and execution of jobs on UNIX database servers using cron.

Once servers and databases are defined in the scheduler, tasks can be assigned and scheduled. All tasks for all databases can then be deployed to multiple servers. The crontab file is created and sent to each server to start the tasks.

The scheduler also offers the ability to track the success of each job through log files that can be managed for each server. Finally, the program allows the user to start or stop cron from the client and view the crontab file.

The Toad UNIX Scheduler includes many different tasks, housed in UNIX shell scripts. These are organized into four different categories: Database Backup, General DBA, Index Maintenance, and Table Maintenance. You can also write your own task files, and the Scheduler can generate a sample template to help with this.

Caution: When you deploy, any other cron jobs for this user will be overwritten. If you are using an existing UNIX account, that already has a crontab file, you should back up your crontab config file on the UNIX server if you plan to use Toad to schedule db jobs.

Notes:

  • On some servers the user must be included in the cron.allow file for the UNIX scheduler to work properly. For more information, please see your server’s help on cron.allow and cron.deny.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To Access The UNIX Scheduler

» Select Utilities | UNIX Job Scheduler.

UNIX Scheduler Window

The UNIX Scheduler is composed of two panes. The left pane includes a tree structure of both servers and categories of available tasks. The right pane displays details that refer back to the item selected in the left pane, as follows:

Select in the left pane | To display in the right pane
Available tasks (tasks which have not been assigned to a sid) | The contents of the selected task file.
Available tasks node or a sub node under it (a "category") | The tasks for that category and the task description (parsed out of the file header). Selecting a task on the right and right-clicking offers a "Find/View". When selected, this will find that task and move to it in the tree view on the left.
Server node | SID information. A second tab, Log, displays an interface for managing the cron log files.
SID node | All the assigned tasks, a condensed view of when they are to be performed (this view corresponds with how cron sees the schedule) and the parameter values assigned.
Assigned task node | The assigned task property information.

Troubleshooting the Unix Scheduler

If you are having trouble with the Unix Scheduler, you might try one of the following to solve the problem.

  • You must have your FTP and RExec access configured properly. For information on testing your connection, see FTP and RExec.
  • On some servers the user must be included in the cron.allow file for the UNIX scheduler to work properly. For more information, please see your server’s help on cron.allow and cron.deny.

Related Topics

FTP

RExec


Creating Servers and SIDS

The first step to using the Unix Job Scheduler involves a typically one-time setup of the servers and their databases in the user’s specific environment. The Scheduler eases this process somewhat by reading the Windows client hosts file and the default tnsnames.ora file. For each host found in the hosts file it tries to find HOST entries in the tnsnames.ora file. If any are found, it pre-populates the left-side tree view accordingly.

If no entries are found in the Windows hosts file, the tree view on the left will have only one node upon startup – All available tasks.

Caution: This feature should only be used on secure clients. The password for the UNIX server will be stored encrypted on the client, regardless of how the Toad option to store passwords is set. In addition, the password for the database is stored encrypted in the job datafile, and UNENCRYPTED in the actual files Toad deploys to the server. These files display on both the client and the server.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Adding a Server

To create a new server

  1. Click [image] on the toolbar.

  2. Enter the Server Name or use the drop down menu to select a host found in the Windows client hosts file.

    Note: If you accidentally delete a pre-defined server, you can later use the drop down to recreate it.

  3. Enter the Server connection information into appropriate boxes. See FTP for more information.

Adding a SID

Once a server is defined, you need to define at least one database for the server in order to schedule a task for it.

To add a SID

  1. From the tree view, Click [image] .

  2. Enter the SID parameters:

    SID

    Contains the name of the SID for the database. Do not confuse this with the server name in the tnsnames file. It is found in the tnsnames file line that begins with either: SID = or Service_Name = . This is the value of db_name for your database.

    Note: Toad does not support dots in the SID.

    Oracle home

    Contains the fully qualified directory on the server for the "Oracle home" of the database instance. For example, a default 9i home might be /home/oracle/product/9.0.1.

    DBA user id and Password

    Must contain valid DBA account information so jobs can be performed.

    Note: All of the fields in the SID parameters group box are required.

    3. Enter TOAD User parameters for jobs that will access the Toad schema:

    Toad user id and password - used only by jobs that access the Toad schema. They are required only if you are scheduling those jobs.

  3. SYSDBA User parameters for jobs requiring access as SYSDBA:

    SYSDBA user id and password - used by certain jobs that require SYSDBA level access, such as database startup and shutdown. They are required only if you are scheduling those jobs.

Related Topics

Unix Scheduler Overview


Assigning Tasks in the UNIX Job Scheduler

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Once servers and SIDs are defined in the Unix Job Scheduler, tasks can be assigned to SIDs. (See Unix Scheduler Overview for more informationabout the Job Scheduler.)

There are a variety of ways tasks can be assigned to a SID. You can assign new tasks, or you can copy them from one SID to another. When you have assigned tasks to various SIDs, you must then set the task Properties for each task. See Setting Task Properties for more information.

Assigning New Tasks

To assign one task to a specific SID

  1. From the tree view in the left pane, select All available tasks, or a subcategory under that node. A list of tasks displays in the right pane.

    Note: If you select a specific task from the tree structure, the script itself will display in the right pane.

  2. In the right pane, select one or more tasks and drag to the SID in the left. When the SID is highlighted, release the mouse button. The tasks are assigned.

To assign tasks to several SIDs at once

You can also assign one or more tasks to all the SIDS under a the same host.

  1. From the tree view in the left pane, select All available tasks, or a subcategory under that node. A list of tasks displays in the right pane.
  2. In the right pane, select one or more tasks and drag to the host in the left. When the hostname is highlighted, release the mouse button. The tasks are assigned to all the SIDs in that host.

In addition, you can assign tasks by dragging and dropping within the left side tree view.

To copy assigned tasks

Tasks that have already been assigned to a SID can be copied to other SIDs.

  • Click the SID to see the assigned tasks under it. Select the task to copy and drag it to another SID.
  • All of the tasks for a SID can be copied to another SID by dragging a SID that has assigned tasks and dropping it onto another SID. All tasks assigned to the source SID are copied to the destination SID. This does not overwrite tasks that have already been defined.

Related Topics

Unix Scheduler Overview

Setting Task Properties


Deploying Tasks to Servers

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

When at least one task has been assigned and any parameters given values, you can deploy to your servers using the Unix Job Scheduler. The deployment process is a fast and efficient series of rexec and ftp commands. Deployment assumes your account information and server are properly configured for both rexec and ftp. If the servers are not properly configured, the deployment process may not complete, or errors may be returned. See Unix Scheduler Overview for more information.

Caution: When you deploy, any other cron jobs for this user will be overwritten. If you are using an existing UNIX account, that already has a crontab file, you should back up your crontab config file on the UNIX server if you plan to use Toad to schedule db jobs.

To deploy tasks to servers

  1. Click the Deploy button.

    2. The grid in this dialog box is populated with a list of the servers with tasks assigned to them.

  2. Select the servers containing tasks you are going to deploy. Choose whether you want to overwrite the previous Scheduler deployment data by checking the Remove checkbox.

    Caution: When you deploy, any other cron jobs for this user will be overwritten.

  3. Click the Deploy button.

    A status window opens, showing the progress of the server deployments:

    This status window shows precisely what occurs during a deployment:

  • The necessary server directories are created using RExec. This includes the Scheduler root directory, as specified in server properties, as well as four subdirectories: dmp, log, shell and tmp.
  • The shell subdirectory is where all task files are copied.
  • The log subdirectory contains log files.
  • The dmp and tmp subdirectories are used by the jobs themselves (dmp for exports, tmp for jobs creating temporary files).
  • Scheduler system files are copied to the server’s root Scheduler directory. These consist of the script engine used to run tasks, "tjs_run_job.sh," as well as the scripts used in creating log files: "tjs_start_log.sh" and "tjs_stop_log.sh".
  • The assigned task files are sent to the servers by ftp, and their executable bit is set.
  • The crontab files are then generated and sent to the servers. Cron is then told to use the new crontab file.


Setting Task Properties

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Once tasks have been assigned to SIDs in the Unix Job Scheduler, you must set their properties. This includes scheduling information, and setting any parameter values.

To view and set properties

  1. Under a SID in the left pane, click an assigned task. Properties display in the right pane.
  2. Click in the value column of a parameter and adjust as desired.

Related Topics

Unix Scheduler Overview

Scheduling Tasks

Setting Parameter Information


Scheduling Tasks

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Scheduling information for the Unix Job Scheduler is found in the Perform task area of the right details panel. See Unix Scheduler Overview for more information.

Each task provided with the Scheduler has default scheduling information contained in its header. This scheduling information is parsed out and assigned to the scheduling fields automatically when you select that task. For example, this is the header for a task that deallocates one index:

#-------------------------------------------------------

# File: deallocate_index_one_index.sh

# Desc: Perform Index Deallocate - Single Index

# Runs: Four Times per Month = 0 0 1,8,15,22 * *

# Parm: 1 - Index Owner

# Parm: 2 - Index to Analyze

# Parm: 3 - Megabytes to Keep (default 4)

#-------------------------------------------------------

Note: In the "Runs:" field the fields are parsed out and automatically assigned to the scheduling fields.

When you select this task, Toad parses the header and enters the default schedule into the appropriate fields in the details pane. All of the fields can be changed, and parameter listings that have no value listed need to have the correct parameter added.

The schedule below is from the built-in .sh file execute_stored_procedure.sh. You can change any of the schedules, as described below. In addition, the parameter grid for this shell needs to have the parameter values added. See Setting Parameter Information for more information.

Pre-defined Schedules

For further convenience, a Pre-defined Schedules drop-down offers commonly used dates and times. Selecting a pre-defined schedule will populate the fields with the appropriate values for the selected time sample.

These Pre-defined Schedules are configurable. If you use a schedule regularly, and it is not already on the list, you can add it.

Click [image] to edit the list. You can add records, delete records, change the preset times, and so on. Changes in this window are stored in the TOAD.INI file. If you find you need to delete your changes, you can click Restore Defaults and the original Toad defaults will be restored.

Options for scheduling

The scheduling details consist of five fields: Minute, Hour, Day of Month, Month of Year, and Day of Week. Taken together, these fields represent an enormous range of date/time possibilities you can use to schedule a task. They also directly represent the fields used in a crontab file entry.

Basic Entries

Each crontab entry is a single line composed of these six fields separated by whitespace.

Entry

Contains

Minute

Digits 0 through 59

Hour

Digits 0 through 23 (0 being midnight, and 23 being 11 p.m.)

Day of the month

Digits 1 through 31

Month of the year

Digits 1 through 12

Day of the week

Digits 1 through 6

The different "day" fields (day of the month and day of the week) are present to let you use different scheduling algorithms. For example, you can back up a database every Tuesday, or perform index maintenance every 15th of the month.

  • Enter an asterisk (*) in the day field you are not using.

Use both day fields if you prefer to have the task execute on, say, the fifteenth of the month as well as every Tuesday.

Additional Customization

To Specify

Use

Multiple Days

The different "day" fields (day of the month and day of the week) are present to let you use different scheduling algorithms. For example, you can back up a database every Tuesday, or perform index maintenance every 15th of the month.

  • Enter an asterisk (*) in the day field you are not using.

Use both day fields if you prefer to have the task execute on, say, the fifteenth of the month as well as every Tuesday.

Ranges

Specify ranges with a dash. If you want to specify the eighth through the fifteenth days of the month, enter 8-15 in the Day of the month field.

Non-consecutive entries

Separate non-consecutive entries in a field with commas. For example: 1,15 in the Day of the month field means the first and fifteenth of the month.

All values

Specify all values for a field, for example every month of the year, with an asterisk (*) in the field.

Note: To specify every day you must enter * in both day fields.


Setting Parameter Information

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Scheduling some tasks in the Unix Job Scheduler requires parameters. These parameters are described in the header of the task file. For example, this is the header for a task that deallocates one index:

#-------------------------------------------------------

# File: deallocate_index_one_index.sh

# Desc: Perform Index Deallocate - Single Index

# Runs: Four Times per Month = 0 0 1,8,15,22 * *

# Parm: 1 - Index Owner

# Parm: 2 - Index to Analyze

# Parm: 3 - Megabytes to Keep (default 4)

#-------------------------------------------------------

There are three parameters defined here. The first is used to specify the index owner, the second describes the index to analyze, and the third specifies the number of megabytes to keep.

These parameters are parsed into the Assigned Task Properties panel. Each parameter for each assigned task must be assigned a value in the parameters grid in the bottom half of the assigned task properties panel on the right hand side.

If a parameter has a default value, the default value is parsed from the header and automatically placed in the grid.

To change parameter values

» Click in the value column and enter the new value.

Related Topics

Scheduling Tasks


Checking Required Elements

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Before tasks can be successfully deployed to servers through the Unix Job Scheduler, many required elements may need to come together. These include user id’s, passwords, task parameter values, and so on.

Before a deploy is executed, an automatic check is performed for all of these elements. You can also perform this check manually.

Unresolved issues must be resolved before deployment. If they are not resolved, the list will redisplay when you choose to deploy.

To check required elements manually

» Click [image] on the toolbar.

Related Topics

Unix Scheduler Overview


Creating New UNIX Task Files

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

You can create new task files for tasks you want to schedule on a regular basis using the Unix Job Scheduler. See Unix Scheduler Overview for more information.

A task file is saved as a text file with a .sh extension. If you are proficient with UNIX shell scripts you can use the "New task template" button to get a starting shell template. Or you can use an existing task file as the basis for a new script: just open it in a text editor, edit and save as a new file.

Toad Unix Scheduler requires the header of a task file to conform to its format. This allows the scheduler to parse the code and enter the appropriate boxes in the details pane of the window.

To create a task file from a template

  1. Click [image].
  2. Click OK to confirm.
  3. Paste the template into a text editor.
  4. Edit the template.
  5. Save with a .sh extension.

Saving the Task File

The Toad Scheduler organizes its hierarchy from the \UnixJobs\Base\Shell subdirectory under the Toad executable directory.

To be sure the scheduler can find your new task, save it in this directory. Alternately, you can save it in a subdirectory under the Shell directory. The Scheduler searches the Shell subdirectory and any subdirectory under it for "*.sh" files.

Subdirectories are listed as separate nodes under the "All available tasks" node. You can create new directories in the Shell directory and Toad will recognize them.

Header

The Toad Scheduler expects the header to contain specific information, in a specific format. This is where Toad gets the information to fill in the details for default values. The header should be formatted as follows:

#-------------------------------------------------------

# File: deallocate_index_one_index.sh

# Desc: Perform Index Deallocate - Single Index

# Runs: Four Times per Month = 0 0 1,8,15,22 * *

# Parm: 1 - Index Owner

# Parm: 2 - Index to Analyze

# Parm: 3 - Megabytes to Keep (default 4)

#-------------------------------------------------------

Related Topics

Unix Scheduler Overview


Working with Multiple Job Datafiles

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

All of the data defined for servers, their databases, and assigned tasks in the Unix Job Scheduler is stored in an INI file, called "Scheduler.jdf". This file is stored in the \UnixJobs subdirectory. See Unix Scheduler Overview for more information.

Typically you will only work with one configuration datafile. However, there may be times when you want to establish two or more completely different environments where jobs are scheduled. You can move between different configurations by opening and deploying a different Scheduler datafile.

There are three toolbar buttons that facilitate this:

Button | Action
 | Load job datafile…
 | Save job datafile
 | Save job datafile as…

To create a new datafile

» Start with the default datafile and select Save job datafile as…. You are now working in a new datafile with the name you just applied.

To load a datafile

» Do one of the following:
  • To load a different datafile, assuming you have created a new one, simply click the Load job datafile button.
  • If you want to save your current work before opening another datafile, click the Save job datafile button first.

The rightmost section of the status bar displays name of the datafile currently open.


Scheduler Logger Overview

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

When you have successfully started jobs running on your servers, you can use the Unix Job Scheduler logging facility to see the results of those jobs.

To access the scheduler logging facility

  1. From the right side, select a Server.
  2. On the right side, select the Log tab.

Fetching the Log File List

To view the current log files

» Click

To view a subset of log files

» Click the [image] drop-down and then select one of the following:
All log files (this is the default) | Retrieve a list of all log files (potentially a very long process).
Last execution | Display the last log file created for each job.
Failures only | Display a list of all log files that have a status of failure.
Failures only, for last execution | Display the last log file created for each job that failed.

Viewing Log Files

To view contents of one of the log files

» Double-click a grid entry. This will ftp the chosen log file and open it in the Toad default editor.

Deleting Log Files

To delete selected log files

  1. Select or multi-select the files in the grid.
  2. Click [image] and then click OK.

CAUTION: No confirmation is requested.

To delete all log files

» Click [image]. A confirmation request is given.

Viewing the Crontab File

To view the crontab file

» Click [image].

Note: The crontab file (named crontab_file.txt) is ftped from the Scheduler directory on the server and opened in Toad’s default editor.

Starting and Stopping the Cron program

To manually start or stop the CRON program

» Click [image] button on the toolbar.

Note: This issues a "cron crontab_file.txt" or a "crontab –r" RExec command, respectively. A confirmation prompt is given, although the success of the command is not verified.


About Source Control

Toad provides several different options for source control. You can use Toad's built-in source control (Team Coding) by itself, use Team Coding in conjunction with your third-party version control system, or interface directly to a third-party system through file-based source control.

Source Control Option Description Advantages and Disadvantages
File-based source control, without Team Coding

Toad interfaces with a third-party version control provider to manage files.

See About Third-Party Version Control for more information.

Advantages:

  • No additional database objects need to be created to use source control
  • Maintains version history

Disadvantages:

  • Database objects are not locked for editing
  • Only works in the Editor and Project Manager
Team Coding without third-party source control

Team Coding locks database objects to prevent unintentional changes. Team Coding does not maintain version history for files. See Team Coding Overview for more information.

Advantages:

  • Database objects are locked for editing when checked out
  • You can define Code Control Groups to lock only certain pieces of the database
  • Works in any place in Toad where an object can be opened (such as the Project Manager, Schema Browser, and Editor)

Disadvantages:

  • Requires additional Team Coding objects to be installed on the server
  • Does not maintain version history
Team Coding with third-party source control

Team Coding locks database objects, and it interfaces directly with your version control provider to provide version history for database objects and files. Review the following for additional information:

About Third-Party Version Control

Enable Version Control with Team Coding

Advantages:

  • Database objects are locked for editing when checked out
  • You can define Code Control Groups to lock only certain pieces of the database
  • Works any place in Toad where an object or file can be opened
  • Maintains version history for database objects and files

Disadvantages:

  • Requires additional Team Coding objects to be installed on the server

Related Topics

Supported Version Control Providers


Team Coding Overview

Team Coding is a cooperative source control feature. You can use Team Coding alone or in conjunction with a third party version control system. Team Coding controls access to and development of functions, procedures, packages, triggers and types. Review the following for additional information:

  • About Source Control
  • Enable Version Control with Team Coding

Team Coding Options

Team Coding can be used by itself or in conjunction with a version control provider. Alone, Team Coding:

  • Provides PL/SQL developers with the ability to develop stored programs without concurrently modifying the same objects.
  • Provides a built-in viewer to see item status .
  • Does this through a check in/out system that does not require a third party version control product.

Working with a version control provider, Team Coding:

  • Provides a revision history for your code .
  • Allows you to manage files within Toad. If you are using SCC, Toad launches the VCS's browser for file and revision management.
  • Enables multiple Oracle users to work on a Team Coding controlled project in their own schemas.
  • Places script files under code control.

  • Provides import/export of Code Control Groups.

    Note: For the Toad freeware version, you can perform up to three checkouts per Toad run. In addition, you can only use CVS and Subversion.

Team Coding Built-in Features

Some highlights of the Team Coding built-in features are:

  • Flexible Code Control Groups (CCGs) help you control objects from one or more schemas, using customizable groupings.
  • You can organize objects into CCGs by using object masks representing both specific database objects and collections of similar objects (by using the Oracle % wildcard). You can also set up exclusion masks to exclude specific objects from a CCG.
  • Even without a third party version control product, you can use CCGs, so you can track referenced objects through Team Coding (though without revision history).
  • All configuration data is stored in the database under Team Coding control. Individual workstations do not need to be configured.

Related Topics

Set Up Team Coding

Code Control Groups Overview

Enable Team Coding in the Database


Set Up Team Coding

You must prepare your database and configure Team Coding before you begin using it. This procedure allows you to use basic Team Coding functionality. Once you complete these steps, you can also set up Code Control Groups and use a version control provider.

A video tutorial is available for this process. This video opens in a new browser and requires an Internet connection.

To install Team Coding

  1. Install Server-Side Objects
  2. Grant Team Coding Roles to Users
  3. Enable Team Coding in the Database
  4. Optional: Create Code Control Groups
  5. Optional: Enable Version Control with Team Coding

Related Topics

Team Coding Overview


Grant Team Coding Roles to Users

Team Coding uses Oracle table and column privileges to control access. The roles are automatically set up when you create the Team Coding objects in the Server Side Objects wizard. Team Coding roles are granted to users in the same way you would grant other roles.

Role | Privileges
Administrator (TC_ADMIN_ROLE) | Can configure the instance to define how Team Coding operates, which VCS (if any) is used, and so on. This role is automatically assigned to the Toad user.
Project Manager (TC_MGR_ROLE) | Can create and delete code control groups (CCGs) and relate them to a VCS project.
Team Leader (TC_LDR_ROLE) | Can modify CCGs, define the objects or scripts are included in the group, and freeze objects. Can also delete rows from the Team Coding Viewer.
Users not granted one of these three roles hold the assumed role of developer. They can view the status of objects with the Team Coding Viewer and check items in and out of source control.

Notes:

  • You must be connected as a DBA user to grant roles.
  • You can also grant roles from the Editor. Enter the appropriate SQL and execute it. For example: grant TC_ADMIN_ROLE to ARTHUR
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To grant roles to users

  1. Open the Schema Browser and select Users.
  2. Select a user in the left panel.
  3. Click [image].
  4. Click the Roles tab. Add or remove roles as desired.

Related Topics

Team Coding Overview

Schema Browser: Users


Enabling Team Coding in the database

Enable Team Coding in the Database

Before you can use Team Coding, it must be enabled within the Oracle connection. This must be done by a user with the TC_ADMIN_ROLE.

To enable Team Coding

  1. Click [image] on the Team Coding toolbar.

    Note: If Team Coding is enabled, the Permissions area will display a green check mark beside Team Coding Available and the permissions the current user has.

  2. Click Settings.

  3. Check Enable Team Coding.

  4. To select a version control provider for this database, select the Use Code Control Groups and Use 3rd Party Version Control fields. Then, select a version control provider from the list.

    Notes:

    • Only source control software you have installed displays in the Version Control Provider field.
    • Selecting a version control provider on this window overrides the default provider in the Source Control options page. See Source Control Options for more information.

Related Topics

Team Coding Overview

Set Up Team Coding


Review Team Coding Settings

Any team member can see the settings chosen for the database where they are connected. However, you must have the Administrator role to make changes. Review the following for additional information:

  • Grant Team Coding Roles to Users
  • Source Control Options

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To review Team Coding settings

  1. Click [image] on the Team Coding toolbar.

  2. Click Settings.

    Tip: The Configuration tab includes field descriptions in the box on the right side of the window. You can hover over the fields in the other tabs for a description.

Related Topics

Team Coding Overview


Review Team Coding Status

You can see the status of Team Coding functionality in the current database at any point. If you have the correct permissions (the Administrator role), you can make changes to the settings and permissions.

To review the Team Coding status

» Click [image] on the Team Coding toolbar.

Tip: You can click Settings to see the settings for the Team Coding feature, or Messages to see any status messages for the current connection. See Review Team Coding Settings for more information.

Related Topics

Team Coding Overview


View Team Coding Locks (without VCP)

The Team Coding Viewer shows object details under Team Coding control, including which objects are checked out and when they were last checked in. It does not display locks in a version control provider, which are displayed in the Version Control Browser. See Version Control Browser for more information.

You can check objects in or out from this window. With the appropriate privileges, you can freeze objects so other users cannot modify them. See Freeze an Object for more information.

To access the Team Coding viewer

» Click [image] on the Team Coding toolbar.

Tip: The list of objects shown in the Team Coding Viewer can be limited to just those that you need. Use the Team Coding Viewer Filter dialog box to specify which objects should be shown. See Team Coding Viewer Filter for more information.


Freeze an Object

Users with the TEAM LEADER role (or higher) can freeze and unfreeze objects in the Team Coding Viewer. Freezing an object locks that object from revision. It cannot be checked out. It can be opened as a read-only file in the Procedure Editor.

To freeze an object

  1. From the Team Coding Viewer, select the object you want to freeze.
  2. Click the Freeze button on the toolbar, or select Freeze from the right-click menu.

To unfreeze an object

  1. From the Team Coding Viewer, select the object you want to unfreeze.
  2. Click the Unfreeze button on the toolbar, or select Unfreeze from the right-click menu.

Related Topics

Team Coding Overview

View Team Coding Locks (without VCP)


Checking Objects and Scripts In and Out

You can check objects and scripts in and out from the Team Coding menu, the Team Coding Viewer toolbar, and the Version Control Browser toolbar (if you are not using SCC).

Using Automatic Check-In and Automatic Check-Out

If the Automatic Check-In and Automatic Check-Out features are enabled, then you are automatically prompted to check out the item when you open it and to check it in when you close it. These prompts can be bypassed by un-checking the "Prompt for comment options". See Source Control Options for more information.

Manually Check-In or Check-Out

Alternately, you can manually initiate the check-in or check out using commands on the Team Coding menu.

To check out an object or script when Automatic Check-Out is enabled

  1. Open an object or script from the database in the Editor.
  2. When the Check-Out dialog box displays, follow the prompts to check the item out or choose Cancel to open it in read-only mode.

To check in an object or script when Automatic Check-In is enabled

  1. Close the object or script in the Editor.
  2. When the Check-In dialog box displays, follow the prompts to check the item in.

To check items in and out manually

  1. Open the object or script in the Editor. Alternatively, select the object in any of the following Toad windows:
    • Schema Browser: Procedures, Types and Favorites tabs
    • Version Control Browser
    • Project Manager
    • Team Coding Viewer
  2. From the Team Coding menu or toolbar, the Schema Browser, Project Manager, or from the shortcut menu, choose Check In or Check Out.
  3. You can choose Undo Check Out to cancel the check-out and reverse any changes.

Related Topics

Team Coding Overview

Source Control Options


Code Control Groups Overview

Toad’s Code Control Groups (CCGs) are the most powerful and flexible feature of Team Coding.

Conceptually, a CCG is like a project that developers are working on together, consisting of a collection of database objects. Configuring a Code Control Group gives Toad a name to call the collection and specifies a set of filters that Toad can use to determine which CCG an object belongs to. These filters are called DB Object Masks.

You can organize your controlled objects into groups associated with development projects using CCGs. For example, you can create multiple CCGs for a single Oracle instance, each containing references for all stored programs relating to a customer application. Review the following for additional information:

  • Example: Use Code Control Groups for a Single Application
  • Example: Use Multiple Code Control Groups

When CCGs are enabled, Team Coding is only applied to objects that are members of a code control group. When CCGs are disabled and Team Coding is enabled, then Team Coding is applied to every supported object in the database.

You can also use CCGs with a third party source control provider. If a third-party version control provider is used, there are additional features of code control groups.

Related Topics

Team Coding Overview


Example: Use Code Control Groups for a Single Application

Suppose you have a schema containing stored programs that all relate to a single application on your Oracle instance. You can easily create a CCG in Team Coding that includes all objects in that schema and then map it to a Version Control System in your provider’s archive.

Using CCGs to map objects from multiple schemas to one VCS Project

Including certain types and schemas

If your application contains some objects located in a different schema, it is easy to modify the CCG to include those objects. To take this a step further, you can also configure your CCG so that it contains any of the following:

  • object masks based on a particular schema or schema mask (such as PROD%)
  • stored programs of any type or a particular type (such as Trigger)
  • objects of any name or using a name mask (such as ACC_%).
  • certain types and schemas

Any object mask can be used to exclude as well as include, so you can readily include a group of objects, but exclude (for instance) all objects of name like DBG_%

Excluding objects

If the schema also contains some objects that you do not want controlled (for example, you may have some test packages which don’t form part of your application), it is a simple matter to add an exclusion reference (Object Mask) in your CCG. See Specifying CCG Object Masks for more information.

Scripts

If your application involves ancillary scripts, you can include references to these scripts in your CCG. As with other objects, you can use wildcard masks and exclusions.

Related Topics

Team Coding Overview

Code Control Groups Overview

Specifying CCG Object Masks


Example: Use Multiple Code Control Groups

If you subsequently start development of a second application, using objects stored in the same schema as the one used for the first application, you can then simply create a second code control group (CCG) in Team Coding. This new CCG would contain object masks for the stored programs that are related to your new application, and you would associate the new CCG to a different project in your version control repository.

For example, if a second application is made up of procedures whose names all begin with a common prefix such as "ACC", your second CCG would contain an Object mask for all procedures in the schema with a name like ACC%. Team Coding automatically recognizes objects with names matching the new object mask and maps them to the second VCS project rather than the first.

Note: Objects cannot be mapped to more than one CCG.

Using CCGs to map objects from one schema to different VCS projects

Related Topics

Team Coding Overview

Code Control Groups Overview

Specifying CCG Object Masks


Enable Code Control Groups

When this option is used, if an object is not referenced by a CCG, it is not under Team Coding control.

Once CCGs have been configured, users may start using Team Coding features immediately, as objects or scripts will be automatically added to the Version Control System as they are modified.

To enable your CCGs

  1. Click [image] on the Team Coding toolbar.

    Tip: You can also select Utilities | Team Coding | Team Coding Status.

  2. Click Settings.

  3. Select Use Code Control Groups in the Team Coding Features area.

    You now have the option to use third party source control. The list will contain only the version control products you have installed for use. If you are using SCC API Team Coding, later choosing the Version Control Browser will launch the user interface of the third party product instead. See Version Control Browser for more information.

Related Topics

Team Coding Overview

Version Control Browser


Create Code Control Groups

You can easily create a Team Coding Code Control Group.

Note: Code Control Groups must be enabled to create a new CCG. See Enable Code Control Groups for more information.

To create a CCG

  1. Click [image] on the Team Coding toolbar.

    Tip: You can also select Utilities | Team Coding | Code Control Groups.

  2. In the Code Control Groups toolbar, click [image].
  3. If a login window displays, provide the needed information.
  4. In the New Group dialog box, enter a descriptive name for the Group.

    5. If you are using a third party Version Control System (VCS), select a VCS project by following the prompts in the dialog boxes that display, which vary depending on the product in use. The Code Control Group window displays.

    Note: If you are not using a VCS, the Code Control Group window displays immediately.

  5. In the Code Control Group window, create New Object and script mask definitions for the current CCG.

Related Topics

Team Coding Overview

Code Control Groups Overview

Enable Code Control Groups


Specifying CCG Object Masks

Object masks are the references that define a Code Control Group (CCG). When Team Coding processes a CCG, it associates a certain ranking with object masks in order to determine which database objects belong to that CCG.

You can specify several different masks, and Team Coding will rank them when deciding what object to include in a specific CCG. See Object Mask Ranking for more information.

Use the Mask Properties dialog box to specify an object or group of objects to be included in a CCG.

To specify a CCG object mask

  1. From the Code Control Group window, select the group where you want to add masks.
  2. Click [image].
  3. Click [image].

  4. Select from the following options:

    Object Type

    Choose from View, Procedure, Function, Package, Package Body or All.

    Schema

    Pick a user from the list, or type a schema name. You can use the % wildcard character

    Object Name

    You can type an object name, including the % wildcard. Alternatively, you can launch the Open DB Object dialog box to choose an object matching the Object Type and Schema settings.

    Excluded

    Select Excluded to exclude any objects matching this object mask from the CCG.

Related Topics

Team Coding Overview

Object Mask Ranking

Code Control Groups Overview


Object Mask Ranking

By ranking object masks Toad can resolve objects that fit duplicate matching masks into the correct Team Coding Code Control Group (CCG).

  • Object masks are ranked based on the number of wildcards they contain.
  • Highest ranking is given to the most specific mask.
  • When there are duplicate masks of different ranking the highest-ranking mask takes precedence. When duplicate masks of the same ranking are encountered it is not possible to resolve the object to the correct CCG.

The mask rankings are, from highest to lowest:

Ranking | Examples
Specific object reference | Trigger SCHEMA.NAME
One wildcard only | Any Type SCHEMA.NAME Trigger SCHEMA%.NAME Trigger SCHEMA.NAME%
Two wildcards | Any Type SCHEMA%.NAME Any Type SCHEMA.NAME% Trigger SCHEMA%.NAME%
Three wildcards | Any Type SCHEMA%.NAME%

Related Topics

Team Coding Overview

Specifying CCG Object Masks


Specifying File Server Scripts

Specify File Server Scripts

Use the Mask Properties dialog box to specify a group of file server scripts (or a specific script) to include in a Team Coding CCG.

To specify file server scripts

  1. Click [image] to add a new script or group of scripts.

  2. Select from the following options:

    File Name/Mask

    Type the path to a specific script file, or browse and select. You can use the * wildcard character to specify a group of scripts.

    Include Path

    Check this box to include the path name.

    File Path

    This option becomes active if you choose Include Path. If you browsed to the script file, the path is automatically entered. If you entered the file name without a path, Toad assumes you want to use your default working folder as the path.

    Excluded

    Select Excluded to exclude any scripts matching this object mask from the CCG.

Related Topics

Team Coding Overview

Example of User Mapping

Enable Code Control Groups


Map Users to a Code Control Group

You can associate a developer’s schema to a particular Team Coding Code Control Group (CCG). This means, if you are the developer, that when you open an object in your own schema, Toad searches for the object in the mapped CCG and locks it as if you had opened it from the original schema. When you check an object out, the archive for the original schema is checked out and the object is locked in both your schema and the original schema.

This can be useful in cases where you often work in your own schema, but on projects containing objects that actually exist in another schema.

So when you map a user to a CCG, you basically create a new CCG identical to the first, but with all object masks referring to a particular user schema. The same VCS archive is shared between the user schema and the schema contained in the original CCG. See Example of User Mapping for more information.

To map a user to a CCG

Note: You must be logged in as the user you want to map.

  1. Open the Code Control Groups window (Toad menu bar | Team Coding | Code Control Groups)
  2. Select the appropriate CCG
  3. Click [image] on the toolbar.
  4. If the CCG contains object masks for multiple schemas, follow the prompts to select the schema you want.
  5. If required, perform an Import to update the objects in your schema.

To display all mapped users

» In the Code Control Groups window, select a CCG and click [image].

Related Topics

Team Coding Overview


Example of User Mapping

Developers can work on common code in their own schema through Team Coding's User Mapping.

As an example:

  • You have a common schema containing all the code for your development environment.
  • You prefer that your developers check code in and out of your source control product using their own schema.
  • At an appropriate time, you would update your "master" schemas for testing purposes and move the code to Production.

User Mapping allows developers to work on their own copies of objects existing in a schema (the "master") that is controlled by a CCG (Code Control Group). This means that the objects in the master schema can remain unchanged during development, until the master schema is updated from the source control system using the Import function.

Note: The CCG must be exported to the source control system before it can be imported into the master schema.

This example shows how a developer can map to the REPORTS schema, for which a CCG has been created. See Create Code Control Groups for more information.

To add copies of the master schema’s objects to the developers’ schemas, each developer must import the CCG.

Scenario

The Development Manager has set up code control groups and assigned the Developer Scott to work on the REPORTS functions. Scott needs to map himself into the CCG in order to add copies of the objects in the master schema to his schema for work.

To map a developer to a CCG

  1. Log in as the developer.

    Scenario: Login as the user scott.

  2. From the Team Coding menu, open the Code Control Groups window and select appropriate Code Control Group.

    Scenario: Select the REPORTS Group.

  3. Click [image].
  4. Click [image] in the Code Control Groups window.

    5. In the Import into Database window, select the objects to import. Only those objects found in the VCS for this CCG are shown. When selection is complete, click OK.

  5. In the Import Options window, select the Update another schema option. Click OK to begin the import.

    6. Scott can now check out the REPORTS objects from his own schema. When a user-mapped object is checked out or checked in, the Team Coding Check Out/In dialog box will show the object’s Master Owner.

    When a developer has a copy of a user-mapped object checked out, all other copies are locked. Other developers cannot check out their copies and neither can the master owner.


Remap a Project Association

With appropriate permissions you can change the association between a CCG and a VCS project. See Grant Team Coding Roles to Users for more information.

For example, if you originally configured a CCG without a Version Control product (VCS) and then subsequently decided to use one, you can use the remapping feature to associate the CCG and the VCS project.

To remap a project association

  1. From the main Toad menu bar, select Team Coding | Code Control Groups.
  2. Click [image] in the Code Control Groups window.
  3. Choose the VCS project to which you want to map the group and then click OK.

Related Topics

Team Coding Overview

Code Control Groups Overview


Team Coding Viewer Filter

The list of objects shown in the Team Coding Viewer can be limited to just those in which you are interested. Use the Team Group Filter dialog box to specify which objects should be shown.

To access the Team Coding Viewer Filter

  1. Click [image] on the Team Coding Viewer toolbar.
  2. Check or clear the boxes in the Object Types and Status areas to display or hide these items.
  3. To filter the owner, name, or user, click in the text field and enter the text you want to include. The % wildcard character is an acceptable entry.


Exporting Objects

Use the Team Coding Export function to:

  • Construct a first revision of an application development project in your source control archive.
  • Create a new revision for all objects and scripts: for example, when you have completed your project and updated your production server.

In order to perform these operations, you should have access to all the objects referenced by the CCG. Otherwise, the process will need to be launched multiple times by all the different owners of the objects.

To export objects to your archive

  1. On the Code Control Groups window toolbar, click the Export [image] button.
  2. Use the Export dialog box to select (and exclude) objects and scripts for export.
  3. In the Export Options dialog box, select from the following options.
    • Add objects not existing in the VCS

      • Allows new objects and scripts to be added to the VCS archive. Any object for which there are already VCS archives will not be updated

    • Create a new revision for existing objects

      • Forces all existing archives within the VCS to be updated, as well as adding new archives for any new database objects

    • Create a revision only if the object has changed

      • Compares the object in the database with the archive in the VCS, updating it only if it differs. This is useful when objects or scripts have been modified by a tool other than Toad’s object editors.

    • Prompt individually for all existing objects

      • Prompts you to update or not for each object that already exists in the archive.

    • Comment

      • Enter a comment to be applied to all new revisions created in the archive.

  4. If required, save or print the status report using the buttons provided.

Related Topics

Team Coding Overview


Importing Objects

Import Objects

You can update your Oracle instance from the Version Control System for a selected Team Coding CCG using the Import feature.

To import objects

  1. Click [image] on the Code Control Groups toolbar.
  2. Use the Import dialog box to select (or exclude) objects for import. The Import listing is populated based on existing archives contained in the VCS (these objects do not have to exist on the Oracle instance), but filtered down to only those objects defined in the CCG.
  3. Click OK.

    4. Act on the original schema or another schema:

    Update original schema | Create or update objects in the original location in the Oracle instance, as per the CCG and archive file names.
Update another schema | Choose an alternate destination schema. All objects will be created in this schema regardless of the original object for which the archive was created.
Note: You must have the appropriate privileges to create objects in the destination schema.
  4. Select the action you want to perform:
    5. Update database | Updates the database immediately.
Generate import script | Generates an import script and loads it into the Editor, so you can review and alter it before you execute it. The database is not changed until the generated script is executed.
Add new revision to VCS | You can select this box when you choose to update the database directly. This will add a new revision to the VCS archive. In addition, you can then add a revision comment for the new revision.

Related Topics

Team Coding Overview

Code Control Groups Overview


Enable Version Control with Team Coding

Team Coding allows you to lock database objects and access your version control provider (VCP). You must enable your VCP before you can use it with Team Coding.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To enable a version control provider with Team Coding

  1. Click [image] on the Team Coding toolbar.

    Tip: You can also select Utilities | Team Coding | Team Coding Status.

  2. Click Settings.
  3. Ensure that Team Coding, Code Control Groups, and Use 3rd Party Version Control are enabled.

  4. Select a version control provider in the Version Control Provider field.

  5. Log in to the version control provider.
  6. If necessary, click Provider Options to change settings such as the date format, logging in automatically, and connection settings. Review the following for additional information:
    • CVS Configurations Options
    • Subversion Configuration Options

    • Team Foundation Server Configuration Options

      Note: Toad uses default settings if you do not edit the provider options.

  7. Enter the login information for the VCP.

    Note: You should verify the correct login information with your VCP administrator before you log in.

Related Topics

About Source Control

Team Coding Overview

Version Control Browser

About Third-Party Version Control


Version Control Browser

You can view all version control archives in all projects using the Team Coding Version Control Browser. You can also view differences between revisions and check out objects and scripts.

This browser is not available to users of SCC API Team Coding support; instead, selecting this option launches the user interface of the third party product in use.

Notes:

  • The Version Control Browser can display both Team Coding and version control locks. See Show Team Coding and VCP Locks for more information.
  • When using CVS, the VCS browser does not know whether the object has been checked out. Therefore, it will only allow you to check out files and will not enable checking in.

To browse version control

» From the Team Coding menu, choose Version Control Browser.

To view differences between revisions

» When you choose View Differences from the Browser toolbar, you can select from the following options:
  • View differences between two specified revisions
  • View differences between the selected revision and the database object (using CCG mapping)
  • View differences between the selected revision and any database object or file system script

Related Topics

Team Coding Overview


Show Team Coding and VCP Locks

You can hide or display Team Coding locks in the Version Control Browser with the Show Team Coding Locks option. Enabling this option allows the browser to differentiate whether files are locked in the version control provider (VCP), Team Coding, both systems, or neither system.

When this option is cleared, the version control provider browser determines which files are locked by querying the version control provider; essentially it is just showing the status of each file as it would look in the provider's own GUI.

This option can significantly increase the time it takes to expand a project node. However, this option can be particularly useful when using CVS as the Version Control Provider, since CVS does not support locking of files. In this case, using Show Team Coding Locks is the only way you can see what files Team Coding has locked under CVS.

Notes:

  • After selecting the Show Team Coding Locks option, remember to refresh any project nodes which have already been expanded, as this does not happen automatically.
  • Toad saves the state of the Show TC Locks option when you close the version control provider browser.

To show Team Coding locks

» Select Show Team Coding Locks in the Version Control Browser.

Related Topics

Team Coding Overview


Viewing Differences Between Revisions

View Differences Between Revisions

You can view differences between two different revisions in Team Coding.

To view differences between revisions

  1. Select the file you want to compare. You can select either one of the revision nodes, or the main file node.
  2. Click [image].
  3. Select how you want to view differences. If you want to compare revisions, select the revision numbers you want to compare.
  4. Click OK. See Viewing File Differences for more information.

Related Topics

Team Coding Overview

Viewing File Differences


Get the Latest Revision

Working in a Team Coding environment, it is often necessary for you to ensure that you are working with the latest version of an object or script that is held in the version control system.

Caution: The Get Latest Revision command overwrites the version of the object or script in the database, replacing it with the latest version held in the VCS.

To get the latest revision

» Click [image] on the toolbar.

Related Topics

Team Coding Overview

View Differences Between Revisions


Responding to the Different Files Dialog

Respond to the Different Files Dialog

When you open an object or script, Team Coding compares it with the latest revision in the Version Control Provider (VCP) repository (unless it is checked out, in which case Toad opens a read-only version of the file). If the database object or script differs from the version saved to the VCP repository, Toad notifies you.

Differences in objects could be due to a number of factors. For example:

  • Another tool may have been used to edit the object
  • A script may have been executed that modified the object
  • The archive in the VCP repository may have been updated by some means other than Team Coding.

You can choose one of the following options in the Different Files dialog box.

Option

Description

View Differences

Launch the Differences Viewer so that you can compare the two objects.

Open Database Version

Load the database version into the VOE or Procedure Editor in Read Only mode.

Open VCP Version

Update the database with the VCP repository version and loads into the VOE or Editor in Read Only mode.

Caution: Opening the version from the repository will cause the object in the database to be updated.

Make editable

Check the selected item out for editing.

Related Topics

Team Coding Overview

View Differences Between Revisions

Viewing File Differences

File Comparison Rules

Difference Viewer Options


Using Team Coding in SQL Navigator Environments

Use Team Coding in SQL Navigator Environments

Team Coding can use a Team Coding environment installed by SQL Navigator. This allows cooperative Team Coding between users of Toad and SQL Navigator on the same database.

Requirements

The SQL Navigator Team Coding environment that is installed on your database must be version 6. This was released with SQL Navigator 4.3. If an older version of the Team Coding environment is detected, Team Coding will be disabled until you update your environment. You can update your environment using the Toad Server Side Object Wizard.

Note: The SQL Navigator objects must be set up through SQL Navigator. You can direct Toad to use the SQL Navigator Team Coding Objects and you can update older versions through Toad so that Toad can use the environment.

Set Up Team Coding in a SQL Navigator Environment

When you install Toad, if you have the SQL Navigator Team Coding environment version 6, you do not have to do anything to use Team Coding.

However, if you used SQL Navigator 4.1 or 4.2 to create your environment, you will need to use the Server Side Objects Wizard to upgrade it.

To upgrade your SQL Navigator Team Coding environment

  1. Select Database | Administer | Server Side Object Wizard.
  2. Choose Install, upgrade or remove objects for all users to share and then click Next.
  3. Select Install, upgrade or remove objects in a schema other than Toad and logon as the SQLNAV user.
  4. In the Team Coding area, select Upgrade to 6.0 objects. Click Next.
  5. Change Team Coding roles if desired. Click Next.
  6. Do one of the following:
    • Click Run Script to upgrade your Team Coding objects.
    • Click Save Script to Disk to save the script and run it later.
  7. Click Finish.

Troubleshooting

If you find that Toad is using its own Team Coding environment and you know that you should be using the SQL Navigator environment, then you can use one of two methods to remedy the issue.

To use the Server Side Install method

» Use the Server Side Objects Install wizard to remove the Toad Team Coding objects from the database. See Install Server-Side Objects for more information.

To use the manual method

» Modify the public synonym QUEST_COM_TEAM_CODING so that it points to the TC config table in the schema where their chosen TC objects are installed.

Caution: Ensure that you want to change environments before proceeding, as this change affects all users of the selected database.

To use the SQL Navigator version

  1. Drop the Public synonym 'QUEST_COM_TEAM_CODING'.

  2. Run the following in the Editor:

    CREATE PUBLIC SYNONYM 'QUEST_COM_TEAM_CODING' FOR SQLNAV.SQLNAV4_VCS_CONFIG

To use the Toad version

  1. Drop the Public synonym 'QUEST_COM_TEAM_CODING'.

  2. Run the following in the Editor:

    CREATE PUBLIC SYNONYM 'QUEST_COM_TEAM_CODING' FOR <schema>.TC_CONFIG

    where <schema> is wherever Team Coding was installed.

Related Topics

Team Coding Overview


About Third-Party Version Control

You can use third-part source control providers on their own or in conjunction with Team Coding. Toad allows you to access third-party version control providers with two different methods:

  • File-based version control—Allows you to access a version control provider without using Team Coding. The primary advantage of file-based source control is that it does not require you to install additional database objects to access the version control provider. This is important for high-security environments, where you may not have the ability to install third-party database objects.

    Note: To connect to an external version control provider using SCC, you must install the provider's SCC-compliant client. See the provider's documentation for instructions on how to install their SCC client.

  • Team Coding—Uses Team Coding to lock database objects and interface with the version control provider.

    Note: There are important differences between these two methods, and unique advantages and disadvantages. See About Source Control for more information.

Toad supports many of the popular version control providers. See Supported Version Control Providers for more information.

Refer to the following topics for information about specific version control providers:

  • Concurrent Version Systems Requirements
  • Subversion Requirements
  • Team Foundation Server Requirements


Supported Version Control Providers

Toad provides direct support to specific third-party version control providers and it also provides SCC support to connect to additional version control providers.

Important: Quest Software is unable to provide support for source control issues caused by the version control provider, including the version control provider's support for Microsoft's SCC API. If you have problems connecting to Toad through SCC, contact the version control provider.

Direct Supported

Version Control Provider | Version
Concurrent Versions System (CVS)* | CVS 1.11.9 and later CVSNT 2.08 and later
Microsoft Team Foundation Server | 2005, 2008, and 2010
Microsoft Visual SourceSafe | 5.0, 6.0, and 2005 (8.0)
Perforce* | 2009.2 (command-line client)
PVCS | 5.2 and later Note: PVCS 6.6.1 and 6.8.0 are specifically not supported with Team Coding.
Subversion* | 1.6.5 and later
*These version control providers connect using a command-line client.

SCC Support

In addition to providing direct support to the version control providers, Toad supports additional version control providers through Microsoft's SCC API. You should be able to connect to any version control provider that uses SCC.

To connect to an external version control provider using SCC, you must install the provider's SCC-compliant client. See the provider's documentation for instructions on how to install their SCC client.

Notes:

  • It is strongly recommended you use the native APIs for SourceSafe and PVCS when using Team Coding (instead of the SCC integration).
  • Most version control providers that integrate with Toad through the SCC API ignore the "Force revision" flag and the "Create a new revision for existing objects" option when exporting.


Set Up File-Based Source Control

The client portion of the source control install must be run. You cannot run only the server piece of the Source Control install.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To prepare source control for use

  1. Install your client.
  2. Select View | Toad Options | Source Control.
  3. Select your version control provider and check/uncheck options as desired. See Source Control Options for more information.
  4. Open your file in the Editor. Remember that Toad Source Control is run through the Editor.
  5. Right-click in the Editor and choose Source Control. Click Select Project.

    6. Your provider will display a dialog box asking you to select a project. Depending on the provider and the configuration, it may also ask you to log in or browse for a database. It may provide a place for you to set a working folder. Refer to your Source Control provider’s documentation for further details.

    Note: The working directory for the selected project must match the directory where you loaded the file.

  6. If the file is already stored in Source Control, you can check it in and out. Otherwise, you can right-click and select Source Control | Add File to add it to the Source Control database. This assigns it a checked-in status. You will have to check it out to modify it.


CVS Requirements

Concurrent Version Systems Requirements

To use Concurrent Version Systems (CVS) with Team Coding, you need to have a CVS command-line client installed on your system. The following minimum versions are recommended:

  • CVS client version 1.11.9 or later
  • CVSNT client version 2.08 or later

Team Coding has been tested with the following clients:

  • CVS clients 1.11.9 and 1.11.17 with the pserver authentication
  • CVS client 1.11.12 with pserver and ssh authentication
  • CVSNT clients 2.0.8 and 2.0.41a with the pserver authentication
  • CVSNT clients 2.0.11, 2.0.26, 2.0.34, and 2.0.41 with sserver, pserver, and sspi authentications
  • CVSNT client 2.0.14 with sserver, pserver, sspi, ssh, ext, and local authentications

Related Topics

Team Coding Overview

CVS Configurations Options

Log Into CVS


CVS Configurations Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To set CVS configuration options

  1. Click [image] on the Team Coding toolbar.

    Tip: You can also select Utilities | Team Coding | Team Coding Status.

  2. Click Settings.
  3. Ensure that CVS is selected and click Provider Options.

  4. Review the following for additional information:

    CVS

            Use these options to...

    CVS Executable

    Enter the name of the CVS program file here. The default is CVS.EXE. If your file is different, you can enter it here.

    You can specify the full path to the file, such as C:\Program Files\CVS\cvs.exe. This will force Toad to use the specified program.

    If you enter only the file name, rather than the entire path, the location of the program file must be in your system path. Toad will then use the first occurrence it finds of the specified file name.

    Global Options

    Use this option to specify any global options you want Toad to pass to CVS whenever a CVS command is executed by Toad. For example, the default option of -f tells CVS to ignore your .cvsrc options file.

    The default is -f.

    You can use more than one option. Separate multiple options with a space.

    Note: Do NOT enter a -d CVSROOT option here. Toad adds this option automatically, using the CVSROOT you provide in the CVS Login window. See Log Into CVS for more information.

    Dates and Times in CVS Output

             Use these options to...

    Date Format

    These options tell Toad how CVS will send dates. You can use the following formats:

    d

    Day as a number without a leading zero (1-31)

    dd

    Day as a number with a leading zero (01-31)

    m

    Month as a number without a leading zero (1-12)

    mm

    Month as a number with a leading zero (01-12)

    yy

    Year as a two-digit number (00-99)

    yyyy

    Year as a four-digit number (0000-9999)

    Default: yyyymmdd

    Time Format

    These options tell Toad how CVS will send times. You can use the following formats:

    h

    Hour without a leading zero (0-23)

    hh

    Hour with a leading zero (00-23)

    n

    Minute without a leading zero (0-59)

    nn

    Minute with a leading zero (00-59)

    s

    Second without a leading zero (0-59)

    ss

    Second with a leading zero (00-59)

    Default: hhnnss

    Time Zone

    This option tells Toad to adjust the time stamps read from the output of CVS commands. For example, to subtract eight hours from all timestamps, specify a value of -800. To add three hours, enter a value of 300.

    Default: 0

    Login

            Use these options to...

    Login Automatically

    When this option is checked, upon connecting to the database Toad logs in to CVS without prompting you. The most recently used CVSRoot will be used.

    To use this option, the following must be true:

    • The Team Coding option "Disable Login Prompt on Connection" is UNCHECKED
    • The TC=NO command-line option is NOT used
    • You have previously logged into CVS in Toad

      • The previous login used an authentication method not requiring a password

      or

      You checked the Save Password option on the login form.

    Time Between Keypresses

    This option controls the amount of time (in milliseconds) Toad pauses after sending each character of the password to the CVS password prompt.

    The default is zero.

    Note: If you find that CVS is returning "invalid password" errors, you may need to increase this number. A suggested figure is 100 milliseconds.

Related Topics

Concurrent Version Systems Requirements

Log Into CVS


Updating Working Folders

Update Working Folders

Toad requires that your working folders are initialized and up-to-date so that it can determine what files and folders are in your CVS repository for use with Team Coding. This initialization must be performed manually.

To update your working folders

» Perform a full checkout and update with your CVS client. You can do this from the CVS command-line client by issuing the following CVS commands in your root working folder:

cvs co .

cvs update .

Related Topics

Team Coding Overview


Logging Into CVS

Log Into CVS

By default, when you have Team Coding with CVS set up, Toad will automatically display the CVS login prompt when you connect to the database.

If you do not want to connect automatically, you can activate the Team Coding option Disable Login Prompt on Connection.

Note: The login command prompt window occasionally opens in the background instead of the foreground, and this causes the login to fail. When this happens, the user needs to select "Log in to VCS Provider" from the Team Coding menu or toolbar to re-do the login.

To display the login prompt manually

» Select Utilities | Team Coding | VCS Logon.

Note: If the Team Coding menu is not visible on your menu bar, you can add it manually. See Display Additional Menus for more information.

To login to CVS

  1. Select the root you want to use. You can choose one of two options:

    • Use $CVSROOT Environment variable

      Toad attempts to use your CVSROOT environment variable. When you select this option, your current CVSROOT environment variable is displayed in the first box.

      Note: This cannot be edited in Toad; for instructions on changing environment variables, see you Windows Help.

    • Specify CVSROOT

      Select this to specify which CVSROOT to use when issuing CVS commands. Toad passes this to CVS using the -d option. Up to ten of the most recently used CVS ROOT values will be remembered. You can select from these by clicking the arrow in the right of the box.

  2. Enter a path to your chosen working directory in the Working Directory box. You can click [image] to select a directory rather than entering the entire path by hand.

    Note: If you do not specify a value for the working directory, Toad uses the value supplied for Default Working directory under the Team Coding options. If you do specify a value here, it will override the default working directory.

    It is recommended that you specify a working directory in this box, as Toad will remember the working directory specified for up to ten of the most recent unique CVSROOTs you use.

  3. Enter your password for the specified CVSROOT in the password box. If you have specified a CVSROOT that does not use password authentication (for example, the :local:method) you can leave this box blank. In this case, Toad will not issue a CVS login command.
  4. Select or clear the Save Password checkbox. If selected, Toad stores the password in an encrypted form in the CVS.INI file.

  5. Click OK.

    Note: Selecting Team Coding | VCS Logon, will log you out of CVS for the current connection, even if you click Cancel at the logon prompt. To reconnect, click OK without changing any values.

Related Topics

Concurrent Version Systems Requirements

Authentication Methods and the CVS Root


Authentication Methods and the CVS Root

Most CVS servers support several different authentication methods. The authentication method used to access a CVS server is specified in the first part of the CVSRoot. The CVSRoot contains the following sections

:authentication method:user@host:port:/path

All sections except path are optional. The following rules apply:

  • A CVSRoot consisting only of a path will use the local authentication method. It is synonymous with:

    :local:/path

  • If the user section is omitted, the CVS client will use your Window login name.
  • The host section must be included for all methods other than local.
  • The port section is only necessary when the CVS server is listening on a port other than the default port, which is 2401.

CVS Authentication Methods tested with Toad

Toad has been tested with the following CVS authentication methods: pserver, sserver, ssh, sspi, ext, and local.

Using pserver and sserver methods

Using pserver and sserver is straight-forward.

  • Both require a username and password.
  • With both, Toad executes the CVS login command.
  • With sspi, username is optional. If a username is supplied, Toad executes the CVS login command. If no username is supplied, Toad will not execute the CVS login command.

Using local and ext methods

The local and ext methods do not require a password.

  • The local method is used to access a local CVS repository. This method is assumed if no authentication method is specified.
  • The ext method is used for SSH authentication. See SSH Authentication Using the ext Method for more informationon using SSH.

Related Topics

Log Into CVS

SSH Authentication Using the ext Method


SSH Authentication Using the ext Method

Toad supports the use of SSH (Secure Shell) with the ext method in Team Coding as long as the following conditions are met:

  • An external SSH client and SSH Authentication Agent must be installed and configured.
  • SSH authentication must be transparent. Toad cannot respond to requests for private key or passphrase.
  • The CVS_RSH user environment variable must be set to specify the SSH client program if the SSH client program is anything other than "ssh".

Example SSH configuration steps:

This configuration uses Plink as the SSH client and Pageant as the SSH authentication agent. Plink, Pageant and PuttyGen are parts of the PuTTy software package by Simon Tathem.

Note: This is just one sample configuration.

  1. Install PuTTy (including Plink and Pageant)
  2. Generate public and private keys using PuttyGen.
  3. Upload public key to the CVS server, which must be running SSHD.
  4. Load Pageant and register your private key with it. Keep Pageant running whenever SSH is being used.
  5. Set CVS_RSH environment variable to the path to plink.exe (for example: c:\program files\Putty\plink.exe).
  6. Set CVSRoot to :ext:user@host:port:/path, where
    • user = your SSH login name on the CVS server
    • host = the CVS server hostname or IP address
    • port = the CVS server port (optional)
    • path = the path to the CVS repository on the server (for example: :ext:smithj@cvs.toadrocks.com:2401:/usr/local/cvs/project).

Related Topics

Authentication Methods and the CVS Root

Log Into CVS


Missing CVS\Entries File Error

Toad determines which files and folders are in your Team Coding CVS repository by reading the file named Entries. This normally resides in a folder named CVS under each of your working folders. If Toad cannot find this file in any of your working folders, you receive the Missing CVS\Entries file error.

This can happen in one of two ways:

  • If you have not yet performed a cvs co . to check out everything, your Entries and Repository files will not have been created automatically. This can be remedied by performing the cvs co . (remember to include the dot in the command).
  • Some versions of CVS will not automatically create a CVS\Entries file in the root working folder. This does not affect normal CVS operation, but it does prevent Toad's CVS support from working.

To manually correct the problem causing a CVS/Entries file error

  1. In your root working folder, create a new folder named CVS.
  2. In the new CVS folder, create an empty file named Entries.
  3. In the new CVS folder, create file a named Repository containing a single line with the single character . (the period) followed by a carriage return.
  4. Log in to CVS.
  5. In your root working folder, execute the CVS command: cvs co .
  6. In your root working folder, execute the CVS command: cvs update .

    7. Note: You may need to perform the "update" on individual files or projects instead of the whole repository.

Setting up your Entries file

Once created, you can set your Entries file to check out the files you want. You can check out the entire repository, or only a few projects.

To check out your entire repository

» Leave the Entries file empty to check out the entire repository.

To check out a few projects in your repository

  1. To keep only a few projects in the repository, enter the projects in your Entries file as described below:

    2. D/Project1///

    D/Project2///

    D/Project3///

    Where Projectn is the name of the project.

  2. Check out and update each project one by one. For example:

    3. >cvs co Project1

    >cvs update Project1

    >cvs co Project2

    >cvs update Project2

Related Topics

Team Coding Overview


Subversion Requirements

To use Subversion with Team Coding , you need to have a Subversion command-line client installed on your system. It is recommended that you use CollabNet’s certified client, which is freely available from their Web site.

Subversion is based on a client-server model, and both are necessary in order to use it. The server can be installed locally (for a local connection), or on a separate server (for SVN and WebDAV connections). Both the client and server software can be found on the main Subversion website.

Notes:

  • Subversion contains many options for setting up and configuring the server software. For more information on configuring a Subversion server, see the Subversion documentation.
  • File-based source control directly supports TortoiseSVN, a Subversion client. See Set Up TortoiseSVN for more information.

Initial Subversion Configuration

Once you have a Subversion command-line client installed on your machine, select a local directory to server as your local “sandbox”. This directory is your working directory that will house local copies of all the files in a repository on your Subversion server. For example, we could select the following as an example:

c:\svn-sandbox

Once that directory is created, perform an initial checkout of a remote repository to get a full working copy of all files in the repository using the following command inside that directory:

svn co <Repository Url> .

For example, if you’re installed the server locally, and your repository is located in “C:\Repository1”, you might use:

svn co file://localhost/c:/Repository1 .

If, however, you’re using an svn connection to a remote server named “svnserver1”, you might use:

svn co –-username <username> --password <password> svn://svnserver1/Repository1 .

This only needs to be done once to initialize the working folder.

Related Topics

Subversion Configuration Options

Log In to Subversion

About Source Control


Subversion Configuration Options

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To set Subversion configuration options

  1. Click [image] on the Team Coding toolbar.

    Tip: You can also select Utilities | Team Coding | Team Coding Status.

  2. Click Settings.
  3. Ensure that Subversion is selected and click Provider Options.

  4. Review the following for additional information:

    Client Tab | Use these options to...
    Global Options

    Subversion allows various global options to be sent across all Subversion commands. For more information, please see the help information provided with the svn client.

    Note: The username and password global options are automatically included when necessary with server-based connections.

    Server

            Use these options to...

    Connection Method

    Select Local Connection if the server is installed on the same machine as the client.

    Select WebDAV Connection if the server is to be accessed across the HTTP protocol.

    Select SVN Server Connection if the server is on a remote machine, and is to be accessed through the svn protocol.
    Options | Use these options to...
    Use locking on check out / check in

    Use locking when checking out files and to clear locks when checking in files.

    Note: By default, Subversion does not use locks when working with files. This option allows you to override this default behavior.

Related Topics

Subversion Requirements

Log In to Subversion


Log In to Subversion

When Toad attempts to connect to Subversion, it will present you with a login window. This window will allow you to enter, or select the server repository, a local working directory, your username and password.

If using a local connection, where the server is on the same machine as the client, all you need to specify is the path to the repository in the Repository drop-down. Then, enter the path to the local working folder you set up with your initial checkout. The username and password fields will be disabled, as no username and password is required for a local connection.

If using either a WebDAV or SVN connection, simply enter the repository name in the Repository drop-down. Toad’s Team Coding will automatically create the URL to the server when necessary in order to issue commands to the server. Next, enter the path to the local working folder you set up with your initial checkout. Finally, enter the username and password needed for the remote server.

You can also specify whether or not to save passwords for each repository entered so you won’t need to re-enter them on future connections.

Related Topics

Subversion Requirements

Subversion Configuration Options


Set Up TortoiseSVN

Subversion SCC is a command-line only version control application. Therefore, in order to use its functionality in Toad, you must must install Tortoise SVN, which provides a streamlined IDE for Subversion.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To set up TortoiseSVN

  1. Install Tortoise SVN and reboot your machine.

    As a standalone app, Tortoise uses Windows Explorer for its interface. A successful install will be indicated by an expanded and modified right-click menu in Explorer.

  2. Create a repository. A repository can be created locally, but is not recommended. Name the SCC folder appropriately (‘SCC’ for instance).
  3. Right-click the folder and choose TortoiseSVN | Create repository. Select a native file system when prompted.
  4. Create a local folder called MyFiles.
  5. Right-click the MyFiles folder and select TortoiseSVN | Import.

  6. Select the repository created above (‘SCC’) for the repository URL.

    Enter a comment if desired. This is the initial load and the repository will be at Revision 1. The MyFiles folder will not be under version control.

  7. Create a second local folder called VersionedFiles, which will be the folder under control by Subversion.

  8. Right-click the VersionedFiles folder and select SVN Checkout.

    The files in this folder will have special Tortoise-assigned icons indicating each file’s SCC status. These controlled files are the same ones as above, and are now ready to be handled within Toad. You will not need to work with the MyFiles folder again.

    Subversion uses a multi-user file merge methodology rather than a standard lock> checkout> edit> checkin> unlock model, although it does use a Commit feature that acts much like a normal check in/check out. Toad employs the same tool icons (Check In, Undo, Check Out, etc.) for Subversion as it does for other SCC providers. All revisioning in Subversion is continuous, regardless of the action.

Related Topics

About Source Control

About Third-Party Version Control


Team Foundation Server Requirements

In order to use Toad’s Team Foundation Server support, you need to have Team Foundation Server (TFS) installed on your network. Please review Microsoft's documentation for instructions on installing and configuring TFS.

Team Coding includes two methods for interfacing directly with Team Foundation Server: an internal client and an external client. Each client implementation has its own unique advantages and disadvantages. Whichever one you choose will depend upon your environment and your specific needs. Please see your Team Foundation Server administrator before configuring it in Toad.

Option | Advantages | Disadvantages
Internal TFS Client Uses Microsoft’s Web Services API to directly communicate with Team Foundation Server. This internal client supports Team Foundation Server 2005 and 2008. | Improved speed (over the external client) No need to install additional software on the client machine | Does not include support for Check-in Policy items Certain administrative tasks, like deleting workspaces are not supported
External TFS Client Uses Microsoft’s command-line Team Foundation client to communicate with Team Foundation Server. This command-line client is included with Microsoft Team Explorer, and should remain consistent throughout versions. | Expected compatibility with future versions of Team Foundation Server Supports all features of Team Foundation Server, including Check-in Policies | Much slower than the internal client since an instance of the external client is launched for each TFS command issued to the server Requires the installation of Microsoft Team Explorer

Related Topics

About Source Control

About Third-Party Version Control

Team Foundation Server Configuration Options


Team Foundation Server Configuration Options

The following options can be set for both the internal and external client.

Notes:

  • Please see your Team Foundation Server administrator before configuring any of these options.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To set TFS configuration options

  1. Click [image] on the Team Coding toolbar.

    Tip: You can also select Utilities | Team Coding | Team Coding Status.

  2. Click Settings.
  3. Ensure that TFS is selected and click Provider Options.

  4. Review the following for additional information:

    General Tab | Use these options to...
    Client

    Select to conned through the internal or external client. Each option has advantages and disadvantages. See Team Foundation Server Requirements for more information.
    Check In / Out Tab | Use these options to...

    Disable prompts when possible

    Enable this option to suppress Team Foundation Server prompts whenever possible during a check-in or check-out process.

    Note: If required check-in notes are defined on the server, Toad still prompts you to enter these notes during a check-in process.

Related Topics

Team Foundation Server Requirements


Command Line Syntax

There are several ways in which you can control Toad from the command line.

  • You can create ToadApps to run some commands in sequence and with more complicated structures. ToadApps are not interchangeable with other command line functionality, with the exception of connections. ToadApps must be called separately from other command line functionality. See Execute Actions from the Command Line for more information.

    Note: Several of the old-style command line features are now Toad actions. The old command line files may no longer work, but you can convert them to new actions. See Converting Old Settings Files to Actions for more information.

  • You can run some commands and features individually from the command line.
  • You can activate some features directly from the command line, or group them together into a “command file” and call that from the command line, running the features in order as if they were a batch file.
  • You can [image] create Windows shortcuts that include the command line functionality.

    To create a new shortcut

    1. From the desktop or Windows Explorer, copy the original shortcut to Toad.
    2. Select the shortcut, right-click and select Properties.
    3. Click the Shortcut tab, and enter the command line in the Target box

Command List

Commands to Open Toad and Connect to Oracle

Description

Toad.exe

Calls the Toad executable.

-c schema/password@db "schema2/password@db as sysdba"

Make connections. The second (and third and fourth and so on) connection should be within quotation marks. Actions are a special case. See Execute Actions from the Command Line for more information about running actions with connection overrides.

Note: If you have AutoConnect set up, you do not need to enter the connection information unless you want to specify a different connection.
Commands to Control the State of Toad | Description

-debug

Temporarily sets DEBUG=1 in the Toad.ini file (executes Toad in debug mode to assist in troubleshooting).

-f File1 File2 File3

Load files into Editor. Accepts modifiers.

-min

Minimize Toad

-max

Maximize Toad

-scriptdebug

Temporarily sets the SCRIPTDEBUG=1 in the Toad.ini file (executes Toad in debug mode to assist in troubleshooting).

-tc=no

Disables the Team Coding login prompt.

Commands to Modify Files

Description

/EXEC

Triggers execution of the loaded file as a script. You may use only one of these in a command line.

This is the equivalent of using F9 in the Editor.

/PRINT

Triggers printing the source code. You may use only one of these in a command line.

/SCRIPT

Triggers executing the loaded file as a script. You may use only one of these in a command line.

This is the equivalent of using F5 in the Editor.
Activating Specific Toad Features | Description

These can be included in a Command File, or run directly from the command line. Each of the settings files for these features contain additional commands that are specific to the feature. See either the settings file you created or the help topic about the feature for more information.

Note: In all cases below, filename refers to the settings file created from the Toad window, and when run directly from the command line should include the entire path to the file, and be enclosed in quotation marks.

ANALYZE="filename"

Analyze DBMS_STATS objects.

CMDFILE="filename"

Opens and runs a command file, where filename is the name of the command file.

REP="filename"

Report.

RMI="filename"

Rebuild Multiple Indexes (legacy). See Run Rebuild Objects from the Command Prompt for more information.

RMO="filename"

Rebuild Multiple Objects (including indexes). See Run Rebuild Objects from the Command Prompt for more information.

RPTMGR="filename"

Report Manager. See Run Reports Manager from the Command Line for more information.
Running CodeXpert from the command line | Description

-cx ="filename"

Open and run CodeXpert, where file is the control file.

Note: CodeXpert parameters files work differently than other settings files, and must be run directly from the command line. See Run CodeXpert from the Command Line for more information.

Controlling Toad from within a Command File

Description

CLOSETOAD

Close Toad at end of script execution

CMDFILE="filename"

Read and process another command file - This allows you to nest files for different purposes.

Examples

Enter on Command Line from directory containing toad.exe

 Performs the following task:

toad.exe -c scott/tiger@
ora10gr2.example.com CMDFILE="c:\examples\fred.txt"
  1. Opens Toad
  2. Connects to the schema scott on the db ora10gr2.example.com with the password "tiger".
  3. Opens the Command file named "fred.txt" in the examples directory.
  4. Executes the commands in the Command file.

Toad.exe –max –c scott/tiger@db “fred/example@db as sysdba” –f somefile.sql /exec /print someotherfile.sql
  1. Opens Toad.
  2. Connects to the schema SCOTT.
  3. Connects to the schema FRED, as DBA.
  4. Opens the somefile.sql in the Editor.
  5. Executes as if you pressed F9.
  6. Prints the contents of someotherfile.sql.
  7. Leaves Toad open.

The following example would be contained in a text file with its own name, and called as described in the previous example. For example, "mycommandfile.txt" could contain the following commands:

GDBS=c:\dbscript.txt

RMO=c:\indrebuild.txt

CMDFILE=c:\othercmdfile.txt

CLOSETOAD
  1. Runs Generate Database script with the settings saved in dbsript.txt.
  2. Runs Rebuild Multiple Objects with settings from "indrebuild.txt"
  3. Calls and runs an additional command file.
  4. Closes Toad.


Converting Old Settings Files to Actions

Several of the old-style command line have been added to the ToadApps utility. Because of this, old settings files may no longer work. If you attempt to use the old command-line methods, Toad will notify you that these have become actions. You can convert old settings files to new Action files using the conversion command. This conversion is not perfect, but it can help you reduce the time it takes to convert to ToadApps from command line settings.

To convert settings files to actions

  1. From the window that created the settings file, do the following:

    From this window

    Do this

    Data Import Wizard

    Anywhere in the second step (Select Source), right click and select Import Settings from SMI file.

    Health Check

    In the options tree, press CTRL+SHIFT-ALT.

    Schema Doc

    In the Index File Name box, press CTRL+SHIFT-ALT.

    Schema Compare

    In the Target Schemas grid, press CTRL+SHIFT-ALT.
  2. Open the settings file.
  3. Click [image] and save the settings as an action. See Creating New Actions for more information.

Related Topics

Automation Designer Overview


Command Line Passwords

Passwords saved in command line settings files in Toad versions 9.1 through 9.6 were optionally encrypted. The encryption key differs in version 9.7 and later, due to moving the User Files directories to the Documents and Settings folder.

Because of this, settings files that include passwords will need to be updated if you plan to use them without a previously established connection (such as through batch files when Toad is not connected). Actions are not affected by this change.

Note: Several Command line settings files have been converted to Actions in 9.7. See Converting Old Settings Files to Actions for more information.

To update settings files

  1. With the connection to Oracle made, from the appropriate Toad window, load the settings file you want to update.
  2. Save the settings file. You can overwrite the settings file that already exists.


Export Tables and Views from the Command Line

Before you can run an export command from the command line, you must build the command file.

To export tables and views

  1. From the Schema Browser, select the Table or View you want to export, right-click it, and select Save As from the menu.
  2. Choose the settings you want the exported file to contain, and enter a directory name in the Destination Directory box.
  3. Click [image].
  4. Specify the ToadApp where you want the settings saved.

Run from the Command Prompt

See Execute Actions from the Command Line for more information.

Errors

Errors do not interrupt the export. If there are errors, they will be written to a file called ToadError.log See Properties Files for more information on location.

Related Topics

Automation Designer Overview

Creating New Actions

Execute Actions from the Command Line


Run Analyze Objects from the Command Line

You may find you would like to analyze objects at regular intervals, or have them analyzed during off-hours. With a little preparation, you can this from a command prompt. If commands are saved to a batch file, the batch file can be scheduled using the NT scheduler to execute when you are away from your desk. Results are saved to files.

To build the file to run Analyze Objects

  1. Start Toad.
  2. From the Database | Optimize menu, select Analyze All Objects.
  3. Make all settings to perform the analysis, but do not click either Analyze buttonSee Rebuild Indexes and Tables for more information.
  4. Instead, on the toolbar of the options tab, click [image]. Click Save to save settings information. The settings are saved by default into the Toad folder, but you can save them wherever you choose.

Adjust the file

The file resulting from the above procedure can be edited with Notepad or any text editor. For it to be used in the command line, commands must be activated in the settings file to form a script.

The commands can be at the end or the beginning of the file, and they need to be in the order in which you want them executed. For your convenience, all of the available commands are written into the settings file and commented out. You can easily remove the comments and cut and paste the commands into the order you want them to execute. An abbreviated set of these instructions is also in the settings file comments.

Uncomment any or all of the command lines in the settings file for actions to perform. All file names and items in quotes are editable.

  • Do not put more than one command per line.
  • Do not leave spaces before the commands.
  • Email settings are taken from View | Toad Options | Email Settings. See Email Settings for more information.

Commands go in a logical order, as they are presented in the settings file. You need to load indexes before you rebuild them, and so on.

Comments

Any lines in the file that begin with # are comments, and commands contained within will not be performed. To activate a command, remove the #.

Commands

Command

Notes

Commands to Load the Table and Index Grids

LoadUserIndexes('USERA', 'USERB', 'USERC')

Change usernames as necessary.

LoadTableIndexes(TableOwner='USERA')(Tables='TABA', 'TABB','TABC')

Change usernames as necessary.

LoadTablespaceIndexes('TABLESPACEA', 'TABLESPACEB')

Change tablespace names as necessary.

LoadUserTables('USERA', 'USERB', 'USERC')

Change usernames as necessary.

LoadTablespaceTables('TABLESPACEA', 'TABLESPACEB')

Change tablespace names as necessary.

ImportIndexesFromText('c:\MyTextFile.txt')

Change the path and filename as necessary.

ImportIndexFromBinary('c:\MyBinaryFile.bin')

Change the path and filename as necessary.

ImportTablesFromText('c:\MyTextFile.txt')

Change the path and filename as necessary.

ImportTablesFromBinary('c:\MyBinaryFile.bin')

Change the path and filename as necessary.

LoadTableColumns

ImportColumnsFromText('c:\MyTextFile.txt')

Change the path and filename as necessary.

ImportColumnsFromBinary('c:\MyTextFile.txt')

Change the path and filename as necessary.

Commands to reload information about the currently loaded tables or indexes.

You might use one of them after loading tables or indexes from a text or binary file to make sure all the information is current.

ReloadAllIndexes

ReloadAllTables

Note: If you want to reload column info, call LoadTableColumns again)

Command and parameters to check or uncheck specific rows

CheckRows(ObjType='TABLE')(Operation='CHECK')(Selection='ALL')

OBJTYPE parameter

Can have values of 'TABLE', 'INDEX', or 'COLUMN'.

It tells TOAD which grid you want to check rows on.

OPERATION parameter

Can have values of either 'CHECK' or 'UNCHECK'.

SELECTION parameter

Specifies which rows to check or uncheck as follows:

  • 'ALL' - all rows loaded in the grid
  • 'NONPART' - only nonpartitioned objects.
  • 'PARTS' - all object partitions (but not subpartitions)
  • 'SUBPARTS' - all objects subpartitions
  • 'ANALYZED' - all objects and partitions or subpartitions that HAVE been previously analyzed
  • 'UNANALYZED' - all objects and partitions or subpartitions that HAVE NOT been previously analyzed
  • 'UNUSABLE' - (indexes only) indexes, partitions and subpartitions marked 'Unusable' by Oracle

Note : The CheckRows command is cumulative. For example, if you wanted to check only analyzed table partitions (and not subpartitions), you could issue this series of commands:

CheckRows(ObjType='TABLE')(Operation='CHECK')(Selection='ANALYZED')

CheckRows(ObjType='TABLE')(Operation='UNCHECK')(Selection='NONPART')

CheckRows(ObjType='TABLE')(Operation='UNCHECK')(Selection='SUBPARTS')

Commands that execute the analysis using either ANALYZE or DBMS_STATS commands according to your saved settings

AnalyzeIndexes

Can be used with either ANALYZE or DBMS_STATS

AnalyzeTables

Can be used with either ANALYZE or DBMS_STATS

AnalyzeSchemas

Use with DBMS_STATS only.

Does not require loading of any grid data prior to their use.

If you use any of the LIST options output will be written to the error log file, ToadError.Log, which will display in the same directory as TOAD.exe.

AnalyzeDB

Use with DBMS_STATS only.

Does not require loading of any grid data prior to their use.

If you use any of the LIST options output will be written to the error log file, ToadError.Log, which will display in the same directory as TOAD.exe.

AnalyzeSystem

Use with DBMS_STATS only.

Does not require loading of any grid data prior to their use.

Commands to transfer statistics from one schema or database to another (depending on the saved settings)

CopyIndexStats

CopyTableStats

CopyDBStats

CopySchemaStats

CopySystemStats

Commands to export specified statistics from the database to a table according to saved settings

ExportTableStats

ExportIndexStats

ExportColumnStats

ExportSchemaStats

ExportDBStats

ExportSystemStats

Commands to import specified statistics from a table to the Database according to saved settings

ImportTableStats

ImportIndexStats

ImportColumnStats

ImportSchemaStats

ImportDBStats

ImportSystemStats

Commands to manipulate results

ExportIndexesToHtml('c:\MyHTMLFile.htm')

Change the path and filename as necessary.

ExportIndexesToExcel('c:\MyExcelFile.xls')

Change the path and filename as necessary.

ExportIndexesToText('c:\MyTextFile.txt')

Change the path and filename as necessary.

ExportIndexesToBinary('c:\MyBinaryFile.bin')

Change the path and filename as necessary.

ExportTablesToHtml('c:\MyHTMLFile.htm')

Change the path and filename as necessary.

ExportTablesToExcel('c:\MyExcelFile.xls')

Change the path and filename as necessary.

ExportTablesToText('c:\MyTextFile.txt')

Change the path and filename as necessary.

ExportTablesToBinary('c:\MyBinaryFile.bin')

Change the path and filename as necessary.

ExportColumnsToText('c:\MyTextFile.txt')

Change the path and filename as necessary.

ExportColumnsToBinary('c:\MyBinaryFile.bin')

Change the path and filename as necessary.

Commands to close feature window or Toad after other commands completed

CloseAnalyze

CloseTOAD

Do not activate this command if you are including this settings file in the context of a COMMAND file, as once Toad is closed, further functionality cannot be called.


Run CodeXpert from the Command Line

Note: This extended Toad feature is only available in Toad for Oracle Professional Edition and above.

You can run CodeXpert from the command line and create a CodeXpert report that you can access from any location, with or without Toad.

To run CodeXpert from the command line, you must first set up a parameter file. Then you can run CodeXpert. After completion, an html, an xml, and a bin subfolder are placed in the output directory you specify in the parameter file.

To run CodeXpert from the command line

  1. Set up your parameter file as described in CodeXpert Parameter File.

  2. Run CodeXpert from the command line using the following syntax:

    Toad.exe -CX C:\CMDLineCodeXpertINIFile.ini

  3. View the html file located in the OUTPUT DIRECTORY you specified.

    Note: The web page created (html file) is best viewed in MS Internet Explorer.

Scheduling CodeXpert

When you have created a CodeXpert ini file, you can create a small program to then schedule the scan. Your application should do the following:

  1. Dynamically create the Command Line CodeXpert INI file.
  2. Right-click in the CodeXpert window and select Add to Task Scheduler
  3. Enter the INI file name in the Command Line Parameter field.
  4. Select or enter an output directory in the Output Directory field.
  5. Select one or more output type: HTML, XML, or DB Inserts.
  6. Click OK.

Command Line Error Log

If there are errors running CodeXpert from the command line, Toad stores a log of these in User Files\CXCmdLineErrors.log. Any errors you would have received in the CodeXpert window are sent to the log file, as well as start and stop times. If no errors occurred, the log will state that as well.

You can use this log file to determine how and why the job failed, and also as documentation as to when and how it ran.

Related Topics

CodeXpert Overview

CodeXpert Properties


Execute Actions from the Command Line

You can run ToadApps and actions from the command line with or without Toad active.

Command Line Syntax

To execute actions from the command line

» Use the –a parameter and specify the action, the ToadApp, or a series of both.

If you specify only the action, the action name must be unique across all ToadApps. Otherwise an entry will be made in the Action Log about more than one action found, and the action will not run.

If there may be more than one action with the same name, fully qualify an action within an ToadApp: use ActionSet->ActionName.

Separate more than one action or ToadApp with a space and surround each item with double-quotes. See Examples of Command Line Syntax for more information.

Parameters in Command Line Syntax

You can use the parameter file to override some settings in an action so that you can run various permutations without creating multiple actions.

An action parameter INI file contains property=value pairs for the settings that can be overridden. When originally created, these will correspond to the properties saved within the actions.

See Action Parameter Files for more information about creating and using parameter files.

Connections in the Command Line Syntax

Connection information is stored with the action, and passwords are retrieved from the connectionpwds.ini file if you have selected the Save passwords option.

However, the connection information stored in an action is overridden if you use a connection string (-c schema/password@dbname) in the command line. See Command Line Syntax for more information about connection strings.

If connections are included in a parameter file and/or the command line, Toad will use connections in the following order:

  1. Connections specified on the command-line always override everything else.
  2. If a connection is not present on the command line, then those specified in a parameter (ini) file are used.
  3. If there are no connections on the command-line or defined from the Automation Designer's Run with connections option, then the connection bound to the action is used.

Note: Connection syntax does not require a password if a save password command exists for that connection within Toad.

Examples of Command Line Syntax

Command line | Notes
Toad.exe –a “MondayQueries” | Runs a ToadApp called “MondayQueries” and executes all actions within the ToadApp.
Toad.exe – a “Email Mom” | Runs an action called “Email Mom”. Only one action by that name in the entire datafile can exist.
Toad.exe –a “CommonQueries->EmpQuery” | Runs a fully qualified action, since there may be more than one action by the name “EmpQuery”, the ToadApp containing the action is included
Toad.exe -a "App->Export Dataset1 | c:\data files\ExportDataset1.ini | Runs a qualified action with a parameter file. See Action Parameter Files for more information.
Toad.exe –a “CommonQueries” “EmailSet->Email Mom” “SalesReports->MondayReport” | Runs a series of actions and ToadApps.
Toad.exe –c mlerch@ora10gr2.world –a “SalesReports->MondayReport” | Overrides the connection assigned to the MondayReport Action and uses the mlerch connection instead.
Toad.exe –c mlerch@ora10gr2.world akrotzer@utf11gr2.world -a “SalesReports->MondayReport” | Runs the MondayReport action twice, once for each of the connections specified. The connection assigned to the action within the Automation Designer will not be used. Note: Using more than one connection executes the action against all the connections.

Related Topics

Command Line Syntax

Running Actions from the Automation Designer


Run Rebuild Indexes from the Command Prompt

Run Rebuild Objects from the Command Prompt

You may find you would like to rebuild indexes or tables at regular intervals, or have them rebuilt during off-hours. With a little preparation, you can do the rebuild indexes from a command prompt. If commands are saved to a batch file, the batch file can be scheduled using the NT scheduler to execute when you are away from your desk. Results are saved to files.

You can both check indexes and rebuild them from the command prompt.

To build the file to run Rebuild Multiple Objects

  1. From the Database | Optimize menu, select Rebuild Multiple Objects.
  2. Make all settings to perform the comparison, but do not click either Rebuild or Examine indexes.See Rebuild Indexes and Tables for more information.
  3. Instead, on the toolbar of one of the options tabs, click the Save All Settings to File button. A Save file dialog box displays. Click Save to save settings information. The settings are saved by default into the Toad folder, but you can save them wherever you choose.

Adjust the file

The file resulting from the above procedure can be edited with Notepad or any text editor. For it to be of use in the command line, commands must be activated in the settings file to form a script.

The commands can be at the end or the beginning of the file, and they need to be in the order in which you want them executed. For your convenience, all of the available commands are written into the settings file and commented out. You can easily remove the comments and cut and paste the commands into the order you want them to execute. An abbreviated set of these instructions is also in the settings file comments.

Uncomment any or all of the command lines in the settings file for actions to perform. All file names and items in quotes are editable. Do not put more than one command per line. Do not leave spaces before the commands. Email settings are taken from View | Toad Options | Email Settings. See Email Settings for more information.

Commands go in a logical order, as they are presented in the settings file. You need to load indexes before you rebuild them, and so on.

Comments

Any lines in the file that begin with # are comments, and commands contained within will not be performed. To activate a command, remove the #.

Commands to load the grid

  • LoadUserIndexes('USERA', 'USERB', 'USERC') - This command loads the User indexes for the specified users. Change, remove and add users as necessary.
  • LoadTableIndexes(TABLEOWNER='USERA')(TABLES='TABA', 'TABB','TABC') - This command loads indexes for the specified tables. Change, remove, and add tablenames as necessary. Note that you need to specify the tableowner, and then the tables.
  • LoadTablespaceIndexes('TABLESPACEA', 'TABLESPACEB') - This command loads tablespace indexes. Change, remove, and add tablespacenames as necessary.
  • LoadUserTables(‘USERA’, ‘USERB’, ‘USERC’) - This command loads the User tables for the specified users. Change, remove and add users as necessary.
  • LoadTablespaceTables(‘TABLESPACEA’, ‘TABLESPACEB’, TABLESPACEC’) - This command loads tablespace tables. Change, remove, and add tablespacenames as necessary.
  • ImporTablestFromText('c:\MyTextFile.txt') - This command lets you import the settings for your tables list from a previously saved text file. You can edit the path and filename.
  • ImportTablesFromBinary('c:\MyBinaryFile.bin'); - This command lets you import the settings for your tables list from a previously saved binary file. You can edit the path and filename.
  • ImporIndexesFromText('c:\MyTextFile.txt') - This command lets you import the settings for your index list from a previously saved text file. You can edit the path and filename.
  • ImportIndexesFromBinary('c:\MyBinaryFile.bin'); - This command lets you import the settings for your index list from a previously saved binary file. You can edit the path and filename.

Commands to reload

  • ReloadAllIndexes - This command is reloads information about the currently loaded indexes. You might use it after loading indexes from a text or binary file to make sure all the information is current.
  • ReloadAllTables - This command is reloads information about the currently loaded tables. You might use it after loading tables from a text or binary file to make sure all the information is current.

Commands to Choose Tables/Indexes to Rebuild or Examine All

  • CheckAllIndexes - This command marks all indexes with a checkmark. It is used with the …Selected commands described below.
  • CheckAllTables - This command marks all tables with a checkmark. It is used with the …Selected commands described below.
  • CheckUnusable - This command marks indexes and tables that have a status of Unusable with a checkmark. It is used with the …Selected commands described below.
  • RemoveIndexConsiderationFailures - This command checks settings under the Consider Indexes for Rebuild Only If section of the Thresholds and performance options tab. It removes indexes from the list that do not meet the configured settings. Use this to exclude indexes that are small or do not have very many extents.
  • RemoveTableConsiderationFailures - This command checks Conditional Threshold settings for tables in the section of the Thresholds and performance options tab. It removes tables from the list that do not meet the configured settings. Use this to exclude tables that are small or do not have very many extents.

Commands to Rebuild or Examining Checked Indexes

  • ExamineSelectedIndexes - This command examines all selected indexes and marks them if they are recommended for rebuild. It must be performed before a RebuildRecommended command can be performed.
  • RebuildRecommendedIndexes - This command rebuilds all indexes marked as Rebuild Recommended by an Examine command.
  • RebuildSelectedIndexes - This command rebuilds all marked indexes, regardless of whether they have been recommended for rebuild.
  • RebuildSelectedTables - This command rebuilds all marked tables.

Use Results

This group of commands is for sending the results to file or email.

Note: There is an on-screen option to send results by email. This option is included in the settings file, so if it is checked, results will be sent by email, even if the settings are run from the command line. See Email Notification - Rebuild Multiple Objects for more information.

  • ExportIndexesToHtml('c:\MyHTMLFile.htm') - This command exports the results of the rebuild or examine indexes commands to an HTML file. The path and filename can be edited.
  • ExportIndexesToExcel('c:\MyExcelFile.xls') - This command exports the results of the rebuild or examine indexes commands to an Excel file. The path and filename can be edited.
  • ExportIndexesToText('c:\MyTextFile.txt') - This command exports the results of the rebuild or examine indexes commands to a text file. The path and filename can be edited.
  • ExportIndexesToBinary('c:\MyBinaryFile.bin') - This command exports the results of the rebuild or examine indexes commands to a binary file. The path and filename can be edited.
  • ExportTablesToHtml('c:\MyHTMLFile.htm') - This command exports the results of the rebuild tables command to an HTML file. The path and filename can be edited.
  • ExportTablesToExcel('c:\MyExcelFile.xls') - This command exports the results of the rebuild tables command to an Excel file. The path and filename can be edited.
  • ExportTablesToText('c:\MyTextFile.txt') - This command exports the results of the rebuild tables command to a text file. The path and filename can be edited.
  • ExportTablesToBinary('c:\MyBinaryFile.bin') - This command exports the results of the rebuild tables command to a binary file. The path and filename can be edited.

Close

  • CloseRMO - This command closes the Rebuild Multiple Indexes page after the previous commands are completed.
  • CloseToad - This command closes Toad after all command line activities are completed.

Backwards Compatible commands

If you are using settings files created with older versions of Toad, the following commands apply to indexes only. Quest Software, Inc. strongly suggests using the most current commands available.

  • ImportFromText('c:\MyTextFile.txt')
  • ImportFromBinary('c:\MyBinaryFile.bin')
  • ExportToHtml('c:\MyHTMLFile.htm')
  • ExportToExcel('c:\MyExcelFile.xls')
  • ExportToText('c:\MyTextFile.txt')
  • ExportToBinary('c:\MyBinaryFile.bin')
  • ReloadAll
  • CheckAll
  • CheckUnusable
  • RemoveConsiderationFailures
  • ExamineSelected
  • RebuildRecommended
  • RebuildSelectedInds
  • CloseRMI

Run from the Command Prompt

One setting file only

Once your file is ready, you can run the examine/rebuild file from a command line.

Open the command prompt and enter the command line in standard command line syntax. See Command Line Syntax for more information.

It should look similar to the following:

Toad.exe -c system/manager@mydb RMI c:\thisfile.txt

Note: You must either be in the same directory where Toad.exe is located, or you must enter the full path name in the command line.

  • The characters after the -c command should reflect your userid and Oracle database.
  • Change thisfile.txt to the path of the settings file you saved above.

Multiple setting files

You can call Toad with this command line to run the Rebuild Multiple Indexes function from a command file.

Toad.exe -c system/manager@myOraDB CmdFile=c:\commandfile.txt

You can also call the index rebuild from a command file like this:

c:\toad\Toad.exe Connect=system/manager@mydb CMDFILE=c:\mycommandfile.txt

In this case, mycommandfile.txt will be a separate file containing specific commands. The file might look like this if you are doing 2 index rebuilds, a schema comparison and finally building some html schema documentation.

RMI=c:\rebuild1.txt

RMI=c:\rebuild2.txt

COMP=c:\schemacomp1.txt

GENHTML=c:\html1.txt

Here, rebuild1.txt and rebuild2.txt, are the index rebuilds. Schemacomp1.txt is the schema comparison settings files. When Toad is called it will run the two index examination/rebuilds defined by these files, then the schema compare, and then create the HTML files. Toad will close itself when the comparison is finished.

Note: Even if you have a CLOSEToad command in any of the settings files, Toad will not close until all commands from the command file are executed.


Running Reports Manager from the Command Line

Run Reports Manager from the Command Line

You can easily export, print, or email reports from the Reports Manager using the command line. See Reports Manager Overview for more information about creating reports.

This functionality allows you to batch reports together easily and run them at a convenient time.

Create the command file

To create the command file

  1. Open the Reports Manager.
  2. Select the reports you want to run: you can multi-select from multiple categories in the grid by holding down SHIFT or CTRL as you click.
  3. Click [image] and save the file.

Adjust the command file

There is no need to adjust the file. Toad automatically puts the appropriate commands into the file when you select click OK. However, this file can be modified with notepad if you choose. The file contains information about how to use it in a command line.

Email settings are stored in the registry by FastReports. Because of this, you will need to send a report by email manually before using the command line interface. After the initial email, the settings will be saved and the command line will suffice.

To send email manually from Reports Manager

  1. Preview any report.
  2. In the Preview dialog, click Export and choose Email.
  3. In the Send By Email dialog, click the Account tab to enter your email settings.

Comments

Any lines in the file that begin with # are comments, and commands contained within will not be performed. To activate a command, remove the #.

Running the command file

The path to Toad is taken from the connection you have open when you create your file, as are the username, database, and file. If you move the file you will need to change the filename.

Once your file is ready, you can run the Reports Manager from the command prompt or from a batch file.

Open the command prompt and enter the command line in standard command line syntax. (See Command Line Syntax for more information.) It should look similar to the following:

C:\toad\TOAD.exe -c <username>/<password>@<database> RPTMGR "C:\thisfile.txt"

Your path to Toad may differ, along with your connect info. 'c:\thisfile.txt' represents the file you created.


About the Editor

The Toad Editor lets you edit many types of statements and code, and Toad provides many options to customize the Editor's behavior. See Important Editor Settings for more information.

The Editor attaches itself to the active connection in Toad, but if you do not have a connection you can still use it as a text editor. You can also change the schema to execute against from the Current Schema toolbar. See Change Current Schema for more information.

Tips:

  • The Editor's right-click menu contains many options to help you work with code. When you are trying to figure out how to do something, try right-clicking the Editor to see if it is available in the menu.
  • Select an object and press F4 to display the object's properties. See Describe Objects for more information.
  • If you press CTRL and click a PL/SQL object, the object opens in a new Editor tab. If you press CTRL and click a non-PL/SQL object, the object opens in the Describe Objects window.

Editor Panels

The Editor is organized into the following areas:

Area Description
Navigator Panel

The Navigator Panel is a desktop panel that displays an outline of the Editor contents in the active tab. You can click on the items listed to navigate to that statement in the Editor. The Navigator Panel is displayed on the left-hand side by default, but you can change where it is docked. See Navigator for more information.

Editor

The main Editor window displays code in separate tabs. You can create tabs for different bits of code, or different types of code. SQL and PL/SQL can go in the same tab. Toad can tell where the cursor is located and compile PL/SQL or run SQL as required.

Note: If you have multiple statements in the Editor, you must trail them with a valid statement terminator such as a semi-colon.

Desktop Panels

The desktop panels contain many options for tab display, depending on what kind of code you are working with and what you want to do with it. In addition, you can configure how these panels display to make Toad work for you. See Customize the Editor Layout for more information.


Important Editor Settings

Toad provides many options to let you customize the Editor's behavior. The following table describes some of the most popular or important Editor options:

Option Description Navigate

Code templates

Select code template settings. Code templates use a manual keystroke (CTRL+SPACE) to perform substitutions. See Code Completion Templates for more information.

 View | Toad Options | Editor | Behavior

Commit after every statement

Commit every time a statement is run, after any posted edits are made in the grid, and after a row is deleted in the grid.

Enabling this option makes it very easy to accidentally change or delete data. It is recommended that you do not select this option, and you should never have it enabled when you are working on a production database.

 View | Toad Options | Oracle | Transactions

Font

 Select the Editor display font. View | Toad Options | Editor | Display
Syntax highlighting

Select syntax highlighting settings. See Syntax Highlighting for more information.

 View | Toad Options | Editor | Behavior
Tab stops

Enter the number of spaces entered when you press TAB.

 View | Toad Options | Editor | Behavior

When closing connections

Commit, rollback, or prompt when closing connections. This field is disabled if you select Commit after every statement.

Selecting Commit makes it very easy to accidentally change or delete data. It is recommended that you select Prompt.

 View | Toad Options | Oracle | Transactions

Related Topics

About the Editor


Customize the Editor Layout

You can easily configure which panels display on your Editor desktop and where they display. You can select panels to display one at a time or in groups. When you have configured it, you can save the desktop with its own name, returning to it whenever the need arises. In addition, you can turn on Auto-save current desktop, and however you have the desktop set when you change tabs or close Toad will be how your desktop is defined the next time you open the Editor.

You can split the Editor to easily compare code revisions. See Split the Editor Layout for more information.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To display panels one at a time

  1. Right-click the Editor and select Desktop.
  2. Select the panel you want to display or hide.

To configure your desktop

  1. Right-click the panel area near the bottom of the window.
  2. Select Desktop | Configure Desktop Layout.
  3. Select the panels you want to display in the Show column, and click the drop down menus in the Dock Site column to change where the panel is docked. By default, all except the Navigator will be docked below the Editor.

To save your desktop

  1. Click [image] on the Desktops toolbar.
  2. Enter the name you want to use for this desktop.

To use a saved desktop

» From the drop-down desktop menu, select the desktop you want to use.

To restore a desktop

» Click the drop-down arrow on [image] and select Revert to Last Saved Desktop or Restore Default Desktop.


Configuring the Editor

Configure the Editor

You can use the Toad Editor in the main Editor window to edit SQL text. The same Editor is used in read-only mode on many other windows throughout Toad. This Editor provides the following features:

  • User configurable Syntax Highlighting
  • Bookmarks
  • Customize Shortcut Keys for common editing commands.
  • Auto Replace Substitutions (replaces as you type)
  • Code Completion Templates
  • Undo/Redo (from the Edit menu)
  • Comment Out Code Block
  • Find Closing Block
  • Find and Replace Text
  • Word Wrap, Auto Indent, and all other common editor functions

Altering Editor Options

Editor Options can be altered from the Toad Options | Editor nodes.

Related Topics

Editor Behavior Options

Code Assist Options

Editor Options: Display

Editor Options: Open/Save

Editor Printing Options

Properties Files


Troubleshooting the Editor

Missing Panels

If you cannot see a pane it has probably been removed from the desktop, or hidden inadvertently.

To restore a missing pane

  1. Right-click in the Editor window and select Desktop.
  2. Make sure the pane you are looking for is marked with a check. If it isn't, select it now.

Hidden Panels

Sometimes, a pane will display to be visible: it will be marked with a check as described above. However, it will still be hidden. Hidden panes are generally hidden because they have been scrolled beyond the visible range.

Missing Toolbar buttons

The toolbars in Toad are configurable. The default toolbars in the Editor are minimal, in order to leave plenty of space for editing. You may find that some of the buttons included are not commands you use regularly, and that there are some commands you do use that you would like on the toolbar. You can easily adjust the toolbars to reflect the way you work. See About Customizing Toolbars and Menus for more information.

Missing Toolbar

It is possible to delete all the toolbars in the toolbar area. If this happens, you can restore them.

To restore missing toolbars

» Right-click in the Editor and then select Customize toolbars. Select at least one toolbar to display.

Functionality doesn't work

If you are an upgrading Toad user, some features in the Editor may not work properly (including CTRL-Click, and hover-over hints). So that you did not lose your customizations of the languages in this library, the lexlib.lxl file was not upgraded to include the Unicode notation.

You will need to make the following change to your LexLib for the Editor parser to work correctly with Unicode:

  1. From the View menu, select Options.
  2. Click the Editor - Behavior node.

  3. Set the language drop-down to PL/SQL and then click [image].

  4. Click the Parser tab and select Any Name.

  5. Add (?r) to the beginning of the "Any name" parser rule:

  6. Click OK or Apply to save changes.


Object Palette

The Object Palette can be docked to the main Toad window, so that it is available within any of your Toad windows.

When the active connection changes the Object Palette automatically refreshes to reflect the new active connection. Or, you can use the refresh button to refresh the list (this method queries the database).

To access the Object Palette

» From the View menu, select Object Palette.

To view objects from a different schema

  1. At the top of the Object Palette, click the Schema drop-down.
  2. Select the new schema from the list. Objects from that schema now display in the object list.

To change the style in which objects are listed

  1. Click the drop down arrow beside [image].
  2. Select the style in which you want to view objects.

To insert an object into an Editor

  1. Place your cursor in the Editor in the location where you want the object.
  2. In the Object Palette, double-click the object you want to insert.

To perform a DESCRIBE on an object

  1. In the Object Palette, select the object you want to describe.
  2. Press F4 to display the DESCRIBE window.

To filter the Object Palette

  1. In the Object Palette toolbar, click the appropriate filter button:
    • Project Manager filter
    • Filter tables. See Create Schema Browser Filters for more information.
  2. Enter the filter criteria to limit the objects shown.

To view columns

» In the Object Palette, click [image]. Columns are displayed for the selected object at the bottom of the palette.


Split the Editor Layout

You can split the Editor to easily compare code revisions.

Tip: To remove the split layout, right-click in the Editor and select Split Editor Layout | Not Split.

To split the Editor

  1. Right-click the Editor and select Split Editor Layout.
  2. Select one of the following options:

    • Left-Right

    • Top-Bottom


Navigator

This pane displays an outline of the code in the active window. You can click on the items listed to navigate to that statement in the Editor.

To access the Navigator

  1. Right-click in the Editor.
  2. Select Desktop Panels | Navigator.

The left pane contains the Navigator List, a list of statements, objects or package contents contained in the editor.

The list is displayed in a hierarchy, with each element broken out separately (if you want to hide some of these elements, you can right-click the hierarchy and select Configure Navigator Panel. See Navigator Options for more information. Elements in the code are broken out and indicated as follows:

Icon | Meaning
DDL | DDL statements
DML | DML statements
SQL | SQL statements
 | Procedure
 | Function
 | Constant
 | Cursor
 | Exception
 | Field
 | Parameter
 | Record
 | Subtypes
 | Variable


Reload Object

The reload object options give you an easy way to synch your PL/SQL source with objects also existing on the database.

You can reload objects in one of several ways.

To reload an object from the Navigator

  1. In the Navigator, select the object you want to reload.
  2. Right-click and select Reload Object.

To reload all objects from the Navigator

  1. In the Navigator, select the object you want to reload.
  2. Right-click and select Reload All Objects.

To reload from the Toolbar

  1. Place your cursor in the object in the Editor that you want to reload.
  2. Click [image] on the toolbar.

Related Topics

Navigator

Navigator Options


Using the Navigator Panel

From the toolbar in the Navigator panel, you can:

Icon | Meaning
 | Refresh the Navigator list
 | Sort the Navigator list alphabetically (depressed, items display alphabetically, up, the list displays in source code order)
 | Pin the Navigator list open or let it slide open and closed
 | Close the Navigator list

In addition to these, from the right-click menu you can also expand or collapse the entire tree.

To display the entire statement

» Hover the pointer over an item in the Navigator. Information about it is displayed as a tooltip.

To jump to the statement

» Click on the statement in the Navigator and the cursor jumps to that point in the Editor.

To refresh the navigator panel

» Do one of the following:
  • Save the current file
  • Click the Refresh [image] button.

Sorting Statements

You can sort statements within the Navigator panel.

Sort

Select Sort to sort the tree alphabetically. When unchecked the tree is sorted so that items in the tree display in the same order as they display in the script.

Related Topics

Navigator

Navigator Options


Navigator Options

In the Editor, you can configure the Navigator panel to only display declarations that you want to see. In addition, you can change the look of the panel to suit the way you work. See Navigator for more information about the navigator panel.

To access the Configure Navigator Panel

» From the Navigation Panel, right-click and select Navigator Panel Options.

General

Initial Node Expansion

In this area you can choose how the hierarchy is expanded when first opened. You can choose to expand to one level, all levels, or no levels.

Lower-case text

With this option selected, declarations display in lowercase. If it is not selected, they display in uppercase. Lowercase takes up less screen space.

Default: Selected

Sort

When this option is selected, declarations are sorted alphabetically within the hierarchy. Unselected, declarations display in the same order they are declared in the code.

The default is unselected.

Font

Click the Font button to select the font you want to use in the Navigator tree.

Statements

In the Statements area, you can select the items you want to display in the navigator. By default, all statement types are included. These include packages, package bodies, functions, SQL*Plus, anonymous blocks, and so on. In addition, you can rearrange the order in which they are displayed in the tree structure.

To rearrange the tree structure

  1. Click the item you want to move.
  2. Click the Up or Down button to move it up or down in the display.

PL/SQL Components

In the PL/SQL Components area, you can select the PL/SQL items you want to display in the navigator. By default, all types are included. These include constants, exceptions, subtypes, cursors, ref cursors, local subprograms and so on. In addition, you can rearrange the order in which they are displayed in the tree structure.

To rearrange the tree structure

  1. Click the item you want to move.
  2. Click the Up or Down button to move it up or down in the display.

Other configuration options

Beside the tree structure area are several other options you can use to configure your Navigator Panel.

Include parameter direction | Declarations displays differently if the parameter is an input or output parameter. If this is selected, labels on the tree will take up a bit more room. The default is selected.
Include Datatype | When this option is selected, the datatype is displayed beside the declaration. for example, a variable will display as follows: When unchecked, the variable will display as follows:


Bookmarks

Use bookmarks to help you manage files. They mark a position within the Editor so that you can easily jump back to that line. You can set up to ten separate bookmarks within one Editor.

Note: All keystrokes assume you have not altered the default Editor keys.

To set a bookmark

» Right-click and select Toggle Bookmark | Bookmark# (CTRL+SHIFT+# where # is a number between 0 and 9).

The bookmark number displays in the Editor gutter.

To clear all bookmarks

» Right-click and select Clear All Bookmarks.

To clear one bookmark

» Right-click and select Toggle Bookmark | Bookmark# (CTRL+SHIFT+# where # is a previously defined bookmark between 0 and 9).

To jump back to a bookmark

» Right-click and select Go to Bookmark (CTRL+# where # is a previously defined bookmark between 0 and 9).

Note: The # must be called from the number row on the keyboard. Using the Number pad will not call the bookmark.


Moving Between Editor Tabs

There are several ways to move between tabs in the Editor.

To move between tabs:

» Do one of the following:
  • Click the tab you want to open.
  • Press ALT+PageUp or ALT+PageDown to cycle through them.
  • If you have opened them using the CTRL+Click functionality within the Editor, click the navigation buttons in the Editor toolbar and select either scroll forward and back through them in the order they were opened, or select from a drop-down order.

Related Topics

About the Editor


About Executing Statements and Scripts

Toad provides several different methods for you to execute code. Each method has unique advantages and disadvantages:

Method Advantages and Disadvantages Recommendation
Execute a single statement in Toad (F9)

Advantages

  • Can produce editable data
  • Supports bind and substitution variables
  • Fetches results in batches, which allows it to executes faster than other methods

Disadvantages

  • Only executes one statement at a time
  • Does not support SQL*Plus commands

Use whenever you need to execute a single statement.

See Execute Single Statements for more information.

Execute as script in Toad (F5)

Advantages

  • Executes multiple statements in Toad's interface
  • Supports SQL*Plus commands

Disadvantages

  • Does not support bind variables
  • Only produces read-only data
  • Fetches all matching records at the same time, which may cause it to execute slower and use more resources than executing a single statement

Use whenever you need to execute multiple statements, or include SQL*Plus commands.

See Execute Scripts for more information.

Execute script with Quest ScriptRunner

Advantages

  • Executes in an external application, which allows you to keep working in Toad while a script executes
  • Provides many of the same features as Toad's Editor

Disadvantages

  • Compared to executing a script in Toad, Quest ScriptRunner does not offer all of the Editor's features
  • Scripts are executed in a different session than the session used by Toad*

Use for scripts that may take a long time to execute and you want to view your results in a grid.

See Execute Scripts with Quest ScriptRunner for more information.

Execute script with SQL*Plus

Advantages

  • Executes in an external application, which allows you to keep working in Toad while a script executes
  • May execute faster than Quest ScriptRunner

Disadvantages

  • Does not have data grids or other Toad features

  • Does not support Unicode

    Note: SQL*Plus is a non-Unicode application and only supports ANSI.

  • Scripts are executed in a different session than the session used by Toad*

Use for scripts that may take a long time to execute, or when you want to compare the script execution in two different applications.

See Execute SQL via SQL*Plus for more information.

* If you change data in the script session, the changes will not reflect in Toad until you commit the changes in the script session. Also, any session control statements executed in the script session (such as ALTER SESSION) are not visible to the Toad session.

Related Topics

About the Editor


Execute Single Statements

You can easily execute a single statement in the Editor. Toad's parser identifies and executes the statement or compiles the PL/SQL at the cursor.

Note: If you select code and execute, Toad ignores the parser results and executes the portion that is selected. This may cause errors, especially if you select more than one statement. It is better to place your cursor in the statement you want to execute and let Toad select the statement.

This method fetches matching records in batches to improve performance. The default is 500 records, but you can change the default by editing the OCI Array Buffer size option. See General Oracle Options for more information.

Notes:

  • Executing a statement can produce editable data. See Understand Editable Resultsets for more information.
  • Toad provides several options to execute a full script or multiple statements. See About Executing Statements and Scripts for more information.

To execute a statement in the Editor

» Place the cursor in the statement and click [image] on the Execute toolbar (F9).

Note: To cancel the execution, click [image] in the Execute toolbar.

Related Topics

Execute Scripts

About the Editor


Execute Scripts

Toad's Execute as script command is generally the best method when you want to execute multiple statements or a script in the Editor. However, there are some important differences between executing scripts and single statements. For example, executing scripts does not support bind variables and cannot produce editable datasets. See About Executing Statements and Scripts for more information.

If you want to execute a script that may take a long time to run, executing with Quest ScriptRunner may be the best choice. Quest ScriptRunner is an external execution utility, which allows you to keep working in Toad while the script executes in the background. See Execute Scripts with Quest ScriptRunner for more information.

Notes:

  • Toad does not support all SQL*Plus commands. See SQL*Plus Commands for more information.
  • Linesize in Toad defaults to 80, just as in SQL*Plus. If you want to change this to a longer amount, you can do it using the SET LINESIZE command in your script.

To execute the contents of the Editor as a script

» Click [image] on the Execute toolbar (F5).

Caution: If any changes have been made, the script in the current window is automatically saved, and then executed as a script.

Note: To cancel the execution, click [image] in the Execute toolbar.

Related Topics

About the Editor


Execute Scripts with Quest ScriptRunner

Quest ScriptRunner (QSR) looks and operates the same way as the Toad Editor, but it only includes a subset of the Editor's features. QSR is a small script execution utility that can run in the background or from the command line. QSR can be helpful when you need to run long scripts and want to perform other tasks in Toad. In addition, several instances of QSR can run at one time because of its small size.

The QSR window is divided into the following regions:

  • Editor (top)—Displays the script for you to review and edit. You can use the toolbar to save the script, open a different one, search, manage your connection, and other options.
  • Script output (bottom)—Displays the script output and variable settings. See Script Output Tabs for more information.

Notes:

  • QSR is not completely SQL*Plus compatible; however, most DDL and DML scripts should be supported. See SQL*Plus Commands for more information.

  • If you change data in the script session, the changes will not reflect in Toad until you commit the changes in the script session. Also, any session control statements executed in the script session (such as ALTER SESSION) are not visible to the Toad session.

  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To execute scripts from Toad in Quest ScriptRunner

  1. Open the script in the Toad Editor.
  2. Select Editor | Execute SQL via QSR. Quest ScriptRunner opens using your current connection and the script executes.

    3. Note: You can also click the drop-down beside the [image] icon and select Execute in QSR.

To execute scripts within QSR

  1. Open the script in the QSR Editor.
  2. Click [image] on the toolbar.

Related Topics

Use the Command Line with QSR


Use the Command Line with QSR

You can use the command-line interface to run Quest ScriptRunner (QSR).

Parameters

Parameter | Description
-c | Connection information. You can use any combination of the user, password, database, and application server. QSR prompts you to provide any necessary information you omit. For example: user/password@database
-e | Closes QSR after execution.
-f | Filename.
-h | Oracle home. This field is not required. If you do not provide this information, QSR uses the default Oracle home.
-i | Minimizes QSR when it runs.
-n | Prevents QSR from executing the specified file when -f is used. By default, if you include connection information and a file to execute, QSR executes the file. This parameter allows you to load the file in QSR and connect to the database (if -c is included) without executing the file.
-o | Output file name.
Tip: Use quotes around the parameter data to avoid command-line interface issues. For example: -c "user/password@database"

Examples

Review the following command line examples:

  • Connect to a database with MyOracleHome, load c:\myfile.sql into the Editor, but do not execute the file:

    -c "user/pwd@mydb" -f "c:\myfile.sql" -h "MyOracleHome" -n

  • Connect to a database with MyOracleHome, load c:\myfile.sql into the Editor, and run minimized:

    -c "user/pwd@mydb" -f "c:\myfile.sql" -h "MyOracleHome" -i

  • Connect to a database with MyOracleHome, load c:\myfile.sql into the Editor, execute, send output to c:\myoutput.txt, and exit when complete:

    -c "user/pwd@mydb" -f "c:\myfile.sql" -h "MyOracleHome" -o "c:\myoutput.txt" -e

Related Topics

Execute Scripts with Quest ScriptRunner


General Options (Quest ScriptRunner)

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To set general QSR options

  1. Click [image] on the toolbar.

    Tip: You can also select Edit | QSR Options.

  2. Select General.

  3. Set the options. Review the following for additional information:

    4. Default encoding | Set the default encoding of Unicode files. Unless manually changed in the affected window, Toad uses this setting for encoding saved files in places where you can specify encoding (for example, Save As dialogs and Editor tabs). Default: ANSI
Save source files in Unix format | Save CR-LF character pairs as LF, making the source compatible with Unix. Default: Cleared
Favorite folders | Add or remove favorite folders. These fields control the "Favorites" box on the open/save dialogs. You can specify favorites or remove them from your list here as well as from an Open/Save dialog.

Related Topics

Execute Scripts with Quest ScriptRunner


Editor Options (Quest ScriptRunner)

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To set QSR Editor options

  1. Click [image] on the toolbar.

    Tip: You can also select Edit | QSR Options.

  2. Select Editor.
  3. Set the options. Review the following for additional information:
    4. General | Use these options to...
Confirm Clear All Text | Select to have Toad prompt you when you clear all text from the Editor, either by pressing F7 or selecting Edit | Clear All. Default: Cleared
Persist dynamic highlighting when not focused | Keep dynamic highlighting when you move focus into another panel or window within Toad. Default: Selected
Persist selection when not focused | Keep the selected code highlighted when you move focus into another panel or window within Toad. Default: Selected
Persist selection when using navigation keys | Keep the selected code highlighted when you use arrow keys to navigate. Default: Cleared
Show control characters | Display control characters (such as spaces, tabs, carriage returns) within your code. Default: Cleared
Show current line focus rectangle | Display a rectangle around the line of code that has focus in the PL/SQL tab. Default: Selected
Gutter and Margin | Use these options to...
Visible gutter | Set the width of the gutter to the left of your code. Default: 50
Visible right margin | Set the position of the right margin on your screen to make your coding area wider or narrower. Default: 80

Related Topics

Execute Scripts with Quest ScriptRunner


Oracle Options (Quest ScriptRunner)

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To set QSR Oracle options

  1. Click [image] on the toolbar.

    Tip: You can also select Edit | QSR Options.

  2. Select Oracle.

  3. Set the options. Review the following for additional information:

    Commit after every statement

    Commit every time a statement is run, after any posted edits are made in the grid, and after a row is deleted in the grid.

    Default: Cleared

    When closing connections

    Commit, rollback, or prompt when closing connections. This field is disabled if you select Commit after every statement.

Related Topics

Execute Scripts with Quest ScriptRunner


Grid Options (Quest ScriptRunner)

This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To set QSR grid options

  1. Click [image] on the toolbar.

    Tip: You can also select Edit | QSR Options.

  2. Select Grids.
  3. Set the options. Review the following for additional information:
    4. Behavior | Use these options to...

    Tabs

    Tab through one record.

    Note: You cannot tab through multiple records unless Tab through is also selected.

    Default: Selected

    Tab through

    Tab through more than one record.

    Default: Cleared

    Row select

    Select an entire row when you click in a data grid cell. If this option is cleared, Toad only selects one cell.

    Default: Cleared

    Column sizing | Use these options to...

    Size to header

    Size all columns to the width of the column headers. If the data is wider than the header, it is truncated.

    Default: Cleared

    Size to data

    Size all columns to the width of the data contained in them. You can also select the following options:

    • Allow columns narrower than header width—Select to be able to make columns narrower than the width of the column header. This can allow you to fit more data on the screen. If this option is not selected, columns will never be narrower than the header for the column, although this may be narrower than the data contained in it. The default is cleared.
    • Allow columns wider than grid width—Select to allow columns to be wider than the grid width. This prevents column widths from becoming excessively wide due to LONG data. The default is cleared.

    Default: Selected

    Display | Use these options to...

    Show focus rectangle

    Display a rectangle around an item in the grid, which persists when you click outside of the grid.

    Default: Cleared

    Show grid selection

    Highlight selected items in the data grid, which persists when you click outside of the grid.

    Default: Selected

    Null column text

    Enter text to display in null fields, such as {NULL}. By default, null fields are blank.

    Default: <this field is empty>

Related Topics

Execute Scripts with Quest ScriptRunner


Import Settings (Quest ScriptRunner)

Quest ScriptRunner (QSR) looks and operates the same way as the Toad Editor, but it only includes a subset of the Editor's features. Consequently, the options included in QSR are identical to their counterparts in Toad. You can import your Toad settings to automatically set your QSR options.

To import settings from Toad

  1. Select the Toad version in the Location field from which you want to import settings.
  2. Click Import.

Related Topics

Execute Scripts with Quest ScriptRunner


Execute SQL via SQL*Plus

This opens a DOS box and executes the contents of the Editor using SQL*Plus.

Important: SQL*Plus does not support Unicode.

Note: If you change data in the script session, the changes will not reflect in Toad until you commit the changes in the script session. Also, any session control statements executed in the script session (such as ALTER SESSION) are not visible to the Toad session.

To access MS DOS for SQL*Plus

» From the Editor menu, select Execute SQL via SQL*Plus.


Load and Execute a Script File

To load and immediately execute a script file

  1. From the Editor menu, select Load and Execute a Script File
  2. Select a file to load into the Editor and execute immediately.


SQL Results Grid

The SQL Results Grid is found in the Data tab in the lower portion of the Editor, and the Data tab in the right hand detail panel of the Schema Browser. Results are displayed in the Editor Data grid. There are many things you can do with the results of a query. See About Working with Data Grids for more information.


AutoTrace

AutoTrace is a mini version of SQL Trace that displays quick results directly on the client. In Toad, the results are displayed beneath the Editor or the Query Builder window. From the AutoTrace results area you can sort columns, print the grid, and copy the results to the clipboard.

AutoTrace is one of many optimization features Toad provides. For more of these features, see the Optimization topic.

Notes:

  • This feature requires access to some V$ tables. See V$ Tables Required for more information.
  • AutoTrace will force a read of all data from the result of the query. This can take some time. If a query will return a large number of rows, and time is a factor, AutoTrace is not advisable.

To enable AutoTrace

» Right-click in the Editor and select the AutoTrace menu option. A checkmark indicates it is enabled.

To disable AutoTrace

» Right-click in the Editor and select the AutoTrace menu option.

To view AutoTrace results

  1. In the Editor results area, click the AutoTrace tab.

    2. If the AutoTrace tab is not visible, right-click and then select Desktop | Autotrace.

    Note: Every statement issued in AutoTrace mode will have results generated.


DBMS Output to Debug PL/SQL Code

View DBMS Output

Oracle provides a specifically designed package called DBMS_OUTPUT with functions for debugging PL/SQL code. It uses a buffer that your PL/SQL code writes into and then a separate process queries the buffer out and displays the contents.

You must enable DBMS Output before executing the PL/SQL. In Toad, output displays after the procedure has completed execution, not while you are stepping through the code. In nested procedure calls, all procedures must have run to completion before any DBMS Output content is displayed.

Troubleshooting

If you do not see DBMS Output, try the following suggestions:

  • Right-click the lower pane and select Desktop Panels | DBMS Output.
  • Make sure the Toggle Output On/Off button is on ( [image]) in the DBMS Output tab. Then, set the interval in the Polling Frequency box. If the toggle is on, Toad periodically scans for and displays DBMS Output content.
  • Contact your Oracle DBA to make sure the DBMS_OUTPUT package is enabled on your database.


Optimization

Toad offers several features to help you optimize queries or view the performance statistics for the server. Although Toad provides access to these statistics and/or Oracle utilities, this section describes only how to use the features within Toad, not how to interpret the results. For an excellent guide on SQL tuning, we suggest Oracle SQL - High Performance Tuning by Guy Harrison available from Prentice Hall Press.

Feature Description
Optimize Current SQL

Use the Optimize Current SQL feature to optimize a single SQL statement. Toad searches for faster alternatives and allows you to compare them to the original statement and each other. See Optimize SQL Statements for more information.
SQL Optimizer

If you have a Toad Edition that includes the SQL Optimizer package, you can use it to help you optimize your code. See Using SQL Optimizer with Toad for more information.
Explain Plan

Explain Plan shows the path and order in which Oracle will process your statement. By processing Explain Plan on variations of a statement, you can see how the adjustments will affect the execution. See Explain Plan Overview for more information.
SQL Trace

SQL Trace is a server side trace utility that will show CPU, IO requirements, and resource usage for a statement. SQL Trace is a much more complete utility than AutoTrace; however, viewing the results can be difficult because the output file is created on the server. See Trace Sessions for more information.
AutoTrace

AutoTrace is a mini version of SQL Trace that displays quick results directly on the client. In Toad, the results are displayed beneath the Editor window. See AutoTrace for more information.

Server Statistics

The server statistics window displays Wait, Latch, and derived (calculated) statistics using the Oracle V$ tables. See Toad Server Statistics for more information.
Optimizer Mode

You can set the optimizer mode for the current session. This will affect all queries (including Toad's own) for the duration of the session or optimizer setting. See Oracle Optimizer Hints for more information.

Note: Optimizer mode is not available in Oracle 10g databases. Therefore Toad disables this option when it is connected to a 10g database.


Output Window

The output window displays whenever there are results of an action. The Output window can be sized however you want. By default it is docked at the bottom of your screen.

In addition, the output window displays error messages, and other general information Toad creates for you. Output is sent to various tabs as needed. Using the popup menu you can work with the messages displayed in the Output window.

Various Tabs

Output is sent to various tabs in this window as needed.

Tab | Contents
General tab | This tab provides general information.
<connection> tab | This tab provides information about what you have done during a connection. For example, if you end or begin a Debugger session for a specific connection a log of this will be displayed here.
Formatting Results tab | This tab displays results of the Format Files command from the Project Manager. See Format Files for more information.
Syntax Check Results tab | This tab displays results of the Check Syntax command from the Project Manager. See Checking Files for Syntax for more information.
Spool SQL tab | This is where SQL is displayed from the Spool SQL command. This is the SQL Toad uses to perform various functions.

Popup menu

From the right-click menu you can do several things.

Command | Result
Find in Files | Open the Find in Files dialog box to find specific information. See Find in Editor for more information.
Clear | Clears all messages in the active output tab.
View Messages | Displays the selected messages in a dialog box. This is useful when a message is too long to view in the Output window, or contains linefeeds.
Copy | Copies the contents of the Output window to the clipboard.
Print | Prints the contents of the Output window.
Save to File | Saves the contents of the Output window to a text file.
Spool SQL to Screen | Toggles spooling.


Row Numbers

Toad will display row numbers in the Editor data grid if the option to do so is enabled. Make sure the View | Options | Data Grids tab | Show row numbers in all grids (applies to data grid on Browser also) checkbox is checked.

The total number of rows returned in the resultset will display in the status bar at the bottom of the window only after you have scrolled to the end of the resultset. This is because the resultset is fetched only as required, to improve overall performance. When the last row is fetched, Toad will display the total count.

To return the Oracle pseudo-column ROWNUM in the SQL Results grid, add "ROWNUM" to the query:

select rownum, emp.* from employee emp

Remember that rownum is an Oracle pseudo-column, not stored with the table definition or data, but derived when queried.

To return the ROWID in the query, specify the column and the datatype:

select rowidtochar(rowid), emp.* from employee emp

Note: You can also enable "Show ROWID in data grids" from View | Options | Data Grids tab by clicking in the checkbox. This will accomplish the same thing without resorting to coding.


Saving Toad Query Results

Any of Toad's window query results can be saved to the Windows Clipboard or to a file by the procedure below. Some dialog boxes do NOT have a "Copy to Clipboard" or "Save to Disk" function. This duplicates that functionality.

To save query results

  1. Turn on spooled output to disk file: Database | Spool SQL | Spool SQL To File.
  2. Run the desired Toad window (for example, the Schema Differences window) select each desired tab.
  3. From the User Files folder, open DEBUG.SQL.
  4. Copy each SQL into the Editor window.
  5. Run each SQL in the Editor window, substituting hard coded values for the bind parameter variables, or just enter them when prompted in the Variables dialog box.
  6. Save the grid contents to clipboard or disk file, using right-click, Export Dataset.


Script Output Tab

Script Output Tabs

After you run a script, Toad displays the output and maintains a running list of system variables and user variables. This lets you keep track of what has been set.

Tab | Description
Output | The output tab displays any output from the script you are running, such as errors, status of system variables, and data in output format.
Grids | Data grids display the data selected by the script. One grid displays for every select statement.
History | Displays output for all the scripts run during this session, or until the history tab is cleared. This tab is hidden by default, but can be turned on in the options. See Execute and Compile Options for more information.
Environment | Displays user, system, and bound variables and their values for the script.

Related Topics

Quest Extensions

Navigator


Time Values

When displaying times with dates, Delphi, and thus, Toad, will suppress the time values if they are 12:00:00 AM (midnight). The time portion of the date fraction is zero, so Toad adds no value to the display of the date.

Remember that Oracle stores dates as a big fraction number offset from January 1, 4712 B.C. It is then converted to a complete date and time. It is also good well past Y2K.

Performing the query "Select sysdate from dual" will display the time, and similarly, queries of DATE datatype columns will display the time if it is not midnight.

The time drop-down in View | Toad Options | Data Grids does not affect this output of time.


Create New PL/SQL Object

Use this dialog box to use a template for your new procedure, function, package, or trigger.

To create a new PL/SQL Object in the Editor

  1. Click [image] on the Editor toolbar. (If this button does not display, you may need to add it. See Customize Toolbars and Menus for more information.)
  2. Select the type of object you want to create.
  3. Enter the name of your new object in the New Object Name box, or leave this blank for now and enter a name when you save the object.
  4. Select a default template.

To create a new PL/SQL Object from the Schema Browser

» From the schema browser object pane for the object type you want to create (package, procedure, function, and so on), click [image].

Default Templates

Default templates are read from the Toad for Oracle\User Files folder. If you want to use a template you have created other than the default, choose it from the drop down menu. The following default templates are located in the Toad for Oracle\User Files folder:

NEWPROC.SQL | Create a Procedure
NEWFUNC.SQL | Create a Function
NEWPackage.SQL | Create a Package spec
NEWPackageBody.SQL | Create a Package body
NEWType.SQL | Create a Type spec
NEWTypeBody.SQL | Create a Type body
NEWTrigger.SQL | Create a Trigger spec

Note: In addition to the above templates, there are two others stored in the Toad/User Files folder and editable as described below. These are useable within a created package and include both Package Procedures and Package Functions. See Using Templates within Packages for more information.

Editing Templates

Templates can be edited using any text editor, or select the file from the Toad Options |Proc Templates page and click Edit.Delete, change, or add new files as desired. See Proc Templates for more information.

You can load new templates from any network path. Specify where the files are located when you add them to the list. To change the path, you will need to add the new path and delete the old entry.

Auto Replace Keywords

There are several keywords in the templates for which Toad will automatically substitute in values when you open the templates. In addition to these, you can also specify custom keywords from Proc Templates.

KEYWORD RESULT REPLACEMENT

%YourObjectName% Object Name

%SYSDATE% Workstation date, for example, mm/dd/yyyy

%DATETIME% Workstation date and time, for example, mm/dd/yyyy hh:mm:ss am

%DATE% Workstation date, for example, mm/dd/yyyy

%TIME% Workstation time, for example, hh:mm:ss am

%USERNAME% Username specified in Toad Options, Editor node

%TRIGGEROPTS% Trigger Options for triggers only, for example, "Before insert on, for each row"

Note:

  • "*YourObjectName*" is also supported for backwards compatibility.
  • The keywords ARE NOT case sensitive.
  • The date and time formats come from the Windows Control Panel settings.
  • This feature is only in the Commercial version of Toad, not the freeware Toad.

Related Topics

Schema Browser: Procedures

Execute Stored Code from the Schema Browser

Using Templates within Packages

Proc Templates


Running SQL from within PL/SQL code

When you run something containing the @ command (such as @whereami.sql) as script in the Editor, Toad follows a hierarchy of where to look for the whereami.sql file to execute.

The hierarchy it follows is:

  1. Parent script directory (If you load scripta.sql that has an @scriptb.sql command in it, Toad first looks in the directory where scripta.sql is located.
  2. Current Editor directory (File | Open in Editor).
  3. Toad dir/User Files.
  4. SQLPATH environmental variable.


Using Templates within Packages

There are two template types that you can use only within packages. These are Package Function and Package Procedure. You can create and edit these templates from the Toad Options | Editor | Proc Templates page. See Proc Templates for more information.

Using a package function or package procedure template from the Create PL/SQL Object Window

When you choose to create a package from the Create PL/SQL Object window, Toad automatically creates the one procedure and one function to the body using the default templates. You can add additional procedures and functions fusing the following procedure:

To use a package function or package procedure template within an existing package

  1. In the Editor, load a package spec or create a new one.
  2. Enter a new declaration for a package procedure or function into the spec.

    3. Press Ctrl+Shift+C. The default package procedure or package function template is used to create a new procedure in the package body.

    Note: If you have created multiple templates, the template you want to use MUST be designated the default. Any other template will not be used.

Related Topics

Schema Browser: Procedures

Execute Stored Code from the Schema Browser

Proc Templates


Load Database Object

Use this dialog box to load an existing object into the Stored Edit/Compile window for further editing.

To load an object from the database

  1. Click [image] in the Editor window.
  2. From the Schemas/Owners drop-down:
    • Enter the first letter of the schema to perform an incremental search of the list.
    • Select the Schema/Owner of the object you want to load
    • Select the type of object you want to load from the drop-down list.
      • For databases with few objects, just select All.
      • For databases with many objects, select a type of object and then filter to show a manageable list in the left hand panel below.
  3. From the left hand panel, you can do one of the following:
    • Click an object to select it.
    • Enter the first few letters of the object you want to perform an incremental search.

      • Note: You can turn the preview off by using the Show Source checkbox.


Highlighting Statements

You can highlight bits of code so that an explain plan is run on only that code, or so that you can see what Toad is including as a part of the statement before you Execute it. Highlighting code uses the same logic as SHIFT+F9.

To highlight a SQL Snippet

» Place your cursor in the code you want to highlight and then press CTRL+H.


SQL_Plus Commands

SQL*Plus Commands

Toad does not support all SQL*Plus commands. The lists below describe the commands Toad supports, ignores, or does not support.

SQL*Plus Syntax - Supported

SQL*Plus commands supported by Toad include:

@ and @@

/ (slash) - Required as a separator between certain commands (anonymous blocks, PL/SQL, and Create Type statements)

This does not run the contents of the buffer, because Toad does not store a command buffer as SQL*Plus does.

& (ampersand)

&&(2 ampersands)

ACCEPT

BREAK/BRE

BTITLE/BTI

CLEAR

  • CLEAR SCREEN not supported
  • SQL not supported
  • BUFFER not supported

COLUMN/COL

COMPUTE/COMP

  • SUM, MIN, and MAX supported at one level of detail

CONNECT/CON and DISCONNECT/DISC

DEFINE/DEF and UNDEFINE/UNDEF

  • CONNECT IDENTIFIER not supported
  • SQLPLUS RELEASE not supported
  • EDITOR not supported

EXEC/EXECUTE

EXIT/QUIT

HOST

MERGE

PAUSE/PAU

PASSWORD

PROMPT/PRO

PRINT

REM/REMARK

REPFOOTER

REPHEADER

SET APPINFO (only changes the module name when running scripts)

SET AUTOCOMMIT

SET AUTOPRINT

SET AUTOTRACE/AUTOT (default OFF)

SET COLSEP

SET DEFINE/DEF (default ON)

SET ECHO (default OFF)

SET ESCAPE/ESC

SET FEEDBACK/FEED

SET HEADING/HEA (default ON)

SET HEADSEP

SET LINESIZE/LINES (default 80, maximum 2000)

SET LONG

SET LONGCHUNK SIZE

SET NEWPAGE

SET NULL

SET NUMFORMAT

SET NUMWIDTH

SET PAGESIZE

SET RECSEP

SET RECSEPCHAR

SET SCAN (default ON)

SET SERVEROUTPUT/SERVEROUT (default OFF)

  • ON and OFF supported
  • SIZE supported

SET SHOW

SET SQLCONTINUE

SET SQLNUMBER

SET SQLPROMPT

SET SQLTERMINATOR

SET TERMOUT/TERM (default ON)

SET TIMING

SET TRIMOUT

SET TRIMSPOOL

SET UNDERLINE

SET VERIFY

SET WRAP

SHOW

SPOOL Filename and SPOOL OFF (also SPO).

  • In Toad, non-pathed files are created in the Toad directory.
  • In Quest ScriptRunner, non-pathed files are created in the same directory as Quest ScriptRunner.
  • Supports relative spool paths
  • Like SQL*Plus, passes SPOOL file to sub-scripts

START

STORE SET

TTITLE

VARIABLE

WHENEVER OSERRER

WHENEVER SQLERROR

SQL*Plus Syntax - Ignored

These commands are ignored, but do not cause an error.

SET ARRAYSIZE | SET DESCRIBE | SET MARKUP
SET AUTORECOVERY | SET EDITFILE | SET PAUSE
SET BLOCKTERMINATOR | SET EMBEDDED | SET SHIFTINOUT
SET CMDSEP | SET FLAGGER | SET SQLBLANKLINES
SET COMPATIBILITY | SET FLUSH | SET SQLCASE
SET CONCAT | SET INSTANCE | SET SQLPREFIX
SET COPYCOMMIT | SET LOBOFFSET | SET SUFFIX
SET COPYTYPECHECK | SET LOGSOURCE | SET TAB
 |  | SET TIME

SQL*Plus - Unsupported

These SQL*Plus commands will cause a "Statement Ignored" error on the Script Output tab.

APPEND | COPY | LIST
ARCHIVE LOG | DEL | RECOVER
ATTRIBUTE | EDIT | RUN
CHANGE | GET | SAVE
CLEAR SCREEN | HELP | SHUTDOWN
CLEAR SQL | INPUT | STARTUP
CLEAR BUFFER |  |


Code Folding

Code folding lets you collapse portions of your code so that you can see more of the code you need to see. Then you can expand it when you need to work with the folded code.

Language management is the basis of code folding. Although some standards settings for code folding are included with Toad, the strength of this feature is found in the ease of configuration. You can set Toad to fold code where you want it to fold.

To enable code folding

» From Toad Options | Editors | Behavior, select Enable code folding.

To fold code selection

  1. In the Editor, select the code you want to fold or unfold.
  2. Right-click and select Fold Selection.

To fold (or unfold) all code in the Editor

» In the Editor window, right-click and select Fold all (or Unfold all).

Marking Code to Fold

You can create new areas for Toad to fold code by creating new ranges within the Language Management area. When code folding is enabled, you can then fold the code within that range.

To set a code folding range

  1. In Toad Options | Editors | Behavior | Language Management, select the type of code you want to fold, and then click [image].
  2. Click the Rules tab.
  3. Add a new Rule. When you name the rule, you may want to include Start in it, as in If start. Create another rule that will define where you want the range to end, such as If end.
  4. Click the Conditions tab, and then select the starting condition you have just created.
  5. Set up the conditions you want to use to define the start of your range. For example, Identifier = one or more tokens.
  6. Click the Properties tab.
  7. Select Range start in the rule type box.
  8. Set the range end condition to the rule where you want to end the condition.
  9. Set the style you want to display when the range is selected. In the case of If start, the default style is Current block.
  10. Select any other options you want to activate. Make changes to the Advanced tab if you wish. See Rules Tab for more information.
  11. Set the Range end condition in the ending rule you have created in the same manner, only selecting Range End as the rule type.
  12. Click Apply or OK.

Related Topics

Language Management Overview

Rules Tab


Results Grids

At the bottom of the Editor are tabs that display results of your actions within the edit window.

Depending on your Toad Edition, any of these may display results:

  • Data Grid
  • DBMS Output area
  • Script Output area
  • Script Debugging area

Data Grid

The data grid displays fetched data. The results panel contains tabs for Data, Explain Plan, Auto Trace, DBMS Output, Code Statistics, and Script Output. If you have the debugger module, you may also have the Script Debugger displayed.

A horizontal splitter between the Editor and results panel lets you size each component.

The data grid is user configurable. It includes:

  • optional movable columns
  • support for LONG and LONG RAW columns by popup windows
  • support for exporting data to disk
  • printing
  • editing data

The grid also has a right click menu for quick access to grid configuration options. If the resulting dataset is editable, several of the buttons on the grid navigator will become enabled (insert, delete, post updates, and so on).

DBMS Output

You can view the DBMS Output in the same area.

To see the DBMS output window

» In the Results area, click the DBMS Output tab.

Related Topics

SQL Results Grid

Script Debugger Overview

Export Dataset


Variables Window

The Variables window displays when you execute a statement from the Editor window, if you have specified parameters in your SQL query. For example, execute the following:

SELECT * FROM EMPLOYEE WHERE EMPLOYEE_ID =:EMPID

or the following:

SELECT * FROM EMPLOYEE WHERE EMPLOYEE_ID = &EMPID

Once the variables window comes up, select each bound variable, select the data type, and enter the desired value. Click OK to complete running the resulting SQL statement.

Note: Bound parameter substitution is NOT supported in anonymous PL/SQL blocks.

To delete a bound variable

» Select it and click Delete.

To add a deleted bound variable

» Click Scan SQL. Toad will rescan the SQL and reenter the variables.

Related Topics

Using Variables

Define New Variables


Strip Code Statement and Make Code Statement Functions

The Editor window contains two functions that simplify copying SQL statements from Toad to code development tools such as Delphi, VB, C++, Java, or Perl, and from those code development tools back to Toad. The functions

  • Strip Code Statement (CTRL+P)
  • Make Code Statement (CTRL+M)

are available from the Editor menu.

Strip Code Statement

Strips off the code development tool syntax from the SQL statement, ready to execute in Toad.

For example, taking this VB code from the VB development tool, copying it, pasting it into Toad, and running Strip Code Statement, changes the SQL statement from this:

Sql = " select count(*) as cnt"

Sql = Sql & " from all_tables"

Sql = Sql & " where owner = 'DEMO'"

Sql = Sql & " and table_name = 'EMPLOYEE'"

to this:

select count(*) as cnt

from all_tables

where owner = 'DEMO'

and table_name = 'EMPLOYEE'

Now the SQL is ready to execute in Toad.

If you have multiple SQL statements in the Editor, highlight the statement you want to strip before executing the Strip Code Statement function.

Make Code Statement

Adds the code development tool syntax to the SQL statement in the Editor and makes it ready to paste into the appropriate development tool.

When making code statements, rather than changing the code in the Editor window as the Strip Code Statement function does, the Make Code Statement function takes the currently highlighted SQL statement, translates it into the code development tool syntax, and copies it to the clipboard. You can now switch to the code development tool and paste in the results. A message displays in the status panel such as "VB statement was copied to the clipboard".

If you have multiple SQL statements in the Editor, highlight the statement you want to make before executing the Make Code Statement function.

Selecting the Code Development Tool

You select the code development tool in the View | Toad Options | Editor | Code Assist | Make Code Format box. The Make Code Format box lets you select a language syntax for Toad to convert a SQL statement into (Make Code Statement function) and out of (Strip Code Statement function). Currently, Delphi, VB, C++, Java and Perl are supported. The default selection is VB. You can also create your own language templates. See Code Assist Options for more information.


Creating Make Code Templates

You can create your own Make Code Templates. See Code Assist Options for more information about Make Code and other options.

To create a Make Code template

  1. From the Toad Options window, select Editor | Code Assist.
  2. In the Make Code area, click Add.
  3. Use the following variables to create your own language template:
    • %SqlVar% - this is the MakeCode variable entered in the Toad Options | Editor | Code Assist | MakeCodeVariable box. Using a variable here is optional.
    • %SqlLength% - This will be replaced by the number of characters in all selected SQL, on one or multiple lines.
    • %SqlText% - This is replaced by the first line of SQL you have selected.
    • %SqlTextNext% - This will be replaced by any subsequent lines of SQL you have selected. This is cumulative and includes ALL subsequent lines of SQL.

    Note: For the best output result, it is recommended that the %SqlTextNext% variable be included on a separate line. Use the left and right brace for comments.

    Remarks (such as template name) should be included in brackets.

  4. Click OK.

Examples:

Using the following SQL:

Select *

from

Employees

and using the following code templates, you will get the results below.

Template | Result
{C# Language Template} string %SqlVar%& = "%SqlText% " + "%SqlTextNext% " | string SQL = "Select * " + "from " + "employees " ;
{C++ Language Template} char %SqlVar%[%SqlLength%]; strcpy(%SqlVar%,"%SqlText%"); strcat(%SqlVar%,"%SqlTextNext%"); | char SQL[23]; strcpy(SQL,"Select * "); strcat(SQL,"from "); strcat(SQL,"employees");
{ Java Language Template } "%SqlText% " + "%SqlTextNext% " | "Select * " + "from " + "employees "

Related Topics

Strip Code Statement and Make Code Statement Functions

Code Assist Options


Aliases

Setting up table aliases lets you create shortcuts to columns of a query. You can then use the alias in a SQL statement instead of a long column name or path.

Toad Table Aliases should not be confused with Oracle RDBMS table aliases. RDBMS table aliases are used to qualify columns in a multi-table SQL statement.

You can set up and edit Toad aliases with a text editor. Aliases are stored in the aliases.txt file. See ALIASES.TXT file for more information.

Using Aliases

No ini changes are required to use aliases. Use them in the Editor by entering the alias instead of the full table name, for example:

SELECT DEPT.

and a column list will pop up for the correct Oracle table (in this case, DEPARTMENT).

If you set up these table aliases in ALIASES.TXT they will be presented on the Query Builder dialog box when you select that table to build your query.

To complete the SELECT SQL statement above, use Auto Replace Substitutions names similarly to the table aliases. These are accessible through the View | Editing Options | Auto Replace tab. See Auto Replace Substitutions for more information for more information about substitutions.See Auto Replace Substitutions for more information

See Code Completion Templates for more information about options.

Related Topics

ALIASES.TXT file

Skip Aliases

Tracking Aliases

Code Completion Templates


ALIASES.TXT file

Because aliases.txt is a text file, you can edit it manually using a text editor.

Caution: Do this when Toad is not running. Otherwise the file will be overwritten at shutdown, or whenever you save options.

You might want to manually edit the file to pre-build a list of aliases. Alternatively, you may want to edit it manually to perform maintenance on it and remove extraneous or multiple entries. Currently there is no way to do this from within Toad.

The text file that controls the alias list is found in /Toad/User Files/aliases.txt. The format of aliases.txt is as follows:

table_name=alias

>for example:

AAX_ACCESSGROUP_APPLICATION=aax

ADD_ADDENDUM=add

ADT_ADDRESS_TYPE=adt

AFP_ACTIVITY_FIRM_PARTIC=afp

AGX_APPLICATION_GROUP_ITEM=agx

DEPARTMENT=dept

Related Topics

Aliases

Skip Aliases

Tracking Aliases

Code Completion Templates


Skipping Aliases

Skip Aliases

There may be times when you have an object name that also happens to be an alias for another table. If you try to use the normal Columns Select methods, Toad returns the columns for the table to which the Alias refers. You can skip the alias and open the columns list for the object, rather than the alias.

To skip an alias

» Select Edit | Picklist drop-down no alias (CTRL+SHIFT+T).

Related Topics

Aliases

ALIASES.TXT file

Tracking Aliases


Tracking Aliases

Toad will keep track of aliases for you as you create them using SQL. Toad scans the FROM clause of a select statement to check for tables and aliases.

Note: Toad only finds the first FROM clause in any one statement. So extra tables and aliases in complex statements such as unions or subqueries will not be found.

If a table alias is found in the FROM clause of a current SQL statement, Toad will do the following:

  • For aliases already on the list, you do not need an alias defined in the FROM clause for Toad to use the columns drop-down feature.
  • If an alias is identified in the SQL statement, and a Columns Select is used on the alias, it is automatically added to aliases.txt.
  • If there is already an entry for that alias in aliases.txt, the pair defined in the current FROM clause replaces the old entry.

Related Topics

Aliases

ALIASES.TXT file

Skip Aliases

Properties Files


Save and Reuse SQL Statements

You can save SQL statements and easily insert them into the Editor at any time. The best way to save SQL statements is with the Named SQL feature.

Toad lists saved and recently executed SQL statements in the SQL Recall pane. See View Recently Executed SQL Statements for more information.

Notes:

  • If you want a quicker way to save SQL statements, you can save them as Personal SQL statements by selecting Editor | Add to Personal SQLs. This bypasses the dialog to name the SQL. However, the only way to reuse Personal statements is from the SQL Recall pane.
  • Toad stores all saved SQL in User Files\SavedSQL.dat.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To save statements from the Editor

  1. Select the statement in the Editor.
  2. Select Editor | Add to Named SQLs.

  3. Enter a name for the SQL statement.

    Note: The name is case sensitive. For example, you can save both "sql1" and "SQL1".

To use a saved statement in the Editor

  1. Select one of the following options:
    • Press CTRL+N in the Editor and select the statement from the pick list.
    • Enter ^MyNamedSQL in the Editor, where MyNamedSQL is the name of your saved SQL statement. Toad replaces the SQL name with the saved statement at execution.
    • Double-click or drag the statement from the SQL Recall pane.

To view saved statements

» Select View | SQL Command Recall | Named.

To edit statements in the SQL Recall pane

» Select a statement and click [image] in the SQL Recall toolbar.


View Recently Executed SQL Statements

Toad saves recently executed statements in the History tab of the SQL Recall pane. This list is organized with the most recent SQL at the top by default. You can select a statement from this list and run it, save the statement for easy recall, or remove a statement from this list.

The SQL Recall pane also lists your saved SQL statements in the Named and Personal tabs. See Save and Reuse SQL Statements for more information.

Notes:

  • You can change the number of statements that SQL Recall saves in the History (500 is default) or save only SQL statements that executed successfully. You can select these options and other SQL Recall settings on the Code Assist options page. See Code Assist Options for more information.
  • The SQL Recall pane can be docked, pinned, or hidden.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To view previously executed SQL statements

» Select View | SQL Command Recall | History (F8).

Tip: You can also press ALT+UP ARROW or ALT+DOWN ARROW in the Editor.

To open SQL statement directly in the Editor

» Double-click or drag the statement from the SQL Recall pane.

To save statements in the History tab

  1. Select a statement and click [image] in the SQL Recall toolbar.
  2. Select Named in the Type field and enter a name for the statement in the Name field.

To edit statements in the SQL Recall pane

» Select a statement and click [image] in the SQL Recall toolbar.


Toad Insight Pick List Shortcuts

There are a variety of shortcuts you can use to display the pick list and make a selection. Toad also provides options for you to customize the pick list behavior. See Code Assist Options for more information.

General | Description

CTRL+T

Display pick list for object (name) at caret. If a stored alias exists by that name, then that alias' object is shown in the pick list.

CTRL+SHIFT+T

Display pick list for object (name) at caret. This option ignores aliases with the same name.

LEFT ARROW

Move the caret left while filtering the pick list.

RIGHT ARROW

Move the caret right while filtering the pick list.
Make Selection | Description

Double-click the selection

Insert the selection and close the pick list.

ENTER

Insert the selection and close the pick list.

PERIOD

 Insert the selection and a period after it. The pick list remains open and displays child objects, if there are any.

SPACE

 Insert the selection and a space after it.

TAB

Insert the a partial selection if possible and leave the pick list open; if a partial selection is not possible, insert the selection and close the pick list.

TAB accepts as much as possible without changing the list of displayed objects. For example, if the pick list displays a list of columns that all start with MY_COL, Toad would insert MY_COL when you press TAB and leave the picklist open. If the columns did not have a common preface, Toad would insert the selected column and close the pick list.

(

OPEN PARENTHESIS

 Insert the selection and "(" after it.
Close Pick List | Description

Click outside the pick list

Close the pick list without making a selection.

ESC

Close the pick list without making a selection.

Related Topics

Display Pick List (Automatically Complete Code)


Change Current Schema

The Current Schema drop-down lets you work with a schema other than the one to which you are connected. This can be useful if, for example, you have tested a SQL statement in your test schema and now want to execute it on several other schemas without disconnecting and reconnecting.

By default, the current schema is set to your current connection. When you use this drop-down, Toad issues an ALTER SESSION SET current_schema command. After you execute, Toad issues the ALTER SESSION SET current_schema command again to return to the original connection schema.

Note: You must have the ALTER SESSION system privilege to use this feature. If you do not have the privilege, the drop-down is disabled.

To change the current schema

» Select a different schema in the Current Schema toolbar.

Change the Schema in Scripts

The Current Schema drop-down does not work with script execution or debugging commands. However, because Execute as Script is designed to mimic SQL*Plus, you can use a set schema command to change the schema.

To change the schema in scripts

» Include the following command at the beginning of your script:

ALTER SESSION SET current_schema = "USERNAME"


Describe Objects

You can use the Describe Objects feature anywhere in Toad to find objects and display their information in the Describe Objects window. The Describe Objects window displays the same information you would see in the right-hand side of the Schema Browser.

Note: You can describe many objects types through database links. However, the following object types are not supported: policy, policy group, java, refresh group, resource groups/plans, sys privs, and transformations.

To immediately describe the object

  1. Select the object and press F4.

    Tip: You can also right-click the object and select Describe.

  2. If multiple objects have the same name, select the appropriate object from the Multiple Object Found window. (This only applies to the object types in DBA_OBJECTS.)

To specify the object schema and name before describing the object

  1. Press CTRL+D to open the Quick Describe window.
  2. Enter the object name in the Object Name field. You can complete the rest of the fields to refine your search. These fields are helpful when multiple schemas may contain objects with the same name, or when different object types have the same name (for example, a SYSTEM user and table).
  3. Click Describe and Close to open the object in the Describe Objects window and close the Quick Describe window. If you click Describe instead, the Quick Describe window remains open.

Related Topics

Editor Behavior Options

Object Palette


Format Code

You can have Toad format your code from the Editor. Click here to view part of a script before and after formatting.

Before

After

You can customize how Toad formats the code, such as inserting spaces instead of tabs or changing the case for SQL commands. See Formatting Options for more information.

Notes:

  • In version 9.7, the Formatter component was replaced with a new component that supports Oracle 10g and 11g functionality. Some formatter options have moved or changed slightly. See Changes in the Formatter for more information.
  • Format multiple scripts at one time from the Project Manager. See Format Files for more information.

To format a statement

» Select the statement you want to select and click [image] on the Edit toolbar.

To format an entire script

» Click [image] on the Edit toolbar.

Tip: You can also right-click the script and select Formatting Tools | Format Code.


Find Closing Block

Closing blocks are controlled by the Language Management options. You can turn the staples (brackets) on and off to mark them. See Rules Tab for more information about Draw Block Staple.


Display Pick List (Automatically Complete Code)

The Toad Insight feature helps you write code by displaying a pick list with relevant object or column names. For example, if you start typing SYS and invoke the pick list, the SYSTEM user would be included in the pick list:

Toad provides options for you to customize Code Insight's behavior, such as adjusting the length of time before the pick list displays. See Code Assist Options for more information.

To display the pick list

» Press CTRL+T, or begin typing a name and pause 1.5 seconds.

Note: There are additional shortcut keys you can use with Toad Insight. See Toad Insight Pick List Shortcuts for more information.


Edit: Popup Menu

Popup Menus

You can access additional commands for a window or pane by right-clicking in the area.

You can also press F10 to access these menus.


Swap This/Prev Lines

Edit: Swap This/Prev Lines

The Edit | Swap This/Prev Lines menu item switches the line your cursor is on in the SQL script with the previous line.

For example, if the cursor is on Line 8, then when you swap, what was on line 8 would now be on line 7 and what was on line 7 would now be on line 8.


Edit: Toggle Fullscreen Editor

You can expand the Editor to fill the entire screen, hiding all other desktop panes. The fullscreen Editor does not affect windows such as the Object Palette or Code Snippets.

To toggle the Fullscreen Editor

» Select Toggle Fullscreen Editor (F2) from the Edit menu.


Change Text to Upper or Lower Case

To change the selection to Upper Case

» Click the Edit | Upper Case menu item (CTRL+U).

To change the selection to Lower Case

» Click the Edit | Lower Case menu item (CTRL+L).

Capitalization Effects that you have set up in the Toad Options can override your Upper Case and Lower Case conversions. See Highlighting Tab for more information.

Related Topics

Language Management Overview

Syntax Highlighting


View Code Statistics

Toad can provide you with some basic statistics about your code.

Note: Because of the way the parser counts lines, the number of lines of code and blank or comment lines may vary. Use these statistics as an estimate rather than an exact count.

To view formatting statistics

  1. Open the code in the Editor.
  2. Right-click and select Formatting Tools | Profile Code.


Editor Macros

You can record and play limited macros in the Editor with the built-in macro recorder and Editor. Only commands that are Editor-specific can be included in a macro. Commands that are available for use in macros can be seen from the Macro Configuration dialog.

Use the macro toolbar to select macro functionality.

To record a macro

  1. From the macro toolbar, click
  2. Perform the actions you want to compose the macro.
  3. Click
  4. Enter a name for your macro.
  5. Click OK.

Related Topics

Macro Configuration


Macro Configuration

You can edit your macros to add or delete commands or text. You can also use the macro editor to create new macros from scratch, and to delete macros that you have created.

The macro editor is divided into two areas: a list of Macros, and the Commands area, which provides the specifics for the selected macro. This second area is where you will do your editing.

To edit a macro

  1. On the macro toolbar, click [image].
  2. In the Macros list, select the macro you want to edit.

    3. Add commands to the macro by clicking Add and then entering the appropriate information in the columns.

    Note: Commands will always be added at the end of a macro. You can place them in the correct location by selecting them and then clicking the Move Up button.

  3. Delete commands by selecting the column you want to delete and clicking Delete.
  4. Move commands up and down in the list: Click the Up and Down arrows.
  5. When you have finished editing your macros, click OK to save them and close the window.

Viewing Possible Macro Commands

Commands that can be used within macros are limited. You can view a list of these commands and select from them when editing a current macro or creating a macro from scratch in the Macro Configuration dialog.

To view macro commands

  1. Click [image] .
  2. In the command grid of either a new macro or an existing one, click in the Description field of a command.
  3. When the drop down menu displays, click the arrow to open the list of commands.

    4. Select a command and it displays in the grid.

    Note: This will change the command that is already in that box.

Related Topics

Editor Macros


Extract Procedures

You can extract a procedure from existing code into a new stored procedure or locally defined procedure.

Creating the new procedure and call depend heavily on the parser to determine which identifiers in the text selection must be declared as parameters in the new procedure. If Toad cannot parse the code, no extraction occurs.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To extract procedures

  1. Select the code you want to extract in the Editor.
  2. Right-click and select Refactor | Extract Procedure.
  3. Select a procedure type.

    4. Note: If you select stored procedure, you can choose to either include the "CREATE OR REPLACE" in the DDL instead of just "CREATE".

  4. Enter the procedure name.

    Tip: The new procedure and the resulting procedure call are created an inserted so that the code is syntactically correct, but no formatting is done to the code. You can have Toad format the code by pressing SHIFT+CTRL+F.


Comment Out Code Block

These commands add or remove comments from the selected block of text by adding or removing "--" from the beginning of each line.

To comment code

  1. Select the code block.

  2. Right-click and select Refactor | Comment Block.

    Tip: You can also press CTRL+B.

To uncomment code

  1. Select the code block.

  2. Right-click and select Refactor | Uncomment Block.

    Tip: You can also press SHIFT+CTRL+B.


Find Unused Variables

Toad can find unused variables and identifiers in PL/SQL with code refactoring. If Toad find unused variables, it displays the variables and lets you jump to the occurrence in the Editor.

Notes:

  • Toad only searches the object in the Editor, and does not evaluate other PL/SQL objects that may reference it. Be careful when removing unused variables from package specifications, as they maybe be referenced in other PL/SQL that is not searched.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To find unused variables

  1. Right-click code in the Editor.
  2. Select Refactor | Find Unused Variables.


Rename Identifiers

You can easily rename identifiers (variables, parameters, or PL/SQL calls) for PL/SQL in the Editor with code refactoring.

Notes:

  • Toad only searches the PL/SQL object in the Editor. Be careful when renaming identifiers in package specifications, as they maybe be referenced in other PL/SQL that is not searched.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To rename identifiers

  1. Right-click an identifier in the Editor and select Refactor | Rename Identifier.
  2. Enter the new name in the Name field.


Code Snippets

Use this dockable window to look up or copy Oracle SQL functions into any of the editors within Toad.

The xml file associated with these items are located in the file: Documents and Settings | Username | Quest Software | Toad for Oracle | versionnumber | User Files | Templates.xml.

To use Code Snippets

  1. From the View menu, select Code Snippets.
  2. Select a category of code from the box at the top of the window.
  3. Select the code from the list. You can:
  4. View a description of the code in the area below the code list
  5. Double-click the code to insert it into the active editor tab
  6. Drag and drop code into the editor

To Edit Code Snippets

  1. From the Toad Options window, select Editor | Code Assist.
  2. In the Code Snippets area, select the category of snippets you want to edit and then click Edit.
  3. Select the snippet you want to edit, and click Edit.
  4. Edit the Oracle Function or the description and click OK.

To Add Code Snippets to an existing category

  1. From the Toad Options window, select Editor | Code Assist.
  2. In the Code Snippets area, select the category of snippets and then click Edit.
  3. Click Add.
  4. Enter the code in the Oracle function box.
  5. Enter a description in the Description box.
  6. Click OK.

To Add Code Snippets to a new category.

  1. From the Toad Options window, select Editor | Code Assist.
  2. In the Code Snippets area, click Add.
  3. Enter a category name in the Category box.
  4. Enter the code in the Oracle function box.
  5. Enter a description in the Description box.
  6. Click OK.


Highlight Snippet

To highlight a snippet

  1. Place your code in the snippet you want to highlight.
  2. From the Editor menu, select Highlight Snippet (CTRL+H).


Query Describe

Describe (Parse) Select Query

Use this function to see what columns would be returned IF the query were executed.

To describe a query

» From the Editor menu, select Describe (Parse) Select Query (CTRL+F9).

This will pop up a window listing all column names, data types, and data lengths of the columns that would be returned from the query IF it were executed. This is useful for tuning a LONG query before it is executed.


Automatically Back Up the Editor

You can have Toad automatically create backups of your Editor files using a temporary filename. If Toad closes abnormally, you are prompted to recover or discard backups when you next open Toad. Auto backup is automatically enabled, with a backup interval of every 3 minutes. See Editor Behavior Options for more information.

You can also use this feature to recover documents manually.

To recover documents from the menu

» Select File | Recover Documents.


About Debugging

You can debug PL/SQL, SQL scripts, and Java in Toad. Toad's documentation includes tutorials on how to debug. See Debugging a Procedure or Function Tutorial for more information.

Notes:

  • There are minimum Oracle database requirements for using this feature. See Minimum Oracle Database Requirements for more information.
  • The debugger is not designed to work with word-wrapped lines, since the Editor will then have a different set of line numbers than what is stored in Oracle. Toad provides a warning message about this if you open the procedure Editor while word-wrapping is enabled. To disable word-wrap, select View | Toad Options | Editor | Behavior and clear Word wrap.

Types of Debugging

Debugging in Toad requires you to select one type of debugging at a time for all database instances open per instance of Toad. For example, if you have three database connections in one instance of Toad, they must all be in the same debugging state. If you then opened another instance of Toad, with the same or different connections, they could be in a different debugging state. Review the following about the debugging types:

DBMS Debugger

Debugs PL/SQL. Using the Debugger, you can set breakpoints, watches, and see call stacks. In addition, you can view DBMS output.

Note: When using the PL/SQL Debugger and connecting to a RAC instance, you must have the TNSNAMES entry for the instance with the server directed the use connection or session here. Or, you must connect directly to an instance of the cluster without letting the server assign an instance.

JDWP Debugger

Debugs Java. The JDWP debugger uses the same basic user interface as the PL/SQL debugger. Because it uses the Oracle package DBMS_DEBUG_JDWP in place of the DBMS_DEBUG package to access the debugging features, it is entirely Oracle-oriented. This means that there are Oracle-imposed limitations on the debugging procedures you can use through Toad.
Script Debugger

Debugs SQL scripts. You can set breakpoints, run to cursor, step over, trace into, and halt execution of your scripts.

You can also use Toad's Auto Debugger, which automatically inserts DBMS_OUTPUT.PUT_LINE statements into the DDL. Once you compile the code and inspect the contents of the DBMS_OUTPUT buffer, you can remove all instances of DBMS_OUTPUT.PUT_LINE with the click of a button. See Automatically Insert DBMS_OUTPUT Statements (Auto Debugger) for more information.

Compile with Debug Information

To use the debugger fully with PL/SQL or Java packages, you need to compile your object with debug information. If you have not compiled with debug information, in databases in versions before 10g you can step into a unit, step over and so on, but you cannot see watches unless the object is compiled with debug. In a 10g database you cannot step into code or step over unless the object was compiled with debug. You can only execute.

In addition, if you are debugging an object that has dependent objects, you cannot step into the dependents unless they, too, are compiled with debug information. See Dependencies and References for more information.

To enable compile with debug

» Click [image] on the main toolbar or select Session | Toggle Compiling with Debug.

Note: You can have Toad enable Toggle Compiling with Debug by default for each new session. See Execute and Compile Options for more information.

Related Topics

Minimum Oracle Database Requirements

Script Debugger Overview

Java Debugger Overview

CodeXpert Overview


Automatically Insert DBMS_OUTPUT Statements (Auto Debugger)

Auto Debugger is a feature that automatically inserts and removes DBMS_OUTPUT.PUT_LINE statements in PL/SQL. This feature is helpful because many developers like to debug their applications through DBMS_OUTPUT, but inserting and removing the DBMS_OUTPUT statements can be tedious. Toad inserts the output statement throughout your program for each of the following conditions:

  • After program entry points
  • Before all program exit points (including the final END and any RETURN statements)
  • After variable assignments
  • After calls to other PL/SQL (excluding calls to DBMS_OUTPUT)
  • After selects that fetch values into variables (select count(*) into variable from table)

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Notes:

  • Toad does not automatically compile the object on the database when you use the Auto Debugger. It only inserts or removes DBMS_OUTPUT statements in the DDL.
  • Toad also offers more advanced debugging options for PL/SQL, SQL scripts, and Java. See About Debugging for more information.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To use the Auto Debugger

  1. Open the PL/SQL in the Editor.

  2. Click [image] on the Editor toolbar. Toad inserts code blocks with the output statements.

    Important: Do not remove the start and end comment tags in the code block, as Toad uses them to remove the output statements.

    Tip: You can also right-click in the Editor and select Debug | Apply Auto Debugger.

  3. Execute the program.

  4. Review the DBMS Output tab.

    The Auto Debugger output displays on its own tab, separate from any other DBMS output. If you double-click a line in the DBMS Output, Toad navigates to the appropriate line of source code as long as the PL/SQL object that generated the output is in the active Editor tab.

  5. When you are finished, click [image] to have Toad remove the DBMS_OUTPUT statements it inserted.


Troubleshooting the Debugger

In any case of trouble with Toad not working as you believe it should, try checking the Toad Advisor for information. Toad is self-diagnosing and can warn you of missing privileges, as well as Toad settings that can make working much easier. See Toad Advisor for more information.

General debugging problems

General debugging problems can often be avoided by double-checking that the database meets the Minimum Oracle Database Requirements. See Minimum Oracle Database Requirements for more information.

Debugger menu is disabled (grayed out)

The debugger menu will be disabled if you do not have Oracle debugging privileges. You must have access to the DBMS_DEBUG Oracle package.

Debugger runs very slowly

The option "Show executable line indicators in gutter" places blue dots in the gutter beside every executable line of code and may slow down the debugger.

If your debugging is going slowly and these dots are displayed, go to View | Toad Options | Editor | Debug and uncheck this option. See Debugger Options for more information.

Debugger highlighting comment blocks

When you have a comment block before the CREATE statement, it is stripped out and not stored on the server. Therefore the code that is visible on the screen is not the code that is actually running.

If you want to preserve the comment block and have it work correctly with the Debugger, you need to move the comment block to after the CREATE statement.

Exception in Anonymous Block - PLS-00302 error

There is an Oracle limitation that causes the Debugger to fail if the user has an object named the same as their user name. So for example, if the user JSMITH has a table named JSMITH, he will not be able to debug it, or any other object named JSMITH.

When you attempt to step into code containing this situation, an exception in the anonymous block occurs that includes a PLS-00302 error. Toad displays an error message similar to the following:

Note: A public synonym that is the same as the user name could also cause this error.

Recommended actions (do one of the following):

  • Rename or delete the object
  • Edit the schema name out of the anonymous block in the Set Parameters window before debugging.

Debugger doesn’t recognize complex datatypes

Toad can only watch complex datatypes that are supported by Oracle. Because Toad queries Oracle for all watches, if Oracle cannot watch a variable, Toad cannot watch it either. This effectively means that sometimes a complex datatype can be watched, and sometimes it cannot, depending on how Oracle interacts with the variable passed to it.

Formatter Error

If you received a warning on startup that the Formatter dll wasn't found or that you have the wrong version of the Formatter dll, the Debugger's functionality will be impaired in this way.

Update the Formatter dll to the correct version.

Toad locks when debugging

When using both the Debugger and the small OCISPY utility at the same time, Toad will lock. Close OCISPY and run the Debugger alone.


Minimum Oracle Database Requirements

For all databases, you must have the Oracle Probe API v2.0 or later installed in order to debug PL/SQL using Toad.

To check the Oracle Probe API version

  1. Make sure a package called DBMS_DEBUG exists in the SYS schema.

    2. To find out what version of the Probe API you have, run the following anonymous PL/SQL block in the SQL editor with a DBMS Output window tab selected:

    declare

    probe_major_ver varchar2(10);

    probe_minor_ver varchar2(10);

    begin

    dbms_debug.probe_version(probe_major_ver, probe_minor_ver);

    dbms_output.put_line('MAJOR='| | probe_major_ver);

    dbms_output.put_line('MINOR='| | probe_minor_ver);

    end;

    If the DBMS Output window displays:

    MAJOR=2

    MINOR=2

Then the version of Oracle Probe API is 2.2.

Issues with Database versions

The Debugger works on the following database versions with the following caveats:

Database Version Notes

Oracle Version

Notes

Oracle 8

BLANK_TRIM requirement also refers to databases 8.0.4 and 8.0.5.The PL/SQL Debugger works without issues on Oracle8 databases.

Oracle 8i & 9i

No special privileges are required to debug PL/SQL in your own schema, but to debug objects owned by other users, your user must have been granted the following privilege:

  • CREATE ANY PROCEDURE

Oracle 9iR2

In order to debug with Oracle9i Release 2, your user must have been granted the following privileges:

  • DEBUG ANY PROCEDURE
  • DEBUG CONNECT SESSION

Additionally, code must be compiled in INTERPRETED mode (not in NATIVE mode). Compiling PL/SQL in NATIVE mode is new with Oracle9i Release 2. This is set in the init.ora file, and INTERPRETED is the default mode.

Oracle 10g & 11g

You must have the DEBUG CONNECT SESSION privilege, or Oracle will not let you use DBMS_DEBUG.

ADDITIONAL NoteS

  • You cannot use the Evaluate/Modify window to change argument values.
  • Watches on package variables are only allowed for Probe v2.2 or higher.


Debugging on a RAC

During debugging, Toad creates two background sessions for handling debugger calls: target and debug sessions. These sessions MUST be on the same instance as the main Toad session.

Requirements:

  • Have an additional entry in your TNSNames.ora file for the connected instance.

    Or

  • Connect directly to an instance of the cluster without letting the server assign one.

Toad accomplishes debugging as follows:

  • Queries the data dictionary to find the current instance name
  • Searches the TNSNames.ora file for the first entry that matches SERVICE_NAME or INSTANCE_NAME.
  • Uses the secondary TNSNames entry when creating the background debugger sessions.


Start Debugging

You can debug PL/SQL objects in the Editor. When you open a complete package or type in the Editor, the spec and body open in separate tabs by default. However, Toad provides options to control how objects are split, reassembled, and saved. See Editor Options: Open/Save for more information.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To start the Debugger

  1. Open a PL/SQL object in the Editor.

    Note: The object must be compiled with debug ( [image]) enabled.

  2. Compile the object on the database.
  3. Select one of the following options on the Execute toolbar to begin debugging:
    • Execute PL/SQL with debugger ( [image])
    • Step over ( [image])
    • Step into ( [image])
    • Run to cursor ( [image])


Stopping the Debugger

If you are debugging a long procedure, you can stop the debugger while it is working.

To stop the Debugger while it is debugging

  1. Click [image].

    The status panel will reset from "Running" to "Idle".

  2. When you have finished debugging your PL/SQL code, discard the debug symbol table: compile it again by pressing F9.


Debugger - General Options

General Options

All these option settings are saved in TOAD.INI and restored the next time Toad is opened. See Debugger Options for more information.

To change options for debugging

» From the View menu, select ToadOptions, and click Debugger in the left panel. A list of options displays in the right panel.


Setting Parameters

Set Parameters

Some PL/SQL has variable parameters that need to be set before you can run the code. If values for these variables are not set, an Oracle error may display when you run the code.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To set parameters

  1. Click [image] on the Execute toolbar.

    or

    Select Debug | Set Parameters.

  2. Enter any necessary values in the Arguments grid.
  3. Select the Options tab to specify how you want output displayed. Review the following for additional information:
    4. REF CURSOR/Collection Results Select one of the following...

    Do not output results

    Select this option to prevent Toad from sending the results to the DBMS Output window.

    Print to DBMS Output (char/number columns only)

    Select to fetch data from the ref cursor and print it to DBMS output one row per line. You can also select the following options:

    • RPAD columns to a width of N characters—Select to modify the generated code to apply the RPAD() function to all values printed to DBMS output, passing the user-specified width. This will not only right-pad values with spaces, but also truncate values longer than the given width.
    • Fetch no more than N rows per cursor—Limits the number of rows fetched. Applies to both DBMS output and table options.

    Note: DBMS_output_print_line() will raise an exception if a line is more than 255 characters long. This option will only print values of char/number datatypes. For other datatypes, the name of the datatype is printed in square brackets.

    Load into grid from memory (strong and weak)

    Select to load the REF CURSORS output into a data grid.

    Tip: Use the and Procedure Source Code tab to view the original source code.
  4. To rebuild the code and see the variables, click [image].
  5. To execute the code in Quest ScriptRunner, click [image]. This button is enabled unless you have selected the return REF Cursor results from memory option. See Execute Scripts with Quest ScriptRunner for more information.

Related Topics

Execute and Compile Options


Dependencies and References

You can use the Debugger to check for dependencies, and compile them.

Manually compiling dependent & referenced objects

To compile dependencies manually

» Click [image] or its drop-down on the debug toolbar and select the appropriate option.

Automatically Compiling Dependent Objects

Toad can automatically compile any procedures that call the current procedure.See Debugger Options for more information..

To set options to handle dependent objects

  1. From the View menu, select Options.
  2. In the left pane, select Debugger.
  3. In the Compile Dependencies area, select one of the following:
    • Yes - Toad will always compile dependencies.
    • No - Toad will never compile dependencies.
    • Prompt - Toad will check for dependencies and ask if you want to compile them.

Viewing Dependencies and their Status

You can visually view dependencies and their status.

To view dependencies and references

  1. From the Schema Browser, objects panel, click the Procedures, Functions, or Packages tab.
  2. Select the procedure you are debugging, then in the details pane, click the Deps(uses) and Deps (used by) tabs. Status of the procedure is listed in the Status column in the details pane as valid or invalid.


Preparing PL/SQL Code for Production

When you have finished debugging your PL/SQL code, the debug symbol tables are left in the code. This makes your code larger and can slow performance. To eliminate this issue, compile the code and its dependencies and references one last time without debug information.

To compile without debug information

  1. On the main toolbar, turn the debug toggle [image] button to the off position (not depressed).
  2. Compile the code. This recompiles without the debug symbol tables.


Debugging Types

At some point, you may find you need to debug a type body. Although the Debugger does not support loading a type body into the Editor and pressing "Run" to debug it, you can debug type bodies indirectly as described below.

To debug type bodies indirectly

  1. Call the type body from a procedure.
  2. When you debug the procedure, step into the code for the type body as well.


Java Debugger Overview

The JDWP debugger uses the same basic user interface as the PL/SQL debugger. Because it uses the Oracle package DBMS_DEBUG_JDWP in place of the DBMS_DEBUG package to access the debugging features, it is entirely Oracle-oriented. This means that there are Oracle-imposed limitations on the debugging procedures you can use through Toad.

With the Toad Java debugger, you can:

  • Create Java Source in the Editor window.
  • Step into Java code.
  • Set breakpoints in Java code.
  • Watch values of Java variables.
  • Profile code.

Related Topics

Getting Started with the Java Debugger

Setting Breakpoints in the Java Debugger

Setting Watches

Stepping into Java Code

Troubleshooting Java Debugging


Getting Started with the Java Debugger

Before you can work with the Java debugger, you need to configure Toad to work with Oracle's Java Debugger. See Java Debugger Overview for more information.

To prepare to debug Java code

  1. Be sure you are running Oracle 9.2 or higher.
  2. Confirm that the debug package DBMS_DEBUG_JDWP is present and in a valid state.

If it is not, then:

  1. Logon as SYS
  2. Run the dbmsjdwp.sql and prvtjdwp.plb scripts, located in the $ORACLE_HOME/rdbms/admin directory.
  3. From the Toad Main menu, select View | Toad Options, and in the left side, click Debugger.
  4. In the Debugger area, select JDWP.

    5. Include configuration information as described below:

    Host | This must be an IP address (of any machine that has the Oracle client 9.2 or above installed) or the name of your local machine. It will function as the debugger host during a debugging session
Port | Choose a TCP port for the Toad Debugger to listen to. Leave this value as Use any available to make Toad pick one for you.
Allow stepping into Java Source | On some platforms stepping into Java code may cause the debugger to hang. This checkbox was introduced to prevent this from occurring. Uncheck this checkbox if you are experiencing such problem to continue debugging your PL/SQL code.
Enable DBMS_JAVA | By default, System.out.* java calls do not display locally. In order to redirect this output to the DBMS_OUT, a call to DBMS_JAVA must be used with the appropriate buffer size. Check this option if you desire to send System.out.* java calls to the DBMS Output window.

Related Topics

Java Debugger Overview

Setting Breakpoints in the Java Debugger

Setting Watches

Stepping into Java Code

Troubleshooting Java Debugging


Stepping into Java Code

Using the Java Debugger, you can step into Java code for debugging. See Java Debugger Overview for more information.

To step into code

Press SHIFT+F7 to step through the code.

Troubleshooting

Determine that the Java debugger is selected

To determine if Java debugging is set

» From the Debug menu, make sure that JDWP debugger is selected.

Oracle debugger hanging

On some platforms, stepping into code may make the Oracle debugger hang. If this is the case, you will not be able to step into Java code.

To continue debugging

» From Toad Options | Editor | Debugging, uncheck the Allow stepping into Java Source box.

Related Topics

Java Debugger Overview

Getting Started with the Java Debugger

Setting Breakpoints in the Java Debugger

Setting Watches


Troubleshooting Java Debugging

The Java debugger uses the same basic user interface as the PL/SQL debugger. Because it uses the Oracle package DBMS_DEBUG_JDWP to access the debugging features, it is entirely Oracle-oriented. This means that there are Oracle-imposed limitations on the debugging procedures you can use through Toad.

General Limitations

The Java debugger does not support triggers.

Toad can only watch complex datatypes that are supported by Oracle. Because Toad queries Oracle for all watches, if Oracle cannot watch a variable, Toad cannot watch it either. This effectively means that sometimes a complex datatype can be watched, and sometimes it cannot, depending on how Oracle interacts with the variable passed to it.

Oracle 9iR2 Issues

The debugger package (DBMS_DEBUG_JDWP) was first released with Oracle 9iR2. In this release there are some limitations.

Stepping into Code

When the debugger steps into Java source, sometimes ORA-03113 errors will be generated by the database.

To continue debugging

» From Toad Options | Editor | Debugging, clear the Allow stepping into Java Source box.

Note: You will not be able to step into Java Source code with this box cleared.

Oracle 10g Issues

Debugger jumps over bulleted lines of code

On a Windows server, the debugger may jump over bulleted lines of code in the Java Source. There is no known work around at this time.

Debugger gutter line execution bullets not visible

In JDWP debugging, the line map cannot be retrieved until the debugger is called and initialized. This will keep the gutter bullets from displaying until debugging or execution starts.

Directing Output to the DBMS Output window

On a line that uses the dbms_java.set_output command, if you are using 9iR2 on a Windows OS, Oracle may return ORA-3113 errors.

When you trace into code that calls the DBMS Output window, errors are generated.

Tracing into System.out.println

Tracing into System.out.println can generate ORA-3113 errors.

Oracle 11g Issues

Debug information isn't included in Java Stored Procedures

  • Starting with 11g, Oracle has gone to using a just-in-time compiler for java. Because of this, when a java stored procedure is compiled, debug information is not included. In order to debug into a java stored procedure (or set breakpoints), the following command has to be issued:

    ALTER SYSTEM SET JAVA_JIT_ENABLED = FALSE;

    Caution: This alters the SYSTEM, not the session and leaving the just-in-time compiler disabled could adversely affect database performance. When you have completed debugging, reset the parameter to TRUE.

  • In addition, Oracle does not recognize that the JIT compiler has been disabled until you step into the Java code. Because of this, you cannot set breakpoints until Toad steps into the Java source.

  • To verify the setting, execute the following statement with F5.

    SHOW PARAMETER JAVA

Related Topics

Java Debugger Overview

Getting Started with the Java Debugger

Setting Breakpoints in the Java Debugger

Setting Watches

Stepping into Java Code


Script Debugger Overview

The Script Debugger is an extension to the Editor that you can use to debug short scripts. Using the Script Debugger, you can do the following in addition to standard Editor functions:

  • Set Breakpoints
  • Run to Cursor
  • Step Over
  • Trace Into
  • Halt Execution

Note: Standard source control fully integrates with the Script Debugger. However, you cannot use Team Coding with the Script Debugger.

To use the Script debugger

» From the View | Toad Options window, select Debugger | Debugger | Script.

To commit changes

» Click [image] on the main toolbar. This will commit changes in both sessions.

Related Topics

Quest Extensions

Navigator


SD_Quest Extensions

Quest Extensions

Quest Extensions are extensions to the scripting, used to control script output within Toad's Script Debugger.

Quest extensions reside within remarks, and are designated by $QX. $QX must be the first thing inside the remark. $QX is not used in remarks in PL/SQL blocks or EXECUTE statements, only in separate script remark statements.

You can easily turn off display of grids within the Script Output tab by using a Quest Extension.

To hide grids

» In a remark, enter the following command:

$QX $GRID HIDE

All grids generated by the script from that line forward are hidden until after the line you display them again as described below.

To show grids

» In a remark, enter the following command:

$QX $GRID SHOW

All grids generated by the script from that line forward will be displayed.

Related Topics

Script Debugger Overview

Navigator


REF CURSOR Results Window

You can have Toad send REF CURSOR results to a tab in the Output area.

When a debug session terminates, this window displays each table that was created for REF CURSORS for the Create and write to table option described in Setting Parameters. (See Set Parameters for more information.) Each table is shown in a grid on a separate tab in the window.

The grid supports all the usual popup editors, but it is a read-only query.

To access the Ref Cursor tab

If you cannot see the Ref Cursor tab at the bottom of the Editor, try one the following:

  • In the bottom of the Editor, right-click and select Desktop Panels | REF CURSOR Results.
  • If REF CURSOR results is already checked, then you may need to scroll through the tabs by clicking one of the navigation arrows beside the tabs.

Troubleshooting

The REF CURSOR window has the following limitations:

  • Works only with strongly-typed REF CURSORs.
  • Works only when the REF CURSOR type is declared in a package belonging to the currently logged-in user.


Debug DBMS Output

When debugging in the Editor, a DBMS Output window automatically displays the results of "DBMS_OUTPUT.PUT_LINE()" statements in the Editor. You can use Toad's Auto Debugger feature to automatically insert DBMS_OUTPUT statements where applicable and remove them when done. See Automatically Insert DBMS_OUTPUT Statements (Auto Debugger) for more information.

You can also edit the DBMS Output content to make comments, delete specific lines of output, and so on. The standard copy, cut, and paste keys also work in the DBMS Output box.

Note: Output only displays after the procedure has completed execution, not while you are single stepping through the code. In the case of nested procedure calls, all procedures must have run to completion before any DBMS Output content is displayed.

Enabling or Disabling DBMS Output

You can enable or disable DBMS Output so that it does not display in the DBMS Output window.

To enable or disable DBMS output

» At the top of the DBMS Output window, click the Enable/Disable toggle button:

Related Topics

DBMS Output Window

Polling for DBMS Output


Breakpoints Window

Breakpoints are markers in your code where you want to stop execution during debugging. The breakpoints window displays as a tab in the desktop panel beneath the main Editor window. If you cannot see the Breakpoints tab, you may need to add it to your desktop.

From the Breakpoints window, you can easily work with your breakpoints. You can select from the toolbars on the window itself, or you can use the right-click menu to access more functions.

To add the breakpoints tab to your desktop

» Right click in the desktops area and select Desktop Panels | Breakpoints. The breakpoints tab displays.

To open the breakpoints window

» In the desktop area, click the Breakpoints tab.

Breakpoints Window Toolbar

The toolbar on the Breakpoints window has several buttons that allow you to easily access breakpoint commands.

Button | Command
 | Edit Breakpoint – opens the edit window for the selected breakpoint
 | Add Breakpoint – adds a breakpoint at the cursor
 | Delete Breakpoint – deletes the selected breakpoint
 | Enable Breakpoint – enables the selected breakpoint
 | Disable Breakpoint – disables the selected breakpoint
 | View Source - places the cursor on the line of source referenced by the selected breakpoint and marks it with a black arrow

Related Topics

Customize the Editor Layout

Editing a Breakpoint

Setting a Breakpoint

Deleting a Breakpoint

Enabling/Disabling Breakpoints


Setting a Breakpoint

You can set (add) a breakpoint from several places.

To set a breakpoint in the Editor

» Do one of the following:
  • Single-click in the Editor gutter to set or reset a breakpoint.
  • Press SHIFT+F5 to set or reset a breakpoint on the current line in the Editor.

The breakpoint is indicated by a stop sign in the gutter.

Note: It is recommended that you set your gutter width to 35. To do this, from the Edit menu, select Editor Options and then enter 35 in the gutter width field.

To set a breakpoint from the Breakpoints window

  1. Click [image] on the toolbar (or double-click the breakpoint).
  2. Fill in the appropriate information and click OK.

To set a breakpoint from the Breakpoints Tab

» Press INSERT.

To set a breakpoint from the Debug Menu

  1. Click in the line where you want the Breakpoint.
  2. From the Debug menu, select Add Breakpoint at cursor.

Related Topics

Breakpoints Window

Customize the Editor Layout


Setting Breakpoint Properties

The Breakpoint Properties dialog box lets you to set standard breakpoints, conditional breakpoints, pass count breakpoints, or a combination of conditional and pass count breakpoints. Properties are changed on each individual breakpoint.

To change breakpoint properties

  1. From the Desktop area, select Desktop Panels | Breakpoints.
  2. Double-click the breakpoint where you want properties set.

Standard Breakpoints

When enabled, a standard breakpoint will break at the breakpoint when running or stepping through the code. A standard breakpoint has the Condition and Pass count lines of the properties dialog box left blank.

Conditional Breakpoints

You can set breakpoints that ONLY break if a certain condition is met when running the code.

To set a Conditional Breakpoint

  1. In the Breakpoints window select a breakpoint.
  2. Right-click and then select Edit Breakpoint.
  3. Enter the condition for the breakpoint, for example, "salary_in > 5000". When running, the Debugger will stop on the breakpoint ONLY if the condition is met.

Format of a Conditional Breakpoint

The format for the "Condition" line is Variable Operator Value. For example "salary_in" (variable) ">" (operator) "5000" (value).

Supported Operators

Operator | Meaning
<= | Less than or equal to
<> | Does not equal
>= | Greater than or equal to
< | Less than
> | Greater than
= | Equal

Pass Count Breakpoints

You can set breakpoints that break ONLY after a certain number of passes in a loop has occurred.

In this case, the Debugger will NOT stop on the breakpoint line until just before the breakpoint line for the nth pass count. The pass could be a FOR loop, DO WHILE loop, IF/END IF, and so on. It is not dependent on any "COUNTER_VAR" value.

To set a breakpoint using a pass count

  1. In the Breakpoints window select a breakpoint.
  2. Right-click and then select Edit Breakpoint.
  3. Enter the Pass Count for the breakpoint, e.g., 5. When running, the Debugger will stop on the breakpoint Just before the 5th pass through that breakpoint.

Combining Conditional and Pass Count Breakpoints

If both Condition and Pass Count are specified, the break will ONLY occur the nth time the condition is met.

Related Topics

Breakpoints Window


Editing a Breakpoint

To edit a breakpoint

  1. If it is not open, open the Breakpoints window. From the Desktops toolbar, select Breakpoints.
  2. Select the breakpoint and open the properties dialog box.
  3. Do one of the following to open the Breakpoints properties window:
    • Single-click to select the breakpoint, and click the Edit Breakpoint [image] icon on the toolbar
    • Double-click the breakpoint in the Breakpoints window
    • Single-click to select the breakpoint, right-click to display the menu, and select Edit Breakpoint
  4. Make desired changes to the properties and click OK.


Enabling/Disabling Breakpoints

To disable breakpoints

» Use one of the following methods:
  • Single-click to select the breakpoint, and click [image] on the toolbar
  • Double-click the breakpoint and uncheck the Enabled checkbox
  • Select the breakpoint, right-click, select Debug and then Disable Breakpoint.

Disabled breakpoints are grayed out in the Breakpoints window.

To enable breakpoints

» Use one of the following methods:
  • Single-click to select the breakpoint, and click [image] on the toolbar.
  • Double-click the breakpoint and check the Enabled checkbox.
  • Select the breakpoint, right-click, select Debug and then Enable Breakpoint.


Deleting a Breakpoint

To delete a breakpoint

» To delete a breakpoint, do one of the following:
  • Select the breakpoint in the Breakpoints window and press Delete.
  • Put your cursor in the line containing a breakpoint in the Editor and press F5.
  • In the Editor, click [image] in the gutter.

Related Topics

Breakpoints Window

Editing a Breakpoint


Breakpoints Right-Click menu

From the Breakpoints window, right-click to access the popup Breakpoints menu. This menu has the following options:

  • Editing a Breakpoint
  • Setting a Breakpoint
  • Enabling/Disabling Breakpoints
  • Deleting a Breakpoint
  • View Source – places the cursor on the line of source referenced by the breakpoint and marks it with a black arrow
  • Enable All Breakpoints – enables all breakpoints
  • Disable All Breakpoints – disables all breakpoints
  • Delete All Breakpoints – deletes all breakpoints


Watches Window

Toad supports watches on implicit and explicit variables, including some complex data types such as explicitly and implicitly defined records, %ROWTYPE records, and cursors. See Complex Datatype Examples for more information about supported types. See Limitations to Watches for more information about unsupported types.

From the Watches window, you can easily work with your watches. You can select from the toolbars on the window itself, or you can use the right-click menu to access more functions.

Note: You can also hover your mouse over a variable to check the value without formally setting a watch.

To access the Watches window

» Click the Watches tab in the Output area.

Note: If the watches tab is not visible, right-click and select Desktop Panels | Watches.

Watches Window Toolbar

The toolbar on the Watches window has several buttons that allow you to access watch commands.

Button | Description
 | Edit selected watch.
 | Add watch.
 | Delete selected watch.
 | Enable selected watch.
 | Disable selected watch.
 | Evaluate/modify watches.
 | Flip watch window.


Smart Watches

Toad can automatically watch every variable in the active procedure or function. If you step into a new tab, the smart watches window refreshes with the values on the new tab.

Smart watches are disabled by default and display collapsed.

If the smart watch window contains cursors or records, the cursor/record is listed as a node and each individual item as an entry underneath it. These are, by default, displayed collapsed. You can expand them by clicking the + sign beside the node.

To enable smart watches

» In the Watches window, select the Enable Smart Watches checkbox. See Watches Window for more information.

Configuring the Smart Watch window

By default, watches and smart watches are arranged side by side in the Watches desktop panel. You can also flip the watch window to show watches over smart watches instead of watches next to smart watches (the default).

To flip the watch panels

» Click [image].

Moving Smart Watches to the Watch panel

Unlike standard watches, smart watches are not saved when you leave the window as they are created dynamically from the code you are actively using. However, if you want a watch to persist when you move into a different procedure or function, you can drag the watch from the smart watches panel to the watches panel. In the case of a watch that contains multiple parts, you choose to drag the node, which will copy everything under it, or only one of the items within the node.

To move a smart watch to the watch window

  • Do one of the following:
  • Drag the smart watch from the smart watches panel to the watches panel.
  • Select a watch, right click, select Add.
  • Select a Smart Watch, click the Add Watch button on the toolbar.

Related Topics

Watches Window


Complex Datatype Examples

Toad can perform watches on several complex datatypes. Some illustrations are described below.

Note: Toad can only watch complex datatypes that are supported by Oracle. Because Toad queries Oracle for all watches, if Oracle cannot watch a variable, Toad cannot watch it either. This effectively means that sometimes a complex datatype can be watched, and sometimes it cannot, depending on how Oracle interacts with the variable passed to it.

A watch on a record variable must be set AFTER you step into the procedure through the Debugger. Toad needs the context of the variable before it can determine that it is a record.

Explicit record declarations:

In the example below, the declaration is explicit because the types of parameter pow and variable rec are explicitly declared as pow_rec.

CREATE OR REPLACE package powexample is

TYPE POW_REC IS RECORD

(

NAME VARCHAR2,

RANK VARCHAR2(),

SERIALNO VARCHAR2(30)

);

PROCEDURE POWRECPROC(POW IN POW_REC);

end;

/

CREATE OR REPLACE package body powexample is

PROCEDURE POWRECPROC(POW IN POW_REC) IS

TMPVAR VARCHAR2(30);

REC POW_REC;

BEGIN

REC.NAME := 'DAVID';

REC.RANK := 'GENERAL';

REC.SERIALNO := '555-00-0000';

TMPVAR := POW.NAME;

TMPVAR := POW.RANK>;

TMPVAR := POW.SERIALNO;

END POWRECPROC;

end;

/

Implicit record declarations:

In the example below, the declaration is implicit because the loop index variable rec is not declared.

Note: You cannot watch an implicit record with a variable in the select list of the corresponding query. Having a variable within this select list will return an empty watch. A variable in the WHERE clause is ignored when record structure is retrieved, and the watch proceeds normally.

This example includes both a record (REC) and a cursor (C1).

CREATE OR REPLACE PROCEDURE ForLoopProc IS

cursor; employee from * select is C1

BEGIN

for C1 in rec

loop

dbms_output.put_line(rec.empname);

end loop;

END ForLoopProc;

Example 2

CREATE OR REPLACE PROCEDURE CursorForLoopProc IS

BEGIN

for ) new_user from * (select in rec

loop

dbms_output.put_line(rec.first);

end loop;

END CursorForLoopProc;

%ROWTYPE records:

In this example, tmpVar will expand as a record.

CREATE OR REPLACE FUNCTION returnrowtype RETURN employee%ROWTYPE as

tmpVar employee %ROWTYPE;

BEGIN

tmpvar.empid := 1;

tmpvar.empname := 'DAVID';

tmpvar.salary := 100000;

RETURN tmpvar;

END returnrowtype;

Collections Records

Toad also supports displaying collection results to the DBMS Output window.

When this option is enabled, collection results will be displayed in the DBMS Output window, and the row formatting will be applied.

Note: Row restrictions will not be applied in this case.

To enable collection results

» From Editor | Set Parameters | Options, select DBMS Output.


Adding a Watch

To add a watch from the Editor

Note: If the Watches window was not open, you will need to open it to view watches.

  1. Click a variable in the Editor.
  2. Do one of the following:
    • Click [image] in the toolbar.
    • Right-click in the Editor, select Debug and then Add Watch at Cursor.
    • Press CTRL+F5 to add the variable at the cursor to the list of watches. The watch is added but the Watch Properties dialog box does not display.

To add a watch from the Watches window

» Right-click and select the Add Watch menu item.

To add a watch from the Debug Menu

  1. Click in the variable you want to watch.

    2. From the Debug menu, select Add Watch at cursor.

    Note: If text is selected when "Add Watch at Cursor" is chosen, Toad sets the watch on the selected text. If no text is selected it uses the text under the cursor. This change occurs so that if you have a recordname.fieldname, you can highlight only recordname to set a watch on it. If you have an expression like v_List(2), where v_List is a varray, then you can highlight the entire expression to put a watch on it.

Related Topics

Limitations to Watches


Limitations to Watches

Because of limitations in the Oracle Probe API, there are some configurations that you cannot Watch.

  • Toad does not support arithmetic in watches. For example, you cannot watch the sum of two variables.
  • You cannot watch a trigger :new.column or :old.column value.
  • Toad can only watch complex datatypes that are supported by Oracle. Because Toad queries Oracle for all watches, if Oracle cannot watch a variable, Toad cannot watch it either. This effectively means that sometimes a complex datatype can be watched, and sometimes it cannot, depending on how Oracle interacts with the variable passed to it.

Related Topics

Watches Window


Setting Watch Properties

You can set watch properties as you add a watch, or from an existing watch.

Some methods of adding a watch bring up the Watch Properties dialog box. (See Adding a Watch for more information.)

To change the properties of an existing watch

» From the Watches window, double-click the watch where you want to change properties.

To set watch properties

  1. In the Expression field, type the name of the variable you want to watch.
  2. Variables within a package body or package spec will be resolved automatically. You can also specify a variable as a package variable and refer to a different schema and package in the appropriate boxes.
  3. In addition to the usual data types that you can watch (for example, date, number, varchar2). You can also watch array values and record types. If you have an array, e.g., MyArray(1..10), and set up a watch on MyArray(1), then you can also set a Repeat Count setting of 3 to examine MyArray(1), MyArray(2), and MyArray(3) all at the same time.
  4. Enter the number of significant Digits to be displayed.

    5. If you prefer to see the watch value formatted differently than the default, then select from the format options, e.g., floating point, scientific, and so on. You cannot format watches on records. If you are selecting a record to watch, this area will be disabled in the Watch Properties window.

    Note: Non-printable characters (ASCII 0-31) embedded in strings can often cause confusing errors and are hard to debug because most fonts are unable to render them in a meaningful way. "String\Dec" will display non-printable characters, e.g., CR and LF, in decimal format, e.g., "This is a test.\013\010" "String\Hex" will display those non-printable characters in hexadecimal format, e.g., "This is a test.\$D\$A".

  5. To set the Debugger to break when a value changes, check the Break on value change checkbox, and they type of break you want:
    • Never
    • Always
    • When a specific condition is met (x=4, for example)

      • Note: This feature is not available when the watch selected is a record, and will be disabled in the Watch Properties window.

  6. Click OK to change or set the properties.

Related Topics

Watches Window


Enabling/Disabling Watches

Once a watch is set, you can temporarily disable it. You may want to disable some watches to improve the performance of the Debugger. As each line of code is run, each watch has to be evaluated. The fewer the watches to evaluate, the faster it will run.

To disable a watch

» Do one of the following:
  • In the watches window, double-click the watch and clear the Enabled checkbox.
  • In the watches window, select the watch, right-click, and select Disable Watch.
  • In the watches window, select the watch, and then click [image].

To disable all watches

» In the watches window, right-click, and select Disable All Watches.

To enable a watch

» In the watches window, do one of the following:
  • Double-click the watch and check the Enabled checkbox.
  • Select the watch, right-click, and select Enable Watch.
  • Select the watch, and then click [image].

To enable all watches

» In the watches window, right-click, and select Enable All Watches.


Editing a Watch

Editing Watches

To change an existing watch

  1. Do one of the following:
    • Double-click the watch in the Watches window
    • Single-click the watch to select it, right-click to display the menu, and select Edit Watch
  2. Make changes to the properties as described in Setting Watch Properties.

Related Topics

Watches Window


Deleting a Watch

Deleting Watches

To delete a single watch

» Do one of the following:
  • Select the watch you want to delete, and then click [image].
  • In the watches window, select the watch you want to delete and press DELETE.

To delete all watches

» In the watches window, right-click and select Delete all Watches.

Related Topics

Watches Window


Evaluate/Modify

The Evaluate/Modify window lets you view the value of a variable on the fly, without having to set a watch. It also lets you change the value of a variable and continue executing. This is useful for advancing a loop variable to the end of a "FOR COUNTER_VAR IN 1..500 LOOP" loop. In this case, evaluate Counter_Var, and set its new value to 499. So, you do not have to step through the loop the extra 498 times. If you want to change a date variable, enter the new date in format DD-MON-YY or DD-MON-YYYY with single quotes surrounding the date: for example, '31-DEC-99'.

Check the Package Variable checkbox if the variable to evaluate is a package level variable, and not a local variable.

To evaluate or modify a watch

» From the Watches window, with an active watch, click the Evaluate/Modify button.

Related Topics

Watches Window


External Debugging Overview

When performing normal debugging, Toad does two things – in the first Oracle session it starts an execution of the procedure it is about to debug, and in the second session it traps the first session into a debugger.

External Debugging allows the user to debug PL/SQL code that is written and run from any client-server application including Visual Basic, Delphi, PowerBuilder, Developer/2000, etc. The external application does not need to exist on the same machine.

External Debugging works with the PL/SQL debugger. Currently this feature is not compatible with the JDWP debugger.

This feature is extremely useful when the client-server application calls a stored program with complex parameters, such as cursors, that are not easily simulated from Toad. Rather than trying to simulate the complex environment within Toad, you can simply connect to the external application and then debug the code in its native environment.

Related Topics

Java Debugger Overview

About Debugging

Requirements for attaching to an external application

Attaching an External Session for Debugging


Requirements for attaching to an external application

Before Initializing

Before initializing the debugger on the external session, disable server output by issuing the 'set serveroutput off' command. If server output capture is enabled, Oracle will freeze on calls to the DBMS_OUTPUT package so that these calls can be debugged. This will give the displayance that the application has frozen for no particular reason.

Initializing

To initialize Debug mode, the external application must execute three commands:

ALTER SESSION SET PLSQL_DEBUG=TRUE

id := dbms_debug.initialize('TOAD')

dbms_debug.debug_on;

where TOAD can be replaced by any ID string. If this parameter is omitted, the return value of initialize will be used as the Session ID. This ID string also must be entered into Toad from Debug menu | Attach External Session.

The ALTER SESSION command (SQL) should be executed separately, while dbms_debug.initialize and dbms_debug.debug_off (PL/SQL) can be placed in the same PL/SQL block.

You can omit the ALTER SESSION command if you have all your procedures compiled with debug.

After running external application

After the external application is finished executing the code that needs debugging, it should execute the command:

dbms_debug.debug_off

Otherwise, all subsequent PL/SQL code that this application submits for execution will be run in debug mode. This will cause the application to hang until Toad attaches to it again.

Related Topics

External Debugging Overview

About Debugging

Attaching an External Session for Debugging


Attaching an External Session for Debugging

In the following procedure, Step 5 can be done before Step 4, but it may then be difficult to pass the Session ID (unless it is hard-coded). The important thing is that the application and debugger are synchronized at the point when:

  • the application runs PL/SQL code in debug mode

AND

  • the ATTACH command has been issued from Toad.

Note: Before initializing the debugger on the external session, disable server output by issuing the 'set serveroutput off' command. If server output capture is enabled, Oracle will freeze on calls to the DBMS_OUTPUT package so that these calls can be debugged. This will give the displayance that the application has frozen for no particular reason.

To attach an external session for debugging

  1. Connect the external application to the database.
  2. In Toad, connect to the same database instance as the external application. The code you want to debug must be displayed in the Editor.
  3. In Toad, from the Debug menu select Attach External Session.
  4. Enter the same Session ID as passed to or returned by the initialize statement. Toad waits for the application to execute PL/SQL code.
  5. From the application, execute the PL/SQL block that calls the stored program to be debugged. Toad enables all debugging commands.
  6. Verify that, when execution of the PL/SQL code is complete, Toad displays the message Execution complete and the external application continues its normal work.

Related Topics

External Debugging Overview

About Debugging

Requirements for attaching to an external application


Call Stack Window

The Call Stack window displays the chain of functions and procedures as they are called, in the order they are called, with the most recent function or procedure listed on the top.

At the end of each procedure name is the current line number in that procedure. So, if you step into procedure B from line 5 of procedure A, then the call stack will look like this:

Procedure B(1)

Procedure A(5)

To access the call stack

» From the Desktops area, click the Call Stack tab.

To add the call stack tab to the Desktop

» Right-click in the Desktops area and select Desktop Panels | Call Stack.

Related Topics

Customize the Editor Layout


Setting Parameters in Triggers

When a trigger is executed, a preprogrammed operation occurs on a table. You’ll notice that debugging triggers is different from debugging procedures or functions. First, the values entered in the Set Parameters window are for the column values, not the argument values. See Set Parameters for more information.

Before you can run a trigger, you have to set the parameters for that trigger. Each type of trigger has a different set of parameters that are required.

Note: When you have entered a value into the Value column of the grid, if you want to make it NULL again, type NULL. If you simply delete the value, the value will revert to an empty string.

INSERT

When you are debugging an INSERT trigger, the values you enter are used as the values to be inserted. The record you insert is then rolled back so that no changes are made to the database during debugging.

To debug an insert trigger

» In the Value field, enter a value to be inserted.

Note: The INSERT INTO… code is not valid until you enter column values.

UPDATE

Enter values for the SET… clause AND the WHERE… clause. The UPDATE TABLE… code is not valid until you enter the column values.

To debug an update trigger

  1. In the Value field, enter values for the SET… clause.

  2. In the WHERE value field, enter values for the WHERE… clause.

    Note: The updated record will be rolled back so that no changes are made to the database during debugging.

DELETE

When debugging a DELETE trigger, you must enter values for the WHERE… clause.

To debug a delete trigger

» Enter the WHERE… values in the Value field. The DELETE FROM… code is not valid until the column values are entered.

Multiple Trigger Priorities

In the case of multiple BEFORE or AFTER actions, trigger types take priority and will be performed as follows:

  • INSERT
  • UPDATE
  • DELETE


Query Builder Overview

The Query Builder window provides a fast means for creating the framework of a Select, Insert, Update, or Delete statement. You can select Tables, Views, or Synonyms, join columns, select columns, and create the desired type of statement.

Note:The Query Builder supports the reverse engineering of queries. Although it was heavily tested throughout its development lifecycle, due to the vast array of possible queries there may be some queries it can create but cannot reverse. Please contact the Toad development team if you discover any such queries at ToadforOracle.com. The main limitations of reverse engineering are that it only supports single-level subqueries in the SELECT and WHERE nodes, and no subqueries in the FROM clause, and some calculated fields that include arithmetic operators might not be reversed correctly.

Access Query Builder

There are two ways to access the Query Builder:

  • On the Database menu, select Report | Query Builder.
  • Click [image] on the main Toad window toolbar.
Area | Description
Table Model Area | Use the upper pane to graphically lay out a query. See Model Area for more information.
Tree View | Current query in tree view.
Generated SQL Query | Automatically generated SQL as a result of the model displays in the results grid below the Model Area. The Query Results tab displays the results of the created query.

Navigating the Query Builder

Click on items or use the keyboard:

  • Up and down arrow keys move you around in lists
  • SPACE checks and unchecks boxes
  • TAB moves forward one area (table, menu, list, etc)
  • SHIFT+TAB moves back one area.

Related Topics

Use the Query Builder

Model Area

Query Builder Options


Quickstart

Use the Query Builder

Follow this procedure to quickly get started using the Query Builder.

To use the Query Builder

  1. Drag-and-drop Tables, Views, or Synonyms from the Schema Browser, Project Manager, Object Palette, or the Object Search window to the modeling area.

    2. Click in the checkbox by a column to select or clear it.

    Note: Clicking this box adds the column to the main query. Columns must be added to subqueries by dragging.

  2. Drag-and-drop columns from one table to another to create joins between the tables.
  3. Add any WHERE clauses, or GROUP by clauses by right-clicking on the column in the tree view node and select Add to n clause. Right-click and adjust properties for clauses where necessary.
  4. Click [image] on the toolbar to save the model to disk.
  5. Click the Generated Query tab to view the generated query, and then click [image] to copy the query to the Editor.

Related Topics

Query Builder Overview

Model Area

Populating the Having Clause

Populating the Where Clause


Model Area

Use the model area to visually join or manipulate the Tables, Views, or Synonyms. You can click in a table header and drag the table to anywhere in the model area.

To establish your own joins

» Drag a column from one table to another table column. When the line is drawn, you can double-click the line to adjust its properties such as Inner Join vs. Outer Join, or Join Test. For example, equal (=), less than (<), greater than (>), and so on.

To specify columns for the query

» Click in the checkbox for each desired column. A checkmark will be displayed in the box. The selected column's information will display in the navigation tree, and the column will be included in the query.

Note: If no table columns are selected, then all columns will be included in the query.

F4 Describe

You can use the F4 key to describe a selected table, as explained in the Describe topic. If a table is not selected when you press F4, the last selected table will be described. See Describe Objects for more information.

Related Topics

Query Builder Overview


Query Builder Explain Plan

Explain Plan

Click the Explain Plan button on the Query Builder toolbar to generate and display an Explain Plan output.

The right-click menu includes the following functions:

  • Copy to Clipboard - Copies the explain plan statement (in text mode) to the Clipboard
  • Optimizer Mode - Allows you to select the query optimizer mode from Choose, Default, Rule, First Rows, or All Rows

Related Topics

Query Builder Overview

Explain Plan Overview


Query Builder Options

Many Query Builder options can be set or changed in the Toad Options window. From this window you can:

  • Set general options, including color of join lines.
  • Add or remove Functions usable in the Query Builder.
  • Control behavior of the Query Builder.

To access Query Builder options

  1. From the View menu, select Toad Options.
  2. In the left hand side, click Query Builder.
  3. Change options as desired, and then click OK.

Related Topics

Query Builder


Viewing Joins

To view joins

» Click [image] on the toolbar, or double-click a join line in the Modeler itself.


Populating the Where Clause

There are two ways to populate the WHERE clause in SQL generated by the Query Builder: as an individual WHERE, or as a global WHERE.

To populate the where clause

  1. Do one of the following:
    • Right-click on the column under the SELECT node and select Include in Where Clause.
    • Drag a column from the select node to the WHERE node.

    Add conditions and select or clear any outer joins you want to apply.

    Note: To build a more advanced query, click the Expert tab and enter your code by typing it in the top box or double clicking on functions and data fields to enter them.

  2. Click OK.

    3. Repeat until all conditions are added.

    Note: When you add multiple columns to a WHERE clause, they are automatically placed

  3. If a condition should be an OR condition, rather than an AND, right-click on it and select OR.

To create a global WHERE clause

  1. Right-click in the Table Model area.
  2. Select SQL | Global Where Clauses.
  3. Click [image].
  4. Enter or build your condition.
  5. Click OK to close the definition window.
  6. Click OK.

Example

To construct the following query:

SELECT DEPT.DEPTNO, DEPT.DNAME, DEPT.LOC

FROM DEPT

WHERE (((UPPER (RTRIM (DNAME)) = 'SALES') AND (DEPT.DEPTNO < 40)) AND ((DEPT.LOC = 'CHICAGO')OR ((DEPT.LOC IS NULL = '')))

Do the following:

  1. Open the Query Builder.
  2. In the Object Palette, select the Scott schema and double-click the DEPT table to add it to the model.
  3. Right-click DEPT and choose Select All.
  4. Drag the DEPTNO column to the WHERE node.
  5. Select < in the operator box, click Constant, and enter 40 in the condition box.
  6. Click OK.
  7. Drag the LOC column to the WHERE node.
  8. In the WHERE definition dialog, click the Expert tab. Click OK to confirm.
  9. Double-click IS NULL in the SQL Operators area and then click OK.
  10. Drag the DEPTNO above LOC in the tree view.
  11. Right-click the LOC column and select OR.
  12. Right-click on OR | LOC and select Properties. Select = in the operator box, click Constant, and enter CHICAGO in the condition box.
  13. Click OK.
  14. In the table model area (the area around the table images), right-click and choose SQL | Global Where. Click [image].
  15. In the top edit box, enter (UPPER (RTRIM (DNAME))) = 'SALES'.
  16. Click OK and then click OK again.

View the generated query. It should display as described above.


Populating the Having Clause

You can automatically populate the Having clause in the SQL generated by the Query Builder in one of two ways.

Note: To create a HAVING clause, you must have added columns to the GROUP BY node.

HAVING entries should be in the form of <expression1> <operator> <expression2>.

To populate the HAVING clause

  1. Do one of the following:
    • Right-click the desired column in the tree, and then select Include in Having Clause.
    • Drag a column from a table in the Table Model area to the HAVING clause.
  2. Enter or build the condition.
  3. Click OK.
  4. Repeat until complete.

Global HAVING clauses

In order to include a global HAVING clause, there must be a GROUP BY clause as well.

To create a global HAVING clause

  1. Right-click in the Table Model area.
  2. Select SQL | Global Having.
  3. Click the Add button.
  4. Enter or build your condition.
  5. Click OK to close the definition window.
  6. Click OK.

Example

To construct the following query:

SELECT emp.empno, emp.ename, emp.job, emp.mgr, emp.sal,

emp.comm, emp.deptno

FROM emp

GROUP BY emp.deptno, emp.comm, emp.sal, emp.mgr, emp.job,

emp.ename, emp.empno

HAVING ((emp.sal + NVL (emp.comm, 0)> 4000))

Do the following:

  1. Open the Query Builder.
  2. In the Object Palette, select the Scott schema.
  3. Double-click the EMP table to add it to the model.
  4. Right-click EMP and choose Select All, then clear Hiredate.
  5. Drag DEPTNO, COMM, SAL, MGR, JOB, ENAME and EMPNO to the Group by node.
  6. Right-click in the Table model area and select SQL | Global Having. Click [image] to add a new Global Having clause.

    7. Enter the Having clause to say:

    EMP.SAL + NVL(EMP.COMM, 0) > 4000

  7. Click OK twice.

View the generated query. It should display as described above. This query selects all the employees whose salary plus commission is greater than 4000.

The NVL command substitutes a null value in the specified column with the specified value, in this case, 0.

Related Topics

Populating the Where Clause

Query Builder Overview


Creating a Sub-Query

You can easily create a sub-query if desired, nested subqueries can also be created, simply by creating the new sub-query within the appropriate clause of the previous one. Subqueries can be created from the SELECT clause, the FROM clause, or the WHERE clause.

Columns must be dragged directly from the table area to be placed in subqueries, or from the current statement. Checking a column in the model area will add that column to the main query.

To create a sub-query in the WHERE clause

  1. Drag a column into the WHERE or FROM node.
  2. In the WHERE definition dialog, select subquery and select the type of subquery from the list below it.
  3. Create the sub-query the same way you would create a normal query.

To create an EXISTS sub-query

  1. Right-click the WHERE clause in the tree view.
  2. Select Include EXISTS subquery.
  3. Create the sub-query as you would a normal query.

To create a sub-query in the FROM or SELECT node

  1. Right-click the SELECT or FROM clause in the tree view.
  2. Select Include subquery.

    3. Create the sub-query as you would a normal query.

    Note: A sub-query based on the SELECT clause cannot have multiple columns: therefore there is no ORDER BY node.

Related Topics

Query Builder Overview


Reverse Engineering a Query

Note: The query builder can handle only one query at a time.

To reverse engineer a query

  1. Do one of the following:
    • Enter a query into the Editor
    • Open a file containing a query in the Editor.
  2. Right-click in the query and select Send to Query Builder.

The query must be a query that originally could have been created in the Query Builder. If the Query Builder could not create the original query, the reverse engineered query may be flawed. This is because the Query Builder cannot visually display a query it cannot build. If the query contains a calculated field, you will have to manually attach the calculated field to the table by clicking on the Add Calculated field button.

At this time, Toad cannot reverse engineer a query with nested sub-queries, although the Query Builder can create them.

Note: Although it was heavily tested throughout its development lifecycle, due to the vast array of possible queries there may be some queries it can create but cannot reverse. We encourage users to inform Quest if they discover such queries.

Toad can reverse engineer:

  • Select
  • Insert
  • Update
  • Delete

queries, one at a time.


Query Report Format

When you choose to "Execute as SQL*Plus Report" from the Query Builder, you can format the report from the Query Report Format window.

To execute as a SQL*Plus Report

  1. After creating a model, right-click over either the Criteria or Generated Query tab and select Execute as SQL*Plus Report.

  2. Set options in the tabs and then click [image] on the toolbar.

    Note: The script is sent to the script tab, and any output is displayed on the output tab.

Related Topics

Query Builder Overview

Query Results


Generated Query

This tab lists the automatically generated SQL statement. Any changes made to the model or column Criteria will automatically regenerate this SQL statement.

To copy the query to the clipboard

» Do one of the following:
  • Select a query and press CTRL+C
  • Click the Send text to clipboard button
  • Select the query, right-click and select Copy

To send the query to the Editor

» Click [image] in the Generated Query toolbar.

SQL*Plus Reports

You can also execute the SQL as a SQL*Plus report. Right-click in the SQL area and select Execute as SQL*Plus Report. See Query Report Format for more information.

You cannot directly edit the SQL on the "Generated Query" tab dialog box.

Generating ANSI Syntax

You can convert a SQL statement from the generated query tab, or you can set the Query Builder to create ANSI syntax automatically from Toad Options | Query Builder. See Query Builder for more information.

To convert a SQL statement in the Query Builder

» In the Generated Query tab, select the query to convert and click the ANSI join syntax button.

Tuning the query

To tune the query

  1. From the Generated Query tab, click the [image] drop-down.
  2. Select either:
    • SQL Optimizer
    • Oracle Tuning Advisor

Related Topics

Using SQL Optimizer with Toad

Query Builder

Query Report Format


Query Results

This grid displays the results of executing the generated query. Insert, Update, and Delete queries can only be executed in the Editor window.

To access the Query Results grid

» From the Query Builder, click the Query Results tab.

Making changes to the Tables or Columns, then clicking on the Query Results tab will prompt you whether or not to requery the data.

Related Topics

Query Builder Overview


Removing columns from the Tree

As you model your code, you may need to remove columns from the model.

To remove columns from the tree

» Drag the column you want to the trash can in the tree structure.

Related Topics

Query Builder Overview


Model Object Relationships (Code Road Map)

Code Road Map graphically displays the complex PL/SQL interdependencies within a database. You can think of the Code Road Map as a developer’s model of the application code.

Each object has a unique shape and different connectors represent dependencies and dependencies. See Code Road Map Legend for more information.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To visually model code

  1. Select Database | Report | Code Road Map.

  2. Click [image] to add objects.

    Tip: You can also add objects by right-clicking an object in the Schema Browser and selecting Code Road Map.

  3. To control the parent/child objects added to the model and the objects that display in the Add to Code Road Map window, select the Options tab in the Add to Code Road Map window. Review the following for additional information:
    4. Use Autoselection

    Select to have Toad automatically select parent and/or child objects.

    You can select how many levels of related objects Toad adds in the Traversal Depth field. For example, assume you want to add EMPLOYEE_TABLE, and it has the following relationships:

    • EMPLOYEE_TABLE is referenced by EMPL_DEPT_VIEW and EMPL_ID_VIEW. These views are one level from the table.
    • EMPL_DEPT_VIEW is referenced by DEPT_PACKAGE, and EMPL_ID_VIEW is referenced by ID_PACKAGE. These packages are two levels from the table.
    • ID_PACKAGE is referenced by JOB_HISTORY_TRIGGER. This trigger is three levels from the table.

    If the Traversal Depth was set to 2, Toad would add EMPL_DEPT_VIEW, EMPL_ID_VIEW, DEPT_PACKAGE, and ID_PACKAGE to the model. It would not add JOB_HISTORY_TRIGGER, because it is three levels removed from the table.
    Smart Traversal

    Select to have Toad automatically limit the traversal direction. This feature only applies when you add objects through the Add to Code Road Map window or Schema Browser.

    If Smart Traversal is enabled, you can select User Objects Only to limit added objects to the currently selected schema.
    Traversal Directions

    Select a traversal direction.

    Parent objects call the selected object. Child objects are called by the selected object. For example, EMPLOYEE_TABLE calls EMPL_DEPT_VIEW, which calls PACKAGE 1. EMPLOYEE_TABLE is EMPL_DEPT_VIEW's parent, and PACKAGE 1 is its child.

  4. Rearrange objects and manage the workspace as necessary. See Manage the Code Model Workspace for more information.

    Tips:

    • You can model dependencies between procedures, functions, variables, constants, types inside packages, and object types. Right-click an object and select Reveal Level 2 Dependencies.
    • Select a package and click [image] on the toolbar to send the package and all of its member items (package function, package procedure, package variable, and so on) to a new workspace.
    • Right-click an object in the model and select Schema Browser Menus to easily access Schema Browser features.
    • Select an object and press F4 to display the object's properties. See Describe Objects for more information.
  5. To export or save the model:
    6. Output | Complete the following:
Copy to clipboard | Right-click the model and select Copy image to clipboard. Tip: You can also press CTRL+C.
Graphic file | Right-click in the model and select Export to Graphic File, or click [image] in the Code Road Map toolbar.
HTML file | Click [image] in the Code Road Map toolbar. Select the appropriate output type in the Report Type field.
RTF file
Script (export DDL) | Click [image] in the Code Road Map toolbar. See Export DDL for more information. Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Related Topics

Manage the Code Model Workspace


Manage the Code Model Workspace

Code Road Map is divided into two panes: an explorer on the left-hand side and the main workspace on the right.

Explorer Pane

The explorer pane has two tabs to help you navigate the model. The Diagram tab lists all modeled objects. The Workspace tab lists the objects in the selected workspace. You can use these lists to navigate from object to object:

  • Click on an object in the tree view to select the object in the model
  • Double-click an object to center the model on the object and select it

Workspace Pane

The workspace displays the code diagram and can have different tabs for specific parts of the model, which remain connected to the main diagram. This feature can be helpful when working with a large code model. To send an object to another workspace tab, right-click it and select Add to Workspace.

Code Road Map provides many options to arrange, organize, and navigate the model through the toolbars and right-click menu. The following table highlights some of the most helpful options:

Rearrange objects | Click [image] to have Toad automatically arrange objects. Click [image] to align the selected objects together, and then select an alignment option.
Categorize and color code objects | Click [image] and then click inside of the main workspace. Double-click the new category box to change the category name, color, and assigned objects.
Navigate the model | Click [image] to loupe the main workspace with the preview in the Workspace tab. When you hover over an item in the model, the Workspace tab displays a close-up of the object. Click [image] to drag the entire model in the workspace. Click [image] to fit the entire model in the visible workspace.
Add title table to model | Click [image] to add a table with information about the model, such as its name, author, version number, and date of creation.

Related Topics

Model Object Relationships (Code Road Map)

Code Road Map Legend


Code Road Map Legend

Code Road Map uses the following shapes and lines to represent objects and their relationships:

Show all

Object Shapes
Object | Shape
Function |
Materialized View |
Package |
Procedure |
Table (Dependent) |
Table (Independent) |
Trigger |
View |
Type |
Items in a Package or Type | Shape
Constant |
Cursor |
Function |
Procedure |
Type |
Variable |
Dependencies and Constraints
Dependency | Line Representation
Code | TR_CUSTOMER is calling method from package PKG_VIEW_DEPENDENT:
Data | TR_CUSTOMER is accessing data (read or write) in T_CUSTOMER:
Trigger | T_CUSTOMER is executing trigger TR_CUSTOMER:
Constraint | Line Representation
Foreign Key Constraint (Non-Identification) |
Foreign Key Constraint (Identification) |

Related Topics

Model Object Relationships (Code Road Map)

Manage the Code Model Workspace


Understand Editable Resultsets

A data grid is fully editable providing that the query itself returns a resultset that can be updated. Query statements must return the ROWID to be editable. For example:

Not Editable | Editable
select * from employee | select employee.*, rowid from employee

Notes:

  • You can substitute EDIT for SELECT * FROM. Toad translates it into the editable version of the statement. For example, edit employee returns the same result as select employee.*, rowid from employee.
  • If the resultset should be editable but remains read only, make sure the Use read-only queries checkbox is not selected on the Data Grids | Data options page. See Data Grid Options: Data for more information.


Post/Revert Edited Data

To post data

  1. Make changes to an editable resultset in the data grid.
  2. Click [image] in the grid navigator.

To revert data

» Click [image] in the grid navigator.

Related Topics

Results Grids

SQL Results Grid

Understand Editable Resultsets


Insert and Delete Rows

The dataset must be editable for you to make any changes. See Understand Editable Resultsets for more information.

To insert a blank row

» Click [image] on the data grid toolbar.

To copy an existing row

» Right-click the cell you want to copy and select Duplicate Row. If you have a sequence set, then the sequence number advances when you finish editing.

To delete a row

» Click [image] on the data grid toolbar.

Related Topics

Understand Editable Resultsets

SQL Results Grid

Results Grids


Edit Data in Popup Editor

You can view and edit data in a Popup Editor. This feature is helpful when there is too much data to view in the data grid. In addition, Toad provides popup editors for several other file formats. (See Related Topics)

Note: The dataset must be editable for you to make any changes. See Understand Editable Resultsets for more information.

To edit data in the Popup Editor

» Right-click a cell in the data grid and select Popup Editor.

Related Topics

About Working with Data Grids

BLOB Editor

View BFILE data

View Object Data

View Nested Table Data

View VARRAY Data

View CURSORs


Use an External Editor

You can use an external editor of your choice, and copy the text to the external editor, edit the text, and bring the results back into Toad.

To set up your External Editor

  1. Select View | Toad Options | Executables.

  2. Navigate to and select the executable for the external editor in the Editor field.

To open text in External Editor

» Select Edit | Load in External Editor (CTRL+F12).

Note: If you have not saved the contents of the Toad Editor to a file, Toad prompts for a filename before launching the external editor.

To return to Toad from the External Editor

  1. Save the file from the external editor and then close it.

  2. Open Toad and load the file.

    Note: Toad prompts you to reload the contents of the file only if the Prompt for reload on activation if timestamp has changed option is selected on the Editor | Open/Save page. See Editor Options: Open/Save for more information.

Related Topics

Editor Options: Open/Save

Executables


Access the Calculator

You can access a calculator within Toad data grids. To use the calculator, the table must be editable. See Understand Editable Resultsets for more information.

To access the calculator

  1. Click in a numeric cell. A drop-down arrow displays.
  2. Click the arrow to display the calculator.


About Working with Data Grids

Throughout Toad, information is presented in a grid format. Within grids, you can customize grid views, filter resultsets, print the grid contents, and other standard operations.

Grids that provide query results have additional functionality. In most data grids you can:

Edit data

The dataset must be editable for you to make any changes. See Understand Editable Resultsets for more information. If the dataset is editable, you can:

  • Post/Revert Edited Data
  • Insert and Delete Rows
  • Edit Data in Popup Editor
  • Use an External Editor
  • Access the Calculator

Manage what and how content displays

Toad data grids support many of the same features as spreadsheet editing software, such as rearranging and resizing columns. You can also:

  • Anchor Column in Data Grid
  • View a Single Record
  • Preview Selected Column
  • Hide Columns
  • Sort and Group Data

Filter results

Review the following for additional information:

  • Filter Data
  • Use Excel-Style Filtering

Note: Schema Browser filters have special features. See Create Schema Browser Filters for more information.

Export data

You can export data to a variety of formats, such as an Excel, HTML, or flat file:

  • Export Dataset
  • Export Data to Flat File

View special data types

Toad has unique editors for selected data types:

  • Date Editor
  • View BFILE data
  • View CURSORs
  • View Nested Table Data
  • View Object Data
  • View VARRAY Data


Sort and Group Data

If the query does not contain an "Order By " command, you can sort the grid manually. You can also group data by column header.

To sort by column

  1. Click a grid column header.
  2. Select the appropriate option, and click Apply.

Group Data by Column

To group by column

» Drag the column header into the area above the grid:

Related Topics

About Working with Data Grids


Anchor Column in Data Grid

You can anchor a column on the left side of the data grid (also referred to as locking, fixing, or freezing the column). This can make it easier to track information you must scroll through a large amount of content.

Note: Row numbers automatically display as fixed columns. With the exception of row numbers, fixed columns remain editable.

To anchor a column

» Right-click a column and select Fix Column.

To remove the column anchor

» Drag it to the right of the bold fixed column divider bar.

Related Topics

About Working with Data Grids


View a Single Record

You can view an individual record from a data grid. This feature presents the information in a format that is easy to view an edit, which is very helpful when the record contains long or complicated information.

To view a single record

» Right-click the grid and select Single Record Viewer.

Tip: Click [image]. to edit the display options, such as the sorting order and alignment.

Related Topics

About Working with Data Grids


Preview Selected Column

You can display or hide a full row below each data row that shows the value of the selected column.

To preview current column

» Right-click the column in the Data grid and select Preview Column.


Hide Columns

You can hide columns from the data grid after running a query.

To select columns to display

  1. Click [image] in the upper left corner of a data grid.

  2. Clear the checkbox by the column name.

    Tip: To sort the column list alphabetically, right-click the column list and select Sort Alphabetically.

Related Topics

About Database Connections


Filter Data

Filters reduce the amount of data displayed and let you display only what you want to see. They work by modifying the query used to fetch the data. If you frequently search for the same criteria, you can save the filter for reuse.

Notes:

  • Schema Browser filters have special features. See Create Schema Browser Filters for more information.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To filter data

  1. Right-click the data grid and select Filter Data.

  2. To change the grouping clause, click AND and select a different option.

  3. Click press the button to add a new condition.

  4. To change the column, click the listed column and select a new one. The first column in the grid is selected by default.
  5. To change the condition, click equals and select the appropriate condition (LIKE, EQUAL TO, LESS THAN, and so on).
  6. Click <empty> and add your criteria.
  7. To add additional conditions or groupings, click Filter and then select Add Condition or Add Group.

Related Topics

Use Excel-Style Filtering

Sort and Group Data

Create Schema Browser Filters

Create Default Schema Browser Filters

Apply Saved Schema Browser Filters


Use Excel-Style Filtering

Toad automatically uses Excel style filtering in its data grids.

To use Excel-style filtering

  1. Hover over a column heading to display the drop-down arrow.

  2. Click the arrow and select a filter.

  3. If you selected (Custom), specify the filter criteria.

Related Topics

Set Filter Conditions


BLOB Editor

In the SQL Results panel, a BLOB or ORABLOB entered in a column field indicates that a BLOB resides in that field. If BLOB or ORABLOB is entirely in capital letters, it indicates that the field is not null. These words in initial caps (Blob; Orablob) indicate that the field may be null, or the BLOB not initialized.

You can edit a BLOB.

To edit a BLOB

» Do one of the following:
  • From the data grid of a table containing a LONG RAW or BLOB datatype column, right-click the field and select the Popup Editor.
  • From a create/alter table window, LONG RAW or BLOB datatype, click [image] in the LOB column of the grid.


Date Editor

You can use the date editor to change the date, select the date format, null the date, or null the time. You can navigate through records as in the Text Editor, and post or cancel the edit.

To access the date editor

» Double-click in a data grid cell containing a date.

To change the date

» Click the drop-down beside the date and select the correct date from the popup calendar.

To change the date format

» Select or clear the Long date format checkbox.

To null the date or time

» Click [image] beside the appropriate information.

To enter the SYSDATE

» Click SYSDATE.


View BFILE data

You can View BFILE data. A cell with BFILE information contains the word BFILE. In addition, another column is added to the grid to show the BFILE directory.

To view BFILE data

» Right-click a cell in the data grid and select Popup Editor.


View Nested Table Data

A cell in the results grid that contains nested data will display as "DATASET".

To view nested table data

» Right-click a cell in the data grid and select Popup Editor.


View VARRAY Data

You can View and edit VARRAY data. A cell with VARRAY information contains the word VARRAY.

Note: The memo editor displays the first 100 entries in the VARRAY.

To view VARRAY data

» Right-click a cell in the data grid and select Popup Editor.


View Object Data

You can view and edit object data. A cell containing object type data displays the data in parentheses, delimited by commas.

Note: You can edit nested object types, but you will not be able to edit attributes of certain types, such as a nested table, or a CLOB.

To view and edit object data

» Right-click a cell in the data grid and select Popup Editor.


View CURSORs

Queries run with CURSORs display results in the data grids. The cell with the cursor displays the word CURSOR.

To view CURSORs

» Right-click a cell in the data grid and select Popup Editor.

Note: Data can only be displayed once per cell each time the query is run. Once the data is displayed, it is lost until the query is run again.

Example

SELECT m.ename, CURSOR (SELECT e.ename

FROM scott.emp e

WHERE e.mgr = m.empno) employees

FROM scott.emp m

WHERE job = ‘MANAGER’

When CURSOR is double-clicked in one of the results, the following dialog box displays:


DBMS Output Window

Oracle provides a package, called DBMS_OUTPUT, which is specifically designed with functions for debugging PL/SQL code. It uses a buffer that your PL/SQL code writes into, and then a separate process queries the buffer out and displays the contents.

Output only displays after the procedure has completed execution, not while you are single stepping through the code. In nested procedure calls, all procedures must have run to completion before any DBMS Output content is displayed.

To access the DBMS Output window

» From the View menu, select DBMS Output.

Related Topics

Generating DBMS Output

Polling for DBMS Output

Editing the DBMS Output Display

Using the DBMS Output window for Debugging


Generating DBMS Output

The Editor has a Right-Click menu option that will generate a DBMS_OUTPUT statement for a highlighted variable. The same menu has an option to create a blank DBMS_OUTPUT statement.

To generate an output line from a variable

  1. Highlight the variable in the Editor.

    2. Right-click and select Output Statements | Make Output Statement.

    Note: The statement is created on the clipboard.

  2. Paste the statement in your code where you want it.

To generate a blank output statement

  1. In the Editor, right click and select Output Statements | Blank Output Statement.
  2. Paste the statement in your code.

Related Topics

DBMS Output Window

Polling for DBMS Output

Editing the DBMS Output Display

Using the DBMS Output window for Debugging


Polling for DBMS Output

An application must poll Oracle for the output results, and if the polling option is turned on. Toad's Output window polls every 5 seconds. You can increase or decrease the frequency of polling with the slider located at the top right of the window.

Related Topics

DBMS Output Window

Generating DBMS Output

Editing the DBMS Output Display

Using the DBMS Output window for Debugging

Execute and Compile Options


Editing the DBMS Output Display

One feature of the DBMS Output window is the ability to edit the output display. This allows you to note what you did to receive the output.

For example, when debugging a procedure named MyProc that expects a single number parameter, you can execute the procedure from an Editor window with the following statement:

begin MYPROC(1); end;

Prior to executing the above, you can document the call in the DBMS Output with a comment:

Calling MyProc with 1

Then turn output ON and execute MyProc. The DBMS_OUTPUT statements will display after your notes about the call.

Related Topics

DBMS Output Window

Generating DBMS Output

Polling for DBMS Output

Using the DBMS Output window for Debugging


Using the DBMS Output window for Debugging

When used with an Editor window, the DBMS Output window is effective for developing and debugging stored procedure code.

Edit the code, test the code, tweak the code, and repeat. You can make notes within the DBMS Output window, and the standard copy, cut, and paste keys work in the DBMS Output box.

Related Topics

DBMS Output Window

Generating DBMS Output

Polling for DBMS Output

Editing the DBMS Output Display


Find in Editor

Use this dialog box to enter a keyword or phrase to search for in the Editor window.

There are options for case sensitive, finding whole words, using Regular Expressions, and searching forward or backward in the buffer.

If text is highlighted prior to opening the Find dialog box, that text will be placed into the Text to Find data entry box. If no text is highlighted, then the word at the cursor will be placed in the Text to Find data entry box. The last n find items are available in the drop-down list. They are NOT saved from Toad session to Toad session.

You can also copy other text and paste it into the Find dialog box using CTRL+V.

Find may be available for a window even if the Find button is not present on the toolbar. In these cases, you easily can use CTRL+F from the keyboard to access this feature.

To open the Find box

From the Edit menu, select Find (CTRL+F).

Show All

This command only works after you have performed the Find command. After you use FIND to search through your text for a word or phrase, you can click Show All from the Search menu and Show All will highlight every occurrence of the search phrase.

The highlighting is removed with any change to the text in the Editor.

To show all after a find

Select Search | Show All.

Related Topics

Find Data in Grids

Find in Files

Regular Expression Searches


Find Data

Find Data in Grids

Use this dialog box to find the first row of matching data in a grid. Toad will search all records for the value, and position the recordset to the first matching value. If the records are cached then the search is fast. If Toad has to query ahead in the recordset, then you will have to wait for the additional rows to be fetched from the database.

Incremental Searching

To find data incrementally

  1. Click in the column you want to search.
  2. Type the first few characters of the item you want to find.
  3. Press F3 to continue stepping through the grid.

Multi-Column Searching

You can use this method to find data in one column, or in many, or items that match two or more criteria.

To find data

  1. Right-click in the grid and select Find Data (CTRL+F).
  2. Select the column to search, enter a value to search for, click Add.
  3. If you want to perform a multi-column search, select more columns and values.
  4. Click OK and the data grid advances to the first occurrence of the search criteria.
  5. To find the next occurrence of the search criteria press F3.

Related Topics

Find in Editor

Find in Files

Regular Expression Searches


Find in Files

Find in Files supports multiple concurrent searches. When you select a result, a preview window displays and stays on top so you can easily compare other results.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To find in files

  1. Select Search | Find in files.
  2. Enter the text you want to find in the Search for field.

  3. Enter the types of files you want to find in the File mask box. For example, *.* searches for all files and *.txt searches for all text files. You can search for multiple file types and separate them with a semicolon, such as *.sql;*.txt (searches for all .sql and .txt files).

  4. Select options in the Find in Files toolbar to include additional search criteria, such as searching sub-folders and using regular expressions.
  5. Click [image].
  6. Double-click a file in the results to preview it. The preview window stays on top so you can easily compare other results.

Related Topics

Find Data in Grids

Find in Editor

Regular Expression Searches


Find Next, Find Previous

The Search | Find Next and Search | Find Previous menu items are only enabled after you have performed a Find.

  • Search | Find Next (F3) will go to the next occurrence of the text you were searching.
  • Search | Find Previous (or SHIFT+F3) will go to the previous occurrence of the text that you were searching.

Related Topics

Find in Editor

Find Data in Grids

Find in Files

Regular Expression Searches


Find and Replace Text

To find and replace text

» Click the Replace button on the edit toolbar (CTRL+R).

Tip: Select Wrap around to continuously loop the search, instead of displaying a message that the search is done.

Related Topics

Regular Expression Searches


Goto Line

If you have a large file, you may want to use this command to move your cursor to a specific line number.

You must enter an integer from 0 to the last line number of the buffer contents.

You can also use bookmarks to quickly navigate around the buffer contents. See Bookmarks for more information.

To goto a specific line

  1. From the Edit menu, select Goto Line.
  2. Enter the line number where you want the cursor.
  3. Click OK.


Object Search

Object Search searches all database objects, table columns, index columns, constraint columns, trigger columns, and procedure source code for a user entered phrase. Each of the previously listed items can be searched or excluded from the search by using options.

To access Object Search

» Do one of the following:
  • From the main toolbar, click [image].
  • From the Search menu, select Object Search

To create an object search action

» Cick [image] on the Automation Designer, DBMisc tab.

Search Term

Specify your search term in the box. You can select to search for an exact match, starts with, occurs anywhere, and you can specify a case-sensitive search by selecting that box.

Object Status

If desired, you can limit your search to Valid or Invalid objects. The default choice is to search both.

Specifying your Search

The object search is an extremely powerful feature. You can search for almost anything or combination of things you can conceive.

By default, Toad searches through all objects in the schema you specify to find the search term you enter.

You can limit your search to:

  • Schemas
  • Object names
  • Column Names
  • Source
  • Any combination of these

Schemas to Search

Select the schemas you want to search. You can right-click in this area to select all, invert your selection, and otherwise control your selection options.

Search Object Names

When the search object names box is checked, you can select object types from the object list. You can right-click in this area to select all, invert your selection, and otherwise control your selection options.

Note: Currently the DB Admin module is required to search the following objects: Contexts, Dimensions, Directories, Evaluation Context, Library, Operators, Policies, Policy Groups, Profiles, Refresh Groups, Resource Plans, Rules, Rule Sets, Scheduler Chains, Scheduler Jobs, Scheduler Job Classes, Scheduler Programs, Scheduler Schedules, Scheduler Windows, Scheduler Window Groups, and Tablespaces.

Search Column Names

When the search column names box is checked, you can select object types with columns from the list. You can right-click in this area to select all, invert your selection, and otherwise control your selection options.

Source Search

The Search Source area of the window uses the Oracle INSTR function to determine if the search term exists in a given object's source. Because of this, when performing a Source Search, the search always searches as if the search team has specified Occurs anywhere, regardless of what is selected in the Search term area.

Related Topics

Action Catalog

Creating New Actions


Object Search DDL Script Options

This window lets you alter the DLL script inclusions for the Object Search window. You can add or remove DDL scripts for Tables, Indexes, Views, Users, Tablespaces, and All others. See Object Search for more information.

Click in the checkboxes to include (checked) or exclude (unchecked) the scripts. By default, all scripts are included.


Regular Expression Searches

Many books have been written about the use and usefulness of regular expressions. You can find additional information at the website www.regular-expressions.info, which also includes a list of recommended books on the subject.

Note: This site has no connection to Quest Software, Inc., and opens in a new browser window.

Toad uses the PERL regular expression syntax, and can be used in both the find and replace boxes throughout, as well as the Parser tab within Language Management. See Language Management Overview for more information about the parser tab.

This topic will touch on the basics of using regular expressions. Regular expressions can be used to specify text by its characteristics, rather than searching for exact characters. In addition, you can use regular expressions to find strings that are not otherwise easily searched. This is one of the basic uses for regular expressions.

Replace with Template

When you select regular expressions in the Replace text dialog, you can also choose to Replace with Template. See Replace with Template for more information.

Simple Matches

Simple matches simply find the occurrence of the specified character. Unless the string contains a metacharacter, Toad will use simple matching. For example, entering "toad" will match "toad", and so on.

Metacharacters

Special characters called metacharacters serve purposes other than matching themselves. Toad can be told to match a special character exactly if necessary. To escape the character and have it match itself, simply precede it with a backslash (\). For example, ^ means "match beginning of string, but \^ will find occurrences of "^". In the same way, characters which are not metacharacters in themselves are sometimes made into metacharacters by preceding them with the backslash. For example "t" will match all "t"s. However, \t finds the tab character.

Metacharacters are the heart of regular expressions. There are several different kinds of metacharacters. Some of the most often used are described below:

Expression | Meaning
\r | Carriage return
\n | New line
\f | Form feed
\t | Tab character
\b | Backspace
\s | Whitespace character
\S | Negation of \s (so all non-whitespace)
. | Any single character. For example, c.b matches cab, cob, and cub.
[] | Any one of the characters in the brackets, or any range of characters separated by a hyphen, or a character class operator.
[^] | Any character that EXCEPTING those after the caret. For example, c[^u]b will match cab and cob, but not cut.
^ | Start of a line
$ | End of a line (but not the line break characters)
* | Matches none or more of the preceding characters or expressions. For example, bo*t matches bt, bot, and boot.
? | Matches zero or one of the preceding characters or expressions. For example, bo?t matches bt, bot, but not boot.
+ | Matches one or more of the preceding characters or expressions. For example, bo+t matches bot, and boot but not bt.

Related Topics

Examples of Regular Expressions

Replace with Template


Replace with Template

If you choose to use a regular expression search, you can also replace the text you find with a template.

When the Replace with template is checked, the replace field is not valued as a string anymore, but rather code to back reference the substrings in Text to find.

To replace with template

  1. Select Edit | Replace Text (CTRL+R).
  2. Select Regular Expressions.
  3. Select Replace with Template.
  4. Enter the Text to Find.
  5. Enter the template code in the Replace with box.

Example

You want to replace the expression "select * from emp." with substring parts.

  1. In the Text to find field, enter the regular expression with each substring surrounded by parentheses:

    2. (se.*t)(.*?)(emp)

  2. In the Replace with field, enter the code referring to the substrings. For example:
    3. Entering | Results in
\1\2\3 | Setting reference points to the substrings: \1 correspond to (se.*t) \2 correspond to (.*?) \3 correspond to (emp)
\1\2dept,\3 | Replacing the substring \2 with "dept,". When you click OK, "SELECT * FROM EMP" becomes "SELECT * FROM dept, EMP". Note: If Replace with Template is NOT checked then the values do not reference the substrings, and Replace with text is treated as a string to insert. So SELECT * FROM EMP would become: \1\2dept,\3.

Related Topics

Regular Expression Searches

Find and Replace Text


Examples of Regular Expressions

Below are some expressions of regular expressions using the metacharacters listed. See Metacharacters for more information.

Expression | Matches
^make | string 'make' only if it begins a line
make$ | string 'make' only if it ends a line
^make$ | string 'make only if it is the only string in the line
m.ke | strings such as 'make', 'mike', 'mbke', 'm1ke', and so on.
mat\dh | strings such as 'mat1h', 'mat2h', and so on, but not 'match, 'matbh', 'matrh' and so on.
mat[\w\s]h | strings like 'match', 'mat h', 'mathh', but not 'mat1h', 'mat2h', and so on.
mat.*h | strings like 'match', 'matasdkfjdf9sasf', and 'math'.
mat.+h | strings like 'math', 'masjdfksjfs9fsj', but not 'math'.
mat.?h | strings like 'matah', 'matbh', and 'math', but not 'mat9h.'
mat{2}h | the string 'matth'
mat{2,}h | the string 'matth', 'mattt', 'matttth', and so on.
mat{2,3}h | strings like 'matth' or 'mattth', but not 'matttth'.
(match){6,10} | strings which contain 6, 7, 8, 9, or 10 instances of "match".
mat([0-9] | a+)h | 'mat0r', 'mat1r', 'match', 'matah', and so on.

Related Topics


Generate Test Data

You can use Toad to generate test data for your database. You can generate data for multiple tables at one time or for single tables. This feature is a Toad Action, which means that you can save it and schedule to run. See Automation Designer Overview for more information.

A video tutorial is available for this feature. This video opens in a new browser and requires an Internet connection.

Notes:

  • This Toad feature is only available in the Professional or higher versions of Toad.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To generate data

  1. Right-click the table in the Schema Browser and select Generate Data. See About the Schema Browser for more information.

    Tip: You can also select Database | Import | Generate Data, or access the window from the Database Browser or ER Diagram.

  2. Click [image] to add additional tables, if necessary.

  3. Complete the fields in the General Options, table, and column nodes. Review the following for additional information:

    General Options | Description
    Random Data Engine Select one of the following options:

    • Internal—Creates a script with "n" INSERT statements per table (depending on the individual table's settings). An option is also available to commit every "x" rows. This is the most basic data generation option, but it does not require you to install any packages on the database server.

      Note: This will create a very large SQL script, which will take longer to execute.

    • DBMS_RANDOM—Uses Oracle's DBMS_RANDOM package to generate data. The package can generate Unicode data. It must be installed on the database server for this option to be available.

    • TOAD_DATAGEN—Uses Toad's package to generate data on the server. This option generates a much smaller SQL script, performs faster, and supports real-life data sets.

      Note: You will need to install the TOAD_DATAGEN package through Server Side Object Wizard in order to use this feature. This package can be installed locally, or in the global Toad schema. See Install Server-Side Objects for more information.
    Transaction Commit mode

    Select an option to specify the commit action to take after each table. DDL statements, such as TRUNCATE TABLE, DISABLE/ENABLE CONSTRAINT, AND DISABLE/ENABLE TRIGGER, automatically apply an implicit COMMIT against the database. This option specifies what level of commit to take between actual data generation blocks.

    Allow Reproducible Sequences

    Select this option to use a hard-coded random seed, allowing the script to reproduce the same sequence of data on multiple Oracle servers. By default, the data generation window initializes its random generator using the system timer from gv$timer.

    Enforce Referential Integrity

    When selected, Toad creates data where all foreign keys in a details table contain only appropriate values found in the referenced table.

    Note: This option can significantly increase execution time because Toad must query every row of the reference table for each entry in the details table. Because of this, you may want to schedule this task at a later time so as not to tie up system resources.

    Constraints | Description

    Disable Constraints before Data Generation

    When selected, Toad will disable all constraints (primary/foreign keys, unique, or check) on the selected table before generating data. If you also wish to maintain foreign keys while generating data, also select Enforce Referential Integrity.

    Enable Constraints after Data Generation

    When selected, Toad will enable all constraints (primary/foreign keys, unique, or check) on the selected table after generating data.

    Note: This step may produce an error on Primary/Unique keys if duplicate data was generated in the table.

    Triggers

    Description

    Disable Triggers before Data Generation

    Disables any triggers associated with this table. This can be useful when a trigger is associated with an INSERT event that does additional work to the selected table, or other table in the database. By disabling these triggers, you ensure they will not be executed every time a record is appended during data generation.

    Enable Triggers after Data Generation

    Select to enable all triggers associated with this table after data generation has completed. Doing this ensures that these triggers fire for subsequent insert or update statements.

    Note: The General Options node applies to all tables selected in the Generate Data window.

  4. Click [image] to execute, or save or schedule the selections as a Toad action. See Automation Designer Overview for more information.

    Tip: You can execute actions from the command line. See Execute Actions from the Command Line for more information.


Automatically Increment Columns with Sequence/Trigger Pair

You can automatically increment a column by creating a sequence/trigger pair in the Schema Browser. If Toad creates a sequence/trigger pair, it indicates the affected column by selecting the Seq/Trigger checkbox in the Schema Browser | Tables | Columns tab. You can also have Toad highlight columns populated by this method. See Schema Browser Data Tab Options for more information.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To create a trigger/sequence pair

  1. Locate the table in the left-hand side of the Schema Browser.
  2. Right-click the table and select Add | Sequence/Trigger Pair.

Related Topics

About Working with Data Grids


Dataset Operations

In the Export File browser, you can work with the dataset on a selected object, such as a table. See Viewing an Export File for more information about the Export File Browser.

To view the dataset

  1. From the left hand side treeview, select the object whose dataset you want to view.
  2. In the right-hand side, click the Data tab.

Related Topics

Go to Row Number

Get Row Count

Export Dataset


Go to Row Number

Note: The Export File Browser is only available in Toad Professional Editions, or with the optional DB Admin module.

When you are working with a large dataset in the Export File browser, sometimes it is advantageous to jump directly to a specific row number within the data. See Viewing an Export File for more information.

To go to a row number

  1. Right-click over the data grid and select Go to Row #.
  2. Enter the row number in the box.

    3. Click OK.

    Note: If you have not performed a row count before you go to a row number, it will be performed now.

Related Topics

Dataset Operations

Get Row Count

Export Dataset


Get Row Count

Note: The Export File Browser is only available in Toad Professional Editions, or with the optional DB Admin module.

Toad can count the rows in a table for you in the Export File Browser. This can be useful when you want to know just how big the dataset contained in the table is. See Viewing an Export File for more information.

When you first open a node that includes a dataset, there is nothing listed beside it. When you perform a Get Row Count on it, the number of rows in the dataset are listed in parentheses beside the node. For example:

To get the rowcount for a dataset

» In the right hand side, right click over the data grid and select Get Rowcount.

Related Topics

Dataset Operations

Go to Row Number

Export Dataset


Column Names Supported

Supported Column Names

Toad supports column names with

  • Letters (A-Z)
  • Numbers
  • Underscore character ( _ )

Toad surrounds any other characters with double quotes. For example, a column named this_is_a_test would be created as entered. A column named This is a test, however, would be created as "This is a test".


Viewing Source Surrounding a PL/SQL Error

You can use this query to see PL/SQL lines before and after the error line.

select decode(to_char(us.line), '1', ue.text| | '
Pkg:'| | us.name| | chr(10)| | chr(10)| |
' '| | to_char(us.line,'99990')| | ' '| | us.text,
to_char(ue.line-7),ue.text| | ' Pkg:'| | us.name| | ' ',
to_char(ue.line-6),'',
to_char(ue.line+6),'',
to_char(ue.line) ,'-->'| | to_char(us.line,'99990')
| | ' '| | us.text
,' '| | to_char(us.line,'99990')
| | ' '| | us.text) outline
from user_source us, user_errors ue
where us.line between (ue.line-7) and (ue.line+6)
and us.name = ue.name
and us.type = ue.type
and ue.text not like 'PL/SQL: Statement ignored'
and ue.text not like 'PL/SQL: Declaration ignored'
order by ue.name, ue.line, ue.text, us.line;

Sample output

Here is some sample output from the above query:

PLS-00103: Encountered the symbol "=" when expecting one of the following:

:= . ( @ % ;

The symbol ":= was inserted before "=" to continue.

Pkg:FOO

20 LIMITATIONS:

21 ALGORITHM:

22 NoteS:

23 ******************************************************************************/

24 BEGIN

--> 25 tmpVar = 0;

26

27 EXCEPTION

28 WHEN NO_DATA_FOUND THEN

29 Null;

30


About the Schema Browser

The Schema Browser allows you to view, add, and modify database objects. It also displays detailed information about a selected object. For example, the detailed information for a table includes its subpartitions, columns, indexes, data, grants, and so on.

Notes:

  • Some Schema Browser features may not be available unless you have the commercial version of Toad with the DB Admin Module.
  • You can set the Schema Browser to open automatically when a new connection is made. Select View | Toad Options | Windows and select the Auto Open checkbox of the Schema Browser row.

Schema Browser Panes

The Schema Browser is divided into two panes to help you review objects and their details:

Pane Description
List of objects (left-hand side)

The left-hand side of the Schema Browser provides a list of objects that you can view. In general, you select a schema and an object type, and the list refreshes to display the relevant objects. You can filter the objects and save your filters for future use. See About Schema Browser Filters for more information.

The list can display additional information about the objects, such as the tablespace and number of rows. To view additional information, right-click a column in the left-hand side and select additional columns to display. (This feature is unavailable with the tree view display.)

Tip: In drop-down mode, you can hide leading characters of object names in the left-hand side. Right click a column and select Hide leading characters of name. The display resets when you change the schema or connection.

Object details (right-hand side)

The right-hand side initially displays the same list of objects as the left-hand side. When you select an object on the left-hand side, Toad displays its details in the right-hand side. This format makes it easy for you to compare details between objects of the same type.

Note: You can use Toad's Describe Objects feature to display an object's details in a new window. The Describe Objects window displays the same information you would see in the right-hand side of the Schema Browser. See Describe Objects for more information.

From the Schema Browser you can drop most objects, enable/disable applicable objects, and disable triggers for a table or for an entire schema. You can recompile procedures, functions, packages, triggers, and views, or they can be extracted from the database and loaded into the clipboard or Editor.

Tips:

  • To reset the right-hand side to mirror the list of objects on the left-hand side, click [image] in the toolbar or select multiple objects on the left-hand side.
  • Many of the panes within the Schema Browser have icons to identify the objects. See View Schema Browser Icon Legend for more information.
  • Many of the objects and panes have enhanced right-click menus. Right-click an object or its details to see what options are available.

Customize the Schema Browser

You can customize how the Schema Browser displays to better suit the way you work. The most common customization is to change how object types display in the left-hand side. See Select the Left-Hand Side Display Style for more information.

Toad also provides dozens of options to further customize the display and behavior of the Schema Browser. Review the following for additional information:

  • Schema Browser Data Tab Options
  • Schema Browser Left-Hand Side Options
  • Schema Browser Right-Hand Side Options
  • Schema Browser Types Tab Options

Related Topics

Create Objects


Create Objects

Toad lets you select Oracle object parameters and generate a DDL statement to create or alter objects. It is generally a good idea to review the DDL statement before executing it. When you execute the statement, Toad passes it to the database, and the object is created or altered.

The options to create or alter an object in Toad follow the parameters defined by Oracle. If you need clarification on what an option means or how it should be used, see Oracle's documentation for more information. Oracle provides detailed documentation about objects, including their purpose, properties, and restrictions.

Notes:

  • You can also find detailed information about parameters in Knowledge Xpert. Knowledge Xpert is an extensive Oracle technical resource which you can search in the Quick Search bar. See Quick Search Bar for more information.
  • You can use an existing object as a template when creating a new one. See Use Existing Object as Template for New Objects for more information.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To create an object

  1. Click [image] on the Standard toolbar to open the Schema Browser.

  2. Select the object type in the left-hand side and click [image].

    Note: You can also create an object by selecting Database | Create | <Object type>.

  3. Complete the fields as necessary.

  4. To add the object to the Project Manager, select Add to PM. See Project Manager Overview for more information.
  5. To view the CREATE statement, click Show SQL or select the SQL tab.

  6. Click OK or Execute to create the object immediately. You can also schedule the script to run later.

    Note: To alter or edit an object, double-click it in the Schema Browser. You can also press F2 to rename an object (if it can be renamed).


Copy Objects to Another Schema

From the Schema Browser, you can use existing objects to create identically formed objects in a different schema. This feature uses the Export DDL feature to export the code for the objects, and then import it into the new schema.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To copy objects to another schema

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Right-click the object you want to copy in the left-hand side and select Create in another schema.
  3. Select export settings and click OK. See Export DDL for more information.
  4. Enter the destination connection and destination schemas.
  5. To review the script to create the objects, click the Script tab.
  6. Click Execute.

Related Topics

Copy Data to Another Schema


Use Existing Object as Template for New Objects

You can use an existing object as a template for creating a new object. Toad loads the original object's properties in the Create window for you to edit as necessary and execute.

Notes:

  • This feature is not available for all object types.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To create an object based on an existing one

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Right-click the object you want to use as a template in the left-hand side and select Create Like.
  3. Complete the fields as necessary.
  4. To view the CREATE statement, click Show SQL or select the SQL tab.
  5. Click OK or Execute to create the object immediately. You can also schedule the script to run later.


View and Modify Object Privileges

The Privileges window allows you to view, grant, and revoke privileges on a database object. You can view all users and their privileges. If you are not the object owner, you can only grant privileges if you have been given the "grant option".

To access the Privileges window

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Select a table, view, sequence, or procedure on the left-hand side.

  3. Click [image] on the left-hand side toolbar. Grants are highlighted in blue and admin grants in yellow.

    Tip: If you do not see all users, make sure Hide privileges granted by other users or Hide users/roles with no privileges assigned are not selected.

Related Topics

Configure Grantees


Configure Grantees

From the System Privileges window you can grant or revoke selected privileges to/from a selected user. In addition, you can do the same to a selected role or roles.

To grant or revoke a privilege

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Select a privilege (listed under Sys Privs) and click [image].
  3. Check or clear the appropriate boxes to grant or revoke privileges to users or roles.

Related Topics

View and Modify Object Privileges


Drop (Delete) Objects

Many objects can be dropped directly from the Schema Browser. Once you confirm the drop, it cannot be reversed.

Note: If you accidentally drop a table on Oracle 10g or later, you may be able to recover it from the recycle bin. See Flashback Tables (Recover Dropped Tables) for more information.

To drop objects

» Select an object in the left-hand side and click [image] in the toolbar or press DELETE. Tables have additional options:

Cascade Constraints

 Deletes all foreign keys that reference the table.

Purge

 Bypasses the recycle bin and completely drops the table. Purged tables cannot be recovered.


Flashback Tables (Recover Dropped Tables)

In Oracle version 10g and later, a recycle bin is available to retrieve tables and associated objects (such as indexes, constraints, and triggers) you have dropped from the database. From the Schema Browser's Recycle Bin page you can access this bin and retrieve dropped tables if necessary.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To flashback table

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Select the Recycle Bin in the left-hand side.
  3. Select the table you want to recover from the list and click [image].
  4. Restore the table with the original name or a new one.

Related Topics

Purge Objects from the Recycle Bin


Purging Objects from the Recycle Bin

Purge Objects from the Recycle Bin

Purging objects from the recycle bin permanently deletes them.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To purge the recycle bin

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Select the Recycle Bin.
  3. Select the objects to purge on the left-hand side and click [image] on the toolbar.

Related Topics

Flashback Tables (Recover Dropped Tables)


Rebuild Indexes and Tables

This procedure explains how to rebuild a single index or table, but you can rebuild multiple indexes and tables at the same time. See Rebuild Multiple Objects Overview for more information.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To rebuild an index or table

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Right-click the object in the left-hand side and select Rebuild Index or Rebuild Table.

  3. Select parameters as necessary.

    Note: The parameters in this window are defined by Oracle. See Oracle's documentation for more information. You can also find detailed information about parameters in Knowledge Xpert. Knowledge Xpert is an extensive Oracle technical resource which you can search in the Quick Search bar. See Quick Search Bar for more information.

  4. To view the ALTER statement, select the SQL tab.
  5. Click Execute.


Copy Data to Another Schema

You can quickly copy data from one or multiple tables to the same table or tables in another schema or database. Toad builds insert statements that use array binding in the variables to copy the data. If you set the array size to 500, then 500 rows are inserted with a single insert statement. The array size is adjustable.

Notes:

  • Toad copies data from one schema to another between tables that have the same table name. The tables must exist prior to running this command.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To copy data to another schema

  1. Select and right-click one or more tables in the Schema Browser.
  2. Choose Copy data to another schema from the menu.
  3. Click the Source/Dest and Options tab to select destination connection, schema, and options.

  4. To add a WHERE clause, select the Where Clauses tab and define Where clauses.

    Tip: You can check your query by clicking Test Query.

  5. Click [image] to execute, or save or schedule the selections as a Toad action. See Automation Designer Overview for more information.

    Tip: You can execute actions from the command line. See Execute Actions from the Command Line for more information.


Automatically Refresh the Schema Browser Data Grid

You can set the Schema Browser to automatically refresh the data grid while you are working with a specific object. This setting only lasts for your active dataset, and turns itself off if you select another object or close the Schema Browser

To automatically refresh the data grid

» Select Auto Refresh in the Data tab toolbar (right-hand side of the Schema Browser).


Jump to Objects in the Schema Browser

Objects are displayed in the Schema Browser right-hand side within a data grid or a label. You can directly jump to the displayed object.

Tip: You can also describe the object to view its details in a new window. See Describe Objects for more information.

To jump to the object from the data grid

» Select the object and press SHIFT+F4.

To jump to an object in a label

» CTRL+click and the object. In the following screenshot, you would click SCOTT.EMP to jump to the SCOTT.EMP table in the Schema Browser.


Schedule Resource Plans

To schedule resource plans, the schema that you log in with must be connected as SYSDBA.

Notes:

  • This scheduler creates jobs that are viewable in the Schema Browser under the Jobs tab. Modifying these jobs is not advisable and may cause the scheduler to perform incorrectly.

  • This feature is only available in the commercial version of Toad with the optional DB Admin Module.

  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To schedule resource plans

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Select a resource plans on the left-hand side and click [image].
  3. From the Daily Resource Plan Schedule that displays, you can:
    • Add new plans by clicking [image].
    • Remove plans by clicking [image].
    • Enable plans by selecting the Enabled checkboxes in the grid, or by clicking Enable All.
    • Disable plans by deselecting the Enabled checkboxes, or by clicking Disable All.
    • Display the SQL that will make the change by clicking Show SQL. From this dialog box you can save the SQL to a file to be run later.
  4. Click OK to run the SQL.


Calling Stored Procedures

Execute Stored Code from the Schema Browser

You can execute stored procedures, functions, packages or triggers in the Schema Browser window.

To execute a stored procedure from the Schema Browser

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Select a PL/SQL object and click [image].

Related Topics

Create New PL/SQL Object


Publish Java to PL/SQL/SQL Wizard Overview

Oracle 8i and above lets you store java classes in the database. PL/SQL programs can access a java class through a PL/SQL wrapped package. The wrapper package defines a set of procedures and functions to be called and maps them to the methods from the java class.

The Publish Java to PL/SQL Wizard is an easy way to create a PL/SQL wrapper package for a selected java class in the database. The java class must be compiled, and it must have compiled correctly to use the wizard.

One of the main functions of the wizard is to map java return types to Oracle return types. Some of the Oracle types mapped must be edited manually to update them and make them valid. See Java Types and Oracle Return Types for more information about the list of types that can be returned.

Notes:

  • To use the Java Wizard, you must have the /com/quest/Reflector class and the QUEST_REFLECTOR package installed in your database. If these are not present when the wizard is opened, the wizard prompts you to create them and walks you through the process.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To publish Java to PL/SQL

  1. Access the Java to PL/SQL wizard from the Schema Browser | Java page.
  2. Select a java class from the Objects panel and right-click. Select Publish to PL/SQL… from the menu.

  3. Refer to the following for more information:

    Selecting Methods to publish

    You must be logged in as the owner of the schema containing the java class you want to publish, or this screen will not display properly.

  4. Complete the wizard.


Java Types and Oracle Return Types

Below is a list of Java types and the Oracle types where they are mapped. Some of the Oracle types mapped must be edited manually to update them and make them valid.

Java Type | Translated to Oracle Type
oracle.sql.CustomDatum, oracle.sql.Datum, oracle.sql.RAW | RAW
oracle.sql.STRUCT | OBJECT
oracle.sql.REF | REF
oracle.sql.CLOB | CLOB
Any array, boolean, java.lang.String, oracle.sql.BLOB, oracle.sql.CHAR, anything else: java.awt.Component, java.awt.Graphics, and so on | VARCHAR2
byte, java.lang.Byte, java.lang.Double, java.lang.Float, java.lang.Integer, java.lang.Long, java.lang.Short, java.math.BigDecimal, oracle.sql.NUMBER, short, double, float, int, long | NUMBER
java.sql.Date, java.sql.Time, java.sql.Timestamp, oracle.sql.DATE | DATE
oracle.sql.BFILE | BFILE
oracle.sql.ARRAY | VARRAY
oracle.sql.ROWID | ROWID


Foreign Key Lookup

When you are editing table data in the Schema Browser, you can look up foreign keys and enter the associated data into the selected table.

Foreign key lookup will also work when the grid is in Read Only mode. You can disable this feature from the Toad Options | Schema Browser | Data and Grids | Enable FK Lookup.

To lookup foreign keys

  1. In the Schema Browser, click the Tables tab.
  2. Select the table you want to edit and in the details pane click the Data tab.
  3. Click in a column that has foreign keys. Click again to activate Editing mode. A drill down button displays.
  4. Click [image] to display the rows in the referential table.
  5. To enter data in appropriate columns in the data grid, select a row and click OK.

The Foreign Key Lookup Window

Within the lookup window, all foreign key constraints are included. If you want Toad to ignore disabled constraints, see Toad Options | Schema Browser | Data.

You can filter rows by typing or by directly editing the query.

To filter rows by typing

  1. Make sure the Filter by box in the lower left is checked.
  2. Put your cursor in one of the displayed columns. You can now filter by typing (if you type "ab" it will filter out rows that do not begin with "ab").

To filter rows by editing the query

  1. Click Edit Query.
  2. Edit the query within the editing window.
  3. Specify variables by clicking the Variable button and entering variable information.
  4. Check that your query syntax is accurate by clicking the Check button.
  5. Click OK to run your new query and filter the lookup grid.

Related Topics

Schema Browser - Data and Grids

Schema Browser Data Tab Options


About Schema Browser Filters

The Schema Browser has several different types of filters:

Type | Description
Object filter (left-hand side)

Object filters reduce the number of objects displayed in a schema. By default, Toad automatically saves your filter settings per schema name. When you reopen the schema, Toad remembers and applies the last filter that you used for it. However, Toad provides other options on how to save and apply filters. You can:

  • Create and apply new filters, which you can save to reuse later. See Create Schema Browser Filters for more information.

  • Create a default filter for each object type, which is used for all schemas. See Create Default Schema Browser Filters for more information.

    Note: You can have Toad automatically apply the default filter when you open a schema, instead of the last filter used. See Schema Browser Left-Hand Side Options for more information.
QuickFilter (left-hand side)

The QuickFilter is a client-side filter, so it filters all Schema Browser object lists without re-querying the database. This filter works in conjunction with the existing browser filters. See Use the QuickFilter (Filter from Memory) for more information.
Data filter (right-hand side) | This is a server-side filter that limits which rows are retrieved from the database. This method is much faster than the grid filter when you are filtering a large dataset. See Filter Data in the Schema Browser for more information.

Note: For performance reasons, Toad caches the list of table names for the current schema once the list has been queried from any window. The browser filter, although primarily intended to filter the Schema Browser window, also affects the table lists throughout Toad. For example, if your filter is set to display only tables that begin with GEO, every table list displays a filtered list until the filter is changed.

Related Topics

Apply Saved Schema Browser Filters

Create Default Schema Browser Filters

Clear Schema Browser Filters

About the Schema Browser


Create Schema Browser Filters

Object filters reduce the number of objects displayed in a schema. See About Schema Browser Filters for more information.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To create browser filters

  1. Click [image] in the left-hand side. This displays the browser filter for the selected object type and schema.
  2. Complete the fields as necessary.
  3. To save the filter, click Saved Filters and select Save Current Filter As.

  4. To customize or review the query before applying it, select View/Edit Query Before Executing and click OK.

    Notes:

    • Do not change the SELECT list.
    • When entering the IN clause, you must enclose the table name in single quotes ('TEST'). This lets you enter multiple table names ( such as 'TABLE1', 'TABLE2', 'TABLE3') or enter a sub-query.

Related Topics

Apply Saved Schema Browser Filters


Apply Saved Schema Browser Filters

To apply a saved filter

  1. Click the arrow beside [image] and select a saved filter from the list.
  2. If the filter you want is not listed, complete the following steps:
    1. Click [image] in the left-hand side of the Schema Browser.
    2. Click Saved Filters in the upper right of the dialog and select Load Filter
    3. Select the filter and click Open.
    4. Click OK to apply the filter and close the dialog.

Related Topics

About Schema Browser Filters

Create Schema Browser Filters


Create Default Schema Browser Filters

You can create a default filter for each object type, which is used for all schemas.

Notes:

  • Instead of using the same default filter for each object type, you can have Toad automatically save filters per connection or schema name. See Schema Browser Left-Hand Side Options for more information.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To create default filters

  1. Select Session | Schema Browser Filters.

  2. Select an object type on the left and set the filter options. See Create Schema Browser Filters for more information.

    Note: When you click OK, Toad saves default filters in a file named Toad_DEF.SBFLT in the User Files folder.

Related Topics

About Schema Browser Filters


Filter Data in the Schema Browser

The Schema Browser has the following methods to filter data:

  • Filter/Sort—This is a server-side filter that limits which rows are retrieved from the database. This method is much faster than the grid filter when you are filtering a large dataset. Access this filter by clicking the [image] button in the tab's toolbar.
  • Filter Data—This is a client-side filter that retrieves all rows from the dataset before filtering them. Access this filter by right-clicking the data grid. See Filter Data for more information.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To filter data in the Schema Browser

  1. Click [image] in the tab's toolbar (right-hand side of the Schema Browser).
  2. Complete the fields as necessary.

Related Topics

About Schema Browser Filters


Clear Schema Browser Filters

To clear filters on the left-hand side

» Click the arrow beside [image] and select Clear Filter.

To clear data grid filters in the Schema Browser

» Click [image] on the Schema Browser right-hand side.

Related Topics

About Schema Browser Filters

Create Schema Browser Filters


Use the QuickFilter (Filter from Memory)

The QuickFilter is a client-side filter, so it filters all Schema Browser object lists without re-querying the database. This filter works in conjunction with the existing browser filters. (See Create Schema Browser Filters for more information.) The QuickFilter provides a faster way to filter the list than just using the browser filters.

The QuickFilter field is located below the schema drop-down for the tabbed and drop-down Schema Browser display styles:

Notes:

  • QuickFilter does not work in the tree view Schema Browser or the Favorites Schema Browser tab.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To use the QuickFilter

» Enter the filter information. You can use wildcard characters at any point in your filter.

Wildcard

Description

* and %

multiple character wildcards

? and _

single character wildcards

Notes:

  • You can use multiple filters by separating them with a semicolon. For example, A*;B* would display everything that starts with A or B.
  • The QuickFilter maintains a history of up to 25 items, listed most recent first. Right-click the QuickFilter to access this list.

Related Topics

About Schema Browser Filters

Create Schema Browser Filters


Select the Left-Hand Side Display Style

You can customize how the Schema Browser displays to better suit the way you work. The most common customization is to change how object types display in the left-hand side. Once you select a basic display style, you can rename, hide, or rearrange the object types on the left-hand side and detail tabs on the right-hand side. See Customize Schema Browser Tabs for more information.

Tips:

  • To hide the right-hand side of the Schema Browser, press F12. You can press F12 again to display it again.
  • To hide or display images and tips in the left-hand side, click [image] in the Schema Browser toolbar and select the appropriate option.

  • In drop-down mode, you can hide leading characters of object names in the left-hand side. Right click a column and select Hide leading characters of name. The display resets when you change the schema or connection.

To select the left-hand side display style

  1. Click [image] in the Schema Browser toolbar.
  2. Select one of the following options:

    Drop-down

    Displays object types in an alphabetical drop-down field. Click here to see an example.

    Tabbed (single row of tabs)

    Displays object types as a single line of tabs. You must scroll through the tabs to view all object types. Click here to see an example.

    Tabbed (multi line tabbed)
    Displays multiple rows of tabs instead of the scroll bar. Click here to see an example.

    Tree view

    Displays object types in a tree view. Click here to see an example.

    Note: You must close any open instances of the Schema Browser for the new browser style to display.


Customize Schema Browser Tabs

The Schema Browser displays object types on the left-hand side and detail tabs on the right-hand side. You can rename, rearrange, and hide the object types that display in the left-hand side or the tabs on the right-hand side.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To customize tabs and object types

  1. Click [image] on the Schema Browser toolbar.
  2. Select Configure LHS Object Types to customize the left-hand side, or select Configure RHS Tabs to customize the right-hand side.
  3. Customize the display settings. Review the following for additional information:
    4. If you want to... | Complete the following:
Rename an object type or tab | Enter a new name in the Caption field.
Hide an object type or tab | Clear the Visible field.
Rearrange tabs | Select a tab and click the up or down arrow on the right. Note: You can only rearrange the order of object type tabs if you are in a tabbed view. See Select the Left-Hand Side Display Style for more information.
Tip: To restore the default settings, click [image] at the bottom of the window.

  4. To save the left-hand side settings as a configuration file, click [image] at the bottom of the window.

    Notes: You can save and load different configurations. This gives you more flexibility when you are working, because you can easily change the display to suit different tasks.


Group Favorite Objects

You can group objects that you use frequently into a tab on the Schema Browser. These different objects can be grouped into one or several folders. Folders are specific to an instance (not a connection or a schema).

Objects supported in this window include: tables, views, PL/SQL code (procedures, functions, packages, triggers), and files.

Notes:

  • The configuration file for this tab is saved as Projects.lst in the User Files folder.
  • This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To group favorite objects

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Select Favorites in the object list in the left-hand side.
  3. Add one or more folders to group the objects:
    1. Click [image] on the Favorites toolbar.
    2. Enter a folder name.
  4. Add objects to a folder. Review the following for additional information:
    5. To search for and select objects

    Complete the following:

    1. Click [image] on the Favorites toolbar.
    2. Search for objects. See Object Search for more information.
    3. Highlight the objects you want to add in the Results tab and click [image].
    4. Select the folder where you want the object.
    To add objects directly

    Complete the following:

    1. Right-click an object in the left-hand side and select Add to SB Favorites List.
    2. Select the folder where you want the object.

    To add scripts/files

    Complete the following:

    1. Right-click the folder where you want the item in the Favorites list and select Add Files.

    2. Select the file and click Open.

      Note: Multi-select files to add more than one at a time.

    3. Select the folder where you want the object.

    Tips:

    • To remove objects from a folder, select the object in the Favorites list and click [image].
    • To empty or remove favorites folders, right-click the folder and select Remove Folder to remove the folder and its contents or Empty Folder to leave the folder in the list but remove its contents.


View Schema Browser Icon Legend

Many of the panes within the Schema Browser have icons to identify the objects. Toad includes an Icon Legend that you can use to easily decipher these images.

To view the icon legend

» Click [image] on the Schema Browser toolbar.

Related Topics

About the Schema Browser

Create Objects


Use Query Templates

Toad has standard query templates, such as Show Dependent Objects or Column Counts, and you can also create your own custom query templates. When you use a query template in the Schema Browser, Toad builds the query with the selected objects and opens the query in the Editor.

To use a query template

  1. Click [image] on the Standard toolbar to open the Schema Browser.
  2. Select the objects you want to use for the query on the left-hand side.

  3. Right-click the objects and select Custom Queries | <Query Name>.

Create a New Query Template

Custom queries are designed to select from the data dictionary about the tables you select, rather than making custom SELECT statements. For example, the following query is not valid as a custom query because there is no specific object stated:

select * from <ObjectOwner>.<ObjectList>>

However, this more specific query is valid:

select *

from dba_tables

where owner = <ObjectOwner>

and table_name in <ObjectList>

To create a new query template

  1. Right-click in the left-hand side of the Schema Browser and select Custom Queries | Edit Custom Queries.
  2. Click [image] above the query list.
  3. Enter your new query name, and query.
  4. Click [image] to create the query and add it to the selection list.

Related Topics

About Schema Browser Filters


Unicode Troubleshooting

Toad now supports Unicode. For people already using Unicode-enabled databases, this should be a seamless transition.

Note: Some Oracle features are not Unicode-enabled, or have specific Unicode requirements to function. See Oracle's documentation for more information.

Squares in Files Instead of Characters

Either the font you are using does not support Unicode, or the character set has not been installed on your computer.

Question Marks in Files Instead of Characters

Toad attempted to open a file with the wrong encoding setting. This has corrupted the data. Do not save the file. Close it and reopen using the correct Unicode encoding. See General Options for more information.

Script Output and Compare Files Fonts

In the Editor and the Compare Files, the font now defaults to fixed-width "Courier-New" font rather than the System font. In addition, you may only select fixed-width fonts in these windows.

Editor Not Working Correctly

If you are an upgrading user, you may find errors when you attempt to use the Editor in Unicode. For example: object name highlighting, CTRL+Click, mouse over watch hints. This is because in order to maintain your custom settings to the Parser library, Toad did not replace the lexlib.lxl file.

To fix the parser file

  1. From the View menu, select Options.
  2. Click the Editor - Behavior node.
  3. Set the language drop-down to PL/SQL and then click [image].
  4. Click the Parser tab and select Any Name.

  5. Add (?r)and _ to the Regular expression test as shown:

  6. Click OK or Apply to save changes.

CodeXpert Not Working with Unicode Characters

This is a known issue. CodeXpert does not support Unicode.

FTP Compatability Issues

Toad's FTP feature can be used with Unicode, however, the code pages on the server, file and client must match.

Toad Group Policy Manager

At this time, Toad Group Policy Manager is not Unicode compliant.

Other Known Issues

There are some known issues with Unicode compatibility, both internally to Toad and externally from Oracle. See the release notes for more information.


Hints and Tips: Connecting To Personal Oracle

Connect to Personal Oracle

If you are having trouble connecting to Personal Oracle or creating a Net8 alias for PO7 or PO8, try one of the following four entries for the database name on the Toad login window:

2:

BEQ-LOCAL

LOCAL

TCP-LOOPBACK

For Schema/Passwords try one of the following pairs:

DEMO/DEMO

SCOTT/TIGER

SYS/CHANGE_ON_INSTALL

SYSTEM/MANAGER


Hints and Tips: Table Does Not Exist Errors

"Table Does Not Exist" Errors

Toad tables are required for recalling previous Explain Plan results, Profiler, Team Coding, and Toad Security. You do not have to create these tables in order to use Toad, but you will need them for the functions listed above. To create these tables, run the Server Side Object Install Wizard.

In addition, many V$ tables are required on other screens. See V$ Tables Required for more information.


Create Support Bundles

The support bundle window provides information about several aspects of your Oracle and Toad setups. In addition, the Support Bundle lets you easily report problems to our peer-to-peer mailing lists or directly to Quest Support.

To create a support bundle

  1. Select Help | Support Bundle.

  2. Review the following for additional information:

    Toad Mailing List

    This opens your email application with a pre-addressed email to the peer-to-peer Toad mailing list.

    Quest Support

    This opens your email application with a pre-addressed email to our customer support department.

    Attach TOAD.INI to email

    If checked this attaches the TOAD.INI to any email sent through the support bundle, whether it is to the peer-to-peer Toad list or to Quest Support


Toad Advisor

Toad is self-diagnosing. If you are having difficulties with Toad that you cannot fix, the Toad Advisor may be able to help you. It offers warnings, alerts, and hints concerning the current state of your Toad installation. If you are in a managed environment, it specifies which features in Toad are managed, and to what extent.

To use Toad Advisor

  1. Select Help | Toad Advisor.
  2. Review the results, which are divided into the following categories:
    3. Warnings | Describe things that should be fixed immediately
Alerts | Describe things that may have an impact upon Toad's functionality
Hints | Provide information about your Toad installation that may affect how Toad works
Performance suggestions | Describe settings that could be changed to improve speed of performance
Tip: Select a result for additional information in the bottom pane. You can double click the performance suggestions to navigate direction to the relevant Toad option.


Contact Quest Support

Quest Support is available to customers who have a trial version of a Quest product or who have purchased a Quest product and have a valid maintenance contract. Quest Support provides unlimited 24x7 access to SupportLink, our self-service portal. Visit SupportLink at http://support.quest.com.

From SupportLink, you can do the following:

  • Retrieve thousands of solutions from our online Knowledgebase
  • Download the latest releases and service packs
  • Create, update and review Support cases

View the Global Support Guide for a detailed explanation of support programs, online services, contact information, policies and procedures. The guide is available at: http://support.quest.com.

Note: This document is only available in English.


Contact Quest Software

Email | info@quest.com
Mail | Quest Software, Inc. World Headquarters 5 Polaris Way Aliso Viejo, CA 92656 USA
Web site | www.quest.com

See our web site for regional and international office information.


About Quest Software, Inc

Quest Software simplifies and reduces the cost of managing IT for more than 100,000 customers worldwide. Our innovative solutions make solving the toughest IT management problems easier, enabling customers to save time and money across physical, virtual and cloud environments. For more information about Quest go to www.quest.com.


Copyright

© 2010 Quest Software, Inc.
ALL RIGHTS RESERVED.

This guide contains proprietary information protected by copyright. The software described in this guide is furnished under a software license or nondisclosure agreement. This software may be used or copied only in accordance with the terms of the applicable agreement. No part of this guide may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording for any purpose other than the purchaser’s personal use without the written permission of Quest Software, Inc.

The information in this document is provided in connection with Quest products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Quest products. EXCEPT AS SET FORTH IN QUEST'S TERMS AND CONDITIONS AS SPECIFIED IN THE LICENSE AGREEMENT FOR THIS PRODUCT, QUEST ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL QUEST BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF QUEST HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Quest makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Quest does not make any commitment to update the information contained in this document.

If you have any questions regarding your potential use of this material, contact:

Quest Software World Headquarters
LEGAL Dept
5 Polaris Way
Aliso Viejo, CA 92656
email: legal@quest.com

Refer to our Web site (www.quest.com) for regional and international office information.

Trademarks

Quest, Quest Software, the Quest Software logo, Benchmark Factory, Spotlight, Toad, T.O.A.D., Toad World, vSpotlight, and vToad are trademarks and registered trademarks of Quest Software, Inc in the United States of America and other countries. For a complete list of Quest Software’s trademarks, please see http://www.quest.com/legal/trademark-information.aspx. Other trademarks and registered trademarks are property of their respective owners.


Legal Notices

Toad contains some third-party components whose authors require attribution. These components are listed in the following table, and the licenses may be found on our web site at http://www.quest.com/legal/third-party-licenses.aspx.

Component | License or Acknowledgement
Indy 10 | Mozilla Public License (MPL) 1.1
ODAC 6.9 | Copyright 1997-2009, Devart. All Rights Reserved.
PCRE 8.01 | BSD 4.4
Virtual Shell Tools 2 | Mozilla Public License (MPL) 1.1
Virtual Treeview 4.42 | Mozilla Public License (MPL) 1.1
zlib 1.2.3 | zlib 1.2.3


CodeXpert Parameter File

You can create the CodeXpert parameter file by hand, or you can generate it from within Toad.

Generating a Parameter file

If you generate it from within Toad, all passwords will be encrypted and the file will be more secure than creating it by hand. It is recommended that you have Toad generate parameter files for you.

Note: If you are planning to schedule Toad to run CodeXpert, you must create the parameter file manually.

To generate a parameter file

  1. Open the CodeXpert window:
  2. From the Database menu, select Diagnose | CodeXpert.
  3. From the Schema Browser, right-click on an appropriate object and select Send to CodeXpert.
  2. In the grid, select the objects or files you want to run from the command line.
  3. Right-click and select Create Command Line Parameter File.
  4. Choose a directory in which to save the parameter file and then set options as desired.
  5. Click OK.

Creating a parameter file manually

If you create your own parameter file, it should follow the following format:

Note: If you create your own file, the PASSWORDS_ENCRYPTED option should be set to "0" so you can enter passwords. This is not secure.

[OPTIONS]

RULESET=C:\Documents and Settings\<USER>\Application Data\Quest Software\Toad for Oracle\9.7\RuleSets\Minimum_20.rst

RSET=Minimum 20

OUTPUTDIR=C:\Documents and Settings\<USER>\Desktop

HTMLFILENAME=CodeXpert.html

XMLFILENAME=CodeXpert.xml

CODEXPERT_SCAN=1

SQL_SCAN=0

PASSWORDS_ENCRYPTED=1

INCLUDE_HTML=1

INCLUDE_XML=0

INCLUDE_SERVERSIDE_INSERT=0

CLEAR_ERROR_LOG=1

SERVERSIDE_INSERT_RUNNAME=AUTOGENERATE

[FILES]

FILE1=c:\work\test.sql

[OBJECTS]

OBJECT1=LOGIN1,SCOTT,TEST

[CONNECTIONS]

LOGIN1=SCOTT@YOURDB.WORLD

[PASSWORDS]

PASSWORD1=1,2,3,4,5,6,7,8,9,10

Configuration Variable | Meaning
RULESET= | The path to the ruleset you want to use.
OUTPUTDIR= | The path to the directory where you want the output stored.
CODEXPERT_SCAN= | 1 runs CodeXpert, 0 does not.
SQL_SCAN= | 1 runs SQL Scan, 0 does not.
HTMLFILENAME= | HTML file name in GUI
XMLFILENAME= | XML file name in GUI
PASSWORDS_ENCRYPTED= | Always 1 if generated from GUI. If manually generating, can use 0 (1 yes, 0 no)
SERVERSIDE_INSERT_RUNNAME=AUTOGENERATE | In the GUI, you will be prompted; this can be hard coded or autogenerated
CONNECTIONS | Specify any connections you want to use. You must specify at least one connection.
OBJECTS | Specify database objects to run the scan against in the format LOGINn, USERNAME, OBJECTNAME.
FILES | Specify any files you want to run the scan against.
INCLUDE_HTML= | Create HTML report (1 yes, 0 no)
INCLUDE_XML= | Create XML output (1 yes, 0 no)
INCLUDE_SERVERSIDE_INSERT= | Do DB inserts (1 yes, 0 no)
CLEAR_ERROR_LOG= | Clear error log between runs (1 yes, 0 no)

Note - You can specify any number of Objects and Files to scan, in any combination.

Related Topics

CodeXpert Overview

Run CodeXpert from the Command Line


New Database: Add/Edit Volume

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Clicking the Add or Edit button from Step 5 displays the Add/Edit Volume Screen. The title of the window will either specify Add Volume or Edit Volume, depending on what you chose.

Enter information in the fields as follows:

  • Volume Name – The name of the hard drive/volume. For Windows, this will typically be a drive letter, while for UNIX it will be a mount point (/u01, for example)
  • Datafile directory – The directory on this volume where datafiles should be stored.
  • Available space – The amount of space the wizard should use on this volume
  • # disks – The number of disks on this volume (used in the speed rating calculation)
  • RAID – The RAID type of this volume (optional)
  • Interface – The drive interface type (for example, IDE, SCSI, and so on)
  • Transfer rate – The transfer rate speed of the volume
  • RPM – The drive’s RPM value
  • Operating System – Check if there is an operating system on this volume
  • Swap – Check if this volume is used as a swap drive
  • Defaults – If checked, the provided values are saved and are used the next time a volume is added (during the current session)

Most of these properties are used in the calculation of the speed rating for the drive, determining where the tablespaces are put.

Return to New Database Step 5

Related Topics

New Database Wizard

New Database Step 5


New Database Step 1

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Step 1: Basic Information

Step 1 of the New Database wizard allows you to set up the name and location of your new database.

You can create a new database in two ways. You can Load your previously saved settings, or you can go through the steps sequentially and fill in the fields manually.

To Load settings

Settings can be loaded from any of the New Database wizard windows. Loading settings will replace all the settings for all the steps and allow you to move directly to Finishing the Database.

  1. Click Load….
  2. Select previously saved settings from the drop-down menu.

To Save settings

Settings can be saved from any of the New Database wizard windows. Saving settings will save the settings as entered for all steps, no matter where you are in the process.

  1. Click Save….
  2. Do one of the following:
    • Select a previously saved setting from the drop-down menu to replace with the new settings.
    • Click in the box and enter a name for your new set of settings.

To Set up your database manually

  1. Enter the Database name – This is the name of the new database that will be created. It also acts as the unique System Identifier (SID) for this database. The maximum length of the SID is eight characters. This is a required field, and the Next button is disabled while it is blank.
  2. Choose your Database location – Local indicates the user is on a database server. Remote offers two choices: Windows and UNIX. Selecting Windows will effectively create the same files as choosing Local, while selecting UNIX will create a UNIX style script instead of the Windows batch file. Selecting UNIX will also change the paths in the SQL file according to the UNIX environment (using "/" instead of "\" for example).
  3. In the Directories area, two pathnames are loaded from the registry keys when the wizard starts. Check to make sure they are correct.
  4. Oracle base – Oracle 8.1 introduced the Optimal Flexible Architecture where multiple Oracle homes may reside under one C:\Oracle directory structure. Prior to this, each Oracle home was the top of its own directory structure. The Oracle Base field represents the new ORACLE_BASE, or top-most directory, for 8.1 databases (for earlier databases it can remain the same as the Oracle home field value). When the wizard starts, this field is loaded from the registry ORACLE_BASE key, if on a database server, otherwise it loads the ORACLE_HOME key and has the same value as the Oracle home field. This is a required field.
  5. Oracle home – This is the Oracle home, or top-most directory for Oracle databases prior to 8.1. For 8.1 specified databases it is the first home created under the ORACLE_BASE, as previously described. Multiple databases can reside under the same Oracle home. For an Oracle 8.1 installation this home is named Ora81. This field is populated from the registry ORACLE_HOME key (local machine/software/oracle) when the wizard starts. It is a required field.
  6. Choose the appropriate Application type – This specifies how the database will be used. It sets the default block size field according to the following values:
    • Web – 4K
    • Multi-purpose – 8K

      • Data warehouse – 16K

      Note: If you change the block size manually, changing the Application type will not overwrite its value unless you click the Default button.

  7. You can also change the block size manually. Generally, the block size is determined by the Application type. This is the database block size. It will be used for the DB_BLOCK_SIZE parameter in the parameter file. The block size is typically either 2K or 4K. The default is 4K. This value should be a multiple of the operating system’s block size. This is a required field. Its minimum is 1K, and its maximum is a very large number. If you change this number and want to return to the default, click Use Default.
  8. Choose the Oracle version you are running.

Related Topics

New Database Wizard

New Database Step 2


New Database Step 2

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Hardware Info

Step 2 of the New Database Wizard sets the hardware information for the new database. These are the factors that describe your database hardware.

  1. Select the Word size for the database:
    • 32-Bit
    • 64-Bit
  2. Select the number of CPU cores, and whether you want to use HyperThreading.
  3. If you are using a 64 bit machine, choose the OS Word Size you want to use.
  4. Move the slider by dragging it with your mouse to select the number of Physical CPUs the database will support. This number is used in the computation of the cpu_count value in the parameters file. The cpu_count will only be included if its value is greater than 1.
  5. Specify the available RAM. This figure is used in the computation of the db_block_buffers and shared_pool_size values in the parameters file.
  6. Select the CPU GHz. This is used in the computation of the cpu_count value in the parameters file.
  7. Specify the Cache size. The cache size is used in the computation of the cpu_count value in the parameters file.
  8. Specify the number of Channels/Directors. This will be used in the computation of the cpu_count value in the parameters file.

Related Topics

New Database Wizard

New Database Step 1

New Database Step 3


New Database Step 3

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Database Info

Step 3 of the New Database Wizard sets the Database information. For detailed information about these parameters, please see your Oracle documentation.

  1. If you are using a 64 bit machine, select the appropriate Oracle Word Size.
  2. Enter the Character Set you want to use.
  3. Enter the National Character Set you want to use.
  4. Move the slider by dragging it with your mouse to select the number of Users the database will support. This number is used in the computation of the log_buffer value in the parameters files, as well as the size of the redo log files during automatic tablespace layout with only one volume.
  5. Select the number of instances allowable on the same node.
  6. Select the average number of users per instance on the same node.
  7. Click Next.

Related Topics

New Database Wizard

New Database Step 2

New Database Step 4


New Database Step 4

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Tablespace Mode Selection

Step 4 of the New Database wizard allows you to choose the way Toad creates tablespaces. This can be done automatically by Toad, or manually by you.

  1. Select the method of creating tablespaces:
    • Choose Automatic if you want to give Toad a list of hard drives/volumes and their attributes and have Toad automatically lay out the tablespaces across these volumes, optimizing the layout for either drive speed or available drive space.
    • Select Manual if you want to specify all tablespace information, including datafile location, starting with a default list that Toad provides.
  2. If you want to use an UNDO tablespace, select the checkbox. Otherwise, clear it: the default is checked.
  3. Click Next.

Related Topics

New Database Wizard

New Database Step 3

New Database Step 5


New Database Step 5

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Automated Tablespace Mode or User Defined Tablespace Mode

The step 5 window displays in one of two ways. If you chose Automatic in Step 4, Toad displays the choices for Automatic tablespace mode. If you chose Manual, Toad displays choices for manually allocating tablespaces.

Automatic

The Automatic Step 5 allows you to enter the list of volumes you want Toad to consider available for datafiles. The list starts with a default C drive of 136 mb, which is the smallest required volume for the minimum database size of 136.

The Add, Edit and Delete buttons operate on the volume list grid. See New Database: Add Edit Volume for more information.

  1. Specify the total size of the database you want created in the Total database size (mb) field. The tablespaces will be created to fill this size.
  2. Select whether to optimize for Speed or Space. Tablespaces are assigned to the provided volumes according to either Speed or Space.
    • If Speed, an algorithm is used to determine how fast each volume is, given the user inputs. The tablespaces are then assigned to the volumes according to their speed rating, the tablespaces being assigned, and those that can best coexist on one volume.
    • If Space is chosen, the volumes with the most room are chosen, for the tablespace being assigned.
  3. Click Preview to review how the tablespaces are being assigned.

Manual

The Manual Step 5 Tablespace Mode screen allows you to enter the tablespace information yourself, instead of having Toad assign them automatically. You are provided with standard default tablespace and redo log information.

  • Add/Edit tablespace – These buttons open the add/edit tablespace dialog box. This dialog box makes changes to the tablespace grid. See New Database: Add/Edit Tablespace for more information.
  • Add/Edit redo log – These buttons open an add/edit redo log dialog box. This dialog box makes changes to the redo grid. See New Database: Add/Edit Redo Log for more information.
  • Total database size – Shows the total size of the tablespaces and redo logs you have entered.

The only restrictions on your settings are:

  • There must be a minimum of 2 redo logs.
  • SYSTEM, RBS and TEMP tablespaces may not be deleted.

Related Topics

New Database Wizard

New Database Step 4

New Database Step 6


New Database Step 6

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

Build Database

This is the final step of the wizard. Select from a variety of Oracle options, and start the execution of various SQL install scripts.

  1. Select the appropriate Oracle options for your database from the checkboxes provided. See Oracle's documentation for more information.
  2. Select the appropriate choice from the Generation options:
    • Create database now – Saves the wizard information to a script (one is generated in the Windows Temp directory if not provided) and then executes the script. This option is only available if Local is chosen on the first screen (user is operating a PC that has a database server installed).
    • Save information to a batch/script file – (caption changes according to Windows/UNIX). This field specifies a batch (.BAT) or script (.SH) file to create that can be executed at a later time in order to create the database. If the provided directory path is not present, the user is asked if they want the directory created. By default, the file is put into the datafile directory (varies according to version specified) and is named "create" + the database name.
  3. Click Finish.
  4. If you are saving to a batch file that does not yet exist, Toad will ask if you want to create it. Click Yes.
  5. If you have chosen Create database now, a dialog box lets you know the database has been created.
  6. Make adjustments to the database name if required. Adjustments will be required if the following conditions are met:
    • a SQLNET.ora file is present in the Network/Admin directory AND
    • a domain name is used for the database aliases (if there is a NAMES.DEFAULT_DOMAIN value present). The wizard will not extract this information and include it in the database name entry in TNSNames.ora. Choose the correct option below and make the appropriate changes as described.

If you saved to a Batch or Script File:

  • You can make the adjustments prior to executing the file. Open the batch file or shell script (.BAT or .SH file) the wizard created.

    • The last section is a series of ECHO commands. Modify the first line in this series as necessary. For example:

    Assuming a named domain of "WORLD" is being used, modify the script as follows:

    Change | To
echo "TEST = ">>c:orant/network/admin/tnsnames.ora | echo "TEST.WORLD= ">>c:orant/network/admin/tnsnames.ora

If you chose Create Database Now:

  • You will need to manually edit TNSNames.ora to add the domain name to the end of the database name. For example:
    • A SQLNET.ora file is present, with the line: NAMES.DEFAULT_DOMAIN = world

      • If Ora805 is the database name, you will edit TNSNAMES and add .WORLD to the end. The following is one possibility:

      ORA805.WORLD =

      (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(Host = ORA804) (Port = 1521))

      (CONNECT_DATA =

      (SID=ORA805)

      )

      )

Related Topics

New Database Wizard

New Database Step 5


New Database Wizard

The Toad Database Wizard provides a rapid way for DBAs to create Oracle databases. It offers an interface to select parameter values for construction of the database parameter file (INIT.ORA) and for values used in the construction of a SQL file that can later be executed by either a batch file (Windows) or a script (UNIX), generated by the wizard.

It is easy to use and has the ability to automatically assign tablespaces across available hard drives (or volumes), optimized according to either a drive performance rating it assigns, or available volume space. It is OFA-compliant (Optimal Flexible Architecture) in the directories it creates for 8.1.x databases.

Note: This feature is only available in the commercial version of Toad with the optional DB Admin Module.

To access the New Database Wizard

» SelectDatabase | Create | New Database .

Starting Up and Shutting Down Databases

Databases created with the New Database Wizard can be started up and shut down with the Instance Manager. Be aware of the following:

  • The .bat/.sh script the wizard creates calls orapwd, the Password File creation utility.
  • This creates a password file to permit the use of a client connection using a SYSDBA privileged account. This, in conjunction with remote_password_login = EXCLUSIVE in the pfile (INIT.ORA) is required for starting up & shutting down from the client with a SYSDBA privileged connection (OS authentication alone will not work).
  • The INIT.ORA created by the wizard sets remote_password_login to exclusive to support this.

    • The sysdba privilege is also granted to both SYS and SYSTEM.

    Note: The database to be shutdown/started does not have to have been created with the Wizard, but a password file is required and remote_password_login=EXCLUSIVE must be set in the pfile (typically INIT.ORA or INIT<sid>.ORA.

    See Instance Manager for more information.

Related Topics

New Database Step 1

Instance Manager


JD Setting Breakpoints

Setting Breakpoints in the Java Debugger

You can set breakpoints in the Java debugger in the same way you would for PL/SQL Debugging.

To set breakpoints

» Do one of the following:
  • Click in the gutter of the line where you want the breakpoint.
  • Click [image] from the Breakpoints window

Related Topics

Getting Started with the Java Debugger

Java Debugger Overview

Setting Breakpoints in the Java Debugger

Setting Watches

Stepping into Java Code

Troubleshooting Java Debugging

Breakpoints Window


JD_Setting Watches

Setting Watches

You can set watches in the Java debugger in the same way you would for PL/SQL Debugging.

To add a watch from the Editor

  1. Click a variable in the Editor.
  2. Click the Add Watch [image] button in the toolbar. The variable is added to the list of watches. If the Watches window was not open, you will need to open it to view watches.

OR

Right-click in the Editor and select Debug and then Add Watch at Cursor.

To add a watch from the Watches window

  • Right-click and select the Add Watch menu item. The Watch Properties dialog box displays.

Or

Press <CTRL>F5 to add the variable at the cursor to the list of watches. The watch is added but the Watch Properties dialog box does not display.

To add a watch from the Debug Menu

  1. Click in the variable you want to watch.
  2. From the Debug menu, select Add Watch at cursor.

Related Topics

Getting Started with the Java Debugger

Java Debugger Overview

Setting Breakpoints in the Java Debugger

Stepping into Java Code

Troubleshooting Java Debugging

Watches Window


Optimizer Pane

The left hand side optimizer pane displays the status of your optimizing session, and an overview of the results.

The topmost area displays the number of plans checked, the number of unique plans, and a progress bar while optimization is in process.

Below this is a link to the Best Alternative for the Goal you set in the Customization Pane. See Customization Pane for more information.

The grid provides the various alternatives Toad has discovered, the metrics results for the

Note: This Toad feature is only available in the Toad Xpert bundle.

To view the Best Alternative

» Click the Best: Alternative link in the Optimizer pane. The alternative code is opened in the Alternative Detail tab.

To view any other Alternative

» Do one of the following:
  • Double-click on the alternative in the data grid.
  • Click the alternative detail tab and then select the alternative from the drop-down menu.

To view grid results by other Goals

» Select the goal containing the metrics you want to see from the View By: drop-down.

Related Topics

Tuning Single Statements

Customization Pane

About Working with Data Grids


Popup Editor

Popup Editors

Use the text editor to edit the contents of lengthy columns. Use the date editor to change the formatting of date columns. In addition, Toad provides popup editors for several other file formats. (See Related Topics)

Note: The recordset must be editable in order to edit the data in the Popup Editor window. See Understand Editable Resultsets for more information about making a recordset editable.

To access the Text Editor

» Do one of the following:
  • From the SQL Results grid or Schema Browser data grids, right-click and select Popup Editor.
  • Double-click on a CHAR, VARCHAR, CLOB, or LONG column.

To access the Date Editor

» Do one of the following:
  • From the SQL Results grid or Schema Browser data grids, right-click and select Popup Editor.
  • Double-click on a Date column.

Related Topics

BLOB Editor

View BFILE data

View Object Data

View Nested Table Data

View VARRAY Data

View CURSORs


Tuning Single Statements

Note: This Toad feature is only available in the Toad Xpert bundle.

When you need to tune a statement within a procedure, function, package, or script, but don't need or want to tune the entire thing using SQL Optimizer or Oracle Tuning, you can tune a single statement from within Toad.

If you do not save the tuning session, it is automatically cleaned up when closing Toad to save disk space.

Tuning sessions are saved to \SQLTuning. This folder is not configurable.

To tune a single statement

  1. Place your cursor within the statement you want to tune.
  2. Do one of the following:
    • On the Editor toolbar, click [image] and select Single Statement Tuner.
    • Right-click and select Tuning | Single Statement Tuner.
    • From the main menu, select Database | Optimize | Single Statement Tuner.
  3. Set your tuning options in the customization pane.
  4. Click to start optimization.
  5. Optionally, save the tuning session.

To view details of one alternative

  1. Click the Alternative Detail tab.
  2. Select the alternative you want to view in the Alternative box.

To compare alternatives

  1. Click the Compare Alternatives tab.
  2. Select the alternatives you want to see from the drop-down menus in each pane. Explain plans and metrics are displayed below the alternative code.

Related Topics

Customization Pane

Optimizer Pane

Oracle Tuning Advisor Overview

Using SQL Optimizer with Toad


CR/LF Example

You can use the following script to demonstrate the Newline options:

CREATE TABLE crlf_comp

(textcol VARCHAR2(20));

INSERT INTO crlf_comp VALUES ('crlf'| | CHR(13)| | CHR(10)| | 'char'); /*Carriage return linefeed combo*/

INSERT INTO crlf_comp VALUES ('line'| | CHR(10)| | 'feed'); /*Linefeed only*/

COMMIT;

See General Oracle Options for more information

Windows style

  • The cells in the grid will show two black characters for a CrLF, and one black character for a LF.
  • The memo editor will start a new line when it encounters a CrLF, but will just show a black character when it encounters a LF.
  • When you post data from the memo editor, the line separator will be a carriage return + linefeed.

Unix style

With the option checked:

  • The cells in the grid will show two black characters for a CrLF or a LF.
  • The memo editor will go to a new line whenever it encounters a CrLF or a LF.
  • When you post data from the memo editor, the line separator will be just a linefeed.


Regular Expressions Character Classes

Character Classes

Character classes in regular expressions can be specified by enclosing a list of characters in square brackets ([]), which will match any one character from the list contained within. If the first character after [ is "^", the class matches any character not in the list.

Within a class list, use the "-" character to specify a range. For example, a-z is all the characters between a and z, inclusive. You can include "-" as a member of the class by putting it at either the start or the end of the list, or by escaping it with a backslash.

Examples

Expression | Matches
m[aeiou]ke | 'make', 'meke', 'mike', and so on, but not 'mke','mbke', 'mcke', and so on.
m[^aeiou]ke | mbke', 'mcke', and so on, but not 'make', 'meke', and so on.
[-az] | 'a', 'z' and '-'
[az-] | 'a', 'z', and '-'
[a\-z] | 'a', 'z', and '-'
[a-z] | all 26 lower case characters from 'a' to 'z'
[\n-\x0D] | any of the following: '10', '11', '12', or '13'
[\d-t] | any digit, '-', or 't'
[]-a] | any character from ']' to 'a'

Related Topics

Regular Expression Searches

Examples of Regular Expressions

Replace with Template


Toad Options

To use options

  1. From the View menu, select Toad Options.
  2. Select a category on the list at the left
  3. Set options in the detail pane on the right.

Option settings are saved in TOAD.INI and restored the next time Toad is opened. Some of these options are set when you first create the TOAD.INI file (when you open Toad for the first time).

See Search for Options for more information about searching the options.


Set Up the Oracle Database

Before you can use Team Coding and CVS together, you must configure your Oracle Database to do so.

It is assumed that Team Coding has been installed on the database prior to setting up CVS. See Set Up Team Coding for more information.

To set up the Oracle Database

  1. Connect to your database as the Team Coding Administrator user.
  2. Select Team Coding | Team Coding Status
  3. Click the Settings button
  4. Select Enable Team Coding.
  5. Select Use Code Control Groups.
  6. Select Use 3rd Party Version Control.
  7. Under Version Control Provider, select CVS (Concurrent Versions System).

Related Topics

Concurrent Version Systems Requirements

Log Into CVS


Create Constraint

Create and Alter Constraints

To create a constraint

  1. Do one of the following:
    • From the Create menu, select Constraint.
    • Click [image] on the Schema Browser | Tables.
  2. Type the constraint name in the Constraint Name field.
  3. Select the FROM schema and FROM table from the Schema and Table lists. This will query and populate the columns into the Table Columns list.
  4. Refer to the following for additional information about different constraint types:
    5. Constraint Type | Notes
Primary Key | If a Primary Key constraint already exists for the selected table, then the Primary Key button will be disabled.
Check | Check Constraint Condition example: SALARY < 100000 and COMMISSION > 5000
Note: If you want to move records that do not meet the new constraint criteria into another table, click the Exceptions tab, pick a schema, existing table, or enter a new table name, and click the Create a New Exceptions Table button.
  5. Review the SQL prior to execution by clicking the SQL tab.
  6. Do one of the following:
    • Click the Execute button to create constraint immediately.
    • Click Schedule to schedule the create task for a later time.

Related Topics


Customization Pane

Note: This Toad feature is only available in the Toad Xpert bundle.

Set options for how Toad tunes your statement in the Customization pane.

To set customization options

  1. From the Auto Optimize SQL window, click Customization at the bottom of the left hand pane.
  2. Set a Goal for optimization and select the Database type which your SQL affects.
  3. Set Search Depth (how thorough the optimization will be) and whether or not to retry at a deeper depth if the goal is not met.
  4. If you want to set a time limit, you can choose to cancel the optimization if it exceeds a particular amount of time.

Related Topics

Tuning Single Statements

Optimizer Pane


Data Generation - Advanced Options Tab

The options available when you click the advanced options tab provide the ability to control how data is generated (See Generating Data Overview)

Note: Options tabs are only available from the right-click Generate Data selection. Generate Data tabs in other locations integrate options into one spot.

Table Options

Truncate Data before Data generation | Description

Reuse Storage

When selected, Toad instructs Oracle to retain the space from the deleted rows allocated to the table. This space can then be re-used by the new data generated.

Drop Storage

When selected, storage will be deallocated as data is truncated. Space can then be used by other objects in the tablespace.
Constraints | Description

Disable Constraints before Data Generation

When selected, Toad will disable all constraints (primary/foreign keys, unique, or check) on the selected table before generating data. If you also wish to maintain foreign keys while generating data, also select Enforce Referential Integrity.

Enable Constraints after Data Generation

When selected, Toad will enable all constraints (primary/foreign keys, unique, or check) on the selected table after generating data.

Note: This step may produce an error on Primary/Unique keys if duplicate data was generated in the table.

Triggers

Description

Disable Triggers before Data Generation

Disables any triggers associated with this table. This can be useful when a trigger is associated with an INSERT event that does additional work to the selected table, or other table in the database. By disabling these triggers, you ensure they will not be executed every time a record is appended during data generation.

Enable Triggers after Data Generation

Enables all triggers associated with this table after data generation has completed. Doing this ensures that these triggers fire for subsequent insert or update statements.

Enforce Referential Integrity

When selected, Toad creates data where all foreign keys in a details table contain only appropriate values found in the referenced table.

If you are generating data on a table that has referential integrity, this option defaults to checked. Otherwise, it defaults to unchecked.

Note: This option can significantly increase execution time. If the reference table has 10,000 rows, Toad queries all 10,000 rows, orders them in a random order, and selects the first value, inserting that value into the detail table. Because of this, you may want to schedule this task at a later time so as not to tie up system resources.

Random Data Generation

Description

Allow Generation of Reproducible Sequences

By default, the data generation window initializes its random generator using the system timer from gv$timer. Select this option to use a hard-coded random seed, allowing the script to reproduce the same sequence of data on multiple Oracle servers.

Transaction Commit Mode

Specifies the commit action to take after each table. DDL statements, such as TRUNCATE TABLE, DISABLE/ENABLE CONSTRAINT, AND DISABLE/ENABLE TRIGGER will automatically apply an implicit COMMIT against the database. This option specifies what level of commit to take between actual data generation blocks.

Commit work | Places a COMMIT statement after data generation block for each table.
Do not explicitly commit | Does not place a COMMIT statement after data generation block.

Related Topics

Generate Test Data

Data Generation - General Options Tab


Data Generation - General Options Tab

General options specify the basic requirements of the data in the Generate Data window. See Generate Test Data for more information.

Note: Options tabs are only available from the right-click Generate Data selection. Generate Data tabs in other locations integrate options into one spot.

Option

Description

# of Records to Create

Enter the number of records you want to create in this box.

Apply to All

Click Apply to All to apply the number of records to all tables in the table list. This can be useful if you are creating data for all tables in an entire schema.

Note: Maintaining referential integrity is defined from the Advanced Options tab.

Column Options

Set specific options for the table columns in the Column Options area. The grid provides a method to set minimum and maximum values for column entries. These are defined by the data type contained in the column. For example:

  • a NUMBER type could have a minimum of 1 digits and a maximum of 999
  • a VARCHAR2 type might have a minimum of one character and a maximum of 50.
  • a DATE might have a starting date of 01/01/2008 and an ending date of 06/30/2008.

Data Types Supported

String | Integers | Floating Point | Raw | Date/Time | Large Object
Char | Pls_Integer | Number | Long | Date | CLOB
Nchar | Binary_Integer | Binary_Float | Raw | Timestamp | NCLOB
Varchar | Integer | Binary_Double | Long Raw |  |
Varchar2 | Int | Dec |  |  |
Nvarchar | SmallInt | Decimal |  |  |
Nvarchar2 |  | Numerica |  |  |
String |  | Double |  |  |
Character |  | Precision |  |  |
Char Varying |  | Float |  |  |
Character Varying |  | Real |  |  |
National Char Varying |  | Double Precision |  |  |
National Char |  |  |  |  |
National Character |  |  |  |  |
National Character Varying |  |  |  |  |

Related Topics

Generate Test Data

Data Generation - Advanced Options Tab


Delete a Menu

To delete a menu

  1. Right-click in the menu bar and select Customize to display the customize window.
  2. Right-click the menu you want to remove. Select Delete from the menu. The menu is removed.


Execute Snippets

The Execute Snippet command (SHIFT+F9) executes the current statement at the cursor in the Editor and executes the current source in the Editor for PL/SQL debugging.

This is a legacy feature and should not be used. Instead, use execute/compile as a statement. See Execute Single Statements for more information.


New Database: Add/Edit Redo Log

Clicking the Add or Edit button displays the Add/Edit Redo Log Screen. The title of the window will either specify Add Redo Log or Edit Redo Log, depending on what you chose.

  1. Enter or change the File name of the redo log.
  2. Enter or change the Size (in megabytes) of the redo log.
  3. Click OK to save your changes and return to the New Database Wizard.

Return to New Database Step 4


New Database: Add/Edit Tablespace

Clicking the Add or Edit button displays the Add/Edit Tablespace Screen. The title of the window will either specify Add Tablespace, or Edit Tablespace, depending on what you chose.

These properties are Oracle requirements to specify tablespace. Enter or change information in the fields as follows:

  • Tablespace name: Enter the tablespace name in this text field
  • File name: Enter the file name
  • Size (Mb): Enter the size of the tablespace
  • % Increase: Enter the percent increase desired
  • Initial: Enter the size of the first extent allowed
  • Next: Enter the size of extents after the first
  • Max Extents: Enter the maximum number of extents you want to allow
  • Logging - Check to use logging
  • Dictionary
  • Locally managed
    • Auto allocate - you can choose to auto allocate logging.
    • Uniform size - choose the size.

Click OK to save your tablespace modifications.

Return to New Database Step 4


Save As dialog

Use this dialog box to pick an output file for your Editor code.

If the destination file is marked with the read only file system attribute, Toad will not be able to save the Editor code to that file. Pick another file.

Note: You can also save the contents of your data results grid using the Export Dataset command. See Export Dataset for more information.

To access save as

» Select the File | Save As menu item.


Save File

This saves your current file. If you have not selected a name it opens the Save As window, at which time you can select or type in a name. See Save As dialog for more information.

To save a file

» From the File menu, select Save.


Viewing or Hiding Docked Windows

Many of the windows within Toad can be docked to the main window. These include, but are not limited to:

  • Project Manager
  • Output window
  • Code Snippets
  • Object Palette

When docked, these windows can be displayed at all times, or they can be hidden in the form of tabs unless you run your pointer over them.

To hide a docked window

» In the upper right corner of a docked window is a thumbtack button. When visible, the thumbtack image will be vertical. Click [image] to hide the docked window.

Hidden Docked windows

When the docked window is hidden, a tab with the name of the window displays in its place, taking up less screen space.

To view a hidden docked window

» To view the window, hover the pointer over the tab.

To show a hidden docked window

» Click [image] in the upper right corner of a hidden window to show the docked window.

Related Topics

Project Manager Overview

Output Window

Code Snippets

Object Palette


Accessing the Server Side Install Wizard

In order to install server side objects, you will need to have access to either the account for the Toad user, the account for the schema where you are installing them, or an account with the DBA role.

To install server side objects

  1. From the Database | Administer menu, select Server Side Objects Wizard. The wizard displays.

  2. Select what you want to do:

    Install, upgrade or remove objects for all users to share

    Use this to create and administer a special schema called TOAD. This schema gives you a central location from which to maintain the tables needed to run the above-mentioned portions of Toad. You could create some of these objects (Explain Plan and Profiler) in every schema in which you intend to use them (in other words, every schema would have these same tables, see below) but if you have a large number of users, using the Toad schema is more efficient. In addition, Toad Security, ObjectName, and Team Coding must reside in the Toad schema.

    Install, upgrade or remove objects for an individual schema to use

    If you do not want to create the Toad user, you can create and administer certain objects in the schemas where you intend to use them. This may be more efficient if you have a small number of users for these special features and you do not want all of your users to have access.

    Create setup scripts without a database connection

    You can create the scripts to set up the Toad schema, and so on without access to the database connection you need. Then you can log in later and run the scripts.


Administering the Toad or other Publicly Accessible Schema

When you choose to create or administer the Toad schema from the Server Side Objects Installation wizard, you must have access to either the Toad user, or a user account with a DBA role.

  1. Do one of the following:
    • Install, upgrade or remove shared objects in the Toad schema.
    • Drop the entire Toad schema and all public synonyms for its objects
    • Install, upgrade or remove shared objects in a schema other than Toad.
  2. Enter your logon information in this screen and then click Next.

    3. Note: Whether you are using a TNS file or an LDAP server, servers will be listed in the database drop-down.

Related Topics

Install Server-Side Objects

Select Objects to Administer

Accessing the Server Side Install Wizard


Install/Remove Objects in Private Schema

Install, Upgrade or Remove Objects in Private Schema

You can use the Server Side Install wizard to provide Explain Plan support and Toad Profiler support on an individual basis.See Install Server-Side Objects for more information.

If you do not want to create the Toad user, you can create and administer some of the objects in the schemas where you intend to use them. This may be more efficient if you have a small number of users for these special features and you do not want all of your users to have access.

If you choose this option, remember that each user who needs to use the features will have to have setup done individually.

To start the process

  1. Enter the Log on information for the user account where you want to create the objects.
  2. Click Next.

See Select Objects to Administer for more information about the next step.

Related Topics

Install Server-Side Objects

Accessing the Server Side Install Wizard


Select Objects to Administer

From the Server Side Install wizard Toad checks the selected user schema and lists the features that include server side objects, along with their status. See Install Server-Side Objects for more information.

Statuses include:

  • Found and OK
  • Not found
  • Error

This notice will describe the problem in more detail. For example, if you are using an older version of Oracle, the message under Toad Profiler might read as follows:

Profiler not applicable to Oracle versions less than 8.1.

Alternately, you may have a problem such as:

Synonyms missing, Toad_PROFILER package is modified or out of date.

Choose the objects you want to administer in the private schema and what you want to do.

You can now choose what you want to administer. When you have made your choices, click Next.

Profiler Tables

Use Toad’s interface to DBMS_PROFILER.

Caution: Toad Profiler objects should be installed into EITHER the Toad schema or an individual user schema, not both.

  • Add - This option lets you add the objects not currently in the selected schema that are necessary for Toad’s interface to DBMS_PROFILER.
  • Remove - You can choose to remove objects. Removing a Toad object will make that portion of Toad unusable unless they are present in the Toad schema.
  • Drop and Recreate All - Use this option to drop and then recreate all objects required for the Profiler. This option is available when Toad finds problems in the Profiler objects that it cannot fix.
  • Recompile and Update - Use this option to recompile and update the Profiler objects. This option is available when Toad finds problems in the Profiler objects that it can fix. You can also update Toad_PROFILER at any time, even if it is found and OK.

Related Topics

Install Server-Side Objects

Accessing the Server Side Install Wizard