7 Creating and Editing Database Objects

You can create and edit objects for some object types by using the context menu in the Navigator tab. If you do not have any existing objects for the object type (such as tables), you can create objects by using the New Object icon, after first selecting the object type from the drop-down list. For all objects, the context menu includes Quick DDL, which saves the DDL statements for creating the object to a worksheet or to a text file. The various object types and the corresponding options are:

  • Tables: Tables are used to hold data. Each table has multiple columns that describe the attributes of the database entity associated with the table, and each column has an associated data type.

    You can create new tables, edit existing tables, and add indexes by using the options available in the context menu. Or you can select Use as Template, which displays the dialog box with information for the selected object filled in. You should then change the object name and any other aspects of the definition, as needed, to create a new object of that type. For a description of the fields, see The Table Properties Dialog.

  • Views: Views are virtual tables that select data from one or more underlying tables. For information about creating and editing a view, see The View Properties Dialog.

  • Indexes: An index contains an entry for each value that appears in the indexed column of the table and provides direct, fast access to rows. For information about creating and editing an index for a table, see The Index Properties Dialog.

  • Packages, Functions, Procedures: A package 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. Select Run from the context menu to insert the code for a selected function, procedure, or package into the worksheet.

  • Triggers: Triggers are stored PL/SQL blocks associated with a table, a schema, the database, or anonymous PL/SQL blocks or calls to a procedure implemented in PL/SQL or Java.

  • Types: 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 function or procedure.

  • Sequences: Sequences are used to generate unique integers. You can use sequences to automatically generate primary key values. For information about creating and editing a sequence, see The Sequence Properties Dialog.

  • Materialized View: 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. For information about creating and editing a materialized view, see Materialized View.

  • Materialized Views Logs: 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.

  • Synonyms, Public Synonyms: 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. For information about creating a synonym, see The Synonym Properties Dialog.

  • Database Links: A database link is a database object in one database that enables you to access objects on another database. After you have created a database link, you can use it to refer to tables and views in the other database.