DBA Data[Home] [Help]

PACKAGE: SYS.DBMS_XSTREAM_AUTH

Source


1 PACKAGE dbms_xstream_auth AUTHID CURRENT_USER AS
2 
3 -- Grants the privileges needed by a user to be an administrator for streams.
4 -- Optionally generates a script whose execution has the same effect.
5 -- INPUT:
6 --   grantee          - the user to whom privileges are granted
7 --   privilege_type   - CAPTURE, APPLY, both(*)
8 --   grant_select_privileges - should the select_catalog_role be granted?
9 --   do_grants        - should the privileges be granted ?
10 --   file_name        - name of the file to which the script will be written
11 --   directory_name   - the directory where the file will be written
12 --   grant_optional_privileges - comma-separated list of optional prvileges
13 --                               to grant: XBADMIN, DV_XSTREAM_ADMIN,
14 --                               DV_GOLDENGATE_ADMIN
15 -- OUTPUT:
16 --   if grant_select_privileges = TRUE
17 --     grant select_catalog_role to grantee
18 --   if grant_select_privileges = FALSE
19 --     grant a min set of privileges to grantee
20 --   if do_grants = TRUE
21 --     the grant statements are to be executed.
22 --   if do_grants = FALSE
23 --     the grant statements are not executed.
24 --   If file_name is not NULL,
25 --     then the script is written to it.
26 -- NOTES:
27 --   An error is raised if do_grants is false and file_name is null.
28 --   The file i/o is done using the package utl_file.
29 --   The file is opened in append mode.
30 --   The CREATE DIRECTORY command should be used to create directory_name.
31 --   If do_grants is true, each statement is appended to the script
32 --     only if it executed successfully.
33 PROCEDURE grant_admin_privilege(
34   grantee          IN VARCHAR2,
35   privilege_type   IN VARCHAR2 DEFAULT '*',
36   grant_select_privileges IN BOOLEAN DEFAULT FALSE,
37   do_grants        IN BOOLEAN DEFAULT TRUE,
38   file_name        IN VARCHAR2 DEFAULT NULL,
39   directory_name   IN VARCHAR2 DEFAULT NULL,
40   grant_optional_privileges IN VARCHAR2 DEFAULT NULL,
41   container        IN VARCHAR2 DEFAULT 'CURRENT');
42 
43 -- Revokes the privileges needed by a user to be an administrator for streams.
44 -- Optionally generates a script whose execution has the same effect.
45 -- INPUT:
46 --   grantee           - the user from whom the privileges are revoked
47 --   privilege_type    - CAPTURE, APPLY, both(*)
48 --   revoke_select_privileges - should the select_catalog_role be revoked?
49 --   do_revokes        - should the privileges be revoked ?
50 --   file_name         - name of the file to which the script will be written
51 --   directory_name    - the directory where the file will be written
52 --   revoke_optional_privileges - comma-separated list of optional prvileges
53 --                                to revoke: XBADMIN, DV_XSTREAM_ADMIN,
54 --                                DV_GOLDENGATE_ADMIN
55 -- OUTPUT:
56 --   if revoke_select_privileges = TRUE
57 --     revoke select_catalog_role from grantee
58 --   if revoke_select_privileges = FALSE
59 --     revoke a min set of privileges from grantee
60 --   if do_revokes = TRUE
61 --     the revoke statements are to be executed.
62 --   if do_revokes = FALSE
63 --     the revoke statements are not executed.
64 --   If file_name is not NULL,
65 --     then the script is written to it.
66 -- NOTES:
67 --   An error is raised if do_revokes is false and file_name is null.
68 --   The file i/o is done using the package utl_file.
69 --   The file is opened in append mode.
70 --   The CREATE DIRECTORY command should be used to create directory_name.
71 --   If do_revoke is true, each statement is appended to the script
72 --     only if it executed successfully.
73 PROCEDURE revoke_admin_privilege(
74   grantee           IN VARCHAR2,
75   privilege_type    IN VARCHAR2 DEFAULT '*',
76   revoke_select_privileges IN BOOLEAN DEFAULT FALSE,
77   do_revokes        IN BOOLEAN DEFAULT TRUE,
78   file_name         IN VARCHAR2 DEFAULT NULL,
79   directory_name    IN VARCHAR2 DEFAULT NULL,
80   revoke_optional_privileges IN VARCHAR2 DEFAULT NULL,
81   container        IN VARCHAR2 DEFAULT 'CURRENT');
82 
83 -- Grantss the privileges that allow a Streams administrator at another
84 -- database to perform remote Streams administration at this database
85 -- using the grantee through a database link.
86 -- INPUT:
87 --   grantee          - the user to whom privileges are granted
88 -- OUTPUT:
89 --   grantee is added to DBA_STREAMS_ADMINISTRATOR with ACCESS_FROM_REMOTE
90 --   set to YES.
91 PROCEDURE grant_remote_admin_access(grantee    IN VARCHAR2);
92 
93 -- Revokes the privileges that allow a Streams administrator at another
94 -- database to perform remote Streams administration at this database
95 -- using the grantee through a database link.
96 -- INPUT:
97 --   grantee          - the user from whom the privileges are revoked
98 -- OUTPUT:
99 --   set ACCESS_FROM_REMOTE to NO for user in DBA_STREAMS_ADMINISTRATOR.
100 --   if user also does not have LOCAL_PRIVILEGES then remove entry for
101 --   user from DBA_STREAMS_ADMINISTRATOR.
102 PROCEDURE revoke_remote_admin_access(grantee    IN VARCHAR2);
103 
104 END dbms_xstream_auth;