[Link]
htm
SQL Scripts
This chapter describes the SQL scripts that are required for optimal operation of the
Oracle7 Server. The SQL scripts are described in the following sections:
Creating the Data Dictionary
Creating Additional Data Dictionary Structures
Migration Scripts
Note: Check the header of each SQL script for more detailed information and
examples.
Creating the Data Dictionary
The data dictionary is automatically created when a database is created. Thereafter,
whenever the database is in operation, Oracle7 updates the data dictionary in response
to every DDL statement.
The data dictionary base tables are the first objects created in any Oracle database.
They are created and must remain in the SYSTEM tablespace. The data dictionary
base tables are present to store information about all user-defined objects in the
database.
During database creation, the initialization parameter INIT_SQL_FILES specifies the
names of script files that are run immediately following database creation. These SQL
scripts create the data dictionary and other important structures.
The initialization parameter INIT_SQL_FILES can also specify other files to run
during database creation, after the data dictionary is created. These other files may
create site-specific tables. You must specify the names of your files after the default
filenames, as in the following example:
INIT_SQL_FILES = ([Link], [Link] ACME_DBA.SQL)
In this example, ACME_DBA.SQL is an additional file to run during database
creation.
The default filenames specified by INIT_SQL_FILES vary by operating system. See
your operating system specific Oracle documentation for the default filenames.
These initial SQL files do the following tasks:
1. Define the SYSTEM tablespace and SYSTEM rollback segment.
2. Define the data dictionary base tables in the SYSTEM tablespace. For every
table and column in a base table, a comment is also loaded to provide online
documentation.
3. Load data into some data dictionary tables.
Table 6 - 1 lists the scripts that are required for the Oracle7 Server with the indicated
options. The appropriate scripts for your Oracle7 Server options are run automatically
when you create a database. They are described here because you might need to run
them again, when upgrading to a new release of Oracle7. Your release notes
and Oracle7 Server Migration indicate when this is necessary. Run these scripts
connected to the Oracle7 Server as the user SYS.
For more information about scripts with names starting with DBMS, see the Oracle7
Server Application Developer's Guide.
The exact names and locations of these scripts are operating system dependent. See
your operating system specific Oracle documentation for the names and locations on
your system.
Script Name
Requires
Options
[Link]
none
[Link]
none
[Link]
none
[Link]
none
[Link]
[Link]
[Link]
none
none
Parallel
Server
[Link]
none
[Link]
none
Description
Creates the data dictionary and public synonyms for many of
its views, and grants PUBLIC access to the synonyms; also
calls the scripts [Link], [Link], and
[Link]
Creates the database audit train and views (This is run
automatically by [Link]; it can be removed by
running [Link])
Creates data dictionary tables for Import/EXPORT (This is run
automatically by [Link].)
Creates views for using SQL*Loader (This is run
automatically by [Link])
Remove the objects created by [Link]
Drops all objects created by [Link]
Creates data dictionary views on Parallel Server information
Runs all scripts required for or used with PL/SQL:
[Link], [Link], [Link],
[Link], [Link], [Link],
[Link], [Link], [Link],
[Link], [Link], [Link],
[Link], [Link], [Link]
Creates data dictionary views for stored procedures, packages,
and database triggers (This is run automatically by
[Link]
none
[Link]
distribute
d
[Link]
distribute
d
[Link]
none
[Link]
Trusted
Oracle7
[Link]
none
[Link]
none
[Link]
none
[Link]
none
[Link]
none
[Link]
none
[Link]
distribute
d
[Link]
none
[Link]
none
[Link]
none
[Link])
Creates the views and tables required for Symmetric
Replication in Server Manager
Creates data dictionary views on distributed database
information (This is run automatically by [Link]; it
requires [Link].)
Creates data dictionary structures for storing and maintaining
snapshots (This is run automatically by [Link]; it
requires [Link].)
Creates the views used by Server Manager (This is run
automatically by [Link])
Defines structures needed for the Trusted Oracle7 Server
Allows users and applications to use event alerters (This is run
automatically by [Link]; it requires [Link].)
Creates a package that allows you to describe the arguments
and return values of program units (This is run automatically
by [Link]; it requires [Link].)
Allows users and applications to send Oracle* Mail messages
(This is run automatically by [Link]; it requires
[Link]. You must run it on the sending database, and
run [Link] on the receiving database.)
Allows users and applications to send Oracle7*Mail messages
(This requires [Link]. You must run it on the sending
database, and run [Link] on the receiving
Oracle7*Mail database.)
Allows application developers to receive I/O from procedures.
(This is run automatically by [Link]; it requires
[Link].)
Allows sessions in the same instance to communicate with
each other (This is run automatically by [Link]; it
requires [Link].)
Creates procedures for administering snapshots (This is run
automatically by [Link]; it requires [Link],
and you must run it on both the snapshot and master table
nodes.)
Includes extensions to the package standard (This is run
automatically by [Link]; it requires
[Link].)
Creates utilities that can be called from within procedures (this
is run automatically by [Link]; it requires
[Link].)
Creates PL/SQL packages for the none option (This is run
automatically by [Link]; it requires [Link].)
[Link]
none
[Link]
none
[Link]
none
[Link]
none
[Link]
none
Creates PL/SQL packages for the none option (This is run
automatically by [Link]; it requires
[Link].)
Creates PL/SQL packages for the none option (This is run
automatically by [Link]; it requires
[Link].)
Creates PL/SQL packages for the none option (This is run
automatically by [Link]; it requires [Link].)
Database bootstrap script.
Creates PL/SQL packages for the none option (This is run
automatically by [Link]; it requires [Link]; it
requires [Link].)
Table 6 - 1. (continued) Required SQL Scripts
Creating Additional Data Dictionary Structures
Oracle supplies other scripts with the Oracle7 Server that create additional structures
you can use in managing your database and creating database applications. These
scripts are listed in Table 6 - 2.
The exact names and locations of these scripts are operating system dependent. See
your operating system specific Oracle documentation for the names and locations on
your system.
Script Name
Options
Require
d
Run
By
[Link]
none
SYS
[Link]
L
none
SYS
[Link]
none
SYS
[Link]
none
any
user
[Link]
none
any
user
[Link]
none
[Link]
none
any
user
any
user
Description
Creates the view BLOCKING_LOCKS, which
shows which locks are blocking the system
Removes the database audit trail created by
[Link], including its data and views
Removes data dictionary structures that were
created by [Link]
Begins collecting performance tuning statistics (end
with [Link].)
Creates tables for storing the output of the
ANALYZE command with CHAINED ROWS
option
Displays the results of running the scripts
[Link] and [Link]
Creates tables and views that show dependencies
between objects
any
user
any
user
[Link]
none
[Link]
none
[Link]
none
SYS
[Link]
none
SYS
[Link]
L
none
SYS
[Link]
none
[Link]
none
[Link]
none
any
user
[Link]
none
any
user
any
user,
any
user
Ends collecting of performance tuning statistics
started by [Link]
Creates the default table (EXCEPTIONS) for
storing exceptions from enabling constraints
Displays a lock wait-for graph, in tree structure
format
Allows Oracle7*Mail database to receive messages
from procedures (run on Oracle7*Mail database;
requires that you run [Link] on the
database that will send messages)
Grants access to all performance tables used by
Server Manager Monitors to PUBLIC group,
including access to Monitors
Runs [Link] on multiple columns
Creates sample tables, such as EMP and DEPT, and
users, such as SCOTT
Computes the selectivity of a column, and tests
whether an index created on the column would be
appropriate
Creates the table PLAN_TABLE, which holds
output from the EXPLAIN PLAN command
Table 6 - 2. (continued) Additional SQL Scripts
Migration Scripts
The scripts in Table 6 - 3 are useful when migrating to another version or release.
For more information, see Oracle7 Server Migration.
Script Name
Options
Required
[Link]
none
[Link]
L
none
[Link]
none
[Link]
none
Run By
Description
Creates the view BLOCKING_LOCKS,
SYS
which shows which locks are blocking
the system
user with access Creates views for using the Version 6
to data dictionary Export utility with Oracle7
tables
Creates views for using the Version 6
SYS
Export utility with Oracle7
SYS
Removes the Version 6 views and
restores the data dictionary to full
[Link]
none
SYS
Table 6 - 3. Migration SQL Scripts
Oracle7 form.
Returns a list of objects not exported by
SQL*Net export of a Version 6 database