Skip Headers
Oracle® Database Express Edition Application Express User's Guide
Release 2.1

Part Number B25309-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

20 Using SQL Utilities

This section describes how to use SQL utilities to load and unload data from the Oracle Database Express Edition (Oracle Database XE) database, generate DDL, view object reports, and restore dropped database objects.

This section contains the following topics:

Loading and Unloading Data from From the Database

You can load data into and unload data from the Oracle Database XE database using the Data Load/Unload page. Supported load formats include:

Supported unload formats include:

This section contains the following topics:

See Also:

"Importing, Exporting, Loading, and Unloading Data" in Oracle Database Express Edition 2 Day DBA Guide

Accessing the Data Load/Unload Page

To access the Data Load/Unload page:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Data Load/Unload.

    The Data Load/Unload page appears.

  3. Click the appropriate icon to load data, unload data, or view the repository.

Loading Data

You can load data into the Oracle Database XE database in the following ways:

  • Copy and paste data from a spreadsheet.

  • Upload a spreadsheet file in a delimited format (such as comma-delimited (.csv) or tab-delimited).

  • Upload a text file containing comma-delimited or tab-delimited data.

Topics in this section include:

Loading a Text File

For files less than 30KB, you can copy and paste tab-delimited data directly into the Load Data Wizard. For files larger than 30KB, you must upload a separate file.

To load a text file:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Data Load/Unload.

  3. Click Load.

  4. Click Load Text Data.

    The Load Data Wizard appears.

  5. Under Load To, select either Existing table or New table.

  6. Under Load from, select either Upload file or Copy and paste.

  7. Follow the on-screen instructions.

Loading an XML Document

Oracle Application Express supports XML documents adhering to the Canonical XML specification.

To load an XML document:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Data Load/Unload.

  3. Click Load.

  4. Click Load XML Data.

    The Load XML Data Wizard appears.

  5. Follow the on-screen instructions.

Loading Spreadsheet Data

You can load spreadsheet data by either copying and pasting text, or by loading a file. To copy and paste text, the spreadsheet file must be less than 30KB. For files larger than 30KB, you can import the file in a delimited format (such as comma-delimited (.csv) or tab-delimited), upload the file, and then load the data into a new or existing table.

To load spreadsheet data:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Data Load/Unload.

  3. Click Load.

  4. Click Load Spreadsheet Data.

    The Load Data Wizard appears.

  5. Under Load to, select either Existing table or New table.

  6. Under Load from, select either Upload file or Copy and paste.

  7. Follow the on-screen instructions.

Unloading Data

You can use the Unload page to export the contents of a table to a text file or XML document.

Topics in this section include:

Unloading a Text File

Use the Unload to Text Wizard to export the contents of a table to a text file. For example, you could export an entire table to a comma-delimited file (.csv).

To unload a table to a text file:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Data Load/Unload.

  3. Click Unload.

  4. Click Unload To Text.

    The Unload to Text Wizard appears.

  5. Follow the on-screen instructions.

You select the schema and choose the table and columns to be exported. You can also specify the type of separator to be used to separate column values as well as whether column text strings are identified using single or double quotation marks.

Unloading to an XML Document

Use the Unload to XML Wizard to export the contents of a table to an XML document adhering to the Canonical XML specification.

To unload a table to an XML document:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Data Load/Unload.

  3. Click Unload.

  4. Click Unload to XML.

    The Unload to XML Wizard appears.

  5. Follow the on-screen instructions.

You select the schema and choose the table and columns to be exported.

Using Text Data Load Repository

Loaded text data files are stored in the Text Data Load Repository.

To access the Text Data Load Repository:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Data Load/Unload.

  3. Click Repository.

  4. To filter the display, make a selection from the Show list and click Go.

  5. To view information about a specific file, click the View icon.

  6. To delete an imported file, select it and click Delete Checked.

Generating DDL

With Oracle Application Express, you can generate Data Definition Language (DDL) statements from the Oracle data dictionary. These scripts can be used to create or recreate database schema objects. The scripts can be generated to display inline or saved as a script file. You can generate the create scripts for all objects for a specific schema, specific object types, or specific objects.

To generate a DDL statement:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Generate DDL.

    The Generate DDL page appears.

  3. Click Create Script.

    The Generate DDL Wizard appears.

  4. Select a database schema and click Next.

  5. Define the object type:

    1. Output - Specify an output format. Select either Display Inline or Save As Script File.

    2. Object Type - Select the object types for which to generate DDL.

    3. To select object names for the selected object types, click Next and follow the on-screen instructions.

  6. Click Generate DDL.

See Also:

Viewing Object Reports

SQL includes a variety to object reports to help you better manage the objects in your database.

Topics in this section include:

Viewing All Objects Reports

Use the reports on the All Objects page to view all objects for the selected schema. Available reports include All Objects, Invalid Objects, Object Calendar, and Objects Counts by Type.

To access the reports available on the All Objects page:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Object Reports and then All Objects.

  3. Select one of the following reports:

    • All Objects. Sort objects by creation date as well as last DDL (data definition language). To filter the report, select a object type, specify an object name, and click Go.

    • Invalid Objects. View all invalid objects in the database by object type. To filter the report, enter an object name, select a object type, and click Go.

    • Object Calendar. View all objects in a calendar format based on the date each database object was created.

    • Object Counts by Type. View counts of database object types for the selected schema.

  4. To filter the report, select a object type, specify an object name, and click Go.

