1 package cwm$util as
2 -- Private internal utility functions
3
4 -- Compute OLAP dimension validity flag used in views
5 --
6 -- param dim_id_owner the id of the dimension
7 -- return varchar2 'Y' if dimension valid, 'N' otherwise
8 function dim_valid(dim_id number) return VARCHAR2 deterministic parallel_enable;
9
10 -- Compute cube validity flag used in views
11 --
12 -- param cube_id the id of the cube
13 -- return varchar2 'N' if cube valid, 'Y' otherwise
14 function cube_invalid(cube_id number) return VARCHAR2 deterministic parallel_enable;
15
16 -- Compute if the tables for a dimension are selectable by the
17 -- connected user. Used by all_olap views filter.
18 --
19 -- param dim_id the id of the dimension
20 -- return varchar2 'Y' if all tables visible, 'N' otherwise
21 function dimension_tables_visible(dim_id number) return VARCHAR2 deterministic parallel_enable;
22
23 -- Compute if the fact tables for a cube are selectable by the
24 -- connected user. Used by all_olap views filter.
25 --
26 -- param cube_id the id of the cube
27 -- return varchar2 'Y' if all tables visible, 'N' otherwise
28 function fact_table_visible(cube_id number) return VARCHAR2 deterministic parallel_enable;
29
30 -- Empty repository contents
31 --
32 -- param full true means also delete seed data.
33 procedure reset_catalog(full boolean := false);
34
35 -- Generate new identifier
36 --
37 -- return number new identifier for repository
38 function get_id return number;
39
40 -- Return the identity of a table
41 --
42 -- param owner owner of table
43 -- param table_name name of table
44 --
45 -- raise table_not_found if table does not exist
46 function get_table_id(owner varchar2
47 , table_name varchar2) return number;
48
49 -- Return the identity of a dimension
50 --
51 -- param owner owner of dimension
52 -- param dimension_name name of dimension
53 --
54 -- raise dimension_not_found if dimension does not exist
55 function get_dimension_id(owner varchar2
56 , dimension_name varchar2) return number;
57
58 -- Return the identity of a foreign key
59 --
60 -- param owner owner of key
61 -- param foreign_key_name name of key
62 --
63 -- raise foreign_key_not_found if foreign key does not exist
64 function get_foreign_key_id(owner varchar2
65 , foreign_key_name varchar2) return number;
66
67 -- Return the id of the default project
68 --
69 -- return number the project id
70 function get_project_id return number;
71
72 -- Return the id of the specified user
73 --
74 -- param user_name name of the user
75 -- return number internal id of the user
76 --
77 -- raise user_not_found if user does not exist
78 function get_user_id(user_name varchar2) return number;
79
80 -- check user has privileges to create / update / delete a cube
81 -- either through owning it or by being an OLAP_DBA
82 --
83 -- param cube_owner user owning the cube
84 -- param cube_name name of the cube
85 --
86 -- raise no_access_privileges if no privileges on cube
87 procedure check_cube_privileges(cube_owner varchar2, cube_name varchar2);
88
89 -- check user has privileges to update dimension metadata
90 -- either through owning it or by being an OLAP_DBA
91 --
92 -- param dimension_owner user owning the dimension
93 -- param dimension_name name of the dimension
94 --
95 -- raise no_access_privileges if no privileges on dimension
96 procedure check_dimension_privileges(dimension_owner varchar2
97 , dimension_name varchar2);
98
99 -- check user has visibility of a cube.
100 --
101 -- param owner owner of the cube
102 -- param cube_name name of the cube
103 --
104 -- raise cube_not_found if no privileges on cube
105 procedure check_cube_visible(owner varchar2
106 , cube_name varchar2);
107
108 -- check user has select privilege on a view or table and
109 -- can thus create mappings to the table. User has privileges
110 -- either through owning the table, granted select access to it
111 -- or by having system privileges such as SELECT ANY TABLE.
112 --
113 -- param table_owner user owning the table
114 -- param table_name name of the table
115 --
116 -- raise table_not_found if no privileges on table
117 procedure check_table_visible(table_owner varchar2
118 , table_name varchar2);
119
120 -- check user has select privilege on a dimension and
121 -- can thus create mappings to the dimension. User has privileges
122 -- either through owning the dimension, granted select access to its
123 -- dimension tablesor by having system privileges such as
124 -- CREATE ANY DIMENSION.
125 --
126 -- param dimension_owner user owning the dimension
127 -- param dimension_name name of the dimension
128 --
129 -- raise dimension_not_found if no privileges on dimension
130 procedure check_dimension_visible(dimension_owner varchar2
131 , dimension_name varchar2);
132
133 -- check that the table has the named column
134 --
135 -- param table_owner user owning the table
136 -- param table_name name of the table
137 -- param column_name name of the column
138 --
139 -- raise table_not_found if no privileges on table
140 -- raise column_not_found if column does not exist
141 procedure check_column_exists(table_owner varchar2
142 , table_name varchar2
143 , column_name varchar2);
144
145 -- check that the dimension has the named level
146 --
147 -- param dimension_owner user owning the dimension
148 -- param dimension_name name of the dimension
149 -- param level_name name of the level to check for
150 --
151 -- raise dimension_not_found if no privileges on dimension
152 -- raise level_not_found if level does not exist
153 procedure check_level_exists(dimension_owner varchar2
154 , dimension_name varchar2
155 , level_name varchar2);
156
157 -- get the dimension level id within lite
158 --
159 -- param dimension_id id of the dimension
160 -- param user_id user owning the dimension
161 -- param level_name name of the level to check for
162 --
163 -- raise dimension_not_found if no privileges on dimension
164 function get_lite_level_id(dimension_id number
165 , user_id number
166 , level_name varchar2) return number;
167
168 -- check that the dimension has the named hierarchy
169 --
170 -- param dimension_owner user owning the dimension
171 -- param dimension_name name of the dimension
172 -- param hierarchy_name name of the hierarchy to check for
173
174 -- raise dimension_not_found if no privileges on dimension
175 -- raise hierarchy_not_found if hierachy does not exist
176 procedure check_hierarchy_exists(dimension_owner varchar2
177 , dimension_name varchar2
178 , hierarchy_name varchar2);
179
180 -- Does the connected user have the OLAP_DBA role
181 --
182 -- return boolean if connected user has role 'OLAP_DBA'
183 function is_olap_dba return boolean;
184
185
186 -- Does the connected user have the SYSDBA role
187 --
188 -- return boolean if connected user has role 'SYSDBA'
189 function is_sysdba return boolean;
190
191
192 -- Diagnostic procedure to dump row count of internal tables
193 procedure dump_table_info;
194 end;