Getting Started With the Oracle Database Plugin for Eclipse DTPWelcome 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.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).Use 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.You 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.In 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. In 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. You 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 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.
The SQL Editor enables standard text-based editing of SQL statements with the added functionality of Content Assist, provides syntax color, and multiple statement support. Content Assist presents a list of available syntax options when you edit SQL statements.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. 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.