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 do the following tasks:

Application administrators can do 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 the following 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 users app_user and app_admin_user, the application had only one schema that owned nothing and could run both employees_pkg and admin_pkg packages. 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 the employees_pkg package, a typical user who exploited that bug could access the admin_pkg package.

Suppose that instead of the app_data, app_code, and app_admin schemas, 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 the employees_pkg package to be able to write to the AUDIT_TRAIL table, but not read or change it. You want the developers of the admin_pkg package to be able to read the AUDIT_TRAIL table and write to it, but not change it. If the AUDIT_TRAIL table and the employees_pkg, and admin_pkg packages belong to the same schema, then the developers of the two packages have all privileges on the AUDIT_TRAIL table. However, if the AUDIT_TRAIL table belongs to the app_data schema, the employees_pkg package belongs to the app_code schema, and the admin_pkg package belongs to the app_admin schema, then you can connect to the database as the app_data schema and run the following commands:

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_null1
UNIQUE constraint on table#.column table_column_unique1
CHECK constraint on table#.column table_column_check1
REF constraint on table1#.column to table2#.column table1_to_table2_fk1
REF constraint on table1#.column1 to table2#.column2 table1_col1totable2_col2_fk1 2
Sequence for table# table_sequence
Parameter name p_name
Local variable name l_name
  1. table, table1, and table2 are abbreviated to emp for employees, dept for departments, and job_hist for job_history.  2 3 4 5

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