An Example
Since data dictionary tables cannot be replicated, the DBA must perform various administrative tasks in multiple sites. One particular task that I have found to be a needless nuisance is user administration, so I have created the package USERADMIN to replicate calls to create and drop users and to grant and revoke roles. The scripts to create the package are:
cr_seq_audit_admin.sqlCreates the sequence SEQ_AUDIT_ADMIN which is used to populate the ID field in the table AUDIT_ADMIN.
cr_audit_admin.sqlCreates the table AUDIT_ADMIN, which logs usage of the USERADMIN package.
pl_useradmin.sqlCalls the scripts
cr_seq_audit_admin.sqlandcr_audit_admin.sqland creates the package USERADMIN. This script should be run by user SYSTEM.
These scripts are included here .
cr_seq_audit_admin.sql
--------------------------------------------------------------------------- -- Filename: cr_seq_audit_admin.sql -- Purpose: Creates SEQ_AUDIT_ADMIN used by USER_ADMIN procedure -- Author: Chas. Dye (cdye@excitecorp.com) -- Date: 5-Mar-1998 --------------------------------------------------------------------------- set echo on set termout on spool seq_audit_admin.log DROP PUBLIC SYNONYM seq_audit_admin / DROP SEQUENCE seq_audit_admin / CREATE SEQUENCE seq_audit_admin START WITH 1 / CREATE PUBLIC SYNONYM seq_audit_admin FOR seq_audit_admin / spool off
cr_audit_admin.sql
--------------------------------------------------------------------------- -- Filename: cr_audit_admin.sql -- Purpose: Creates table ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access