DBA Data[Home] [Help]

PACKAGE: MDSYS.SDO_GEOR_UTL

Source


1 PACKAGE       SDO_GEOR_UTL AUTHID CURRENT_USER AS
2 
3 -- ---------------------------------------------------------------------
4 --      procedure to create DML triggers on a georaster table
5 -- ---------------------------------------------------------------------
6 
7 PROCEDURE createDMLTrigger
8 (
9     tableName      varchar2,
10     columnName     varchar2
11 );
12 
13 -- ---------------------------------------------------------------------
14 --      procedure to create DML triggers on a georaster table
15 -- ---------------------------------------------------------------------
16 
17 PROCEDURE recreateDMLTriggers;
18 
19 -- ---------------------------------------------------------------------
20 -- NAME
21 --   renameRDT
22 --
23 -- DESCRIPTION
24 --   This routine renames raster data table(s) owned by the current user.
25 --   It will update all related GeoRaster objects and GeoRaster system
26 --   data coorespondingly.
27 --
28 -- ARGUMENTS
29 --   oldRDTs - name(s) of existing raster data table(s) to be renamed
30 --   newRDTs - name(s) of new raster data table(s)
31 --
32 -- NOTES
33 --
34 --   This routine renames RDTs owned by the current user.
35 --
36 --   The RDT names in the strings are seperated with ','.
37 --   If an oldRDT does not appear in the GeoRaster sysdata, it is ignored.
38 --   If a newRDT is not unique in the GeoRaster sysdata, ORA-13403 is raised.
39 --   If a newRDT is NULL, a unique RDT name is automatically generated.
40 -- ---------------------------------------------------------------------
41 PROCEDURE renameRDT
42 (
43    oldRDTs VARCHAR2,
44    newRDTs VARCHAR2 DEFAULT NULL
45 );
46 
47 
48 
49 -- ---------------------------------------------------------------------
50 -- NAME
51 --   makeRDTnamesUnique
52 --
53 -- DESCRIPTION
54 --   This routine resolves conflicting raster data table names by
55 --   automatically renaming some of them so that all raster data tables
56 --   are uniquely named afterwards.
57 --
58 -- ARGUMENTS
59 --   None.
60 --
61 -- NOTES
62 --   This routine is part of the fix for bug 3703288. In addition to applying
63 --   the necessary patchset that fixes this bug, an Oracle database of
64 --   version 10.1.0.2 or 10.1.0.3 needs to run this routine to resolve
65 --   potential RDT name conflicts. User may choose to run the above
66 --   renameRDT() to explicitly rename existing RDTs before run this
67 --   routine.
68 --
69 --   This routine should be run while connected as a user with the DBA role.
70 --
71 -- ---------------------------------------------------------------------
72 PROCEDURE makeRDTnamesUnique;
73 
74 
75 -- ---------------------------------------------------------------------
76 -- NAME
77 --   calcRasterNominalSize
78 --
79 -- DESCRIPTION
80 --   This routine calculates the total length of the raster blocks of
81 --   a GeoRaster object as if it is uncompressed and not sparse.
82 --
83 -- ARGUMENTS
84 --   geor       - the GeoRaster object
85 --   padding    - indicates whether to consider padding in the blocks
86 --   pyramid    - indicates whether to consider pyramids
87 --   bitmapMask - indicates whether to consider associated bitmap masks
88 --
89 -- NOTES
90 --   All the argument are case insensitive.
91 --   The result is in bytes.
92 --
93 -- ---------------------------------------------------------------------
94 FUNCTION calcRasterNominalSize
95 (
96   geor       IN SDO_GEORASTER,
97   padding    IN VARCHAR2 DEFAULT 'TRUE',
98   pyramid    IN VARCHAR2 DEFAULT 'TRUE',
99   bitmapMask IN VARCHAR2 DEFAULT 'TRUE'
100 )
101 RETURN NUMBER DETERMINISTIC PARALLEL_ENABLE;
102 
103 -- ---------------------------------------------------------------------
104 -- NAME
105 --   calcRasterStorageSize
106 -- DESCRIPTION
107 --   This routine calculates the actual length of the raster blocks of
108 --   a GeoRaster object.
109 --
110 -- ARGUMENTS
111 --   geor - the GeoRaster object
112 --
113 -- NOTES
114 --   The result is in bytes.
115 --
116 -- ---------------------------------------------------------------------
117 FUNCTION calcRasterStorageSize
118 (
119   geor       IN SDO_GEORASTER
120 )
121 RETURN NUMBER DETERMINISTIC PARALLEL_ENABLE;
122 
123 -- ---------------------------------------------------------------------
124 -- NAME
125 --   calcOptimizedBlockSize
126 -- DESCRIPTION
127 --   This routine calculates the optimized blockSize based on dimensionSize and--   user input seed blockSize.
128 --
129 -- ARGUMENTS
130 --   dimensionSize - dimension size array, whose length must be 3.
131 --   blockSize - block size array, whose length must be 3.
132 --   pyramidLevel - pyramid level, default value is 0.
133 --
134 -- NOTES
135 --
136 -- ---------------------------------------------------------------------
137 PROCEDURE calcOptimizedBlockSize
138 (
139   dimensionSize       IN MDSYS.SDO_NUMBER_ARRAY,
140   blockSize           IN OUT MDSYS.SDO_NUMBER_ARRAY,
141   pyramidLevel        IN number default 0
142 );
143 
144 -- ---------------------------------------------------------------------
145 -- NAME
146 --   fillEmptyBlocks
147 -- DESCRIPTION
148 --   This routine fills in all empty blocks with background values
149 --   specified in the parameter
150 --
151 -- ARGUMENTS
152 --   geor     - the GeoRaster object
153 --   bgValues - background values for filling sparse data
154 --
155 -- NOTES
156 --
157 -- ---------------------------------------------------------------------
158 PROCEDURE fillEmptyBlocks
159 (
160   geor IN OUT SDO_GEORASTER,
161   bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL
162 );
163 
164 -- NAME
165 --   emptyBlocks
166 -- DESCRIPTION
167 --   This routine make blocks empty, if the blocks only contains background values
168 --   specified in the parameter
169 --
170 -- ARGUMENTS
171 --   geor     - the GeoRaster object
172 --   bgValues - background values for filling sparse data
173 --
174 -- NOTES
175 --
176 -- ---------------------------------------------------------------------
177 PROCEDURE emptyBlocks
178 (
179   geor IN OUT SDO_GEORASTER,
180   bgValues IN SDO_NUMBER_ARRAY DEFAULT NULL
181 );
182 
183 ------------------------------------------------------------------------
184 --           Status Report Related Procedures
185 ------------------------------------------------------------------------
186 
187 -- ---------------------------------------------------------------------
188 -- NAME
189 --   createReportTable
190 -- DESCRIPTION
191 --   Create the table for the operation status.
192 --
193 -- NOTES
194 --
195 -- ---------------------------------------------------------------------
196 PROCEDURE createReportTable;
197 
198 -- ---------------------------------------------------------------------
199 -- NAME
200 --   dropReportTable
201 -- DESCRIPTION
202 --   Drop the table for the operation status.
203 --
204 -- NOTES
205 --
206 -- ---------------------------------------------------------------------
207 PROCEDURE dropReportTable;
208 
209 -- ---------------------------------------------------------------------
210 -- NAME
211 --   clearReportTable
212 -- DESCRIPTION
213 --   Delete the records in the table for the operation status.
214 --   If the client_id is not null, only the records with the client_id
215 --   are deleted, otherwise, all the records are deleted.
216 -- ARGUMENTS
217 --   client_id: a unique id to identify the session.
218 --
219 -- NOTES
220 --   This procedure will only commit on the report table so that
221 --   other sessions can see the committed results.
222 -- ---------------------------------------------------------------------
223 PROCEDURE clearReportTable(client_id in number default null);
224 
225 -- ---------------------------------------------------------------------
226 -- NAME
227 --   isReporting
228 -- DESCRIPTION
229 --   Check if any session has status report enabled.
230 -- RETURN
231 --   1: There are session(s) with status report enabled.
232 --   0: There is no session with status report enabled.
233 --
234 -- NOTES
235 -- ---------------------------------------------------------------------
236 FUNCTION isReporting RETURN NUMBER;
237 
238 -- ---------------------------------------------------------------------
239 -- NAME
240 --   enableReport
241 -- DESCRIPTION
242 --   Enable the status report in this session.
243 --
244 -- NOTES
245 -- ---------------------------------------------------------------------
246 PROCEDURE enableReport;
247 
248 -- ---------------------------------------------------------------------
249 -- NAME
250 --   disableReport
251 -- DESCRIPTION
252 --   Disable the status report in this session.
253 --
254 -- NOTES
255 -- ---------------------------------------------------------------------
256 PROCEDURE disableReport;
257 
258 -- ---------------------------------------------------------------------
259 -- NAME
260 --   setseqid
261 -- DESCRIPTION
262 --   Set the sequence id for the operation in one session. This can be used
263 -- to identify the different operations in the same session. If this
264 -- procedure is not called, the sequence id defaults to 0 in the status
265 -- report.
266 -- ARGUMENTS
267 --   seq_id: an id to identify the operation in this session.
268 --
269 -- NOTES
270 -- ---------------------------------------------------------------------
271 PROCEDURE setseqid(seq_id number);
272 
273 -- ---------------------------------------------------------------------
274 -- NAME
275 --   setClientID
276 -- DESCRIPTION
277 --   Set the client id for a session. This can be used
278 --   to identify the different sessions under the same user.
279 --   The client id can be the database session id or the client id in
280 --   the mid-tier environment. If this procedure is not called, the client
281 --   id in the status report defaults to the database session id.
282 -- ARGUMENTS
283 --   client_id: an id to identify the session.
284 --
285 -- NOTES
286 -- ---------------------------------------------------------------------
287 PROCEDURE setClientID(client_id number);
288 
289 -- ---------------------------------------------------------------------
290 -- NAME
291 --   getProgress
292 -- DESCRIPTION
293 --   Get the lastest progress in percentage of a specific operation.
294 --
295 -- ARGUMENTS
296 --   client_id: a unique id to identify the session.
297 --   seq_id: a unique id to identify the operation in this session.
298 -- RETURNS
299 --   The percentage of the progress in a number between 0 and 1.
300 -- NOTES
301 -- ---------------------------------------------------------------------
302 FUNCTION getProgress(client_id number, seq_id number default 0)
303   RETURN NUMBER;
304 
305 -- ---------------------------------------------------------------------
306 -- NAME
307 --   getStatusReport
308 -- DESCRIPTION
309 --   Get the lastest status of a specific operation.
310 --
311 -- ARGUMENTS
312 --   client_id: a unique id to identify the session.
313 --   seq_id: a unique id to identify the operation in this session.
314 -- RETURNS
315 --   A sdo_string2_array in the format:
316 --     TIMESTAMP, OP_NAME, TARGET_RDT, TARGET_RID, OP_STATUS, DESCRIPTION.
317 -- NOTES
318 -- ---------------------------------------------------------------------
319 FUNCTION getStatusReport(client_id number, seq_id number default 0)
320   RETURN MDSYS.sdo_string2_array DETERMINISTIC PARALLEL_ENABLE;
321 
322 -- ---------------------------------------------------------------------
323 -- NAME
324 --   getAllStatusReport
325 -- DESCRIPTION
326 --   Get the lastest status of the operations in the status table for
327 --   each client_id.
328 -- ARGUMENTS
329 --   None.
330 -- RETURNS
331 --   A sdo_string2_arrayset in the format:
332 --     TIMESTAMP, OP_NAME, TARGET_RDT, TARGET_RID, OP_STATUS, DESCRIPTION.
333 -- NOTES
334 -- ---------------------------------------------------------------------
335 FUNCTION getAllStatusReport
336   RETURN MDSYS.sdo_string2_arrayset DETERMINISTIC PARALLEL_ENABLE;
337 
338 ------------------------------------------------------------------------
339 --           End of Status Report Related Procedures
340 ------------------------------------------------------------------------
341 
342 END SDO_GEOR_UTL;