Database Objects |
You can create, edit, and delete (drop) most types of objects in an Oracle database by using the right-click menu in the Connections navigator or by clicking the Actions button in the detail pane display. For some objects, you can do other operations, as appropriate for the object type.
|
Note: The actions available from right-click menus and Actions buttons depend on the Oracle Database release number for the specified database connection. If an action mentioned in the help is not available with a connection, it may be that the feature was not available in that release of Oracle Database. |
Related Topics
SQL Developer Concepts and Usage
Tutorial: Creating Objects for a Small Database
Supplementary Oracle Database Information
A database link is a database object in one database that enables you to access objects on another database. The other database need not be an Oracle Database system; however, to access non-Oracle systems you must use Oracle Heterogeneous Services. After you have created a database link, you can use it to refer to tables and views in the other database. For help with specific options in creating a database link, see Create/Edit Database Link.
You can perform the following operations on a database link by right-clicking the database link name in the Connections navigator and selecting an item from the menu:
Test: Validates the database link.
Drop: Deletes the database link.
A directory object specifies an alias for a directory (called a folder on Windows systems) on the server file system where external binary file LOBs (BFILEs) and external table data are located. To create a directory (that is, a directory object), you can use SQL Developer or the SQL statement CREATE DIRECTORY.
You can use directory names when referring to BFILEs in your PL/SQL code and OCI calls, rather than hard coding the operating system path name, for management flexibility. All directories are created in a single namespace and are not owned by an individual schema. You can secure access to the BFILEs stored within the directory structure by granting object privileges on the directories to specific users.
A function is a type of PL/SQL subprogram, which is a programming object that can be stored and executed in the database server, and called from other programming objects or applications. (Functions return a value; procedures do not return a value.) For help with specific options in creating a PL/SQL subprogram, see Create PL/SQL Function, Procedure, or Package.
You can perform the following operations on a function by right-clicking the function name in the Connections navigator and selecting an item from the menu:
Open: Displays the function text so that you can view and edit it.
Compile with Debug: Performs a PL/SQL compilation of the procedure, with PL/SQL library units compiled for debugging.
Run: Displays the Run/Debug PL/SQL dialog box, and then executes the function in normal (not debug) mode.
Debug: Displays the Run/Debug PL/SQL dialog box, and then executes the function in debug mode.
Execution Profile: Displays the execution profile for the procedure.
Rename: Renames the function.
Drop: Deletes the function.
An index is a database object that contains an entry for each value that appears in the indexed column(s) of the table or cluster and provides direct, fast access to rows. Indexes are automatically created on primary key columns; however, you must create indexes on other columns to gain the benefits of indexing. For help with specific options in creating an index, see Create Index.
You can perform the following operations on an index by right-clicking the index name in the Connections navigator and selecting an item from the menu:
Drop: Deletes the index.
Rebuild Index: Re-creates the index or one of its partitions or subpartitions. If the index is unusable, a successful rebuild operation makes the index usable. For a function-based index, rebuilding also enables the index; however, if the function on which the index is based does not exist, the rebuild operation fails.
Rename Index: Changes the name of the index.
Unusable Index: Prevents the index from being used by Oracle in executing queries. An unusable index must be rebuilt, or dropped and re-created, before it can be used again.
Coalesce Index: Merges the contents of index blocks, where possible, to free blocks for reuse.
A materialized view is a database object that contains the results of a query. The FROM clause of the query can name tables, views, and other materialized views. Collectively these objects are called master tables (a replication term) or detail tables (a data warehousing term). This reference uses "master tables" for consistency. The databases containing the master tables are called the master databases. For help with specific options in creating a materialized view, see Create/Edit View, especially the View Information or Materialized View Information tab.
A materialized view log is a table associated with the master table of a materialized view. When DML changes are made to master table data, Oracle Database stores rows describing those changes in the materialized view log and then uses the materialized view log to refresh materialized views based on the master table. This process is called incremental or fast refresh. Without a materialized view log, Oracle Database must re-execute the materialized view query to refresh the materialized view. This process is called a complete refresh. Usually, a fast refresh takes less time than a complete refresh.
A package is an object that contains subprograms, which are programming objects that can be stored and executed in the database server, and called from other programming objects or applications. A package can contain functions or procedures, or both. For help with specific options in creating a package, see Create PL/SQL Function, Procedure, or Package.
You can perform the following operations on a package by right-clicking the package name in the Connections navigator and selecting an item from the menu:
New Package Body: Displays a pane in which you can enter text for the package body.
Drop: Deletes the package.
A procedure is a type of PL/SQL subprogram, which is a programming object that can be stored and executed in the database server, and called from other programming objects or applications. (Procedures do not return a value; functions return a value.) For help with specific options in creating a PL/SQL subprogram, see Create PL/SQL Function, Procedure, or Package.
You can perform the following operations on a procedure by right-clicking the procedure name in the Connections navigator and selecting an item from the menu:
Open: Displays the procedure text so that you can view and edit it.
Compile with Debug: Performs a PL/SQL compilation of the procedure, with PL/SQL library units compiled for debugging.
Run: Displays the Run/Debug PL/SQL dialog box, and then executes the procedure in normal (not debug) mode.
Debug: Displays the Run/Debug PL/SQL dialog box, and then executes the procedure in debug mode.
Execution Profile: Displays the execution profile for the procedure.
Drop: Deletes the procedure.
Compile Dependants: Performs a PL/SQL compilation of the procedure and any relevant dependent subprograms (see the Dependencies tab).
The Recycle bin (applicable only to Oracle Database Release 10g) holds objects that have been dropped (deleted). The objects are not actually deleted until a commit operation is performed. Before the objects are actually deleted, you can "undelete" them by selecting them in the Recycle bin and selecting Undrop from the right-click menu.
You can perform the following operations on an object in the Recycle bin by right-clicking the object name in the Recycle bin in the Connections navigator and selecting an item from the menu:
Purge: Removes the object from the Recycle bin and deletes it.
Flashback to Before Drop: Moves the object from the Recycle bin back to its appropriate place in the Connections navigator display.
Sequences are used to generate unique integers. You can use sequences to automatically generate primary key values. For conceptual and usage information about sequences, see Managing Sequences. For help with specific options in creating and editing a sequence, see Create/Edit Sequence.
Synonyms provide alternative names for tables, views, sequences, procedures, stored functions, packages, materialized views, Java class database objects, user-defined object types, or other synonyms. The Connections navigator has a Synonyms node for all synonyms (public and private) owned by the user associated with the specified connection, and a Public Synonyms node for all public synonyms on the database associated with the connection. For conceptual and usage information about sequences, see Managing Synonyms. For help with specific options in creating and editing a synonym, see Create/Edit Synonym.
Tables are used to hold data. Each table typically has multiple columns that describe attributes of the database entity associated with the table, and each column has an associated data type. You can choose from many table creation options and table organizations (such as partitioned tables, index-organized tables, and external tables), to meet a variety of enterprise needs. To create a table, you can do either of the following:
Create the table quickly by adding columns and specifying frequently used features. To do this, do not check Show Advanced Options in the Create Table dialog box. For help with options for creating a table using this quick approach, see Create Table (quick creation).
Create the table by adding columns and selecting from a larger set of features. To do this, check Show Advanced Options in the Create Table dialog box. For help with options for creating a table with advanced features, see Create/Edit Table (with advanced options).
You can perform the following operations on a table by right-clicking the table name in the Connections navigator and selecting an item from the menu:
Edit: Displays the Create/Edit Table (with advanced options) dialog box.
Table: Table actions include Rename, Copy (create a copy using a different name), Drop (delete the table), Truncate (delete existing data without affecting the table definition), Lock (set the table lock mode: row share, exclusive, and so on), Comment (descriptive comment explaining the use or purpose of the table), Parallel (change the default degree of parallelism for queries and DML on the table), No Parallel (specify serial execution), and Count Rows (return the number of rows).
Export: Enables you to export some or all of the table data to a file or to the system clipboard, in any of the following formats: XML (XML tags and data), CSV (comma-separated values including a header row for column identifiers), SQL Insert (INSERT statements), or SQL Loader (SQL*Loader control file). After you select a format, the Export Table Data dialog box is displayed.
Column: Column actions include Comment (descriptive comment about a column), Add, Drop, and Normalize.
Index: Options include Create (create an index on specified columns), Create Text (create an Oracle Text index on a column), Create Text (create a function-based index on a column), and Drop.
Storage: Options include Shrink Table (shrink space in a table, for segments in tablespaces with automatic segment management) and Move Table (to another tablespace). The Shrink Table options include Compact (only defragments the segment space and compacts the table rows for subsequent release, but does not readjust the high water mark and does not release the space immediately) and Cascade (performs the same operations on all dependent objects of the table, including secondary indexes on index-organized tables).
Analyze: Options include Compute Statistics (compute exact table and column statistics and store them in the data dictionary), Estimate statistics (estimate table and column statistics and store them in the data dictionary), and Validate Structure (verifies the integrity of each data block and row, and for an index-organized table also generates the optimal prefix compression count for the primary key index on the table). Both computed and estimated statistics are used by the Oracle Database optimizer to choose the execution plan for SQL statements that access analyzed objects.
Constraint: Options include Enable or Disable Single, Drop (delete a constraint), Add Check (add a check constraint), Add Foreign Key, and Add Unique.
Privileges: If you are connected as a database user with sufficient privileges, you can Grant or Revoke privileges on the table to other users.
Trigger: Options include Create, Create PK from Sequence (create a before-insert trigger to populate the primary key using values from a specified sequence), Enable or Disable All, Enable or Disable Single, and Drop (delete the trigger).
You can perform the following operations on a column in a table by right-clicking the column name in the Connections navigator and selecting an item from the menu:
Rename: Renames the column.
Drop: Deletes the column (including all data in that column) from the table.
Encrypt (for Oracle Database Release 10.2 and higher, and only if the Transparent Data Encryption feature is enabled for the database): Displays a dialog box in which you specify a supported encryption algorithm to be used for encrypting all data in the column. Current data and subsequently inserted data are encrypted.
Decrypt (for Oracle Database Release 10.2 and higher, and only if the Transparent Data Encryption feature is enabled for the database): Decrypts data in the column that had been encrypted, and causes data that is subsequently inserted not to be encrypted.
For conceptual and usage information about tables, see Managing Tables.
Triggers are stored PL/SQL blocks associated with a table, a schema, or the database, or anonymous PL/SQL blocks or calls to a procedure implemented in PL/SQL or Java. Oracle Database automatically executes a trigger when specified conditions occur. For conceptual and usage information about sequences, see Triggers: Usage Information. For help with specific options in creating a trigger, see Create Trigger.
A data type associates a fixed set of properties with the values that can be used in a column of a table or in an argument of a procedure or function. These properties cause Oracle Database to treat values of one data type differently from values of another data type. Most data types are supplied by Oracle, although users can create data types.
For conceptual and usage information about data types, see Data Types: Usage Information. For help with specific options in creating a user-defined type, see Create Type (User-Defined).
Database users are accounts through which you can log in to the database. In the Connections navigator, you can see the Other Users in the database associated with a connection, but the database objects that you are allowed to see for each user are determined by the privileges of the database user associated with the current database connection.
Views are virtual tables (analogous to queries in some database products) that select data from one or more underlying tables. Oracle Database provides many view creation options and specialized types of views (such as materialized views, described in Materialized Views), to meet a variety of enterprise needs. For conceptual and usage information about views, see Managing Views. For help with specific options in creating and editing a view, see Create/Edit View.
You can perform the following operations on a view by right-clicking the view name in the Connections navigator and selecting an item from the menu:
Edit: Displays the Create/Edit View dialog box.
Drop: Deletes the view.
Compile: Recompiles the view, to enable you to locate possible errors before run time. You may want to recompile a view after altering one of its base tables to ensure that the change does not affect the view or other objects that depend on it.