How-To Document

How to Export Data using SQL Developer

Updated: July 2007 for SQL Developer 1.2

After completing this How-To, you should be able to understand:

  • How to export data to various file formats using SQL Developer
  • How to export the object definitions in your schema

Table of Contents

1. Introduction

Oracle SQL Developer provides utilities to export both the definitions of the objects in a schema and the data stored in those objects. In this How-To we start by exporting the data and then move onto exporting object definitions.

2. Software Requirements

3. Exporting Data

SQL Developer provides the ability to export user data to a variety of formats; CSV, XML, LOADER, TEXT, INSERT, HTML and XLS.

1.

In order to export the data from a table you can either use the SQL Worksheet and write a SQL query to retrieve the required data (See Step 5 of the Getting Started: Oracle SQL Developer Guide) or you can Click on the Data tab of a table definition. We'll use this latter approach.

Expand the Connections Navigator and the Tables node

Click on DEPARTMENTS.

Select the Data tab.

 

2.

Right-click anywhere on the data to invoke the context menu.

Select INSERT from the EXPORT context menu.This will product a file of Insert statements.

 

3.

Choose an appropriate directory and name for the file.

You can also fine tune what is exported by selecting the columns and adding a where clause to reduce the number of records returned. In this example, we'll take the default of all the records and columns.

 

4.

Click Apply to create the file.

5.

Review the file created. You can repeat this exercise for each of the file formats to observe the different formats provided.

 

4. Exporting Object Definitions

SQL Developer provides the ability to export some or all of your object definitions to script files. You can use these as a backup of the object definitions or run them in another schema. In this exercise, you export 2 tables.

1.

Using the main menu, select Tools -> Export DDL (and Data).

 

2.

At the top of the screen, enter a directory and file name. e.g. d:\working\exportDept.sql. and select the Connection.

 

3.

Set the Options for this Export. e.g.uncheck Show Schema and check Include Drop Statement

 

4.

Select the Filter Objects tab.

 

5.

Instead of querying all objects, by immediately clicking Go, you can enter restriction criteria. Enter D% and then click Go.

 

6.

You can restrict the list of choices further by using the Object Type drop list on the right. Select Table from the list.

The list now displays tables that start with "D".

 

7.

Shuttle the Departments table to the right hand panel.

Click Apply.

 

8.

Review the file created.

 

5. Additional Resources

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy