1 PACKAGE outln_pkg as
2
3 --
4 -- NAME: drop_unused
5 --
6 -- DESCRIPTION:
7 --
8 -- Drop outlines that have never been applied in the compilation of a
9 -- SQL statement.
10 --
11 -- PARAMETERS
12 --
13 -- none.
14 --
15 -- USAGE NOTES:
16 --
17 -- General purpose.
18 -- Likely candidates that will fall in this class are outlines created
19 -- on behalf of dynamic SQL statements generated by an application for
20 -- one time use only. For these statements, the outlines will never be
21 -- used and are simply taking up valuable disk space.
22 --
23 PROCEDURE drop_unused;
24
25 --
26 -- NAME: drop_by_cat
27 --
28 -- DESCRIPTION:
29 --
30 -- Drop outlines that belong to a particular category. While outlines
31 -- are put into the DEFAULT category unless otherwise specified, users
32 -- have the option of grouping their outlines into groups called
33 -- categories.
34 --
35 -- PARAMETERS
36 --
37 -- cat - category of outlines to drop
38 --
39 -- USAGE NOTES:
40 --
41 -- General purpose.
42 -- It is expected that users will, from to time, wish to purge a category
43 -- of outlines and this procedure does this in a single call.
44 --
45 PROCEDURE drop_by_cat (cat VARCHAR2);
46
47 --
48 -- NAME: update_by_cat
49 --
50 -- DESCRIPTION:
51 --
52 -- Change the category of all outlines in one category to a
53 -- new category.
54 --
55 -- PARAMETERS:
56 --
57 -- oldcat - current category to be changed
58 -- newcat - target category to change outline to
59 --
60 -- USAGE NOTES:
61 --
62 -- General purpose.
63 -- Once satisfied with a set of outlines, a user might chose to move
64 -- the outlines from an "experimental" category to a "production" category.
65 -- Likewise, a user might wish to merge a set of outlines from one
66 -- category into another pre-existing category.
67 --
68 PROCEDURE update_by_cat (oldcat VARCHAR2 default 'DEFAULT',
69 newcat VARCHAR2 default 'DEFAULT');
70
71 --
72 -- NAME: drop_extras
73 --
74 -- DESCRIPTION:
75 --
76 -- Drop extra hint tuples not accounted for by hintcount.
77 --
78 -- PARAMETERS:
79 --
80 -- none.
81 --
82 -- USAGE NOTES:
83 --
84 -- Import/Export post table action.
85 -- The main purpose of this procedure is to clean up after an import.
86 -- It is possible that an outline's OL$ tuple was rejected because an
87 -- outline already existed in the target database, either with the same
88 -- name or same signature. Hint tuples will also be rejected, up to the
89 -- number of hints in the already existing outline.
90 --
91 -- Therefore, if the rejected outline has more hint tuples than the
92 -- existing one, spurious tuples will be successfully inserted into the
93 -- OL$HINTS table and this procedure, executed automatically as a post
94 -- table action, will remove those wrongly inserted hint tuples.
95 --
96 PROCEDURE drop_extras;
97
98 --
99 -- NAME: drop_unrefd_hints
100 --
101 -- DESCRIPTION:
102 --
103 -- Drop hint tuples having no corresponding outline in the OL$ table.
104 --
105 -- PARAMETERS:
106 --
107 -- none.
108 --
109 -- USAGE NOTES:
110 --
111 -- Import/Export post table action.
112 -- This procedure will automatically as a post table action in order to
113 -- remove any hints for which no corresponding entry exists in the OL$
114 -- table. This condition is expected to be rare where it might occur
115 -- when an outline is being dropped while an import is going on.
116 --
117 PROCEDURE drop_unrefd_hints;
118
119 --
120 -- NAME: drop_collision
121 --
122 -- DESCRIPTION:
123 --
124 -- Drop the outlines with an ol$.hintcount that does not match
125 -- the number of hints for that outline in ol$hints
126 --
127 -- PARAMETERS:
128 --
129 -- none.
130 --
131 -- USAGE NOTES:
132 --
133 -- Import/Export post table action.
134 -- Another concurrency problem could be that an outline is being created
135 -- or altered at the same time as one is being imported. Since it is
136 -- required that the outline be imported according to its original design,
137 -- if the concurrent operation changes the outline in mid-import, the outline
138 -- will be dropped as unreliable since its metadata is in an inconsistent
139 -- state.
140 --
141 PROCEDURE drop_collision;
142
143 --
144 -- NAME: drop_extras_expact
145 --
146 -- DESCRIPTION:
147 --
148 -- This functional generates a string which serves as an invocation of
149 -- the drop_extras stored procedure.
150 --
151 -- PARAMETERS:
152 --
153 -- none.
154 --
155 -- USAGE NOTES:
156 --
157 -- Import/Export post table action
158 --
159
160 FUNCTION drop_extras_expact RETURN VARCHAR2;
161
162 --
163 -- NAME: drop_unrefd_hints_expact
164 --
165 -- DESCRIPTION:
166 --
167 -- This functional generates a string which serves as an invocation of
168 -- the drop_unrefd_hints stored procedure.
169 --
170 -- PARAMETERS:
171 --
172 -- none.
173 --
174 -- USAGE NOTES:
175 --
176 -- Import/Export post table action
177 --
178
179 FUNCTION drop_unrefd_hints_expact RETURN VARCHAR2;
180
181 --
182 -- NAME: drop_collision_expact
183 --
184 -- DESCRIPTION:
185 --
186 -- This functional generates a string which serves as an invocation of
187 -- the drop_collision stored procedure.
188 --
189 -- PARAMETERS:
190 --
191 -- none.
192 --
193 -- USAGE NOTES:
194 --
195 -- Import/Export post table action
196 --
197
198 FUNCTION drop_collision_expact RETURN VARCHAR2;
199
200 PROCEDURE update_signatures;
201
202 PROCEDURE exact_text_signatures;
203
204 PROCEDURE clear_used(name IN VARCHAR2);
205
206 --
207 -- NAME: create_outline
208 --
209 -- DESCRIPTION:
210 -- Generate an outline from the shared cursor identified
211 -- by hash value and child number.
212 --
213 -- PARAMETERS
214 --
215 -- hash_value - hash value identifying the target shared cursor
216 -- child_number - child number of the target shared cursor
217 -- category - (optional) category in which to create outline
218 --
219 -- USAGE NOTES:
220 --
221 PROCEDURE create_outline(hash_value IN NUMBER,
222 child_number IN NUMBER,
223 category IN VARCHAR2 DEFAULT 'DEFAULT');
224
225 --
226 -- NAME: refresh_outline_cache
227 --
228 -- DESCRIPTION:
229 -- Refresh the outline cache by re-populating it with the current
230 -- set of outlines.
231 --
232 -- PARAMETERS
233 --
234 -- none.
235 --
236 -- USAGE NOTES:
237 -- This procedure is run as a post table action for IMPORT.
238 -- It can also be invoked directly by the user to refresh the
239 -- outline cache. This might be done if many outlines have
240 -- been dropped or their categories changed.
241 --
242 -- PROCEDURE BODY:
243 --
244 PROCEDURE refresh_outline_cache;
245
246 FUNCTION refresh_outline_cache_expact RETURN VARCHAR2;
247
248 END;