Rabu, 03 September 2008

Compiling & correcting

From within the editor you can compile a source file. In case of a compilation error you are automatically taken to the appropriate source line. All compilation errors are reported in a list at the bottom of the editor.
Because you can compile a source file without saving it, you can safely explore many alternatives of solving a problem. The editor keeps track of the fact that you have changed the file without saving or compiling it.

Testing & debugging

To test your program unit, you can write a test script. The body of the test script contains a PL/SQL block in which you can program the test-code. Any variables that you want to use in the PL/SQL block can be declared, assigned a value for input, and viewed after execution.
When you execute a test script, a runtime error might occur. In this case, PL/SQL Developer allows you to view the sources of the error stack. Each source line of the error stack that was involved in the runtime error is highlighted, so you can easily backtrack to the cause of the problem.

If you are using Oracle 7.3.4 or later you can use PL/SQL Developer’s integrated debugger. You can step through your code, set breakpoints, view/set variables, view the call stack, and so on.
On Oracle8i and later you can additionally use the dbms_trace feature to log selected events of a program run. This can help you analyze the program flow and exceptions.
Output from calls to the dbms_output and the PL/SQL Web Toolkit packages are automatically shown in a corresponding tab page of the Test Window.

Optimizing

To optimize the SQL statements in your program units, Oracle's Explain Plan utility can be a big help. Therefore it is integrated into PL/SQL Developer's IDE. By simply selecting the SQL statement in the source file and pressing F5, the query plan is visually presented to you in a separate Explain Plan window. You can then modify the statement to optimize its query plan outside the source file, and copy it back afterwards.
You can also view statistics about executed SQL statements and PL/SQL program units. These statistics can include elapsed time, CPU time, logical reads, physical reads, physical writes, and so on.

Oracle8i introduced a PL/SQL Profiler that allows you to profile your PL/SQL code. For each executed line of PL/SQL code you can determine the execution time, and how many times it was executed.

Querying

To query the data in the database, you can use a SQL window to execute any SQL statement. All executed statements are kept in a history buffer, so you can easily re-execute them. Any query results are conveniently displayed in a separate grid that you can subsequently use to insert, update, or delete records. The result grid can additionally be used in a Query By Example mode, so that you can easily find the information you need.
To query database objects you can use the Object Browser. All relevant properties of database objects such as tables, views, sequences, functions, procedures, packages, types and triggers can be viewed, including any dependencies between the objects. The browser uses a tree view similar to the explorer in Windows for easy point-and-click browsing.

Running SQL scripts

PL/SQL Developer includes a Command Window that can be used to run SQL scripts or execute SQL statements. You can additionally execute commands that are very similar to the SQL*Plus commands that you may be familiar to.

Creating and modifying table definitions

You can easily create and modify table definitions with using any SQL statement. Just fill in the definition in a dialog window to modify columns, constraints, indexes, privileges, storage information, comments, and so on. You can apply this definition in the database, and view, modify and save the resulting SQL.

Reporting

PL/SQL Developer comes with a number of standard reports, which are HTML based. You can view these reports within PL/SQL Developer, print them, or save them as HTML files. You can also create your own custom reports. Reports can be made easily accessible from the reports menu.

Projects

To organize your work you can use PL/SQL Developer’s project concept. A project consists of a number of files and database objects. These objects are easily accessible through the Project Items Window, and can be compiled through a single mouse-click.

Tools

PL/SQL Developer provides several tools that can be helpful during development. These tools include a Find Database Object tool, allowing you to search for text in database object sources, a Compile Invalid Objects tool, to quickly compile objects that have become invalid during development, a Table Export and Import tool, an Export User Objects tool to export the DDL statements of a user’s objects, a Compare User Objects tool to compare the object definitions of 2 users, a Session information tool, and an Event monitor.

In addition to these standard tools, you can define your own tools and include them in PL/SQL Developer’s tools menu.
From PL/SQL Developer Help

Tidak ada komentar: