About the Application

The script content on this page is for navigation purposes only and does not alter the content in any way.

The application has the following purpose, structure, and naming conventions.

Purpose of the Application

The application is intended for two kinds of users in a company.

Typical users can complete the following tasks:

Application administrators can complete the following tasks:

Structure of the Application

The application uses the following schema objects and schemas.

Schema Objects of the Application

The application is composed of these schema objects:

See Also:

Schemas for the Application

For security, the application uses the following five schemas (or users), each of which has only the privileges that it needs.

Suppose that instead of app_user and app_admin_user, the application had only one schema that owned nothing and could execute both employees_pkg and admin_pkg. The connection pool for this schema would have to be large enough for both the typical users and the application administrators. If there were a SQL injection bug in employees_pkg, a typical user who exploited that bug could access admin_pkg.

Suppose that instead of app_data, app_code, and app_admin, the application had only one schema that owned all the schema objects, including the packages. The packages would then have all privileges on the tables, which would be both unnecessary and undesirable.

For example, suppose that you have an audit trail table, AUDIT_TRAIL. You want the developers of employees_pkg to be able to write to AUDIT_TRAIL, but not read or change it. You want the developers of admin_pkg to be able to read AUDIT_TRAIL and write to it, but not change it. If AUDIT_TRAIL, employees_pkg, and admin_pkg belong to the same schema, then the developers of the two packages have all privileges on AUDIT_TRAIL. However, if AUDIT_TRAIL belongs to app_data, employees_pkg belongs to app_code, and admin_pkg belongs to app_admin, then you can connect to the database as app_data and do this:

GRANT INSERT ON AUDIT_TRAIL TO app_code;
GRANT INSERT, SELECT ON AUDIT_TRAIL TO app_admin;

See Also:

Naming Conventions in the Application

The application uses these naming conventions.

Item Name
Table table#
Editioning view for table# table
Trigger on editioning view table

table_{a|b}event[_fer] where:

  • a identifies an AFTER trigger.

  • b identifies a BEFORE trigger.

  • fer identifies a FOR EACH ROW trigger.

  • event identifies the event that fires the trigger. For example: i for INSERT, iu for INSERT or UPDATE, d for DELETE.

PRIMARY KEY constraint in table# table_pk
NOT NULL constraint on table#.column table_column_not_null (Footnote 1)
UNIQUE constraint on table#.column table_column_unique (Footnote 1)
CHECK constraint on table#.column table_column_check (Footnote 1)
REF constraint on table1#.column to table2#.column table1_to_table2_fk (Footnote 1)
REF constraint on table1#.column1 to table2#.column2 table1_col1totable2_col2_fk (Footnote 1) (Footnote 2)
Sequence for table# table_sequence
Parameter name p_name
Local variable name l_name

Footnote 1: table, table1, and table2 are abbreviated to emp for employees, dept for departments, and job_hist for job_history.

Footnote 2: col1 and col2 are abbreviations of column names column1 and column2. A constraint name cannot have more than 30 characters.