Accessing the Data Dictionary

Each Oracle database has a data dictionary. An Oracle data dictionary is a set of tables and views that are used as a read-only reference about the database. For example, a data dictionary stores information about both the logical and physical structure of the database. A data dictionary also stores information about valid Oracle database users, integrity constraints for tables in the database, and the amount of space allocated for a schema object as well as how much of it is being used.

To browse the data dictionary:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Object Reports and then Data Dictionary.

    The Data Dictionary appears, listing all the Oracle Data Dictionary views.

  3. To filter the report, enter a query in the Search field and click Go.

    You can query for details about database objects in the Data Dictionary.

  4. Click the View icon to display Data Dictionary Browser.

    The Data Dictionary Browser appears. Use this page to query the Oracle Data Dictionary for details about database objects.

  5. On the Data Dictionary Browser page, select the appropriate views and click Query. To select all views, select Check All and then click Query.

    A report appears.

  6. To create a new query, click New Query and repeat step 5.

  7. To browse another view, click Browse Another View and repeat steps 4 and 5.

See Also:

Oracle Database Concepts for information about the data dictionary

Viewing PL/SQL Reports

PL/SQL reports enable you to view program unit arguments or unit line counts or search PL/SQL source code.

Topics in this section include:

Viewing Program Unit Arguments

Use the Program Unit Arguments report to view package input and output parameters.

To view the PL/SQL Arguments report:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Object Reports, PL/SQL, and then Program Unit Arguments.

  3. To filter the report, enter a query in Object Name and click Go.

Viewing Unit Line Counts

Use the Unit Line Counts report to view then number of lines of code for each object. Use this report to identify larger PL/SQL program units.

To view the Unit Line Counts report:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Object Reports, PL/SQL, and then Unit Line Counts.

  3. To filter the report, enter an object name and click Go.

Searching PL/SQL Source Code

Use the Search PL/SQL Source code page to search the text within your PL/SQL code. Use this report to find references to tables or functions you might be thinking of deleting. You can also use this page to locate code when you can only recall a code snippet.

To search for PL/SQL source code:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Object Reports, PL/SQL, and then Search PL/SQL Source.

  3. To filter the report:

    1. In Object Name, enter a query.

    2. In Text, enter the PL/SQL code you want to search for.

    3. Click Go.

Viewing Security Reports

Security reports enable you to see privileges granted on database objects owned by other schemas. You can also use these reports to view database roles and system privileges.

Topics in this section include:

Viewing Role Privileges

Role Privileges report shows the database roles that have been granted to a selected schema. Roles are collections of various privileges.

To view Role Privileges:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Object Reports, Security, and then Role Privileges.

    The Role Privileges report appears.

Viewing Object Grants

The Object Grants report identifies privileges granted from or to the selected database schema. Use this report to determine the privileges for an existing schema has as well understand what privileges have been granted from the selected schema to other schemas.

To view the Object Grants report:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Object Reports and then Security.

  3. Click User Privileges and then Object Grants.

    The Object Grants report appears.

  4. From Schema, select the database schema owner.

  5. To filter the report, make a selection from the Show list and click Go.

Viewing Column Privileges

The Column Privileges report identifies column privileges granted from or to the selected database schema. Use this report to determine the privileges for an existing schema as well as understand what privileges have been granted from the selected schema to other schemas.

To view the Column Privileges report:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Object Reports and then Security.

  3. Click User Privileges and then Column Privileges.

    The Column Privileges report appears.

  4. From Schema, select the database schema owner.

  5. To filter the report, make a selection from the Show list and click Go.

Viewing Details about the Tables in Your Database

You can view specific details about the tables within your database by accessing the reports available on the Tables page.

To view the reports available on the Tables page:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Object Reports and then Tables.

    The Tables page appears.

  3. Select a report to review. Available reports include:

    • Columns

    • Comments

    • Constraints

    • Statistics

    • Storage Sizes

    • No Primary Key

    • Unindexed

    • Unindexed Foreign Keys

  4. To filter a report, enter search criteria in the fields provided and click Go.

Using the Recycle Bin to View and Restore Dropped Objects

You can use the Recycle Bin to view and restore dropped database objects. When you drop a table, the space associated with the table is not immediately removed. The Oracle database renames the table and places it and any associated objects in the Recycle Bin. You can recover objects in the Recycle Bin at a later time.

This section contains the following topics:

Note:

The Recycle Bin feature is only available if you are running with an Oracle 10g or later database.

See Also:

"Backing Up and Recovering the Database" in Oracle Database Express Edition 2 Day DBA Guide

Managing Objects in the Recycle Bin

You can view objects in the Recycle Bin on the Dropped Objects page. Once you select an object and view the Object Details page, you can choose to purge the object or restore the object by clicking the appropriate button.

To view objects in the Recycle Bin:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Recycle Bin and then Dropped Objects.

    The Dropped Objects page appears.

  3. To filter the report, select an object type, enter the object name in the Original Name field, and click Go.

  4. To view object details, click the object name.

    The Object Details page appears.

  5. To restore the current object, click Restore Object.

  6. To permanently delete the current object, click Purge Object.

Emptying the Recycle Bin Without Viewing the Objects

To empty the Recycle Bin without viewing the objects:

  1. On the Database Home Page, click the Utilities icon.

  2. Click Recycle Bin.

  3. Click Purge Recycle Bin.

    The Purge Recycle Bin page appears.

  4. Confirm your request by clicking Purge Recycle Bin again.