Getting Started With the Oracle Database Plugin for Eclipse DTP Welcome to the first step towards supporting the Eclipse Data Tool Platform (DTP) by Oracle. This document provides a high level tour through each of the Oracle Database Plugin features.The Database Explorer is the Datasource View provided by the DTP. It is used to create Database connections and to navigate the database. 2.1.1. Connecting to an Oracle Database You can create a connection to a database using the Data Source Explorer view. Use the database connection to connect and explore to the database. Screen shots and examples in this document use the HR schema that is installed by default with Oracle Database.Note:You may download Oracle Database 10g Express Edition - Free Download.
To open the Database Development perspective, click Windows->Open Perspective from the Main menu. This perspective opens the Data Source Explorer (DSE) view.
Right click on the Databases node in DSE and select New... to create a database connection. This displays the New Connection Profile wizard dialog.
Select Oracle Database Connection from the list and then click Next. If "Oracle Database Connection" is not listed, then restart Eclipse with -clean command option. Provide a name for the connection and proceed to the next step.
Complete the rest of the dialog as follows:
This creates a connection with the specified name on the Data Source Explorer (DSE). 2.1.2. Exploring the Oracle DatabaseUse the database connection to connect to the database. You can then navigate through the database objects.Right click on the connection node on the DSE and select Connect. This opens a connection to the database. By default, only the schema associated to the logged in user is listed. To list the remaining, right click on the connection node, and select Properties from the popup menu. This will open the Properties dialog box. Select Default Schema Filter on the left pane. On the right pane, either check "Disable filter" or modify the Expression or Selection to select the schemas to be listed. Use the navigation tree to drill down through the database objects. 2.1.3. Editing Data from a TableYou can edit the table data using the database connection in the Data Source Explorer (DSE). Navigate to the table you want to edit in the DSE. Right click the table and select Data->Edit. The table data is opened in the editor as shown in the Figure 11.
You can make changes to the table data using the popup menu. When you have finished editing, click Save to save the table data into the database. 2.1.4. Loading Data into a TableIn the DSE, navigate to the table into which you want to load data. Right click the table and select Data->Load to load data from a text file. This may fail if there is a foreign key violation.2.1.5. Extracting Data from a TableIn the DSE, navigate to the table from which you want to extract data. Right click the table and select Data->Extract to extract table data to a text file.2.1.6. Generating DDLYou can use Generate DDL option on most database objects to create or drop the object. In the DSE, navigate to the object you want to create or drop, right click the object and select Generate DDL to create a DDL script. (See Figure 12 and Figure 13)Figure 10. Generating DDL Note: You need to create a project, to save the generate DDL script. See Creating a project for more details. The steps above generate the following statements.
The SQL Tools enable you to edit
and run Stored Procedures and Functions, and to execute Explain Plans in
either Graphic or text mode.
In the DSE, navigate to the procedure or function
you want to edit. Right click the procedure or function and select Edit.
The procedure or function opens in the SQL Editor. 2.2.2. Executing a Stored Procedure or Function In the DSE, navigate to the procedure or function you want to run. Right click the procedure or function and select Run. If the procedure or function has any input parameters, the Configure Parameters dialog appears. Enter input values and click OK to run the procedure or function.
2.2.3. Executing Execution Plans In the Navigator or DSE, navigate to the script containing the SQL statement for which you want to execute an Explain Plan. Highlight the script and right click and select either Execute Text Explain Plan or Execute Graphic Explain Plan.
For example, open the views.sql file created in the Generating DDL section. Highlight the SELECT statement block as in Figure 17. Right-click and select Execute Graphic Explain Plan. This opens the execution plan in graphic mode in the Execution Plan view.
Alternatively, if you select Execute Text Explain Plan, it results in a text version of the Execution Plan as shown in Figure 18.
|