Nothing Special   »   [go: up one dir, main page]

XPP E

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 28

E

Using SQL Developer

Copyright © 2006, Oracle. All rights reserved.


Objectives

After completing this appendix, you should be able to do


the following:
• List the key features of Oracle SQL Developer
• Install Oracle SQL Developer
• Identify menu items of Oracle SQL Developer
• Create a database connection
• Manage database objects
• Use the SQL Worksheet
• Execute SQL statements and SQL scripts
• Edit and Debug PL/SQL statements
• Create and save reports

E-2 Copyright © 2006, Oracle. All rights reserved.


What Is Oracle SQL Developer?

• Oracle SQL Developer is a graphical tool that


enhances productivity and simplifies database
development tasks.
• You can connect to any target Oracle database
schema using standard Oracle database
authentication.

SQL Developer

E-3 Copyright © 2006, Oracle. All rights reserved.


Key Features

• Developed in Java
• Supports Windows,Linux and Mac OS X platforms
• Default connectivity by using the JDBC Thin driver
• Does not require an installer
• Connects to any Oracle Database version 9.2.0.1 and
later
• Bundled with JRE 1.5

E-4 Copyright © 2006, Oracle. All rights reserved.


Installing SQL Developer

Download Oracle SQL Developer kit and unzip into any


directory on your machine

E-5 Copyright © 2006, Oracle. All rights reserved.


Menus for SQL Developer

2 4 6

1 3 5

E-6 Copyright © 2006, Oracle. All rights reserved.


Creating a Database Connection

• You must have at least one database connection to


use SQL Developer
• You can create and test connections
– For multiple databases
– For multiple schemas
• SQL Developer automatically imports any connections
defined in the tnsnames.ora file on your system.
• You can export connections to an XML file
• Each additional database connection created is listed
in the connections navigator hierarchy

E-7 Copyright © 2006, Oracle. All rights reserved.


Creating a Database Connection

E-8 Copyright © 2006, Oracle. All rights reserved.


Browsing Database Objects

Use the Database Navigator to:


• Browse through many objects in a database schema
• Review the definitions of objects at a glance

E-9 Copyright © 2006, Oracle. All rights reserved.


Creating a Schema Object

• SQL Developer supports the creation of any schema


object by:
– Executing a SQL statement in the SQL Worksheet
– Using the context menu
• Edit the objects using an edit dialog or one of many
context sensitive menus
• View the DDL for adjustments such as creating a new
object or editing an existing schema object

E-10 Copyright © 2006, Oracle. All rights reserved.


Creating a New Table: Example

E-11 Copyright © 2006, Oracle. All rights reserved.


Using the SQL Worksheet

• Use the SQL Worksheet to enter and execute SQL,


PL/SQL, and SQL *Plus statements
• Specify any actions that can be processed by the
database connection associated with the worksheet

E-12 Copyright © 2006, Oracle. All rights reserved.


Using the SQL Worksheet

2 4 6

1 5 7 8
3

E-13 Copyright © 2006, Oracle. All rights reserved.


Executing SQL Statements

Use the Enter SQL Statement box to enter single or


multiple SQL statements

E-14 Copyright © 2006, Oracle. All rights reserved.


Viewing the Execution Plan

E-15 Copyright © 2006, Oracle. All rights reserved.


Formatting SQL Code

Before
formatting

After
formatting

E-16 Copyright © 2006, Oracle. All rights reserved.


Using Snippets

Snippets are code fragments that may be just syntax or


examples

E-17 Copyright © 2006, Oracle. All rights reserved.


Using Snippets: Example

Inserting a
snippet

Editing the
snippet

E-18 Copyright © 2006, Oracle. All rights reserved.


Using SQL*Plus

• The SQL Worksheet does not support all SQL*Plus


statements
• You can invoke the SQL*Plus command-line interface
from SQL Developer

E-19 Copyright © 2006, Oracle. All rights reserved.


Creating an Anonymous Block

Create an anonymous block and display the output of


DBMS_OUTPUT package statements.

E-20 Copyright © 2006, Oracle. All rights reserved.


Editing the PL/SQL Code

Use the full-featured editor for PL/SQL program units:

E-21 Copyright © 2006, Oracle. All rights reserved.


Creating a PL/SQL Procedure

E-22 Copyright © 2006, Oracle. All rights reserved.


Compiling a PL/SQL Procedure

E-23 Copyright © 2006, Oracle. All rights reserved.


Running a PL/SQL Procedure

E-24 Copyright © 2006, Oracle. All rights reserved.


Debugging PL/SQL

E-25 Copyright © 2006, Oracle. All rights reserved.


Database Reporting

SQL Developer provides a number of predefined reports


about the database and its objects:

E-26 Copyright © 2006, Oracle. All rights reserved.


Creating a User Defined Report

Create and save user-defined reports for repeated use:

E-27 Copyright © 2006, Oracle. All rights reserved.


Summary

In this appendix, you should have learned how to use SQL


Developer to do the following:
• Browse, create, and edit database objects
• Execute SQL statements and scripts in the SQL
Worksheet
• Edit and debug PL/SQL statements
• Create and save custom reports

E-28 Copyright © 2006, Oracle. All rights reserved.

You might also like