Humble Trader

Friday, September 15, 2006

Warehouse Libraries - Package CTL.LIB_UTIL Specification

  • Package: lib_util
  • Description: .
    • Procedure: create_synonyms
      • Description: Creates synonyms to tables, views and sequences owned by other users, excluding system objects.
      • Parameters: None
      • Action:
        • For each synonym in USER_SYNONYMS...
          • Create and run a 'DROP SYNONYM...' statement for the synonym.
        • End; For each synonym in USER_SYNONYMS.
        • For each object in ALL_OBJECTS conforming to the following criteria:
        • (Object type is one of: 'TABLE', 'VIEW', 'SEQUENCE' or 'PACKAGE'.
        • Owner is one of: 'CTL', 'STA', 'VAL', 'ODS' or 'WHS'.
        • Owner is not self.
        • Object name does not start with 'SYS' or 'BIN$'.
        • A synonym for the object does not already exist)...
          • Create and run a 'CREATE SYNONYM...' statement for the synonym.
        • End; For each object in ALL_OBJECTS conforming to the following criteria.
    • Procedure: create_grants
      • Description: Revokes and creates grants to all users for tables, views, sequences and packages owned by user.
      • Parameters: None
      • Action:
        • For each object in user_objects...
          • For all users...
            • If the user isn't me...
              • Create a REVOKE statement for the object / user.
              • Run the 'REVOKE ...' statement.
            • End; If the user isn't me...
          • End; For all users.
        • End; For each object in user_objects.
        • For each object in user_objects...
          • For all users...
            • If the user isn't me...
              • Create a GRANT statement for the object / user.
              • Run the 'GRANT ...' statement.
            • End; If the user isn't me...
          • End; For all users.
        • End; For each object in user_objects.

0 Comments:

Post a Comment

<< Home