Home > How to use SQL Developer to work with an Oracle database
Chapter Download:
EMAIL THIS

How to use SQL Developer to work with an Oracle database

12 Mar 2009 | Written by: Joel Murach

Oracle tips, scripts, and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google

Murach's Oracle SQL and PL/SQL

Chapter 2, How to use Oracle SQL Developer and other tools

SQL and PL/SQL book chapter
This chapter from Murach's Oracle SQL and PL/SQL explains how to work with Oracle SQL Developer and other tools. In this section, learn how to use Oracle SQL Developer to review or modify your Oracle database design. Learn how to navigate database objects and create, export and import Oracle database connections.

How to work with the Oracle database home page
How to use SQL*Plus in Oracle
How to use SQL Developer to work with an Oracle database
How to view and edit table column definitions
How to use SQL Developer to run SQL statements
How to use the Oracle Database SQL Reference manual

Oracle SQL Developer is a free graphical tool that makes it easy to work with Oracle databases, and it's the tool that we recommend for working with an Oracle database. As you will see, this tool makes it easy for you to review or modify the design of a database.

As of press time for this book, the current version of SQL Developer is version 1.5, so that's the version presented in this chapter. However, with some minor variations, the skills presented in this chapter should work for later versions as well.

For more on this book
This chapter is excerpted from the book, Murach's Oracle SQL and PL/SQL, authored by Joel Murach, published by Mike Murach & Associates, Inc., August, 2008. ISBN: 978-1-890774-50-9
When you use SQL Developer, you can connect to any Oracle Database version 9.2.0.1 or later. To connect to earlier versions, you need to use another tool such as the SQL*Plus tool described in the previous figure.

How to create a database connection

Before you can work with a database, you need to create a connection to the database. When you start SQL Developer, the Connections window displays all available database connections. To create a new connection, you can use the procedure described in figure 2-4.

If you have installed the software for this book as described in figure A-5 of appendix A, the AP, OM, and EX users with passwords of AP, OM, and EX will be available on your system. As a result, you will be able to create connections for these three users. Specifically, we suggest that you use the AP user to work with the tables in the AP schema, the OM user to work with the tables in the OM schema, and the EX user to work with the tables in the EX schema.

When you create a database connection, you should note that the usernames and passwords are not case-sensitive. As a result, it doesn't matter if you enter the usernames and passwords in uppercase or lowercase. In this figure, for example, I entered the usernames and passwords in lowercase because it's easier to type in lowercase.

How to export or import database connections

If you want to copy several database connections from one computer to another, you can export the database connections to an XML file as described in this figure. Then, you can use this XML file to import those database connections on another computer. For example, I exported the database connections for the AP, OM, and EX users to this file:

c:murachoracle_sqldb_setupconnections.xml
As a result, if you want, you can use the technique shown in this figure to import the connections that are stored in this file.

The dialog box for creating database connections

Creating database connections

Figure 2-4 How to create, export, or import a database connection

How to create a database connection

1. Right-click on the Connections node in the Connections window and select the New Connection command to display the dialog box for creating database connections.
2. Enter a connection name, username, and password for the connection.
3. Click the Test button to test the connection. If the connection works, a success message is displayed above the Help button.
4. Click the Save button to save the connection. When you do, the connection will be added to the dialog box and to the Connections window.

How to export or import database connections

  • To export database connections, right-click the Connections node, select the Export Connections command, and use the resulting dialog box to select the connections that you want to export and to specify the path and filename for the XML file for the connections.
  • To import connections, right-click the Connections node, select the Import Connections command, and use the resulting dialog box to navigate to the XML file for the connections.

How to navigate through the database objects

Figure 2-5 shows how to navigate through the database objects that are available to the user that corresponds with the current database connection. These database objects include tables, views, indexes, and so on. For this chapter, however, you can focus on the tables. Later in this book, you'll learn more about views, indexes, and other database objects.

When you expand a connection for the first time in a session, you must enter the password for the username in the Connection Information dialog box. In this figure, for example, I clicked on the plus sign (+) to the left of the node for the AP connection. Then, SQL Developer prompted me for the password for the user named AP. When I entered the correct password, SQL Developer expanded the AP connection and displayed a SQL Worksheet window for the AP connection.

Once you expand a connection, you can navigate through the objects that are available for the user that corresponds to the connection. To do that, you can click on the plus (+) and minus (-) signs to the left of each node to expand or collapse the node. In this figure, for example, I expanded the Tables node to view all of the tables available to the AP user.

To work with a node or an object, you can right-click on the object to display a context-sensitive menu. Then, you can select a command from the resulting menu. For example, you can right-click on the node for the AP connection to display a list of commands for working with that connection.

The Connection Information dialog box

Connection information Connection information

The tables available to the AP user

Tables available to the AP user

Figure 2-5 How to navigate through the database objects

Description

  • Each connection provides access to the database objects that are available to the user that corresponds with the connection. These database objects include tables, views, and so on.
  • Before you can expand a connection for the first time in a session, you must enter the correct password for the connection. Once you enter a password for a connection, you can navigate through the nodes for the database objects. You can also use the SQL Worksheet window to enter and run SQL statements.
  • To navigate through the database objects for a connection, click on the plus (+) and minus (-) signs to the left of each node to expand or collapse the node.
  • To work with a node or an object, right-click on the node or object and select a command from the resulting menu.

Download the chapter "How to use Oracle SQL Developer and other tools" in PDF form.

Continue to the next section: How to view and edit column definitions for a table

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Oracle and SQL
Can I specify Oracle column order in my database table?
Review: Oracle's 11g R2 database has some good and bad
SELECT statement syntax and examples
Oracle PL/SQL tutorial
PL/SQL datatypes in Oracle
PL/SQL functions and triggers in Oracle
Stored procedures in PL/SQL
Do I need a license for SQL Developer Data Modeler in Oracle?
Using the SQL GROUP BY clause for counting combinations
How to use an SQL CASE expression
Oracle and SQL Research

Oracle DBA tools
Oracle delivers database fixes in Critical Patch Update
How to get the most out of Toad for Oracle 10
Q&A: Toad for Oracle 10 focuses on developer, DBA productivity
Review: Oracle's 11g R2 database has some good and bad
Oracle OpenWorld 2009 Special Report
Oracle releases new database, says 11g upgrade will cut costs
EnterpriseDB offers Oracle database users a 'bailout program'
Oracle raises prices on database management packs
How to use the Oracle Database SQL Reference Manual
How to use SQL Developer to run SQL statements

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
autonomous transaction  (SearchOracle.com)
CFML  (SearchOracle.com)
dynamic SQL  (SearchOracle.com)
foreign key  (SearchOracle.com)
Java Database Connectivity  (SearchOracle.com)
Open Database Connectivity  (SearchOracle.com)
Oracle  (SearchOracle.com)
stored procedure  (SearchOracle.com)
The Open Group  (SearchOracle.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary




Oracle Tutorials and Expert Advice
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts