Реклама
Реклама
8
Modules, Windows And Dialogs
Analyze Tool
Use the Analyze tool to view and collect statistics, validate structure and list chained rows for database structures such as tables, clusters and indexes.
Ways to open the Analyze Tool
From DB Navigator
From the Explain Plan Tool
1. Select a table, cluster or index node in
2. Click Object | Analyze or right click Analyze.
1. Select a node in the
2. Click Show/Collect Statistics.
Collect Statistics
Select the collection method.
Description Collection
Method
Compute
Statistics
Estimate
Statistics
Delete
Statistics
The entire object is scanned to gather data. The larger the object, the longer it takes to complete the analysis.
Select this option only if the object is small.
Sample by rows or percentage of the object. The accuracy of the statistics depends on the representatives of the sampling.
This option suits large objects.
Delete the statistics gathered for the object.
SQL Navigator 7.2
User Guide
130
Validate Structure
Use to verify the integrity of the selected object.
Select Cascade to additionally verify dependent objects. For example, if you validate the structure of a cluster and select Cascade, SQL Navigator checks all tables and indexes in the cluster.
NOTE:
Oracle returns an error message if it encounters corruption in the structure of an object. To fix errors: Drop and recreate the object from the commands on the
List Chained Rows
Use to identify migrated or chained rows in a table or cluster. Having a high percentage of chained rows can impair application performance. UPDATE statements that cause migration and chaining perform poorly.
Queries that select migrated or chained rows must perform more I/O than those that do not. For these reasons, it is important to detect and correct them. See Oracle documentation on the possible ways of fixing chained-rows problems.
1. The default name for the table that will contain the chained rows information is CHAINED_ROWS. This is defined at View | Preferences |
2. Click Create Chained Rows Table to create the table. Watch for verification in the
3. Click List Chained Rows to collect the information. Watch for verification in the
4. To view the information select the CHAINED_ROWS table in
and click
|
Auto Describe Tool
The Oracle DESCRIBE command reports the attributes, methods and arguments of an object type. The SQL
Navigator Describe command works with more objects than does the SQL*Plus version of the command. You can describe not only procedures, functions, packages, synonyms, and object types, but also tables, indexes, clusters and objects.
Ways to open the Auto Describe Tool
From the
From the
1. Click View | Auto Describe Tool.
2. Ensure the required database connection is active.
3. Select the object to describe. The object may be in DB Navigator, Project Manager, (for example).
1. Press and hold CTRL.
2. Click on the object's name.
SQL Navigator 7.2
User Guide
131
If the object is a text object (view, procedure, function, package or packaged procedure/function) and the Source Preview window is open then the object’s source is automatically previewed.
TIP:
l
Can be used to provide a quick summary of a table or view and all its column names and data types.
l
l
The Auto Describe Tool always stays on top of the application window.
l
Select the following to automatically display the Auto Describe Tool when you press CTRL and click on an object name and create a hyperlink:
|
|
Describe Object at Hyperlink.
Tips to use the Auto Describe Tool
A quick way to construct a SELECT statement
In the Code Editor
To drag column names into a Select statement
1. Open the Auto Describe Tool.
2. In the Code Editor select the table name.
3. Drag and drop column names from the Describe window into the SELECT statement.
To move the text cursor to the declaration of a variable (or Auto Describe it if it’s the name of an external database) press CTRL and point to the variable with the mouse.
To return to the former position in the text, press Alt+Left Arrow.
Describe Command or Auto Describe Tool
Use either the Describe command or the Auto Describe Tool to describe an object
View Menu |
Auto Describe
Tool
Object menu
| Describe
Automatically see a description of any object you select.
A dockable Describe window opens and stays on top of the application window.
As you select various objects you will automatically see a description of the selected object in the Auto Describe window.
Click the Describe command on the Object menu whenever needed. It opens a describe window for a single selected object and will not update automatically when you select another object.
Benchmark Factory
SQL Navigator 7.2
User Guide
132
Benchmark Factory™ is a highly scalable load testing, capacity planning and performance tuning tool capable of simulating thousands of users accessing your database, file, Internet and messaging servers. Benchmark Factory can simulate user transactions before and during application deployments, enabling performance issues to be addressed before end users are affected.
l
Allows IT professionals to determine system capacity and isolate system stress related problems l
Common interface displays the testing of databases, Internet, e-mail and file servers.
l
Simulates the maximum number of users on a minimal amount of hardware l
Enables IT professionals to discern problems before and after applications are deployed l
Comprehensive tutorials cover load testing, benchmarking, capacity planning and performance tuning, including information on configuring your system and analyzing results.
NOTE:
Requires installation of Benchmark Factory. Benchmark Factory is installed independent of SQL
Navigator.
Bookmarks Dialog
View / Go to / Delete bookmarked lines in the code.
Option
List of bookmarks
Jump
Delete
Description
Click on a bookmark to highlight it.
View the highlighted bookmark in an editor.
Delete the highlighted bookmark.
TIP:
More bookmark actions can be found on the
Capture Web Output
When you first log in to SQL Navigator, the Web server is not enabled for use.
Start Capturing Web Output
1. Click Session | Capture Web Output.
2. Verify that the Oracle Web Toolkit is installed and visible to the schema. Check the
for a confirmation message.
SQL Navigator 7.2
User Guide
133
While Capturing Web Output
Each time you execute PL/SQL code that generates HTML output, the generated HTML is displayed in the
NOTE:
If the PL/SQL procedure is run under the debugger, the HTML output is not visible until the procedure is complete.
Change Logon Password
Modify the logon password of the current session.
Option Description
Old password The password you used to logon to the Oracle session.
New password
What you want to change the password to.
Verification Type the new password twice: once in the New password box and then again in the
Verification box.
Code Analysis
Code Analysis is an automated code review and analysis tool. It enables individual developers, team leads, and managers to ensure that the quality, performance, maintainability, and reliability of their code meets and exceeds their best practice standards.
NOTE:
This feature is available in the Professional Edition and higher.
Access to Code Analysis
Code Analysis is available in the Code Editor, which ensures code quality from the beginning of the development cycle. In the Code Editor, Code Analysis evaluates how well a developer's code adheres to project coding standards and best practices by automatically highlighting errors and suggesting smarter ways to build and test the code.
SQL Navigator also provides a dedicated Code Analysis window, where you can perform more detailed analysis, evaluate multiple scripts at the same time, and view a detailed report of the analysis.
SQL Navigator 7.2
User Guide
134
Rules and Rule Sets
Code Analysis compares code against a set of rules (
Code Analysis Rules ) for best practices. These rules are
stored in rule sets ( Code Analysis Rule Sets ).
The Code Analysis rules and rule sets can be adjusted to suit the requirements of different projects.
Regardless of whether developers are responsible for their own code quality or if this needs to be managed centrally, Code Analysis can be adapted to fit either need.
Code Analysis Metrics
Code Analysis uses a variety of metrics to evaluate code, including the following: l
Computational Complexity (Halstead Volume)—Measures a program module's complexity directly from source code, with emphasis on computational complexity. The measures were developed by the late
Maurice Halstead as a means of determining a quantitative measure of complexity directly from the operators and operands in the module. Among the earliest software metrics, they are strong indicators of code complexity. Because they are applied to code, they are most often used as a maintenance metric.
l
Cyclomatic Complexity (McCabe's)—Cyclomatic complexity is the most widely used member of a class of static software metrics. It measures the number of linearly-independent paths through a program module. This measure provides a single ordinal number that can be compared to the complexity of other programs. It is independent of language and language format.
l
Maintainability Index (MI)—Quantitative measurement of an operational system's maintainability is desirable both as an instantaneous measure and as a predictor of maintainability over time. This measurement helps reduce or reverse a system's tendency toward "code entropy" or degraded integrity, and to indicate when it becomes cheaper and/or less risky to rewrite the code than to change it. Applying the MI measurement during software development can help reduce lifecycle costs.
Code Analysis Window
The Code Analysis window provides detailed analysis, including a results dashboard, report, and tree view with violations and code properties. You can also simultaneously analyze multiple files from this window.
NOTE:
This feature is available in the Professional Edition and higher.
To perform detailed code analysis
1. Click Tools | Code Analysis.
2. Load files or objects to analyze.
SQL Navigator 7.2
User Guide
135
Open files.
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 rule set you want to use in the Code Analysis toolbar (the default is Top 20).
4. To evaluate statements' complexity and validity, select Run SQL Scan in the Run Review list on the
Code Analysis toolbar.
5. Select the items to analyze in the grid.
Use SHIFT or CTRL to select multiple items.
6. Analyze code for all selected items. Click or press F9. (Ensure Run Review is selected.)
Alternatively, to apply your selection to all items press F5.
7. Review the Code Analysis results.
Send code back to the Code Editor from the selected file or object. SQL Navigator displays the Code
Analysis errors and violations in the tabs below the Code Editor.
Additional details
Grid
Dashboard
The right side of the grid displays a dashboard of violations and statistics. The dashboard includes the item's Toad Code Rating (TCR), which is a composite of several rating criteria. The score ranges from 1 (best) to 4 (worst). It provides a quick reference for how your code has performed in the analysis.
Result tab The Results tab displays the analysis results in a tree view. Expand each node for details on the violations. If you select a violation in the tree view, the preview on the right displays the corresponding code.
The Result tab displays the results for the item selected in the grid. If you analyzed multiple items and select them in the grid, the tab displays the results for all of the selected items.
NOTE:
Click in the Code Analysis toolbar to view an icon legend.
Report tab
The Reports tab summarizes the analysis results and includes rule definitions. Items in the table of contents are hyperlinked so you can easily navigate the report.
NOTE:
By default, the Report tab only displays the analysis for one item. However, you can select Display all selected results on Report tab to include multiple items in the report.
Code Analysis Rule Sets
A rule set is a collection of rules that Code Analysis uses to evaluate code. You can create your own rule set and determine which rules to include. You can also import existing rule sets from outside SQL Navigator, and export user-defined rule sets.
SQL Navigator 7.2
User Guide
136
1. From the
Tools Menu , click Tools | Code Analysis.
2. From the Code Analysis toolbar, click .
Create and Edit
Icon Description
Edit the selected rule set.
NOTE:
You cannot edit SQL Navigator's standard rule sets.
Create a rule set
Use the selected rule set as your template
For each rule in the rule set, select the rule to include it, deselect the rule to exclude it.
Import and Export
Icon Description
Import a rule set. Navigate to the location of the rule set and click Open.
If the rule set has user defined rules then when importing you will be asked if a rule-export file exists, and you want to import it. If so the rules are imported. If any rule numbering has to occur because of conflicts, the rule set is automatically updated to the new rule numbers.
Export a user-defined rule set.
If the rule set has user defined rules then when exporting you will be asked if you want to export those user-defined rules with the rule set. If so the rules are saved as RuleExport.XML in the same directory as the exported rule set.
Code Analysis Rules
You can use existing Code Analysis rules or clone them and customize them to confirm your code meets your code review requirements. you can import and export rules.
1. From the
Tools Menu , click Tools | Code Analysis.
2. From the Code Analysis toolbar, click .
SQL Navigator 7.2
User Guide
137
Create or Clone
Icon Description
Create a rule
Clone the selected rule
The Code Analysis Rule Builder
Rule IDs are automatically generated sequentially from 7000 to 9000.
Enter the Description and specify the Rule Tip.
l
Specify Rule Severity, Rule Objective, and Rule Category.
l
Click to display the XML that SQL Navigator generates. This is helpful for use in an external XPath parser such as SketchPath to refine the XPath expression.
l
Create the XPath Expression. To test the rule, click .
A checked box in the User Defined column will be displayed for the rule you created.
Edit
Select the rule to edit. Edit the fields as necessary.
Field
Code Preview
XPath Expression
Description
Enter code to use for testing the rule.
Edit the XPath. If this field is blank, then you cannot edit the XPath for the rule.
To test the rule, click .
To restore a rule or all rules, you can select the rule and click the 'Restore Original Rule Value' button, or the double-arrow 'Restore All Original Rule Values' button.
Import and Export
Icon Description
Import a rule. Navigate to the location of the rule and click Open.
NOTE:
l
If a modified SQL Navigator rule is imported, the changes are applied to the rule in place.
l
If a user-defined rule has a number that already exists, the imported rule is given the next available rule number and added.
SQL Navigator 7.2
User Guide
138
Icon Description
Export the selected user-defined rule.
Code Assistant
Drag and drop PL/SQL syntax, SQL functions, column names, and database object names into code.
Move a code snippet into the editor
1. Click
| Code Assistant.
2. Click the cursor in the editor where you would like the snippet inserted.
3. Select the code snippet in Code Assistant. Double click on the code snippet or drag it into the editor.
Locate a code snippet in the Code Assistant
Code Snippets are stored in catalogs. The catalogs are as follows.
Catalog Description
Syntax and Web
Catalog
Browse the ready-to-use library of PL/SQL syntax. The Knowledge Xpert gives SQL Navigator users a library of more than 900 pre-built PL/SQL routines that can eliminate hours of low-level coding and debugging while enhancing application performance and reliability.
PL/Vision
Catalog
Knowledge Xpert products are available as optional add-on modules. For more information, see
Search Knowledge Xpert on page 193 .
Code and
SQL
Catalog
Store your own frequently used SQL statements and code fragments here.
For example, you can store your frequently-used cursor declarations or variable declarations.
TIP:
The catalog sorts the folders and items alphabetically by name. Use your own naming conventions or prefixes to group similar snippets together.
Syn- IF THEN ELSIF …
Syn- WHERE clause …
Syn- SQL - Correlated subquery
Etc.
SQL Navigator 7.2
User Guide
139
The Code Assistant Toolbar
Icon Tool Tip Description
Add new item or node Add a code snippet or SQL statement. Open the
.
Edit item or node
Delete item or node
Edit the selected item. Open the
.
NOTE:
l
To quickly rename an item: select it in the catalog then click on it.
l
You cannot rename the top level folders in the tree.
Delete the selected item.
NOTE:
You cannot delete the top level nodes of the tree.
Paste snippet into editor
Show information window
Capture code
Save all catalogs to disk
Use to paste a code snippet into an editor:
1. Click the cursor in the editor where you would like the snippet inserted.
2. Click Paste snippet into editor.
TIP:
Alternatively drag and drop the snippet into the editor.
Show/Hide the information pane.
The information pane shows detailed information on the selected item.
Use to add a code snippet or SQL statement from an editor window into the catalog:
1. Select the code in the editor window.
2. Click Capture Code.
This opens the
with the selected code already inserted.
Save changes.
Add to Catalog / Edit Dialog
Add a code snippet or folder to the Code Assistant Code and SQL Catalog. Manage items in the catalog.
Field
Name
Description
Make the name descriptive.
Names can be up to 35 characters long and contain uppercase letters, lowercase letters, and
SQL Navigator 7.2
User Guide
140
Field
Snippet
Description
any of the following characters:
_ - & space < > / , ' ( ) ..
Entry Type Select Code Snippet or Folder.
The snippet of code.
NOTE:
For code snippets only.
Information The text to be displayed in the Code Assistant Information pane.
Hint
Image
The text to be used as a hint in the status bar at the bottom of the Code Assistant window.
The icon to identify the code snippet in the catalog (Generic, Function, or Procedure).
NOTE:
For code snippets only.
Code Road Map
The Code Road Map graphically displays the complex PL/SQL interdependencies within a database.
Code Road Map Toolbar
Icon Tool Tip
New code road map
Clear diagram
Open file
Save file as
Save file
Save diagram as text file
Description
This opens the
.
Clear the model window. Revert to the initial start up state.
Open a saved map file (Extension: .crm).
Save the map with a new name (Extension: .crm).
Save the map (Extension: .crm).
Save the map as a text file.
The file consists of a list of the objects and what they reference.
For example the following might be the results of a small code map:
PROCEDURE CRM_TEST EX_PROC_1 ---> PACKAGE CRM_TEST EX_
PACK_2
SQL Navigator 7.2
User Guide
141
Icon Tool Tip
Save diagram as bitmap
Print diagram
Print preview
Code road map info
Collapse packages
Description
PROCEDURE CRM_TEST EX_PROC_1 ---> PROCEDURE CRM_TEST EX_
PROC_2
PROCEDURE CRM_TEST EX_PROC_1 ---> PROCEDURE CRM_TEST EX_
PROC_3
PROCEDURE CRM_TEST EX_PROC_1 ---> TABLE CRM_TEST EMP_
SNAPSHOT
PROCEDURE CRM_TEST EX_PROC_1 ---> VIEW CRM_TEST SALES
The map is laid out as follows where the arrow means "calls".
OBJECT-TYPE SCHEMA OBJECT NAME --> OBJECT-TYPE SCHEMA
OBJECT NAME
Create a bitmap version of the map.
TIP:
You could copy the image to the clipboard. Right click over the map and select Copy Image to Clipboard.
Print the model side of the map.
Preview before printing.
Add a comment to your code map.
Collapse/Expand Package View.
Icon Tool Tip
Collapse
Packages
Expand
Packages
Description
Show/Hide referenced sub units under the object type.
NOTE:
Applicable to Code Type | Package as set in the
.
Refresh the diagram.
Refresh diagram
Choose colors for database objects Color code database objects.
Zoom Zoom in or out of the model.
Previous auto layout / Next auto layout
Scroll through layouts of the Code Road Map.
SQL Navigator 7.2
User Guide
142
The Code Model
The code model consists of two panels. The left panel shows a list of components in a hierarchical tree. The right panel shows a graphic model of the code. The design is similar to models created using
Hierarchical Tree
The hierarchical tree is organized by object type. All procedures are listed under the Procedures node, and all tables under the Tables node.
Click on an object to highlight it in the
Graphical Model.
Graphical Model
Each object listing contains the name of the object, the schema where it resides, and the type of object. For Code Type | Package in Collapse Package view, any sub units that are referenced will be included under the object type. For example:
Lines indicate where an object is dependent on another. Lines have a knob end (the referencing object) and an arrow end (the referenced object).
In this example, DISK_UTIL references the library NT_KERNEL, specifically from the function GET_DISK_FREE_SPACE. The model is in Collapse Package view.
A self-recursive reference is shown with the arrow returning back to the object, as follows:
Actions: l
Click on an object in the tree view and the Graphic Model centers on that object.
l
Right-click on an object to
Actions: l
Right-click on an object to display the popup menu from the
Schema Browser for that object type.
l
F2 toggles full screen mode.
l
F4 or Double-clicking on an object performs a Describe, if SQL
SQL Navigator 7.2
User Guide
143
Hierarchical Tree
display the popup menu from the Schema Browser for that object.
l
F4 performs a Describe, if SQL
Navigator supports Describes on that object type.
l
Double-click an object to perform a Describe.
Graphical Model
Navigator supports Describes on that object type.
Model Code Dialog
Select the code to map and the options to use when the code is mapped.
Field
Schema
Code Type
Code Unit
Sub Unit
Description
The schema where the code is located.
Select from: function, package, procedure and trigger.
The options depend on the Code Type selected.
The various parts of the package, sorted alphabetically. The first sub unit is selected by default.
NOTE:
Visible for Code Type | Package.
Levels to
Model
Display Mode
The number of levels to model down from the starting object. The default is ten.
Option Description
Code
Only
Model the code the object calls.
Display a graphical representation of the run-time, call-stack dependencies.
Code +
Data
Model both the code called and data (tables, views, and so on) referenced by the object.
Display the database objects the code references and in what manner (for example, read versus write). You can also include pertinent triggers and views.
Views are essentially treated as tables.
Display
Options
Select as appropriate. These options affect the visual display of the map. The data in the map is not affected.
l
Expand packages and types for calls into them l
Include triggers (for Code + Data) l
Include views (for Code + Data) l
Include calls to SYS-owned objects
SQL Navigator 7.2
User Guide
144
Field Description
l
Include calls to other schema PL/SQL
Code Templates
Insert ready-made code segments into any active editor window.
Action
Insert code from a template into an active editor window.
Add / Edit / Delete code templates.
Description
1. In the editor, place the cursor where you want to insert the code segment.
2. Choose one of the following: l
Type the shortcut key to the code template.
l
Type the full or partial name of the code template and press
Ctrl+J to either insert the matching code template or select from a list of matches.
l
Press Ctrl+J. Select the template name from the drop-down list and press Enter.
Click View | Code Templates | Edit Code Templates. This opens the
Shortcuts And Templates Dialog
Each template is a file in the SQL Navigator installation Templates directory.
The maximum number of templates allowed, including preformatted templates, is 100.
Standard code routines for which templates have been provided:
Code Description
Basic Loop Statement
Boolean Statement
Close Cursor Statement
DBMS_OUTPUT.Put_Line
Exception
Exit When Statement
Shortcut Key
Shift+Ctrl+L
Shift+Ctrl+B
Shift+Ctrl+C
Shift+Ctrl+D
Shift+Ctrl+E
Shift+Ctrl+X
SQL Navigator 7.2
User Guide
145
Code Description
For Loop Statement
GOTO Label Statement
IF Statement
MLSLABEL Statement
Number Statement
Open_Cursor Statement
Raise_Exception
SQLCODE Statement
VARCHAR2 Statement
Variable_name
While Condition Statement
Shortcut Key
Shift+Ctrl+F
Shift+Ctrl+G
Shift+Ctrl+A
Shift+Ctrl+M
Shift+Ctrl+N
Shift+Ctrl+O
Shift+Ctrl+R
Shift+Ctrl+S
Shift+Ctrl+V
Shift+Ctrl+T
Shift+Ctrl+W
Code Shortcuts And Templates Dialog
Create your own code templates. Edit or delete existing code templates. Change the shortcut key definitions attached to a template.
Option Description
Templates Click on a template to select it.
Code
Add
Delete
Column
Name
Description
The name of the template. A template name is a single word with no spaces.
You cannot change a template name. Instead, you can delete an existing template and create another like it with a different name.
Description A short description of the template.
Click in the Description field to edit it.
Shortcut key
The shortcut key combination used to insert the template code into an editor.
Click in the field to change the Shortcut key. Select from those available. To have no shortcut key select None.
View / Edit the SQL code for the selected template.
Create a new template.
Delete the selected template.
You cannot delete all the templates. There must be at least one template remaining in the
Code Shortcuts and Templates dialog.
SQL Navigator 7.2
User Guide
146
Default Templates
Name
Basic Loop
Description
Basic Loop Statement
Boolean Boolean Statement
Close Cursor Close Cursor Statement
DBMS_PutLine DBMS_OUTPUT.Put_Line
Exception Exception Statement
Exit_When
For_Loop
GOTO_Label
IF
MLSLABEL
Number
Open_Cursor
SQLCODE
VARCHAR2
Exit When Statement
For Loop Statement
GOTO Label Statement
IF Statement
MSLABEL Statement
Number Statement
Open_Cursor Statement
Raise_Exception Raise_Exception
SQLCODE Statement
VARCHAR2 Statement
Variable_name Variable_name
While_ While
Code
LOOP
statements;
END LOOP;
Boolean;
Shortcut Key
SHIFT+CTRL+L
CLOSE cursor_name;
DBMS_OUTPUT.Put_Line(string);
EXCEPTION
WHEN exception_name THEN
statements;
WHEN no_data_found THEN
statements;
WHEN others THEN— Handles all
exceptions
statements;
SHIFT+CTRL+B
SHIFT+CTRL+C
SHIFT+CTRL+D
SHIFT+CTRL+E
EXIT WHEN condition_is_true ; -- To exit loop SHIFT+CTRL+X
FOR J IN 1..12 LOOP
statements;
END LOOP;
SHIFT+CTRL+F
GOTO label_name ;
IF condition_is_true THEN
statements;
SHIFT+CTRL+G
SHIFT+CTRL+A
MSLABEL;
NUMBER( precision , scale ),
SHIFT+CTRL+M
SHIFT+CTRL+N
OPEN cursor_name ;
RAISE exception_name ;
SQLCODE;
VARCHAR2( size ), variable_name ColName%TYPE;
WHILE condition_is_true LOOP
SHIFT+CTRL+O
SHIFT+CTRL+R
SHIFT+CTRL+S
SHIFT+CTRL+V
SHIFT+CTRL+T
SHIFT+CTRL+W
SQL Navigator 7.2
User Guide
147
Name
Condition
Unassigned
Unassigned
Unassigned
Unassigned
Unassigned
Unassigned
Unassigned
Description
Condition Statement
Code
statements;
END LOOP ;
Shortcut Key
SHIFT+CTRL+H
SHIFT+CTRL+J
SHIFT+CTRL+K
SHIFT+CTRL+P
SHIFT+CTRL+Q
SHIFT+CTRL+Y
SHIFT+CTRL+Z
Code Test
The Code Test panel automates the process of testing PL/SQL programs.
To open the Code Test module
1. Open a procedure or function to test in the
.
2. Click Tools | Code Test
3. All test cases currently defined for the procedure / function are displayed. Packages are grouped by entry point.
Icon Tool Tip
Open and
Select
Object
Refresh
Description
Opens the
.
Refresh the list of test cases against the current object.
Create
New Test
Case
Edit Test
Case
Clone Test
Case
Run
Selected
Opens
. Create a new test case.
The first time you create a test case, you are prompted to install the Code Tester for
Oracle® repository. Installation of this repository is required. Complete the wizard that is launched.
Opens
. Includes the properties of the highlighted test case.
Opens
. Renames the test case. Includes the properties of the highlighted test case.
Runs the selected test cases.
SQL Navigator 7.2
User Guide
148
Icon Tool Tip
Test Cases
Description
l
Test Case Selected l
Test Case Not Selected
As test cases are run, the status of each is shown.
TIP:
l
Right click on the test case for further options.
l
Use the search facility to search for test cases by name or parameter.
l
Test cases created in SQL Navigator can also be used in Code Tester for Oracle®.
Test Case Properties
You describe the expected behavior of a program and then SQL Navigator generates the required code for the test case.
Field
Test Name
Description
The name of the test case selected or a new name. This field is editable.
Configure input parameters and expected outputs.
Parameter, Input & Expected
Output
Test & Result
Exception Outcome
Field
No Exception
Exception
Expected
Description
Select if you do not expect the test to raise an exception.
Select if you expect the test to raise an exception.
Fill in the expected Error Code as a number.
Elapsed Time Outcome
Field Description
Check Select to test the time taken to execute the code.
Time
(ms)
The maximum time allowed for the code to complete execution (in milliseconds).
Database Source Code Search
Search stored programs, triggers and views for a character string in the source code.
SQL Navigator 7.2
User Guide
149
TIP:
You can use this utility to perform a quick "where-used" impact analysis.
Open the Database Source Code Search dialog
Select Search | Code Search.
Define the search criteria
1. From the What tab define the search string.
2. From the Where tab select the schema and object type.
3. Click Search.
You can stop/suspend the search from the
or toolbar.
Now objects have been found
Take actions on found object(s)
Icon Action
Edit
Describe
Add to
Project
Manager
Source
Preview
Description
Double click on the object.
The object opens in the corresponding editor with the cursor at the line containing the
search string. For more information, see Visual Object Editors on page 90 .
View Describe information on the object.
Right-click on a row in the results set to see
information.
Save a shortcut to the code location.
Drag the selection from the result list to the
.
Open
.
Select found text objects to view their source code.
DB Navigator
DB Navigator shows the entire database structure as a tree with expandable nodes.
SQL Navigator 7.2
User Guide
150
DB Navigator Toolbar
Icon Tool Tip
Back and
Forward
Up One
Level
Description
Retrace your steps. Navigate between hyperlinked database objects and their dependent objects and components. Move between— l
An object and its dependencies, and vice-versa l
An index or trigger and the table to which it refers, and vice-versa l
A collector type and the base type of table it is related to l
A synonym and its base object
You can also use the Forward and Back buttons in conjunction with Up One Level.
Change hierarchy levels in the DB Navigator tree.
TIP:
Use Back to return to the level where you first used moved up.
DB
Navigator
Preferences
Set and Save filters to limit the objects displayed in the tree.
Open the
.
Expand the selected DB Navigator node and all its descendants.
Fully
Expand
Node from
DB
Refresh from
Current
Node
Show/Hide
Details
Panel
Refresh the selected DB Navigator node.
Show / Hide details about the selected DB Navigator node.
l
When you select a Schema node or Object Type node (for example, Tables or
Indexes) the details pane shows a list of objects contained in that node. This list allows for selection of multiple objects for batch operations like Drop, Extract
DDL, or Compile.
l
When you select a specific object the details pane shows attributes of the selected object.
Using DB Navigator
DB Navigator displays all types of Oracle objects, giving you a hierarchical view of any schema, including dependent objects. The tree view includes nodes for "My Schema," "All Schemas," and "Current Instance."
SQL Navigator 7.2
User Guide
151
This symbol Indicates
The node can be expanded.
Click + to drill down to underlying objects or data.
Alternatively, press the right arrow key or the space bar while the node is selected.
The node can be collapsed.
Click the – sign.
Alternatively, press the left arrow key while the node is selected.
(Grayed text) The database object at that node is disabled or offline.
(Red text) The database object at that node is invalid.
TIP:
l
Drag objects or connections that you use frequently to the
for fast access.
l
Double click on an object to open it for editing ( Visual Object Editors
,
).
l
Further commands are available on a selected object (or objects). Try the
click on the object.
l
When a property is a reference to another database object (for example the base table for an index, or synonym's base object), click on the reference in the Value column to jump to the referenced object's node and display its properties.
l
To move around in the Navigator window you can use the keyboard arrow keys. Use Page Up and
Page Down to scroll multiple lines.
l
To purge objects: Select the object(s) in the Recycle Bin and right click Purge. Alternatively, right-click on the Recycle Bin node and select Empty Recycle Bin.
l
To copy an object from one schema to another:
1. Open a second DB Navigator window.
2. Drag the object from the source window to the target window.
3. Execute the DDL displayed in the editing window l
To switch to another session's DB Navigator window, select the session and click View | DB
Navigator.
l
Filter Properties Dialog
Create or modify DB Navigator filters that restrict the display of objects in the DB Navigator tree. You can save your filters, so that they will be available from the DB Navigator toolbar.
SQL Navigator 7.2
User Guide
152
Select filter
Field
Filter Name
Description
Select an existing filter name or enter a new one.
Select filter settings.
Tab Description
General Selected schemas will be visible in the DB Navigator tree when the filter is applied.
Global
Filters
Selected top level nodes will be visible in DB Navigator when the filter is applied.
Object
Filters
Selected object types will be visible in the DB Navigator window when the filter is applied.
Application of name masks
Type the name mask in the Filter box.
Name masks are specified according to Oracle’s LIKE operator definition. For example, setting the name mask ABC% will result in displaying only those objects with names beginning with the characters "ABC".
The name mask is applied to all selected object types. Click Assign Globally.to
apply the name mask to all objects.
Describe
The Oracle DESCRIBE command reports the attributes, methods and arguments of an object type. The SQL
Navigator Describe command works with more objects than does the SQL*Plus version of the command. You can describe not only procedures, functions, packages, synonyms, and object types, but also tables, indexes, clusters and objects.
To open the Describe window
1. Ensure the required database connection is active.
2. Select the database object.
3. Click Object | Describe.
Right click the object in DB Navigator and select Describe.
Right click the object in Project Manager and select Describe.
Right click the object in Code Editor and select Describe Object at Cursor.
SQL Navigator 7.2
User Guide
153
Shortcut Ctrl+F3
TIP:
To keep the existing Describe window open while opening additional Describe windows, click the
Pin toolbar icon in the Describe window. Set the default pin behavior in View | Preferences | General
| User Interface.
l
Can be used to provide a quick summary of a table or view and all its column names and data types.
Tips to use the Describe window
A quick way to construct a SELECT statement
To drag column names into the Select statement
1. In the editing window, click the cursor on the table name.
2. Open the Describe window.
3. Drag and drop column names from the Describe window into the SELECT statement.
Describe Command or Auto Describe Tool
Use either the Describe command or the Auto Describe Tool to describe an object
Auto
Describe
Tool
Automatically see a description of any object you select.
A dockable Describe window opens and stays on top of the application window.
As you select various objects you will automatically see a description of the selected object in the
Auto Describe window.
Object |
Describe
Click the Describe command on the Object menu whenever needed. It opens a describe window for a single selected object and will not update automatically when you select another object.
Difference Viewer
The Difference Viewer displays the compared objects in a split window. Differences between the objects are highlighted, and the toolbars and menus give you access to controls for customizing the view and creating reports.
SQL Navigator 7.2
User Guide
154
The Difference Viewer Toolbar
Icon Tool Tip Description
Reload and recompare files
Reload the external SQL/text files. Recompare.
Open files Open an external SQL/text file.
Save Save to an external SQL/text file.
Switch sides
Find
Previous
Difference
Find Next
Difference
Show All
Switch left and right sides.
Go to the previous difference.
Go to the next difference.
Show all lines of the compared objects.
Just Show
Differences
Show only lines with differences.
Just show major differences
Show only lines with major differences (as defined by
).
Show only matching lines.
Just show matching lines
Find Find a text string.
Find again Find the next occurrence of the text string.
Go to line number
Copy To
Right
Copy To
Left
Delete left text
Delete right text
Undo
Go to a specific line number.
Replace the selected line (right) with the selected line (left).
Replace the selected line (left) with the selected line (right).
Delete the selected line (left).
Delete the selected line (right).
Undo the change made to the selected line.
Produce file differences
Generate a report of differences.
SQL Navigator 7.2
User Guide
155
Icon Tool Tip Description
report
Comparison summary
Compare similarities and differences in a summary.
Show whitespace
Show/Hide space characters as tilde (~) characters.
Show/Hide line numbers.
Show line numbers
Show thumbnail view
Show/Hide thumbnail view.
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 Difference Viewer window. You can click on the thumbnail view to position the viewer at that point.
Use to quickly change locations within the viewing window.
Show line details
File comparison rules
Options
Show full details of the current line below the viewing window (so you don’t have to scroll to see the entire line)
Open
Open
.
View Differences Dialog
Select objects or scripts to compare in the
.
Viewer Options
Appearance | Color Scheme
1. Select a color scheme for each of: l
Matching Text l
Similar Text l
Different Text
2. Define how missing text should be displayed.
Select Color and click Select Color to choose the color block to show to represent missing text.
Alternatively, select Blank.
SQL Navigator 7.2
User Guide
156
3. Click Font to customize the font, font style, font size and script.
4. Select Horizontal Lines Between Mismatches if desired.
TIP:
All changes to the appearance can be previewed in the sample viewer display in the Viewer
Options window.
Appearance | Find Next Difference
Customize finding the next difference.
File Comparison Rules
General
Option Description
Tab Stops Set the width of Tab Stops displayed in the Difference Viewer.
Synchronization
Settings
The Synchronization Settings control the workings of the comparison engine that reports differences and similarities between the two files. You can set the synchronization parameters low to allow more efficient searches for small differences, or higher for handling larger files or files with large differences. Unless you are experienced in manipulating comparison synchronization algorithms, you will probably find that the default settings work well enough for most situations.
Option Description
Initial Match
Requirement
The minimum number of lines that need to match in order for text synchronization to occur.
Skew
Tolerance
Suppress
Recursion
The number of lines the Difference 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.
Ignore Minor
Differences
Selected Ignore minor differences so you can focus only on significant differences.
Not
Selected
Highlight minor differences in the Difference Viewer window. Minor
Differences are as defined in the Define Minor tab.
SQL Navigator 7.2
User Guide
157
Define Minor
Option
Case
Leading Whitespace
Trailing Whitespace
Embedded Whitespace
/* Text within Slash-Asterisk
*/
(* Text within Parenthesis-
Asterisk *)
{ Text within Curly Braces }
Text Beginning With
Fortran Comments
Description
Select the items you want highlighted as minor differences. Items not selected will be ignored.
Ensure General | Ignore Minor Differences is not selected.
Edit Data
Use to edit data in a table object.
1. Select the table object.
2. Click Object | Edit Data.
Query Results Data Grid on page 70 .
ER Diagram
The ER (Entity Relationship) diagrammer lets you quickly model a table and graphically see the dependencies and joins to other tables.
NOTE:
To ensure indexes are delivered in the correct order in a diagram, ensure the Oracle Data
Dictionary is queried with DBA Views. For more information, see DBA Dictionary Views on page 48 .
SQL Navigator 7.2
User Guide
158
ER Diagram Toolbar
Icon Tool Tip
New ER Diagram
Clear ER Diagram
Description
Opens
Clear the ER Diagram window.
Open File
Save File As
Open a saved ER Diagram.
Save the ER Diagram.
Save File
Save Diagram as Bitmap
Print Diagram
Print Preview
Print the ER Diagram.
ER Diagram Info Show detail of the ER Diagram.
Load ER Diagram in the SQL
Modeler
For more information on the SQL Modeler, see
.
Find Table Dependencies Show joins between tables.
This feature does not add new objects to the diagram; it only finds joins between objects already displayed.
Refresh Diagram Refresh the ER Diagram window.
Scale Zoom in / out of the window.
Previous auto-layout /
Next auto-layout
Scroll through the layouts.
ER Diagram Display Area
For each table in the model
Diagram
Part
Description
Title Bar The name of the table and schema it resides.
Body Area The columns in the table, the column type, whether the column is indexed, and icons as applicable and selected in
SQL Navigator 7.2
User Guide
159
Diagram
Part
Description
Connector
Lines
Lines connect tables that are dependent on each other. Lines have a knob end and an arrow end. The referencing table resides at the knob end, and the referenced table at the arrow end.
To add tables to the diagram
Drag-and-drop from: l
l
From the tree, drag a single object only.
l
From the Details pane, drag a list of objects.
l
l
Create ER Diagram
Field
Schema
Table
How many levels of referential tables do you want to load?
Display Options
Description
Select the Schema where the table resides.
Select the table to diagram.
Select as appropriate.
The more levels of referential tables you load, the more complicated the diagram will become, and the longer SQL Navigator will take to create the diagram.
Select from: l
Show primary keys l
Show foreign keys l
Show unique keys l
Show data type l
Show not nullable l
Show indexes
If the display option has an icon associated with it, the icon is displayed to the right of the option. In the diagram, the appropriate icon will appear to the left of the table name.
SQL Navigator 7.2
User Guide
160
Explain Plan Tool
Use the Explain Plan tool to analyze the execution of a single SQL statement. By examining the execution plan, you can see exactly how Oracle executes your SQL statement, and how it can be improved.
This tool lets you: l generate plans and save them in the table of your choice l organize your saved plans by various criteria, such as type (for example, online SQL statements, batch
SQL statements, and so on), module, or subsystem l build separate plan tables for different subsystems in your project l browse each table separately.
TIP:
The
can be used in conjunction with the Explain Plan tool. The Explain Plan Tool does not analyze tables itself prior to executing the Explain Plan, but it does have a toolbar button for manual launch of the Analyze Tool.
Explain Plan Window
Generate Plans Drag a SQL Statement into the editor on this tab.
Option
Stmt ID
Description
If required, you can enter a Statement ID to identify the statement within the current plan table.
Select to save the SQL when saving the generated plan.
Save SQL text
Comment
Plan Table
Owner
Name
Optionally, comment on the plan.
Enter the Plan Table Owner or use the default listed.
Enter the Plan Table Name or use the default listed.
TIP:
If specifying a new plan table, use the Create Table button to create the table.
Click to view the Oracle execution plan for the statement.
Generate
Browse previously saved execution plans.
Browse Saved
Plans
Operation
Description
Plan
Explain the node selected in the Explain Plan tree. Show how each SQL operation is executed in relation in the Explain Plan.
Show / Hide in Generate Plans | Show Description.
The generated execution plan. Click on nodes to expand and collapse them.
SQL Navigator 7.2
User Guide
161
Print the Explain Plan tree
Use File | Print.
The following data is printed: l
The SQL Statement from which the explain plan tree was derived l
Statement ID, Type, Cost and Time stamp l
The Explain Plan tree, including the execution sequence numbers in brackets
TIP:
l
When the printout exceeds one page, the headings (such as the SQL Text and statement ID lines) are not repeated. This makes it easy for you to 'tile' multiple pages together to display the explain plan tree as a single diagram.
l
Use File | Print Preview to preview your output.
Export Table
Open the Export Tables window
Open the Export Tables window from
| Export Table.
TIP:
Select the objects to be exported before you open the Export Tables window. Use for example
,
, a list of results after finding objects.
Select the tables to export (1)
In the Export Tables window, tables in the Selected Tables list are exported.
Ways to move tables to this list (from the Browse Table to Export list): l
Double-click on a table.
l
Selecting one or more tables and click >.
l
Select one or more schemas and click >. This adds all tables in the selected schemas.
l
Click >>. This adds all tables in all schemas.
l
Select objects before you open the Export Tables window.
SQL Navigator 7.2
User Guide
162
Select export options (2)
Option
Objects to export
Additional Parameters
Description
Select the objects you want exported from the database to the DMP file.
Field
Direct
Consistent
Record
Description
Data is extracted directly, bypassing the SQL Commandprocessing layer. This method may be faster that a conventional path export.
Uses the SET TRANSACTION READ ONLY statement to ensure the data does not change during the execution of the export command.
Select this parameter if you anticipate other applications will update the data after an export has started.
NOTE:
Tables are usually exported in a single transaction. However, nested and partitioned tables may be exported as separate transactions. If nested or partitioned tables are being updated by other applications, the exported data may be inconsistent.
To minimize this possibility without selecting the
Consistent parameter, export those tables at a time when updates are not being performed.
Records an incremental or cumulative export in the system tables SYS.INCEXP, SYS.INCFIL, and SYS.INCVID.
Compress
Selected Flags table data for consolidation into one initial extent upon import. If extent sizes are large (for example, because of the
PCTINCREASE parameter), the allocated space will be larger than the space required to hold the data.
Not
Selected
Export uses the current storage parameters, including the values of initial extent size and next extent size. The values of the parameters may be the values specified in the CREATE
TABLE or ALTER TABLE statements or the values modified by the database system. For example, the NEXT extent size value may be modified if the table grows and if the PCTINCREASE parameter is nonzero.
NOTE:
SQL Navigator 7.2
User Guide
163
Option Description
Field
Buffer size
(leave blank for default)
Record Length
Description
l
Although the actual consolidation is performed upon import, you can specify the
COMPRESS parameter only when you export, not when you import. The Export utility, not the Import utility, generates the data definitions, including the storage parameter definitions. Therefore, if you do not select
Compress when you export, you can import the data in consolidated form only.
l
Neither LOB data nor subpartition data is compressed. Rather, values of initial extent size and next extent size at the time of export are used.
The size, in bytes, of the buffer used to fetch rows. This parameter determines the maximum number of rows in an array fetched by Export.
Use the following formula to calculate the buffer size: buffer_size = rows_in_array * maximum_row_size
If you specify zero, Export Tables fetches only one row at a time.
Tables with columns of type LOBs, LONG, BFILE, REF, ROWID,
LOGICAL ROWID, or DATE are fetched one row at a time.
NOTE:
See your Oracle operating system-specific documentation to determine the default value for this parameter.
The length, in bytes, of the file record. The RECORDLENGTH parameter is necessary when you must transfer the export file to another operating system that uses a different default value.
If you do not define this parameter, it defaults to your platform-dependent value for buffer size.
You can set RECORDLENGTH to any value equal to or greater than your system's buffer size. (The highest value is 64 KB.)
Changing the RECORDLENGTH parameter affects only the size of data that accumulates before writing to the disk. It does not affect the operating system file block size.
You can use this parameter to specify the size of the Export
I/O buffer.
SQL Navigator 7.2
User Guide
164
Option
Specify files
Description
Field
Statistics
Provide a feedback dot each time n rows are exported
Field
Output file name
(.dmp)
Parameter file name
(.dat)
Log file name (.log)
Description
NOTE:
See your Oracle operating system-specific documentation to determine the proper value or how to create a file with a different record size.
Select the type of database optimizer statistics to generate when the exported data is imported.
Export should display a progress meter in the form of a period for n number of rows exported.
For example, if you specify FEEDBACK=10, Export displays a period each time 10 rows are exported.
NOTE:
The FEEDBACK value applies to all tables being exported; it cannot be set individually for each table.
Description
The names of the export dump files.
This field is mandatory.
A name for the file that contains a list of import parameters.
This field is mandatory.
The name of the log file.
All informational and error messages are written to the log file.
Results (3)
When execution is complete there are three tabs in the Export Tables window. The results of the export are shown on the Output tab. The Log and Parameter file tabs show the contents of their respective files.
Find and Replace
Find or replace text strings in the current text file.
NOTE:
Select Regular expressions if you want your strings to be recognized as Regular Expressions.
Regular Expressions are a widely-used method of specifying patterns of text to search for. Special metacharacters allow you to specify, for instance, that a particular string you are looking for occurs at the beginning or end of a line, or contains >n< recurrences of a certain character.
SQL Navigator 7.2
User Guide
165
Find objects Dialog
Find objects in any schema.
What To Search For
You can construct a search argument for any database object.
l
You can use wild-card characters %" and "_" (according to SQL LIKE operator definitions).
l
You can filter by schema, object type, date last modified and status.
TIP:
To display a dynamic list of all objects in a schema
1. In
, select a schema node in the top level of the DB Navigator tree.
2. Click Search | Find Objects.
Now Objects Are Found
Task Action
Describe View a description of object structure ( index, cluster, procedure, function, or package).
Use
or
on the selected object.
Sort Sort on any column (name, owner, type, creation/modification date, status) in ascending or descending order.
Click the column header.
Open the object for editing
Double click on the object.
See
or the
for more information.
Locate in schema
Display the selected object in DB Navigator.
For more information, see Locate In Tree on page 183 .
Batch selection and update
On selecting multiple objects you can l apply commands like Copy Text, Drop, Extract DDL, Compile, Get Metadata, Properties,
Send to Code Analysis, Add to Project Manager, Enable, Disable, and Truncate to the
entire batch of objects. For more information, see Object Menu on page 26 .
l drag the group of objects into a text editor or
.
SQL Navigator 7.2
User Guide
166
TIP:
Other actions are available. Right-click on the object and select a command from the shortcut menu
Find Recycle Bin Objects Dialog
Search for objects in the recycle bin.
NOTE:
Requires Oracle 10g or later.
What To Search For
You can construct a search argument for any database object.
l
You can use wild-card characters %" and "_" (according to SQL LIKE operator definitions).
l
You can filter by schema, object type, drop date and System Change Number (SCN).
Now Objects Are Found
Task
Sort
Open the object for editing
Batch selection and update
Action
Sort on any column (name, owner, type, creation/modification date, status) in ascending or descending order.
Click the column header.
Double click on the object.
See
or
for more information.
When multiple objects are selected, you can apply commands like Copy Text, Purge and
Flashback to the entire batch of objects.
TIP:
Other actions are available. Right-click on the object and select a command from the shortcut menu
Formatting Options
Configure how the Formatter Tool formats code. Formatter Tools are available from the
SQL Navigator 7.2
User Guide
167
Formatting Options Toolbar
Icon Tool Tip
Open
Save
Reset Pane to
Recommended Defaults
Description
Open a previously saved file of SQL Navigator formatting options.
Save the currently selected formatting options to the SQL Navigator installation folder, filename FmtOptions.opt.
TIP:
Click File | Save as in the Formatting Options window to save the options to a different file name or location.
Reset the Formatting Options to the default values
TIP:
SQL Navigator loads the Formatting Options from the default file (FmtOptions.opt) and default location each time the Formatting Tool Options window is opened and when the Formatter Tool performs formatting. The default location for Formatting Options is in the SQL Navigator installation folder.
Set formatting options
Category
Oracle
Formatter
Options
Header
Spacing
Options in the Category
Tooltips
Show tooltips when the mouse cursor is hovered over certain options.
Copy Options to Clipboard
Copy the options in both INI and XML format to clipboard for backup or reviewing purposes.
Show the Example Window
Show an example window when navigating different pages of the Formatter Options window.
You can specify a script file to be formatted as an example, or select the Document per
Pane option to use the example scripts from the Example document folder.
You can modify the example scripts in the Example window. Changes are saved automatically.
Select Enable to generate a header tagline after formatting the script. You can specify some text to be included in the header tagline. Do not use /* or */ in the text.
Note: The date time options are currently not in use.
Set physical output characteristics such as tab size, margins, and indents.
SQL Navigator 7.2
User Guide
168
Category
Comments
Case
Options in the Category
Select this option to align trailing comments to the right margin.
Modify the lowercase, uppercase, or initial capitals of various syntax elements.
Operators &
Punctuations
Alignments
Specify the behavior of various operators and punctuations.
Set alignments of various syntax elements.
List
Arrangements
Define list attributes such as parentheses, commas and folding/stacking characteristics.
HTML Viewer
Show HTML in the integrated viewer.
This eliminates the need to switch from your coding environment to an external browser.
TIP:
l
Enable
so each time you execute PL/SQL code, the generated HTML is displayed in the integrated viewer. If the PL/SQL procedure is run under the debugger, the
HTML output is not visible until the procedure is complete.
l
You can select links and submit forms from the integrated viewer. If the link or submit target is another PL/SQL generated page then that page appears in the viewer. If it is an external link then an error message will appear. You must fill in the
Web Support Configuration Dialog
for this to work correctly.
l
Use the
Web Support Configuration Dialog
to specify where images can be loaded or enter the details of your web server's configuration.
l
Click View in External Web Browser to open the page in your default Windows web browser.
This is useful for testing links to pages that are not PL/SQL generated. SQL Navigator will map images as defined in the
Web Support Configuration Dialog , but this mapping will only apply to
the generated page. All links, frame sources and your browser and Web server, not SQL
Navigator, will handle form posting.
l
Click File | Print to print the page.
Stored Procedure > HTML
Developing Oracle Web server applications involves programming with PL/SQL using the PL/SQL Web toolkit supplied with Oracle Web Server. SQL Navigator provides an integrated development environment with advanced coding, testing and debugging of PL/SQL programs for Oracle Web server.
SQL Navigator 7.2
User Guide
169
Actions
Enable the web server
Open the procedure for editing.
Description
Select Session |
Code Web Server Procedures in the
The editor includes drag and drop coding for Web toolkit packages, including htp and htf items.
Execute the procedure.
Execute the procedure in the
Preview HTML output
NOTE:
You can use the SQL Navigator Debugger to step through the stored procedure, if you want to debug the generation of HTML. However, the HTML will not be displayed until the stored program has completed execution.
View the translated HTML page in the HTML Viewer
Compile and save your script.
TIP:
Use the drag and drop feature as you would for any script development. The Web Server Syntax allows you to drag Web server syntax directly into your script. The results of dragging and dropping syntax into your program are displayed.
Use the
See also
for HTML > Stored Procedure.
Import HTML as PL/SQL
Convert a HTML file into a PL/SQL stored procedure. The stored procedure will in turn output the HTML code via the Oracle Web Toolkit.
Actions Description
Enable the web server
Open the Code
Editor.
New Stored
Object
Select Session |
Click View |
Create a new stored object in the Code Editor. Enter the name and the parent schema of the new procedure.
Import HTML file as PL/SQL
Click Tools | Import HTML as PL/SQL
The import process wraps each line of the imported HTML file inside the htp.print ( … ); markers.
PL/SQL statements can be embedded in HTML code inside comments; for example:
<!--PLSQL a_random_plsql_statement; -->
These comments must start with the string
SQL Navigator 7.2
User Guide
170
Actions
Save the program to the database.
Description
<!--PLSQL and end with
-->
You can put things in the declaration section of the procedure (to declare a cursor, for example) by ensuring they come first in the file, before the first <HTML> tag. For example:
<!—PLSQL
CURSOR emp_cur IS
SELECT ename
FROM emp;
When the HTML is imported into the stored program, you can save the program to the database.
See also
for Stored Procedure > HTML.
Sample code for displaying query results in a HTML page
The following example code will display details from a query in a web browser.
First, create a table named emp with a column ename. Add some data to the ename column, and then run the following procedure with the SQL Navigator Web Development Module enabled.
PROCEDURE PLH_EXAM1 is—this procedure generated from "\\phanevski1\c$\docs\EXEone.HTM".—warning: any changes made to this procedure will not be—reflected in the original HTML file.
CURSOR emp_cur IS
SELECT ename
FROM emp; begin htp.print(‘ ‘); htp.print(‘<HTML>’); htp.print(‘<HEAD>’); htp.print(‘<TITLE>Embedded PL/SQL Example</TITLE>’); htp.print(‘</HEAD>’); htp.print(‘<BODY>’);
SQL Navigator 7.2
User Guide
171
htp.print(‘<H1>Employee Names</H1>’); htp.print(‘<TABLE>’); htp.print(‘ ‘);
FOR emp_rec IN emp_cur LOOP htp.print(‘ <TR>’); htp.print(‘ <TD>’); htp.print(emp_rec.ename); htp.print(‘</TD>’); htp.print(‘ </TR>’); htp.print(‘ ‘);
END LOOP; htp.print(‘</TABLE>’); htp.print(‘</BODY>’); htp.print(‘</HTML>’); end;
Import Table
Open the Import Tables window
Open the Import Tables window from
| Import Table.
Select the tables to import (1)
Option Further Options and Description
Import all tables Import all tables in the DMP file into the current user's schema regardless of which user the tables belong to.
Specify From User To
User
Import all the tables owned by the From User to the To User. Specify the from and to users in the relevant fields.
To import tables from more than one user, use a space or comma (,) to separate the user names.
Manually enter table names
Type the names of the tables to import and click Add.
Do not include the schema prefix in the table name.
SQL Navigator 7.2
User Guide
172
Select import options (2)
Option
Objects to export
Additional Parameters
Description
Select the objects you want imported to the database from the DMP file.
Field Description
Reuse existing data files
Reuses the existing datafiles making up the database. Selecting this parameter causes the Import utility to include the Reuse parameter in the datafile clause of the CREATE TABLESPACE statement. This results in the Import utility reusing the original database's datafiles after deleting their contents.
Commit after each array insert
NOTE:
l
The export file contains the datafile names used in each tablespace. If you select this parameter and attempt to create a second database on the same system the Import utility will overwrite the first database's datafiles when it creates the tablespace.
In this situation, it is recommended that this parameter is deselected so that an error occurs if the datafiles already exist when the tablespace is created. In addition, if you need to import into the original database, select the Ignore errors parameter to add to the existing datafiles without replacing them.
l
If datafiles are stored on a raw device, deselecting this parameter does not prevent files from being overwritten.
Sets the Import utility to commit after each array insert.
By default, the Import utility commits only after loading each table.
If an error occurs, a rollback is performed before continuing with the next object.
Selecting this parameter prevents rollback segments from growing inordinately large and improves the performance of large imports. If the table has a uniqueness constraint it is recommended that this parameter is selected. If a table does not have a uniqueness constraint, the Import utility could produce duplicate rows if you reimport the data.
If a table has nested table columns or attributes, the contents of the nested tables are imported as separate tables. Therefore, the contents of the nested tables are always committed in a transaction distinct from the transaction used to commit the outer table.
If this parameter is not selected and a table is partitioned, each partition and subpartition in the export file are imported in a separate transaction.
SQL Navigator 7.2
User Guide
173
Option Description
Field
Ignore errors
Description
For tables containing LONG, LOB, BFILE, REF, ROWID, UROWID, or
DATE columns, array inserts are not done. If this parameter is selected, the Import utility commits these tables after each row.
Specifies how object creation errors should be handled. If selected, the Import utility overlooks object creation errors when it attempts to create database objects, and continues without reporting the errors. Note that only object creation errors are ignored; other errors, such as operating system, database, and SQL errors, are not ignored and may cause processing to stop.
In situations where multiple refreshes from a single export file are done and this parameter is selected, certain objects may be created multiple times (although they will have unique systemdefined names). You can prevent this for certain objects (for example, constraints) by deselecting the Constraints parameter when importing. If you do a full import with the Constraints parameter deselected, no constraints for any tables are imported.
If a table already exists and the Ignore errors parameter is selected, then rows are imported into existing tables without any errors or messages being given. This may be helpful when importing data into tables that already exist in order to use new storage parameters or because you have already created the table in a cluster.
If this parameter is not selected, the Import utility logs or displays object creation errors before continuing. If a table already exists, then errors are reported and the table is skipped with no rows inserted. Objects dependent on tables, such as indexes, grants, and constraints, will not be created.
NOTE:
When importing into existing tables, if no column in the table is uniquely indexed, rows may be duplicated.
Show export file contents only
When this parameter is selected the contents of the export file are displayed and not imported. The SQL statements contained in the export are displayed in the order in which the Import utility will execute them.
Buffer size
(leave blank for default)
The size of the buffer, in bytes, through which the data rows are transferred.
BUFFER determines the number of rows in the array inserted by the
Import utility. The following formula gives an approximation of the buffer size that inserts a given array of rows: buffer_size = rows_in_array * maximum_row_size
SQL Navigator 7.2
User Guide
174
Option
Specify files
Description
Field Description
For tables containing LONG, LOB, BFILE, REF, ROWID, UROWID, or
DATE columns, rows are inserted individually.
The size of the buffer must be large enough to contain the entire row, except for LOB and LONG columns. If the buffer cannot hold the longest row in a table, the Import utility attempts to allocate a larger buffer.
NOTE:
See your Oracle operating system-specific documentation to determine the default value for this parameter.
Record
Length
The length, in bytes, of the file record.
The RECORDLENGTH parameter is necessary when you must transfer the export file to another operating system that uses a different default value.
If you do not define this parameter, it defaults to your platformdependent value for BUFSIZ. For more information about the BUFSIZ default value, see your Oracle operating system-specific documentation.
You can set RECORDLENGTH to any value equal to or greater than your system's BUFSIZ. (The highest value is 64 KB.)
Changing the RECORDLENGTH parameter affects only the size of data that accumulates before writing to the database. It does not affect the operating system file block size.
You can also use this parameter to specify the size of the Import I/O buffer.
NOTE:
Note: See your Oracle operating system-specific documentation to determine the proper value or how to create a file with a different record size.
Provide a feedback dot each time n rows are exported
Displays a period each time the number of specified rows has been imported.
For example, if you specify 10, Import displays a period each time 10 rows have been imported.
NOTE:
The FEEDBACK value applies to all tables being imported; it cannot be set on a per-table basis.
Field
Dump file name
Description
The name of the export file to import.
The default file extension is .dmp. This field is mandatory.
SQL Navigator 7.2
User Guide
175
Option Description
Field
Parameter file name (.dat)
Description
The name of the file that contains the list of import parameters.
This field is mandatory.
Log file name (.log) The name of the log file.
All informational and error messages are written to the log file (if specified).
Results (3)
When execution is complete there are three tabs in the Import Tables window. The results of the import are shown on the Output tab. The Log and Parameter file tabs show the contents of their respective files.
Java Manager
The Java Manager is a convenient alternative to the Oracle LoadJava and UnloadJava command line utilities.
Use the Java Manager to load and unload multiple Java source files, classes, resources and archives.
Field
Files to Load, Add &
Remove
Options
Description
Manage the list of objects to load.
Set the command line switches found in the Oracle LoadJava and UnloadJava command line utilities.
For details, consult the Oracle documentation.
Job Scheduler
Access the Oracle Job Scheduler.
A job assigns a task to a schedule. The job tells the schedule which tasks - either one-time tasks created "on the fly," or predefined programs - to run. A specific program can be assigned to one, multiple, or no schedule
(s); likewise, a schedule may be connected to one, multiple, or no program(s).
SQL Navigator 7.2
User Guide
176
Tab Description Oracle
Check the status and settings of existing jobs.
Create, run, schedule, edit and remove jobs.
All Oracle releases
Define or select programs to be executed.
Define the frequency with which the Scheduler will execute a particular set of tasks.
Define time windows during which resource plans will be activated.
Oracle 10g release or later
Oracle 10g release or later
Create a named group with containing windows with similar scheduling properties for ease of management
Oracle 10g release or later
Oracle 10g release or later
Group together jobs that have similar resource demands into job classes to ensure best utilization of resources.
Show the current status and information about jobs over a specified date range or by owner.
Show the current status and information about Windows over a specified date range.
Oracle 10g release or later
Oracle 10g release or later
Oracle 10g release or later
Jobs Tab
The Jobs function in the Job Scheduler allows you to create, run or schedule jobs.
Note that some of the functionality below is only available in Oracle 10g or later releases.
Button
New
Save
Description
Click to create a job. This opens the New Job Wizard:
1. Enter a Job Name (for 10g or later)
2. Select a Job Type (PS/SQL Block or Stored Procedure - in 10g or later)
3. Click Next (for 10g or later)
4. Enter the PL/SQL code or select a stored procedure to run
5. Click Next
6. Specify a start date, start time and frequency for your job to run
7. Select a repeat frequency if desired
8. Click Finish.
The new job will appear in the Jobs window.
To attach a program, schedule or job class to a job (for 10g or later)
1. Select the job to be scheduled.
2. Select the program, schedule or job class to be attached to the job.
SQL Navigator 7.2
User Guide
177
Button
Advanced
Clone
Run
Drop
Description
3. Click Save.
To schedule a job (for 10g or later)
1. Select the job to be scheduled.
2. Click En (Enabled) next to the job.
3. Select Start and End date and time.
4. Click Calendar, choose the frequency and intervals for the job and click
5. Click Save.
Edit available Attribute Values for the selected item (for 10g or later).
Create a copy of the selected item (for 10g or later).
To run a job
1. Select the job to be run.
2. Click Enabled next to the job.
3. Click Run.
Remove the selected item from the database (for 10g or later).
Programs Tab
(Only for Oracle 10g release or later)
A program defines what the Scheduler will execute. A program's attributes include its name, type (for example: a PL/SQL procedure or anonymous block), and the action it is expected to perform. A program can also accept zero to many arguments, which makes it a flexible building block for constructing schemes of tasks to be scheduled.
Button
New
Save
Description
Click to create a program
1. Enter a Program Name.
2. Select a Type, that is PL/SQL Block, Stored Procedure or Executable.
3. If you do not want the program to be enabled by default, clear the Enabled check box.
4. Define the Action the program is to perform.
5. For PL/SQL Block or Executable, enter the relevant command string.
6. For Stored Procedure, select one of the available stored procedures from the database.
7. Enter any Comments if required
8. Click Save.
Save changes to a selected program or a new program.
SQL Navigator 7.2
User Guide
178
Button Description
Advanced Edit available Attribute Values for the selected item.
Drop Remove the selected item from the database.
Schedules Tab
(Only for Oracle 10g release or later)
A schedule defines when and at what frequency the Scheduler will execute a particular set of tasks. A schedule's attributes include the date on which a set of tasks should begin, how often the tasks should be repeated and when the set of tasks should no longer be executed, either as of a specified date and time, or after a specified number of repetitions.
Button
New
Save
Advanced
Drop
Description
Click to create a schedule
1. Enter a Schedule Name.
2. Select Start and End dates and times.
3. Click Calender, select the required Frequency and Interval and click OK.
4. Enter any Comments if required
5. Click Save.
Save changes to a selected schedule or a new schedule.
Edit available Attribute Values for the selected item.
Remove the selected item from the database.
Windows Tab
(Only for Oracle 10g release or later)
Assign resource plans to activate at different times such as during specific peak or off-peak periods.
Button
New
Description
Click to create a window
1. Enter a Window Name
2. Select a Resource Plan from the drop-down list
3. Select a Priority from the drop-down list
4. Select a Schedule to attach to run during the window as appropriate
5. Select the Duration (days, hours, months) for the window
6. Specify a start date/time and end date/time for the window
7. Select a repeat interval if desired
SQL Navigator 7.2
User Guide
179
Button Description
Click Save.
The new window will appear in the Windows list above.
Click Enabled to activate the window.
Save Save changes to a selected window or a new window.
Advanced Edit available Attribute Values for the selected item.
Open
Close
Drop
Activate the selected Window and commence running the scheduled jobs based on the durations currently entered. You can change the duration values if required.
Stop the currently active window. Any jobs using that window as their schedule which were started at the beginning of this window and have indicated that they must be stopped on closing of the window will be stopped.
Remove the selected item from the database.
Window Groups Tab
(Only for Oracle 10g release or later)
Create a named windows group to which you can assign any number of previously created windows on the
Button Description
New
Save
Drop
Click to create a window group
1. Enter a Group Name
2. Enter any Comments relevant to that windows group
Click Save.
The new group name will appear in the Window Group Name list on the left-hand side.
Select those Windows listed in the right pane that you want included in the group.
Click Enabled to activate the window group .
Save the window group.
Remove the selected item from the database.
Job Classes Tab
(Only for Oracle 10g release or later)
The Scheduler provides the capability to group together jobs that have similar resource demands into job classes. A job class can be used to ensure all jobs within it utilize the same job class attributes, execute at a higher or lower priority than other jobs in other job classes and only allow jobs in the job class to start if there are sufficient resources available.
SQL Navigator 7.2
User Guide
180
Button
New
Save
Advanced
Drop
Description
Click create a job class
1. Enter a Job Class Name.
2. Select the appropriate Resource Consumer Group as defined for the database.
3. Select the appropriate Service as defined for the database.
4. Select a Logging Level for the database.
l
Off l
Runs l
Full
5. Select the number of days the Log History will be retained.
6. Enter any required Comments
Click Save.
Save the job class.
Edit available Attribute Values for the selected item.
Remove the selected item from the database.
Job Log Tab
(Only for Oracle 10g release or later)
You can view a history of the Job Scheduler transactions over a range of dates, including all job owners if desired.
Field
From date / To date
Owner
Refresh
Description
Select the Start and End date range to view.
Select job owner to use in log display.
Update the display.
Window Log Tab
(Only for Oracle 10g release or later)
You can view a history of the Job Scheduler window transactions over a range of dates.
Field
From date / To date
Refresh
Description
Select the Start and End date range to view.
Update the display.
SQL Navigator 7.2
User Guide
181
Job Scheduler (Requirements)
Specific system privileges are required in order for you to manage the Job Scheduler for connections to Oracle
10g and later.
Job Scheduler system privileges
The system privileges associated with the Job Scheduler (for Oracle 10g and later) are as follows:
System
Privilege
Purpose…
CREATE JOB Enables you to create jobs, schedules and programs in your own schema.
Note: You can always alter and drop jobs, schedules and programs which you own, even when you do not have the CREATE JOB privilege.
CREATE ANY
JOB
EXECUTE
ANY
PROGRAM
EXECUTE
ANY CLASS
MANAGE
SCHEDULER
Enables you to create jobs, schedules, and programs in any schema. This effectively gives the grantee the ability to run code as any user so it must be issued with care.
Enables jobs the ability to use programs from any schema.
Enables jobs to run under any job class.
Enables you to create, alter and drop job classes, windows and window groups. It also enables you to purge scheduler logs and modify scheduler attributes.
INIT.ORA configuration file
In order to successfully use the Job Scheduler, you may also need to adjust the settings on your server in the
INIT.ORA configuration file to allow use of the DBMS_JOBS package (Oracle 9.2 and earlier) or the DBMS_
SCHEDULER (Oracle 10g and later).
The following minimum settings are recommended: job_queue_processes = 2 job_queue_interval = 10 job_queue_keep_connections = false
(Remember to restart your server to apply these settings.)
SQL Navigator 7.2
User Guide
182
Locate In Tree
When an object is open in an editing window, and you want to see where that object resides in the schema, you can use Locate in Tree to jump to that object’s node in the DB Navigator tree. This action expands all intermediate nodes and displays the object’s details—such as privileges and columns.
Locate in Tree is available from the following windows: l
l
l
l
l
l
l
l
l
Output Window
The Output Window displays SQL Navigator messages and server output including Oracle errors.
Interpreting the output display
User Interface
Tabbed Pages
Icons & Color
Coding
Description
There are tabs for each session, plus one for general messages not related to any particular session.
The types of output are distinguished by font color. Icon markers make them even more noticeable.
Color
Blue
Red
Black
Data type
Server output
Error Messages
Other processing messages
SQL Navigator 7.2
User Guide
183
NOTE:
The Output window displays the results of program compilation and execution, including errors.
You can view the full Oracle error description by double-clicking the error code in the Output window.
The resulting dialog contains the error message description, cause and recommended actions, just as they appear in Oracle documentation.
Actions
Action
Copy to the Clipboard
Clear
Print Contents
Description
Select the text you want to copy. Right-click the selection and select Copy.
Right-click in the Output window and select Clear.
Right-click in the Output window and select Print.
PL/SQL Profiler
Analyze the execution time and efficiency of your stored programs. The Profiler is particularly useful for finding bottlenecks in stored code and quality assurance and testing.
NOTE:
l
Requires Oracle 8.1.5 or higher.
l
Before using the Profiler, debug your stored program, as there is no editing capability from within the Profiler.
Toolbar
TIP:
Use the Runs / Groups tabs to select Runs and Groups.
Icon Tool Tip
Refresh
Description
Update both Run and Group tree views with the latest profiling data.
Keyboard
Shortcut
Alt+R
Filters /
Preferences
Open the
Profiler Filter/Preferences Dialog
.
You can sort and filter the result data according to thresholds that you set.
This makes it easy to limit the amount of data displayed, and to isolate the most significant items. For example, you can select lines that were not called during the run, or runs with total times higher than average.
Alt+P
SQL Navigator 7.2
User Guide
184
Icon Tool Tip
Delete
Create New
Group
Delete the data for the selected run.
If a group is selected then delete the group. Removing the group does not remove the associated run data.
Del
Create a new group. Open the
New Group / Group Properties Dialog .
Create groups to logically connect code units and runs. You determine which units and runs belong to a group. You can combine data for a single code unit across multiple runs in order to determine the real coverage and execution times. This is useful when testing stored code in several different runs with different parameters.
Ins
Locate the selected object in
DB Navigator
Open
with the tree expanded to highlight the selected object.
See where the object is in the database tree.
Open the selected object
Properties
Description
Open the selected object in the
Select a line of source code in the Source Viewer tab to open the Code
Editor at that line.
Open the
New Group / Group Properties Dialog
to modify the selected group.
Open SQL Optimizer for Oracle.
Keyboard
Shortcut
Alt+F2
Launch
Xpert tuning
Runs Tab
A run contains all code units that are called during execution. If a procedure or function is a part of a package, the whole package becomes part of the run. The same rule applies to type methods.
Selection Description of information
All Runs
Run
Totals across all the available runs.
Coverage
Time Statistics
Basic run characteristics (comment, date, number of lines, etc…), totals across all the run units.
Coverage
Time Statistics
SQL Navigator 7.2
User Guide
185
Groups Tab
For each group, you have the option of displaying the data either separately by run, or with runs combined.
Selection
All Groups
Group
Description of information
Totals across all the groups.
Time Statistics
Basic group characteristics, totals across the group units and runs.
Coverage
Time Statistics
Select PL/SQL Code on the Runs or Groups Tab
A PL/SQL code unit can be a stand-alone procedure or function, a package body, a type body or an anonymous block. A package body and type body contains further procedures and functions. For a procedure or function, it is sometimes possible to determine how many times it has been called during a run by parsing the available source code and combining the data about the lines where the procedure/function is called.
The Profiler will show you a line-by line analysis of the execution, including the number of times each line was executed and the time required for execution.
The Profiler: l stores data about each code unit executed during a run, down to the level of source code lines l divides all the available profiling data into hierarchically organized logical items l displays profiling and coverage statistics about each item and compares them with others
The Profiler displays the profiling data alongside the actual source code. (This feature is not available if the source code has changed since it was last tested in the currently selected run, or if it is not identical across the runs in a group.)
Selection
Procedure,
Function, Trigger
Body
Type Body,
Package Body
Description
Basic characteristics, totals across the runs. Combines the group runs if Combine Runs in
Group Result Sets is selected in the
Profiler Filter/Preferences Dialog
.
Time Statistics
Call Distribution
Source Viewer
Basic characteristics, total across the runs. Combines the group runs if Combine Runs in
Group Result Sets is selected in the
Profiler Filter/Preferences Dialog
.
Coverage
Call Distribution
SQL Navigator 7.2
User Guide
186
Selection Description
Time Statistics
Source Viewer
NOTE:
The Profiler uses the Oracle session it was activated in.
Profiler Filter/Preferences Dialog
Use the PL/SQL Profiler Filters/Preferences dialog to set the data filter options, sorting and chart drawing properties.
Data Filters
TIP:
Threshold and sorting works only if there is a single series to be displayed in the Runs tree and
‘Combine Runs in Group Result Sets’ is enabled for the Groups tree.
Option
Data Value Filter in
Runs Tree View
Show Anonymous
Blocks
Parse Packages for
Subroutines
Display Line Data
Description
Option
Display only items with value
More than, Less than, Equal to Zero, Nonzero
50 or other value
Description
When selected, charts and lists display only the items with the value specified
Set the method of filtering
Total/Average
Set the Threshold value.
Applicable when More than and Less than are selected.
Set the value against which the threshold value is to be compared.
Applicable when More than and Less than are selected.
Set the tree views to display the anonymous blocks executed during runs.
Set the profiler to break package data down to discrete procedures/functions.
Set the data displays to always show line data for the selected tree view item.
SQL Navigator 7.2
User Guide
187
Option
Directly
Sort Result Sets in
Runs Tree View
Combine Runs in
Group Result Sets
Description
For example, when a run is selected, the charts/lists will show all the lines executed in the run, not the run units.
Enable sorting of the result data in the Runs display.
When selected, you can control the sort order by your selection of the Descending
Order option.
Enable the combining of data from different Runs in the Group (for example, to obtain correct coverage value across the Runs).
Chart Options
Option Description
3D
Run Chart Series
Select to add a 3D look and feel to the charts.
Group Chart Series Select the color generation method for the chart series when displaying Group data
(Groups tree view).
Select the color generation method for the chart series when displaying Run data (Runs tree view).
Chart Panel Control the chart background color.
Series Color
Gradient
Series Color
Sequence
Select the colors used when Gradient is selected.
Select the colors used when Sequence is selected.
TIP:
Click on the color selection rectangles. Select a color from the Windowsstandard color selection dialog.
New Group / Group Properties Dialog
Use the Group Properties dialog to set group name, comment, used units and runs.
The Group Units and Group Runs list boxes display the units/runs used for analysis in the given group. You must specify at least one group unit.
PL/SQL Profiler Requirements
SQL Navigator 7.2
User Guide
188
Required Oracle Conditions
To run the PL/SQL
Profiler
To collect session statistics
For schemas that use the
PL/SQL Profiler
The DBMS_PROFILER package needs to be installed under SYS.
This is does not happen by default on a new instance.
The users need access to V$SESSION, V$SESSTAT and V$STATNAME.
This condition is satisfied when the users have SELECT privilege on system views
V_$SESSION, V_$SESSTAT and V_$STATNAME.
The profiler server side objectsInstalling_server_side_objects (tables and sequences) need to be installed.
Profile Manager
Profiles saved in SQL Navigator can be: l
Re-used in other versions of SQL Navigator.
l
Made available to other users of SQL Navigator.
l
Used on other computers.
l
Made available to support staff to help resolve issues.
To backup a profile
1. Open the Profile Manager: Windows Start | All Programs | Dell | SQL Navigator | Profile Manager
2. Select Backup User Profile.
3. Select the version of SQL Navigator which has the preferences you want to save.
4. Select the directory into which the backup file is to be saved.
5. Enter a name for the backup file, or accept the name displayed.
6. Click Backup.
NOTE:
The file is saved into the designated folder and has an extension of .prof.
To restore a profile
1. Open the Profile Manager: Windows Start | All Programs | Dell | SQL Navigator | Profile Manager
2. Select Restore User Profile.
3. Select the directory from which the backup file is to be restored.
SQL Navigator 7.2
User Guide
189
4. Select the file containing the backed-up profile file. Click Next.
5. Select the version of SQL Navigator that you want the backed-up to replace. Click Restore.
Project Manager
The Project Manager provides instant access to your frequently used database objects and connections.
Projects are holding areas where you can store shortcuts to things that you frequently need to work with instead of searching for them in various lists and directories.
Project Manager Toolbar
Icon Tool Tip
Select types of items to display
Sort items by specified field
Display items in a list
Display extra details about each item
View Tree
Description
See the
Sort items.
Show/Hide item details.
Go Up One Level
Create New Folder
Show/Hide Tree View.
Navigate between projects. Navigate folders in projects.
Navigate the Project Manager.
Organize items in the project in folders.
Manage Your Projects
Action
| New Project
| Rename Project
| Delete Project
Drag and drop into the Project Manager window.
Description
Create a project.
Rename the current project.
TIP:
Change the current project in the Project
Manager window.
Delete the current project.
Add items to the current project: l
Objects from
.
l
Objects from
.
SQL Navigator 7.2
User Guide
190
Action Description
l
Code Selection from
l
A file from Windows Explorer.
l
An Oracle Connection shortcut.
(username/connection strings)
These items can include: l schemas (in particular connections) l schema objects l code location bookmarks within stored programs l schema object templates
Actions on Items in the Project Manager
Select an object in Project Manager and ...
Action
Preview the source code of text objects
Description
To connect to a database from the Project
Manager
You can select a database object in your Project Manager and open it for viewing or editing.
SQL Navigator automatically opens the required database connection and displays the object’s properties in an object editing window. Double click on the shortcut to open the connection.
Code Location shortcuts
Drop an object
Drag the selection from the result list in
Manager.
1. Select the object in the Project Manager window.
2. Locate the object in DB Navigator.
3. Drop the object in DB Navigator.
to the Project
Keyboard Shortcuts In The Project Manager Window
TIP:
Right click in the Project Manager window to see all options available.
SQL Navigator 7.2
User Guide
191
Keyboard
Shortcut
Ins
Shift+Ins
Ctrl+H
Ctrl+U
Description
Add Objects in Project Manager. Open
.
Add Files in Project Manager
Hide items of the selected type (Requires you to select an object in the Project
Manager).
Go up one level (Requires you to have navigated to a sub-folder in the Project Manager window).
Project Filter Dialog
Select the object types you want to display in the project manager window.
Publish Java to PL/SQL
Create a PL/SQL package from a Java class stored in the database.
1. Select a Java Class stored in the database. Use
or the
2. Click Object | Publish Java to PL/SQL.
3. Follow the prompts to generate a PL/SQL package that stores the procedures and functions used to call
Java methods for handling the stored object.
4. The package is generated and displayed in the window. Do you want to open it for editing before saving it to the database, or save it as shown?
Quick Browse
View chained rows information.
1. Select the table object.
2. Click Object | Quick Browse.
3. The Code Editor opens. The query is run. For more information, see SQL Query Results Data
Rename Object
SQL Navigator 7.2
User Guide
192
1. Select the object.
2. Click Object | Rename.
Search Knowledge Xpert
Drag and drop optimized routines directly into your program editor.
Knowledge Xpert is a library of more than 900 pre-built PL/SQL routines, written by some of the world's leading
PL/SQL experts, that can be integrated into the standard PL/SQL environment. The complete PL/SQL Code
Library can eliminate hours of low-level coding and debugging while enhancing application performance and reliability.
Knowledge Xpert
SQL Navigator users can now access 5,400 technical topics, error messages, pre-built and tested code solutions, and code formatting technology. Using the
Code Assistant , you can drag and drop these optimized routines
directly into your program editor.
For example: l
Knowledge Xpert for Oracle® Administration A complete and essential resource for Oracle DBAs.
l
Knowledge Xpert for PL/SQL Comprehensive PL/SQL knowledge combined with an extensive PL/SQL code library.
TIP:
Knowledge Xpert add-on modules are available directly from your Dell representative.
Select DB Object Dialog
Select and open a database object similar to the standard Windows File | Open command.
l
Enter the name of the object or type in a name mask using the SQL wildcard (%) l
Specify the object type (optional) l
Select the object from a list of matches
Server Output
Capture output from the Oracle server and display it in the
SQL Navigator 7.2
User Guide
193
Tips For Use
Toggle on/off
Output
Window
Oracle
Sessions l
Toggle on/off capturing server output from the
l
Click Session | Server Output to toggle On/Off Server output.
l
When toggled ON the
opens if it is not already open.
l
Closing the Output Window does not stop the capturing of Server Output.
l
The Output Window reopens automatically if you execute a stored program in a session capturing server output.
l
The default size of the run time buffer is 32k bytes.
l
Output is captured for the current Oracle session.
l
Server Output is captured individually for each session. Capturing it in one session does not automatically capture it in other concurrent sessions.
Server Side Installation Wizard
Installing server side objects.
The wizard requires connection as a DBA user so that the SQLNAV user can be created, as well as a number of roles. The wizard permits you to specify a password of your choice for this user. Note that the option "Base
SQLNAV Repository" must be selected on at least one occasion to allow the other support features to be installed. All objects installed by the wizard are installed into the SQLNAV schema.
For example: Install Server Side Objects for Team Coding
Install Server Side Objects for Team Coding
Before you can use Team Coding features, you need to install server-side objects on each Oracle instance where these features are to be used.
You can perform these steps from the
|
Server Side Installation Wizard .
After running the Server Side Installation Wizard, you will need to grant the roles.
NOTE:
Before running the Server Side Installation wizard, close all sessions that are Team-Coding enabled.
SQL Navigator 7.2
User Guide
194
Run the Wizard
Window
Install or Remove scripts?
Description
Select to Install Scripts
Which scripts would you like the
Wizard to install?
Select for Team Coding l
Base SQLNAV Repository l
Team Coding Support
Which Database and Tablespace do you want to install the scripts to?
For security the Base SQLNAV repository requires a user password. Please enter and confirm a password.
Supply a password for the SQLNav User. This user is the owner of the objects required for Team Coding support.
Select migration preferences
Connect as a DBA user to the database where Team Coding is to be installed.
In the Migrate from VCS 3.2 to Team Coding dialog, if you are not migrating existing VCS Option data from SQL Navigator 3.2 to SQL
Navigator 4, just press Next.
If you are migrating existing VCS Option data, select a migration preference.
Create Team Coding Roles
TIP:
Click More Info for more information on the migration preferences. Also see the VCSMigrate documents in the \Doc folder within the SQL Navigator installation folder.
Team Coding uses Oracle table and column privileges to control access.
You can create the following default roles using settings that represent the most likely desired use of these privileges: l
Administrator l
Project Manager l
Team Leader
For each set of privileges, you can choose to create a new role, use an existing role (you may already have appropriate roles for your users), grant them to public, or to skip privilege assignment completely.
Default roles
The default roles created by the Wizard have the following Team
Coding privileges: l
Administrator Can configure the instance to define how Team
Coding operates, which VCP (if any) is used, etc. This role is automatically assigned to the SQLNAV user.
l
Manager Can create and delete code control groups (CCGs) and relate them to a VCP project.
SQL Navigator 7.2
User Guide
195
Window Description
l
Leader Can modify CCGs, defining which objects or scripts are included in the group, and freeze objects. Can also delete rows from the Team Coding Viewer.
After creating the roles, you need to grant them to users.
Grant the roles
You can use the SQL Navigator User Editor or the Code Editor to grant the Team Coding roles created by the
Server Side Installation Wizard to individual users. You must be connected as a DBA user.
For example: l grant SQLNAV_ADMIN to DBA l grant SQLNAV_MGR to JOHN l grant SQLNAV_LDR to ARTHUR l grant SQLNAV_LDR to SUSAN
Session Browser
Manage sessions in the Session Browser.
To open the Session Browser click Tools | Session Browser.
Session Browser Toolbar
Icon Tool Tip
New Session
Current Session
Shortcut Description
As per Session | New Session, open the
Show the current session. Use to switch to a different session.
Include NULL and
SYSTEM OS User
Refresh
Auto Refresh Every…
F5
Show / Hide NULL and System OS users.
Refresh the Session Browser.
Refresh the Session Browser automatically. Select Auto-Refresh
every and enter the refresh interval in seconds.
SQL Navigator 7.2
User Guide
196
Sessions Grid
The current session is displayed in pink.
Action
Select / Highlight a session
Sort / Group
Sessions
Show / Hide
Columns
Filter Sessions
Kill Sessions
Description
The tabbed pages show details of the selected session. For more information, see
Session Information on page 198 .
l
Click the column heading you would like to sort by.
l
Drag the column you would like to group the sessions by to the gray area above the grid.
Right click on the grid and select Visible Columns. All columns are listed. Only selected columns are visible on the grid.
TIP:
You can rearrange the columns. Drag and drop the column header into the location you want.
When a filter is applied, only sessions that meet the criteria are displayed.
1. Click the arrow alongside the column heading you want to apply the filter to.
2. Select the value you want to filter by.
3. Apply additional filters if required.
To apply custom filters
1. Click the arrow alongside the column heading you want to apply the filter to and select (Custom...).
2. Create a conditional expression from the menu options provided.
l
Values are case sensitive.
l
Use And / Or to related multiple conditions.
NOTE:
l
The filtered columns are given a blue arrow. Click the blue arrow and select (All) to remove all filters applied to the column.
l
The filter expression is displayed below the Sessions grid. Click X to remove all filters.
Right-click the session and select Kill Sessions.
NOTE:
l
When you kill a top level node you kill all sessions below it.
l
You must have appropriate permissions (ALTER SYSTEM) to kill sessions.
l
You cannot kill the current session (displayed in pink).
l
The following query is used to kill sessions: ALTER SYSTEM KILL SESSION
<SID, SERIAL#> IMMEDIATE
SQL Navigator 7.2
User Guide
197
Session Information
Select a session on the
. Details for the selected session are displayed in the tabbed pages.
Tab Description
Session Further session information for the selected session.
Process Process information for the selected session.
IO
Waits
IO information for the selected session.
Waits information for the selected session.
NOTE:
WAIT_TIME = -2 on platforms that do not support a fast timing mechanism. If you using one of these platforms and you want this column to reflect true wait times, you must set the TIMED_STATISTICS parameter to TRUE. Doing this has a small negative effect on system performance.
The current SQL statement and explain plan for the select session.
Current
SQL
Access
Open
Cursors
Objects in the database currently locked by the selected session.
RBS
Usage
Parallel
Session
Locks
Transaction information for online rollback segments for the selected session.
Parent and slave sessions belonging to a parallel session.
User and system locks. Locks are displayed in groups; Blocking, Blocked By, System, and All Locks.
Long Ops Operations that run for longer than six seconds in absolute time, including some backup and recovery functions, statistics gathering, and query execution.
Cursors that the selected session has opened and parsed.
Source Preview
Preview the source code of text objects (stored programs, triggers and views), or a package’s individual entry points.
SQL Navigator 7.2
User Guide
198
1. Select the object
Module
In the
In
In the
results
In
results
In the
In
How to select the object
Press CTRL and click on the object name
Click on the object
Click on the object
Click on the object
Click on the object
Click on the object
2. Click View | Source Preview.
TIP:
l
While the Source Preview window is open, you can select objects in any of the windows named above, and the object’s source code will automatically appear in the Source Preview window.
l
Use a bookmark to conveniently mark various locations in the source code and quickly move about in the text without searching through the code and without losing your current editing location. You can set up to ten bookmarks. See
SQL Modeler
The SQL Modeler 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.
Section Description
Used to graphically lay out a query.
Most frequently used Modeler functions.
Criteria used in generating the model.
Automatically generated SQL as a result of the model.
SPLITTERS The SQL Modeler has two splitters to change how you divide the screen.
l
There is a horizontal splitter between the Model Area and the Criteria/Generated
Query/Query Results tabs. Drag it up or down and release to see more or less detail.
l
There is a vertical splitter between the Model Area and the Table Selector List. Drag it left or right to see more or less detail.
SQL Navigator 7.2
User Guide
199
SQL Modeler Toolbar
Icon Tool tip
New model
Open an existing model
Save current model as...
Save model
Model information
Edit calculated fields
Generate a
SELECT statement
Description
Clear the modeler window ready to create a new query.
Open a saved query.
Save the query. Specify the filename and location.
Save the query to the current filename and location.
Edit current model information
Edit calculated fields
Select the type of statement you want to create.
If the query in the SQL Modeler is an UPDATE, DELETE or INSERT statement, a rollback will occur automatically.
Use to test the query. The results show in
.
Execute query
Explain plan Open the
.
Load in the
Code Editor
Show Table
List
Save sub query and return to master query
Copy the new query to the
.
Show/Hide the Table Selector.
The Table Selector lists the tables, views and synonyms available to you for inclusion in your SQL Model. You can select from the current schema or any other schema. Only those tables, views or synonyms for which you have SELECT privilege will be listed.
To add a table, view or synonym, double click on it or drag and drop it onto the
.
Save sub query and return to master query
SQL Navigator 7.2
User Guide
200
Icon Tool tip
Cancel sub query and return to master query
Edit global where clauses
Edit global having clauses
View joins
Description
Cancel sub query and return to master query
Edit global WHERE clauses.
Open the
Global WHERE Conditions Window
.
Set Global HAVING conditions (Must have a Group By condition set in the
.)
Open the
Global HAVING Conditions Window .
Auto join objects
Auto join objects
Percentage of zoom for modeler pane
View Joins Dialog
From this dialog you can see individual joins, browse through the joins, and make changes to the joins.
Dialog
Section
Description
From / To
Join Type
The join fields, joined from one table to another.
You can change the Join Type from Inner to Outer. The line color denotes the type of join.
Outer Join On If you have selected an Outer join, you can change which table the outer join is performed on.
Join Test You can change the test for the join.
You can make it Less than, Greater than, etc. instead of Equal to.
Buttons
Previous Join
Next join
Delete Join
OK
Delete the current join.
Move forward in the join list.
Move backward.
Close the window and return to the SQL Modeler.
To open this dialog, click View Joins on the SQL Modeler toolbar. Alternatively, double click on a join line in the
.
SQL Navigator 7.2
User Guide
201
Global WHERE Conditions Window
Add, Edit, Delete global where conditions as per the toolbar.
The Add and Edit buttons open the Global WHERE Definition dialog. Global Where entries are in the form of
<expression1> <operator> <expression2>.
TIP:
You could alternatively populate the WHERE clause via the
Criteria Tab . Entries into the cells of the
Criteria tab should be in the form of <operator> <expression2>.
Example
Construct the following query
SELECT dept.deptno, dept.dname, dept.loc
FROM scott.dept
WHERE ((dept.deptno BETWEEN 1 AND 25)
AND (dept.deptno < 40)
AND (dept.loc IS NOT NULL)
Follow the numbered steps
1. Open the SQL Modeler (as SCOTT/TIGER).
2. Double-click DEPT to add it to the model.
3. Right-click DEPT and choose Select All.
4. On the criteria tab, double click the Where Cond. cell under DEPTNO.
5. Choose < and fill in the value 40. Click OK.
6. On the criteria tab, double click the Where Cond. cell under LOC and then choose the Expert tab and click Yes at the warning dialog.
7. In the top edit box, enter IS NULL. Click OK.
8. On the criteria tab, double-click the OR cell under LOC. Choose the Expert tab and click Yes at the warning dialog.
9. In the top edit box, enter = 'CHICAGO'
10. In the table model area (the area around the table images), right-click and choose SQL>Global Where
11. In the top edit box, enter Data Field DEPT.DEPTNO. Click OK.
12. From the SQL Function panel, select BETWEEN _Const_ AND _Const_. Replace the constants with values, for example 1 and 25 respectively. Click OK twice.
13. View the generated query. It should appear as described above.
Global HAVING Conditions Window
SQL Navigator 7.2
User Guide
202
Add, Edit, Delete global having conditions as per the toolbar.
The Add and Edit buttons open the Global HAVING Definition dialog. Global Having entries are in the form of
<expression1> <operator> <expression2>.
TIP:
You could alternatively populate the HAVING clause via the
. First set a GROUPed BY field. Then set the Having clause for that field by entering it in the group cond. row. This has the limitation that you can only have the selected field on the left side of the relational operator. If you need to have multiple fields on that side of the operator, use the Global Having feature.
Example
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))
Follow the numbered steps
1. Open the SQL Modeler (as SCOTT/TIGER).
2. Double-click EMP to add it to the model.
3. Right-click EMP and choose Select All, then deselect Hiredate.
4. In the Criteria tab, double-click the Group By field for DEPTNO.
5. Double-click the Group By fields for COMM, SAL, MGR, JOB, ENAME and EMPNO as well.
6. Click the Global Having button in the toolbar. Click the Add button to add a new Having clause.
7. Enter the Having clause to say: l
EMP.SAL + NVL(EMP.COMM, 0) > 4000
8. Click OK.
View the generated query.
It should appear 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.
Model Area
Use the model area to visually join or manipulate the Tables, Views and Synonyms.
SQL Navigator 7.2
User Guide
203
Add objects
Show/Hide the Table Selector on the
. It lists the tables, views and synonyms available to you for inclusion in your SQL Model. Double-click each desired Table, View, Synonym, OR drag and drop them from the list to the model area. As the objects are presented on the model area, join lines are drawn from any established foreign keys in the DDL.
Additionally, drag-and-drop objects from: l
tree (single object only) l
details pane (when a list is displayed) l
l
TIP:
l
To open SQL Modeler with a table, select the table in
then click
| SQL
Modeler.
l
You can click in a table header and drag and drop the table where you want it in the Model Area.
Build a query
Steps
Clear an existing query from the Model
Area, if required.
Define the type of statement you want to create.
Add objects to the Model Area.
Description
Click New Model on the
Choose SELECT, UPDATE, DELETE, or INSERT from the
Drag and drop Tables, Views, or Synonyms from the Table
Selector to the modeling area.
You can show/hide the Table Selector on the
Specify table columns to be used in the query.
Select column names in the tables in the Model Area.
NOTE:
If no table columns are selected, then all columns will be included in the query.
Set criteria for the query
View your query as SQL code or as a data grid.
Save the model
See the
.
Click the
and
.
Save the model from the
SQL Navigator 7.2
User Guide
204
TIP:
You can use the
to copy the query to the Code Editor window.
Create a table join
1. Add two table names to the Model Area.
2. In the first table, click the column name that you want to join. Drag it to the corresponding column name in the second table.
3. When the join is successfully created, SQL Modeler draws a connecting line that represents the join between the two table columns.
TIP:
To specify criteria for a table join, double-click on the connecting line joining the two columns. This opens the
Menus in the Model Area
Right click the model
Menu
Copy Model Image To
Clipboard
Tables
Description
Copy a bitmap image of the model to the Windows Clipboard
Visibility
Calculated
Fields
Show / Hide tables in the model.
Hidden tables are not included in the Generated Query
Add calculated fields based on other table columns.
Show
Join Text
Adjust Model
Origin
Primary Key
Indexes
Show Field
Type
Show the column names that comprise the joins.
Move the model so the upper left object is in the upper left of the Model Area.
Show the Table Primary Keys. Show PK next to each
Primary Key column.
Show the Table Indexes. Show IDX next to each Index column.
Show the column data type in each table.
SQL Navigator 7.2
User Guide
205
Menu
SQL
Auto Join All Objects
Hide fields
Zoom to table
Toggle Full Screen Mode
Optimize All Table Sizes
Arrange Tables
Description
Run Query in Thread
Global
Where
Clauses
Global
Having
Clauses
Run the query in a way that allows you to halt it in the middle if necessary.
Open the
Global WHERE Conditions Window
. Use to add a
WHERE clause to the query.
Open the
Global HAVING Conditions Window . Use to add a
HAVING clause to the query.
TIP:
Use the
to set GROUP BY first.
Query
Variables
Add variables. These variables are used in the Global WHERE
Definition Dialog and Global HAVING Definition Dialog.
Join all tables based on DDL Foreign Key Constraints.
Show / Hide the list of columns in the table in the model area.
Select a table to focus.
Show / Hide the Table Select List and Criteria/Generated Query/Query
Results tabs.
Minimize the size of the tables in the Model Area.
Arrange the tables in the Model Area.
Right click the Table object
Menu
Set Table Alias
Alias Field Names
Description
Set the Table Alias. The value is added to the
Set the Field Alias for each column in the table. The values are added to the
.
Automatically join this table to others based on DDL Foreign Key Constraints.
Shows / Hide the schema name in the Generated Query (
Auto Join
Show Schema Name in
SQL
Remove Table
Select All
Unselect All
Invert Selection
Optimize Size
Hide
Remove this table from the model.
Select / unselect columns in the table.
Restore the size of the table to its default size.
Temporarily hide the table from the model.
While the table is hidden it will not be included in the Generated Query
TIP:
To hide multiple tables or show hidden tables, right click on the Model
Area and select Tables | Visibility.
SQL Navigator 7.2
User Guide
206
Keyboard Shortcuts
Key
Up and down arrow keys
Space bar
Tab
Shift-Tab
Action
Move you around in lists
Select / Unselect boxes
Move forward one area (table, menu, list, etc)
Move back one area (table, menu, list, etc)
Tabs
Criteria Tab
1. Add tables, views and synonyms to the
2. In these tables, views and synonyms, select the columns you want to add to the Criteria tab. Only
Selected columns appear on the Criteria tab.
TIP:
To rearrange the order of the columns on the Criteria tab, drag and drop them left or right.
Field
Only fetch unique records
Schema
Description
Select to apply the DISTINCT command to the query.
The schema cannot be edited.
Null Value
Subst.
Double click in the cell to enter a value to substitute for any null values.
To clear the cell, highlight it and press Delete.
Aggregate F.
Double click in the cell to select an aggregate column function, such as Average, Count, Max,
Min, or Sum.
To clear the cell, highlight it and press Delete.
Where Cond.
Double-click in the cell to open the WHERE Definition dialog.
Section Description
Conditions Set a condition which tests if a column is equal to (or <, >, <=, >=, <>, LIKE,
BETWEEN) a constant or another field _or_ a condition where the selected field is in a sub query.
Clear
Form
Click to reset the dialog box and begin the WHERE condition again.
SQL Navigator 7.2
User Guide
207
Field Description
Section
Remove
Condition
Description
Click to remove the WHERE definition.
TIP:
A quick way to remove the WHERE definition is to highlight the cell and press
Delete.
Or
Group By
Double-click in the cell to open the WHERE Definition dialog (as above).
This WHERE criteria will be OR'ed together with the above WHERE criteria.
If you want to AND multiple column criteria together, then select Expert from the
WHERE Definition dialog. For more information, see Global WHERE Conditions Window on page
Double-click in the cell to select it as a GROUP BY column.
A number in parentheses indicates the order of the columns in the GROUP BY clause.
See also The Having Cond. cell.
To clear the cell, highlight it and press Delete.
Having
Aggregate
Double click in the cell to select an aggregate column function (such as Average, Count, Max,
Min, or Sum) for the HAVING clause.
This allows for the following type of query:
SELECT emp.job_id
FROM employee emp
GROUP BY emp.job_id
HAVING ((AVG (emp.salary) > 1500))
To clear the cell, highlight it and press Delete.
Having Cond.
Double click in the cell to open the GROUP BY Definition dialog.
NOTE:
Requires a value in the Group By cell. To create more complex Having conditions see
Global HAVING Conditions Window
for more information.
Sort
Visible
Field Alias
Table Alias
To clear the cell, highlight it and press Delete.
Double click in the cell to sort this column as Ascending, Descending, or no sort.
To clear the cell, highlight it and press Delete.
Double click in the cell to have it be visible / hidden. When visible the column is returned in the column list.
Double click in the cell to change the field name alias.
Double click in the cell to enter a value for the table alias.
To clear the cell, highlight it and press Delete.
SQL Navigator 7.2
User Guide
208
Right-click over the Criteria grid:
Menu
Suppress Current Column
Best Fit (All Columns)
Default Width (All Columns)
Copy Query Grid Image to Clipboard
Description
Remove this column from the query
Set the column width of the Criteria grid to show all text
Set the column width of the Criteria grid to the default width
Copy the Criteria grid to the clipboard
Generated Query Tab
This tab lists the automatically generated SQL statement.
NOTE:
l
Any changes made to the
or
will automatically regenerate this SQL statement.
l
You cannot directly edit the SQL on the Generated Query tab.
Right-click over the query
Menu
Copy
Save As
View Query in Code Editor
Description
Copy the query to the clipboard.
Save the query to a file.
Copy the query directly to the
.
Query Results Tab
Show the results of executing the generated query.
NOTE:
l
Insert, Update, and Delete queries can only be executed in the
l
Making changes to the Tables or Columns, then clicking on the Query Results tab will prompt you whether or not to re-query the data.
SQL Optimizer
SQL Navigator 7.2
User Guide
209
SQL Optimizer supplements Oracle tuning skills for developers. The SQL Optimizer makes observations about a selected SQL statement and the underlying database environment, then recommends several options to improve performance. Users can then view the logic behind the advice, implement the recommendation, apply it to the database, and see the results. The SQL Optimizer module automatically produces all necessary SQL to effect the corresponding change.
NOTE:
l
SQL Optimizer can be used to analyze the execution of SQL scripts containing more than one statement.
l
SQL Optimizer is an external application. It is installed independently of SQL Navigator.
l
Example Scenario: in the
highlight the text of the SQL statement you want to investigate and click SQL Optimizer.
l
For more details, see the online help supplied with the SQL Optimizer product.
Task Manager
SQL Navigator executes long-running tasks in separate threads in the background. They lock only the current session. Background execution happens automatically, and means that all the application’s functionality remains available to the user while the task is running in a separate session.
The Task Manager is a display of all active and complete tasks for the current session.
The following background tasks can be managed through the Task Manager:
More Information
Background Tasks
Batch commands on database objects, such as Drop, Compile, Truncate and
Extract DDL
Enable
Execute PL/SQL code
View Differences
Full expansion of a node in DB Navigator
Source Code Search
Find Objects
NOTE:
l
Right click on a task to Suspend, Resume, End or Delete.
l
Ending some tasks, such as compiling dependants in a complex table, may appear to "hang." This is due to SQL Navigator waiting for a response from the Oracle server. Even though there may be a delay, control will ultimately be returned to SQL Navigator.
SQL Navigator 7.2
User Guide
210
Web Support Configuration Dialog
Specify a local directory where images can be loaded or enter details of your Web server’s configuration.
This is required to view images and follow hyperlinks in your documents.
Wrap Code
The Wrap Code utility provides an easy way to access Oracle’s Wrap Code utility. This window is connection independent so you do not need an open database session to use it.
To wrap code
1. Click
| Wrap Code to open the Wrap Code window.
2. Input File details:
Field
Input File
Description
Enter the file (of PL/SQL code) you want to wrap, including the full path.
TIP:
Click the drill down button to browse for the file.
Input File Text When you have selected the file, the text of the file appears here.
TIP:
Right-click in the text area to copy the code to the clipboard.
Output File By default this is given the same name as the input file, but with extension .plb.
3. Click Wrap Code.
Field
Output File
Text
Description
The wrapped code appears in the Output File Text area and is automatically saved to the specified Output File.
TIP:
Right-click in the text area to copy the code to the clipboard.
SQL Navigator 7.2
User Guide
211
Изтегляне
Реклама