Sei sulla pagina 1di 6

https://docs.oracle.com/cd/A57673_01/DOC/server/doc/SRF73/ch6.

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 = (CATALOG.SQL, CATPROC.SQL 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

CATALOG.SQL

none

CATAUDIT.SQL

none

CATEXP.SQL

none

CATLDR.SQL

none

CATNOREP.SQL
CATNOSVM.SQL
CATPARR.SQL

none
none
Parallel
Server

CATPROC.SQL

none

CATPRC.SQL

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 CATAUDIT.SQL, CATESP.SQL, and
CATLDR.SQL
Creates the database audit train and views (This is run
automatically by CATALOG.SQL; it can be removed by
running CATNOAUD.SQL)
Creates data dictionary tables for Import/EXPORT (This is run
automatically by CATALOG.SQL.)
Creates views for using SQL*Loader (This is run
automatically by CATALOG.SQL)
Remove the objects created by CATREPAD.SQL
Drops all objects created by CATSVRMG.SQL
Creates data dictionary views on Parallel Server information
Runs all scripts required for or used with PL/SQL:
CATPRC.SQL, CATRSNAP.SQL, CATRPC.SQL,
STANDARD.SQL, DBMSSTDX.SQL, PIPDL.SQL,
PIDIAN.SQL, DIUTIL.SQL, PISTUB.SQL,
DBMSSNAP.SQL, DBMSLOCK.SQL, DBMSPIPE.SQL,
DBMSALRT.SQL, SBMSOTPT.SQL, DBMSDESC.SQL
Creates data dictionary views for stored procedures, packages,
and database triggers (This is run automatically by

CATREPAD.SQL

none

CATRPC.SQL

distribute
d

CATSNAP.SQL

distribute
d

CATSVRMG.SQL

none

CATTRUST.SQL

Trusted
Oracle7

DBMSALRT.SQL

none

DBMSDESC.SQL

none

DBMSLOCK.SQL

none

DBMSMAIL.SQL

none

DBMSOTPT.SQL

none

DBMSPIPE.SQL

none

DBMSSNAP.SQL

distribute
d

DBMSSTDX.SQL

none

DBMSUTIL.SQL

none

DIUTIL.SQL

none

CATPROC.SQL)
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 CATPROC.SQL; it
requires CATPRC.SQL.)
Creates data dictionary structures for storing and maintaining
snapshots (This is run automatically by CATPROC.SQL; it
requires CATPRC.SQL.)
Creates the views used by Server Manager (This is run
automatically by CATPROC.SQL)
Defines structures needed for the Trusted Oracle7 Server
Allows users and applications to use event alerters (This is run
automatically by CATPROC.SQL; it requires PISTUB.SQL.)
Creates a package that allows you to describe the arguments
and return values of program units (This is run automatically
by CATPROC.SQL; it requires PISTUB.SQL.)
Allows users and applications to send Oracle* Mail messages
(This is run automatically by CATRPOC.SQL; it requires
PISTUB.SQL. You must run it on the sending database, and
run TULMAIL.SQL on the receiving database.)
Allows users and applications to send Oracle7*Mail messages
(This requires PISTUB.SQL. You must run it on the sending
database, and run UTLMAIL.SQL on the receiving
Oracle7*Mail database.)
Allows application developers to receive I/O from procedures.
(This is run automatically by CATPROC.SQL; it requires
PISTUB.SQL.)
Allows sessions in the same instance to communicate with
each other (This is run automatically by CATPROIC.SQL; it
requires PISTUB.SQL.)
Creates procedures for administering snapshots (This is run
automatically by CATPROC.SQL; it requires CATSNAP.SQL,
and you must run it on both the snapshot and master table
nodes.)
Includes extensions to the package standard (This is run
automatically by CATPROC.SQL; it requires
STANDARD.SQL.)
Creates utilities that can be called from within procedures (this
is run automatically by CATPROC.SQL; it requires
PICTUB.SQL.)
Creates PL/SQL packages for the none option (This is run
automatically by CATPROC.SQL; it requires PIDIAN.SQL.)

PIDIAN.SQL

none

PIPIDL.SQL

none

PISTUB.SQL

none

SQL.BSQ

none

STANDARD.SQL

none

Creates PL/SQL packages for the none option (This is run


automatically by CATPROC.SQL; it requires
DBMSSTDX.SQL.)
Creates PL/SQL packages for the none option (This is run
automatically by CATPROC.SQL; it requires
DBMSSTDX.SQL.)
Creates PL/SQL packages for the none option (This is run
automatically by CATPROC.SQL; it requires DIUTIL.SQL.)
Database bootstrap script.
Creates PL/SQL packages for the none option (This is run
automatically by CATPROC.SQL; it requires CATPRC.SQL; it
requires STANDARD.SQL.)

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

CATBLOCK.SQL

none

SYS

CATNOAUD.SQ
L

none

SYS

CATNOPRC.SQL

none

SYS

UTLBSTAT.SQL

none

any
user

UTLCHAIN.SQL

none

any
user

UTLDIDXS.SQL

none

UTLDTREE.SQL

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
CATAUDIT.SQL, including its data and views
Removes data dictionary structures that were
created by CATPRC.SQL
Begins collecting performance tuning statistics (end
with UTLESTAT.SQL.)
Creates tables for storing the output of the
ANALYZE command with CHAINED ROWS
option
Displays the results of running the scripts
UTLIDXSS.SQL and UTLIDXSO.SQL
Creates tables and views that show dependencies
between objects

any
user
any
user

UTLESTAT.SQL

none

UTLEXCPT.SQL

none

UTLLOCKT.SQL

none

SYS

UTLMAIL.SQL

none

SYS

UTLMONTR.SQ
L

none

SYS

UTLOIDXS.SQL

none

UTLSAMPL.SQL

none

UTLSIDXS.SQL

none

any
user

UTLXPLAN.SQL

none

any
user

any
user,
any
user

Ends collecting of performance tuning statistics


started by UTLBTAT.SQL
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 DBMSMAIL.SQL 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 UTLIDXSS.SQL 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

CATALOG6.SQL

none

CATDBSYN.SQ
L

none

CATEXP6.SQL

none

DROPCAT6.SQL

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

UTLEXP6.SQL

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

Potrebbero piacerti anche