Oracle Enterprise Manager Administrator's Guide | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
This chapter describes how to use Schema Manager to administer schema objects in your database. This chapter assumes that you have read Chapter 7, Overview of the Database Tools and are familiar with the interface elements of the database tools.
With Schema Manager, you can create, alter, or drop schema objects such as clusters, database links, execution plans, PL/SQL, sequences, snapshots, snapshot logs, synonyms, tables, and views.
The topics in this chapter are:
After Schema Manager successfully connects to a database, the schema navigator displays on the left side of Schema Manager window. The navigator consists of a series of schema object containers, one for each type schema object contained in the main Schema Objects folder. The name of the connected database is displayed next to the Schema Objects folder.
Figure 11-1: Schema Manager Window
Schema Menus
Schema manager includes four standard menus, File, View, Log, and Help, plus the Object menu. The Object menu contains the following menu options:
Alternatively, you can view the navigator by specific schemas defined within the connected database rather than by schema type. To view the navigator by defined schemas, select By Schema from the View menu. All schemas defined in the database are listed alphabetically in the navigator as containers. You expand the specific schema folder in the navigator to view the complete list of schema object types defined for that schema.
Use Cluster Parameters (Table Property Sheet only)
Tablespace
Extents
Next Size: Size of the next extent to be allocated to the object. The default value is the size of five datablocks. The smallest permissible value is the size of one datablock.
Increase Size by: Percent by which each extent grows (after the second extent) compared to the previous extent.
Minimum Number: Total number of extents allocated when a segment is created. The default value is one. You can enter a value of one or greater.
Maximum Number: Total number of extents, including the first, that an Oracle database can allocate for the object. There are two extent options available, Unlimited and Value.
Space Usage
% Used: Minimum percentage of used space that an Oracle database maintains for each data block of the object. A block becomes a candidate for row insertions when its used space falls below the % Used value. You can enter a value from 1 to 99. The default value is 40.
Number of Transactions
Maximum: Maximum number of concurrent transactions that can update a data block allocated to the object. You can enter a value from 1 to 255.
Freelists
Groups: Number of groups of free lists for a table, cluster, or index. You can enter a value of one or greater. The default value is one.
Parallel
Instances: Maximum number of instances allowed to participate in parallel query processing.
A cluster is a group of tables that share the same data blocks because they share common columns. Clustered tables are often joined in queries.
Schema
Cluster
Type
Tablespace
Cluster
Schema
Size
Type: Index Cluster
Type: Hash Cluster
Hashkeys: Maximum number of unique hash values that can be generated by the hash function.
Hash Function: Specify that Oracle's internal hash function use the current function (Default) or bypass the Oracle internal hash function and specify a SQL expression (Expression). You enter the SQL expression in the text entry field.
Cluster Key Columns
Datatype: CHAR, VARCHAR2, NUMBER, LONG, RAW, LONG RAW, DATE, ROWID, MLSLABEL
New: Displays the Column Details dialog box.
Edit: Displays the Column Details dialog box for the cluster key column selected in the list.
Remove: Deletes a cluster key column that is selected in the list.
Name
Datatype
You can select one of the following items: CHAR, VARCHAR2, NUMBER, LONG, RAW, LONG RAW, DATE, ROWID, MLSLABEL
Length: Number of bytes allowed for values defined in the column (for CHAR, VARCHARZ, NUMBER, RAW).
Precision (for NUMBER datatype): Number of digits to the right of the decimal point. If CHAR is selected in the Datatype drop-down list, you may specify length. If VARCHAR2 or RAW is selected, you may specify a length. If NUMBER is selected, you may specify a length, a length and a precision, or neither.
Length
Precision (Visible when Datatype is Number)
A database link allows you to access a remote database. For information about database links, see Oracle7 Server SQL Reference.
The columns of the Database Links list are described below:
Schema
Database Link
Username
Host
Created
If you view the navigator by schema, a Database Links folder appears in an alphabetical list of all schema objects under each schema in the navigator. When the Database Links folder is selected, the multi-column list is displayed.
Name
Public
Connection Details
Anonymous Link: Specifies that the database link use the username and password of the user accessing the database link.
Named Link
Username: Username used to connect to the remote database. If the Username field is left blank during the creation process, the newly defined link acquires the username of the person accessing the remote database.
Password: Password used to connect to the remote database. If the Username and Password fields are left blank, the database link uses the username password of the person accessing the database link.
Service Name: Database specification of a remote database.
Test
Creation Date
Select a specific database link from the navigator. A property sheet with the link's current parameters is displayed. The property sheet is nearly identical to the Create Database Link property sheet with the following exceptions:
A function is a PL/SQL subprogram that executes an operation and returns a value at the completion of the operation. A function can be either built-in or user-named. For information about functions, see Oracle7 Server SQL Reference.
The columns of the Functions list are described below:
Schema
Function
Created
Last Modified
Status
Name
Schema
Recompile
Dates
Last Modified: Date the function was last modified.
Status
Show Errors: Displays the Error Message dialog box listing the errors encountered while trying to compile the function source. This button is only enabled when the function status is invalid. For detailed error message information pertaining to PL/SQL, see the Oracle Server Messages Manual.
Source
Schema
Index
Table Owner
Table
Table Type
Status
When you view the navigator by schema, an Indexes folder appears listing all available schema in alphabetical order. Selecting the Indexes folder displays a multi-column list of indexes contained in the parent schema.
Name
Schema
Index Type (Oracle 8 only)
Index On
Schema: Drop-down list displaying available schema to which the index can belong.
Table: Drop-down list displaying all available tables belonging to the selected schema. The coluns of the selected table are displayed in the Table spreadsheet.
Table Spreadsheet
The Table Spreadsheet consists of the following columns:
Table Columns: Column names of the table selected in the Table drop-down list.
Order: Order of the columns selected for the index. Columns are ordered in the sequence in which it is added to the index.
To add acolumn to the index, click on the desired column in the spreadsheet. The order of the column appears in the Order column.
To remove a column from the index click on the desired column entry in the spreadsheet. The columns are automatically reordered after the index is removed.
Options
Sorted (Default): If deselected, indicates to Oracle 7 that rows are stored in the database are in ascending order and therefore do not have to be sorted when creating the index.
Recoverable: Specifies that the creation of the index will be logged in the redo log file.
A package consists of two parts: the specification and the body. The package body defines all constructs (public and private) of the package while the specification declares all public constructs. For information about package bodies, see Oracle7 Server SQL Reference, or the PL/SQL User's Guide and Reference.
The columns of the package bodies list are described below:
Schema
Package Body
Created
Last Modified
Status
Name
Schema
Recompile
Source
Dates
Last Modified: Date the package body was last modified.
Status
Show Errors/Hide Errors: Opens or closes the Error Messages dialog box. This button is available when the package body status is invalid.
A package is a group of related procedures and functions, together with cursors and variables they use, stored together in the database for continued use as a unit. For information about packages, see Oracle7 Server SQL Reference, or the PL/SQL User's Guide and Reference .
Schema
Package
Created
Last Modified
Status
Name
Schema
Recompile
Dates
Last Modified: Date the package was last modified.
Status
Show Errors/Hide Errors: Opens or closes the Error Messages dialog box. This button is available when the package status is invalid.
Package Source
A procedure groups a set of SQL and PL/SQL statements together to perform a specific task. For more information on procedures, see Oracle7 Server SQL Reference, Vol. II, or the PL/SQL User's Guide and Reference.
Schema
Procedure
Created
Last Modified
Status
Name
Schema
Recompile
Package Source
Status
Show Errors: Displays the Error Message dialog box listing the errors encountered while trying to compile the function source. This button is only enabled when the function status is invalid.
Dates
Last Modified: Date the procedure was last modified.
A refresh group consolidates multiple snapshots and allows you to easily refresh two or more snapshots to a single point in time.
For information about refresh groups, see Oracle7 Server Distributed Systems, Volume II: Replicated Data.
Schema
Name
Number
Next Date
Interval
Name
Schema
Refresh
Broken
Delete group when last member deleted
Refresh
Interval: Function used to calculate the next time to refresh the snapshots in the refresh group.
Continue refresh despite conflicts: Select this option if you want the refresh to proceed even if there are outstanding conflicts logged in the DefError table for the snapshot's master. This option is active for updatable snapshots only.
Push changes from snapshot to master before refresh: Selected by default, thi s option allows you to push changes from the snapshot to its associated master before refreshing the snapshot. Otherwise, these changes may appear to be temporarily lost. This option is active for updatable snapshots only.
Rollback Segment
Segment Name: Name of the rollback segment to use while refreshing snapshots.
Segment Schema: Name of the schema containing the rollback segment.
In Group
Available
A sequence is a database object used to generate a serial list of unique numbers for numeric columns of a database's tables. Sequences simplify data entry in a multi-user system by automatically generating unique numerical values for the rows of a single table or multiple tables. For information about sequences, see Oracle7 Server Concepts and Oracle7 Server Administrator's Guide.
The columns of the Sequences multi-column list are described as follows:
Schema
Sequence
Minimum Value
Maximum Value
Interval
Recent Value
Cycle
Order
Cache Size
Name
Schema
Type: Ascending
Type: Descending
Values
Maximum: Maximum value of a sequence. When creating a sequence this field is initially blank. If left blank when the Create button is selected, a default value of 1027 for an ascending sequence and -1 for a descending sequence will be used.
Increment: Interval by which the sequence increases or decreases. When creating a sequence, this field is initially blank. If left blank when the Create button is selected, a default value of 1 is used. Only positive integers are accepted in this field.
Decrement: Interval by which the sequence decreases. When creating a sequence, this field is initially blank. If left blank when the Create button is selected, a default value of 1 is used. Only positive integers are accepted in this field.
Initial: The starting value of the sequence. If the field is blank when the Create button is selected, a default value of the sequence's minimum will be used for an ascending sequence. For a descending sequence, a default value of the sequence's maximum value is used.
Recent: The most recent value of the sequence. This field is active when altering an existing sequence.
Options
Order Values: When checked, specifies that the sequence numbers are to be generated in order of request. When creating a sequence, this checkbox is unchecked by default.
Cache Size: Number of values to be pre-allocated and stored by the database. There are three options:
A snapshot log is a table associated with the master table of a snapshot. The snapshot log contains information about changes made to its associated master table. The information in the snapshot log is used to refresh the snapshot.
The columns of the Snapshots multi-column list are described as follows:
Schema
Log Table
Log Trigger
Master Table
Current Snapshots
On Master Table
Table: Name of the master table. The drop-down list displays all tables belonging to the selected schema.
Log Table
Log Trigger
Current Snapshots:
A snapshot is a read-only copy of a master table located on a remote node. It is periodically refreshed to reflect changes made to the master table. A snapshot can be queried, but not updated; only the master table can be updated.
The columns of the snapshots list are described below:
Schema
Snapshot
Master Owner
Master Table
Master Link
Last Refresh
Type
Name
Schema
Refresh Type
Complete: Specifies a refresh that executes the subquery.
Fast: Specifies a refresh using only the updated data stored in the snapshot log associated with the master table.
Force: Specifies a fast refresh if one is possible or a complete refresh if fast refresh is not possible.
Start Date: Date snapshot refresh is to begin.
Next Date: Expression that calculates the interval at which the snapshot is updated.
Updatable
Snapshot Subquery
Cluster
Column Name: Name of the column to be used as part of the snapshot. Click Add to add the column name to the Snapshot Columns list.
Snapshot Columns: Scrolling list of all columns added to the snapshot. Use the Up/Down arrows to reorder the list of columns (column order must match the order in the cluster).
Remove: Deletes the selected snapshot column from the list.
A synonym is an alias for a table, view, sequence, procedure, function, package or another synonym.
The columns of the Synonyms multi-column list are described as follows:
Schema
Synonym
Object Owner
Object
Link
Name
Schema
As Alias For
Object Type (Local)/DB Link (Remote): Drop-down list containing available database object types (tables, snapshots, etc.) for local databases. If Remote Database is selected the field label changes to DB Link. In this case, the drop-down list contains all database links defined for the current instance.
Schema: Drop-down list containing all available schemas for the current instance (local databases). If Remote Database is selected, the schema name must be typed in explicitly.
Object: Drop-down list containing all available database objects for the selected schema.
As the basic unit of storage in a relational database management system, a table represents entities and relationships, and consists of one or more units of information (rows), each of which contains the same kinds of values (columns). For information about tables, see Oracle7 Server Concepts.
The columns of the Sequences multi-column list are described as follows:
Schema
Table
Tablespace
Rows
Note:
Name
Schema
Define Columns / Define Query (Create mode only) / Columns
The spreadsheet consists of six columns:
Name: Name of the table column being defined or edited. You can specify a valid Oracle identifier as the name of the column. This field is disabled for columns that have already been defined in the database.
Datatype: Column's Oracle datatype. See Oracle7 Server Administrator's Guide for specific information on Oracle datatypes. You can select one of the following items: CHAR, VARCHAR2, NUMBER, LONG, RAW, LONG RAW, DATE, ROWID, MLSLABEL
Length: Number of bytes allowed for values defined in the column (for CHAR, VARCHARZ, NUMBER, RAW).
Precision (for NUMBER datatype): Number of digits to the right of the decimal point. If CHAR is selected in the Datatype drop-down list, you may specify length. If VARCHAR2 or RAW is selected, you may specify a length. If NUMBER is selected, you may specify a length, a length and a precision, or neither.
Nulls?: When checked, indicates that the column being defined is not permitted to contain null values.
Default Value: An expression that serves as the default value for this column in any rows for which the INSERT statement omits a value for the column.
Define Query (Create mode only)
Constraints on Table
Name: Name of the table constraint being defined. To define a new constraint, you can enter a valid Oracle identifier as the name of the constraint. If no name is entered, a default name will be assigned by the database. This field is disabled if the column has already been defined in the database.
Type: The type of constraint. The drop-down list displays available constraint types: UNIQUE, PRIMARY, FOREIGN, CHECK.
Disable: Indicates that the constraint should be disabled (checked) or enabled (`x') when the constraint is created. Click on the spreadsheet cell to toggle this setting.
Referenced Schema: Schema referenced by the foreign key in the constraint being defined. The drop-down list displays all available schema for the database. This list is active only when FOREIGN is selected as the constraint type.
Referenced Table: Table referenced by the column being defined. This drop-down list displays all tables contained within the Referenced Schema.
Cascade on Delete: When checked, indicates that rows will automatically be removed from the child table if they reference values contained in the referenced key column of rows being removed from the parent table. You toggle this setting by clicking on the desired spreadsheet cell. This control is disabled if a query is defined at Create time or if the column has already been defined in the database.
Check Condition: Check constraint to be included in the table constraint currently being defined.
You can enter the text of the check constraint in this spreadsheet cell or a valid expression. For more information see Oracle 7 Server SQL Reference.
Constraint Definition
Table Columns: Column on which the constraint is to be placed. The drop-down list displays all columns in the table. This cell is active for UNIQUE and PRIMARY key constraints.
Referenced Columns: Columns (unique or primary key) referenced by a foreign key in a referential integrity constraint. The drop-down list displays all columns available in the referenced table.
Cluster
Table Column : Drop-down list displaying all columns in the new table.
Cluster Column: Cluster key columns contained within the selected cluster.
To clear the Table Column entries, reselect the current cluster from the drop-down list.
Select a table from the navigator and then select Create Like from the Object menu. The Create Table property sheet appears with all parameters filled in except Table (name), based on the values from the selected table.
Click Create to create the table and close the property sheet.
A trigger is a stored PL/SQL procedure that is implicitly executed when an INSERT, UPDATE, or DELETE statement is issued against the associated table. For more information about triggers, see Oracle7 Server Concepts.
The columns of the Triggers multi-column list are described as follows:
Schema
Trigger
Type
Event
Table Owner
Table
Name
Schema
Trigger On
Table: Drop-down list displaying all available tables in the selected schema. This field specifies the name of the table on which the trigger is to be created. Triggers on SYS schema tables cannot be created.
Replace if Exists
Enabled
During a Create operation, this control is checked and disabled. It is not checked and enabled if a trigger is disabled.
Trigger Body
Triggering Statement
Delete: When checked, indicates that Oracle fires the trigger whenever a DELETE statement removes a row from a table.
Update of Columns: Indicates that Oracle fires the trigger whenever an UPDATE statement changes a value in a column selected in the multi-select list. It is only enabled and populated when the Update checkbox is selected.
Trigger for Each Row
Referencing
You can use correlation names in the PL/SQL block and WHEN clause of a row trigger to refer specifically to old and new values of the current row. The default correlation names are OLD and NEW.
Condition : Specifies the trigger restriction.
The trigger restriction contains a SQL condition that must be satisfied for Oracle to fire the trigger. This condition must contain correlation names and not a query. You can only specify a trigger restriction for a row trigger. Oracle evaluates this condition for each row affected by the triggering statement. See the Oracle7 SQL Reference manual for more information.
A view is a custom tailored presentation of the data in one or more tables and can also be thought of as a stored query. Views do not actually contain or store data; rather, they derive their data from the tables on which they are based, called base tables. Base tables can in turn be actual tables or can themselves be views. Views can be queried, updated, inserted into, and deleted from, with restrictions. All operations performed on a view actually affect the base tables of the view. For information about views, see Oracle7 Server Concepts.
The columns of the Views multi-column list are described as follows:
Schema
View
Status
Name
Schema
Query Text
Options
Force: When checked, specifies that the view is to be created regardless of whether the view's base tables exist or the owner of the schema containing the view has privileges on them.
Read Only: When checked, specifies that no deletes, inserts or updates can be performed through the view.
Constraint
With Check Option: When checked, specifies that inserts and updates performed through the view must result in rows that the view query can select. The CHECK OPTION cannot make this guarantee if there is a subquery in the query of this view or any view on which this view is based. If you omit this identifier, Oracle automatically assigns the constraint a name of the form: SYS_Cn, where n is an integer that makes the constraint name unique within the database.
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |