DBA Data[Home] [Help]

PACKAGE: GSMADMIN_INTERNAL.DBMS_GSM_ALERTS

Source


1 PACKAGE dbms_gsm_alerts AS
2 
3 
4 --*****************************************************************************
5 -- Package Public Types
6 --*****************************************************************************
7 
8 
9 --*****************************************************************************
10 -- Package Public Constants
11 --*****************************************************************************
12  yellow_level          constant  varchar2(7) := 'YELLOW';
13  red_level             constant  varchar2(4) := 'RED';
14  cpu_threshold         constant  varchar2(4) := 'CPU';
15  disk_threshold        constant  varchar2(5) := 'DISK';
16 
17 -------------------------------------------------------------------------------
18 -- Default Names
19 -------------------------------------------------------------------------------
20 
21 
22 -------------------------------------------------------------------------------
23 -- Identifier lengths
24 -------------------------------------------------------------------------------
25 
26 --*****************************************************************************
27 -- Package Public Exceptions
28 --*****************************************************************************
29 
30 
31 --*****************************************************************************
32 -- Package Public Procedures
33 --*****************************************************************************
34 -------------------------------------------------------------------------------
35 --
36 -- PROCEDURE    post_alert
37 --
38 -- Description:
39 --       post a GDS alert.
40 --
41 -- Parameters:
42 --        reason_id  -
43 --        severity -
44 --        object_name -
45 --        database_name
46 --        pool_name -
47 --        region_name -
48 --        resource_name -
49 --        thresh_level -
50 --        expect_card -
51 --        current_card -
52 --        clear_old_alert -
53 --
54 -------------------------------------------------------------------------------
55 procedure post_alert(reason_id      IN   dbms_server_alert.reason_id_t,
56                            severity      IN   dbms_server_alert.severity_level_t,
57                            object_name     IN   VARCHAR2,
58                            instance_name   IN   VARCHAR2 default NULL,
59                            database_name   IN   VARCHAR2 default NULL,
60                            pool_name       IN   VARCHAR2 default NULL,
61                            region_name     IN   VARCHAR2 default NULL,
62                            resource_name   IN   VARCHAR2 default NULL,
63                            thresh_level    IN   VARCHAR2 default NULL,
64                            expect_card     IN   VARCHAR2  default NULL,
65                            current_card    IN   VARCHAR2  default NULL);
66 
67 
68 -------------------------------------------------------------------------------
69 --
70 -- PROCEDURE    post_gsm_down
71 --
72 -- Description:
73 --       post a GDS alert : gsm down.
74 --
75 -- Parameters:
76 --       gsm_name -    The name of gsm.
77 --       region_name - The region GSM belongs to.
78 --
79 -------------------------------------------------------------------------------
80 procedure post_gsm_down(gname     IN  VARCHAR2,
81                         rname     IN   VARCHAR2 default NULL);
82 
83 -------------------------------------------------------------------------------
84 --
85 -- PROCEDURE    post_instance_down
86 --
87 -- Description:
88 --       post a GDS alert : instance down or not reachable.
89 --
90 -- Parameters:
91 --       gsm_name -    The name of instance.
92 --       pool_name -   The pool the instance belongs to.
93 --       region_name - The region the instance belongs to.
94 --
95 -------------------------------------------------------------------------------
96 PROCEDURE post_instance_down (instance_name IN VARCHAR2,
97                               pool_name      IN VARCHAR2 default NULL,
98                               region_name    IN VARCHAR2 default NULL);
99 
100 -------------------------------------------------------------------------------
101 --
102 -- PROCEDURE    post_database_down
103 --
104 -- Description:
105 --       post a GDS alert : database down or not reachable.
106 --
107 -- Parameters:
108 --       database_name  - The name of the database.
109 --       pool_name      - The pool the database belongs to.
110 --       region_name    - The region the database belongs to.
111 --
112 -------------------------------------------------------------------------------
113 PROCEDURE post_database_down (database_name IN VARCHAR2,
114                               pool_name      IN VARCHAR2 default NULL,
115                               region_name    IN VARCHAR2 default NULL);
116 
117 -------------------------------------------------------------------------------
118 --
119 -- PROCEDURE    post_threshold_hit
120 --
121 -- Description:
122 --       post a GDS alert : a CPU or a DISK threshold has been hit
123 --                          for a given service.
124 --
125 -- Parameters:
126 --       service_name -  The name of the service.
127 --       pool_name -     The pool the service belongs to.
128 --       resource_name - The resource (CPU or DISK) hit by the threshold.
129 --       thresh_level -  The threshold level ('Yellow' or 'Red')
130 --
131 -------------------------------------------------------------------------------
132 procedure post_threshold_hit (instance_name  IN VARCHAR2,
133                               pool_name      IN VARCHAR2,
134                               region_name    IN VARCHAR2,
135                               resource_name  IN VARCHAR2,
136                               thresh_level   IN VARCHAR2);
137 
138 -------------------------------------------------------------------------------
139 --
140 -- PROCEDURE    post_database_lagging
141 --
142 -- Description:
143 --       post a GDS alert : The replcated database is lagging
144 --                          for a given service.
145 --
146 -- Parameters:
147 --       service_name -  The name of the service.
148 --       pool_name -     The pool the service belongs to.
149 --       database_name - The name of the replicated database.
150 --       region_name -   The region the database belongs to.
151 -------------------------------------------------------------------------------
152 procedure post_database_lagging (service_name  IN VARCHAR2,
153                               pool_name     IN VARCHAR2,
154                               database_name IN VARCHAR2,
155                               region_name IN VARCHAR2);
156 
157 -------------------------------------------------------------------------------
158 --
159 -- PROCEDURE    post_card_off
160 --
161 -- Description:
162 --       post a GDS alert : Service cardinality is off.
163 --
164 -- Parameters:
165 --       service_name -  The name of the service.
166 --       pool_name -     The pool the service belongs to.
167 --       exp_card -      The expected cardinality.
168 --       curr_card -     The current cardinality.
169 --
170 -------------------------------------------------------------------------------
171 procedure post_card_off (service_name IN VARCHAR2,
172                          pool_name    IN VARCHAR2,
173                          exp_card     IN NUMBER,
174                          curr_card    IN NUMBER);
175 
176 -------------------------------------------------------------------------------
177 --
178 -- PROCEDURE    post_card_off
179 --
180 -- Description:
181 --       post a GDS alert : Service cardinality is off.
182 --
183 -- Parameters:
184 --       service_name -  The name of the service.
185 --       pool_name -     The pool the service belongs to.
186 --       region_name  -  The region where the cardinality is off.
187 --
188 -------------------------------------------------------------------------------
189 procedure post_card_off (service_name IN VARCHAR2,
190                          pool_name    IN VARCHAR2,
191                          region_name  IN VARCHAR2 default NULL);
192 
193 -------------------------------------------------------------------------------
194 --
195 -- PROCEDURE    post_catalog_down
196 --
197 -- Description:
198 --       post a GDS alert : The catalog is down or not reachable.
199 --
200 -- Parameters:
201 --       database_name - The name of the database where the catalog has
202 --                       been created.
203 -- Note:
204 --       This will be posted on the cloud databases.
205 -------------------------------------------------------------------------------
206 procedure post_catalog_down (database_name IN VARCHAR2);
207 
208 
209 
210 -------------------------------------------------------------------------------
211 --
212 -- FUNCTION   get_gsm_name
213 --
214 -- Description:
215 --       Returns the GSM name associated with the alert.
216 --
217 -- Parameters:
218 --       my_alert - The GDS alert.
219 -- Note:
220 --       This will return the GSM name only if a GSM is involved in
221 --       the GDS alert.
222 -------------------------------------------------------------------------------
223 FUNCTION get_gsm_name (my_alert IN ALERT_TYPE
224                  )
225           return VARCHAR2;
226 
227 -------------------------------------------------------------------------------
228 --
229 -- FUNCTION   get_instance_name
230 --
231 -- Description:
232 --       Returns the instance name associated with the alert.
233 --
234 -- Parameters:
235 --       my_alert - The GDS alert.
236 -- Note:
237 --       This will return the instance name only if an instance is involved in
238 --       the GDS alert.
239 -------------------------------------------------------------------------------
240 FUNCTION get_instance_name (my_alert IN ALERT_TYPE
241                  )
242           return VARCHAR2;
243 
244 -------------------------------------------------------------------------------
245 --
246 -- FUNCTION   get_database_name
247 --
248 -- Description:
249 --       Returns the database name associated with the alert.
250 --
251 -- Parameters:
252 --       my_alert - The GDS alert.
253 -- Note:
254 --       This will return the instance name only if a database is involved in
255 --       the GDS alert.
256 -------------------------------------------------------------------------------
257 FUNCTION get_database_name (my_alert IN ALERT_TYPE
258                  )
259           return VARCHAR2;
260 
261 -------------------------------------------------------------------------------
262 --
263 -- FUNCTION   get_database_name
264 --
265 -- Description:
266 --       Returns the database name associated with the alert.
267 --
268 -- Parameters:
269 --       my_alert - The GDS alert.
270 -- Note:
271 --       This will return the instance name only if a database is involved in
272 --       the GDS alert.
273 -------------------------------------------------------------------------------
274 FUNCTION get_service_name(my_alert IN ALERT_TYPE
275                  )
276           return VARCHAR2;
277 
278 -------------------------------------------------------------------------------
279 --
280 -- FUNCTION   get_gdspool_name
281 --
282 -- Description:
283 --       Returns the GDS pool name associated with the alert.
284 --
285 -- Parameters:
286 --       my_alert - The GDS alert.
287 -- Note:
288 --       This will return the GDS pool name only if a GDS pool is involved in
289 --       the GDS alert.
290 -------------------------------------------------------------------------------
291 FUNCTION get_gdspool_name (my_alert IN ALERT_TYPE
292                  )
293           return VARCHAR2;
294 
298 --
295 -------------------------------------------------------------------------------
296 --
297 -- FUNCTION   get_region_name
299 -- Description:
300 --       Returns the region name associated with the alert.
301 --
302 -- Parameters:
303 --       my_alert - The GDS alert.
304 -- Note:
305 --       This will return the region name only if a region is named in
306 --       the GDS alert.
307 -------------------------------------------------------------------------------
308 FUNCTION get_region_name (my_alert IN ALERT_TYPE
309                  )
310           return VARCHAR2;
311 
312 -------------------------------------------------------------------------------
313 --
314 -- FUNCTION   get_resource_name
315 --
316 -- Description:
317 --       Returns the resource name (CPU or DISK)  associated with the alert.
318 --
319 -- Parameters:
320 --       my_alert - The GDS alert.
321 -- Note:
322 --       This will return the resource name only if it is a treshold limit
323 --       GDS alert.
324 -------------------------------------------------------------------------------
325 FUNCTION get_resource_name (my_alert IN ALERT_TYPE
326                  )
327           return VARCHAR2;
328 
329 -------------------------------------------------------------------------------
330 --
331 -- FUNCTION   get_thresh_level
332 --
333 -- Description:
334 --       Returns the thresh level (Yellow, Red) associated with the alert.
335 --
336 -- Parameters:
337 --       my_alert - The GDS alert.
338 -- Note:
339 --       This will return the threshold level if it is a threshold
340 --       GDS alert.
341 -------------------------------------------------------------------------------
342 FUNCTION get_thresh_level (my_alert IN ALERT_TYPE
343                  )
344           return VARCHAR2;
345 
346 -------------------------------------------------------------------------------
347 --
348 -- FUNCTION   get_expected_cardinality
349 --
350 -- Description:
351 --       Returns the expected cardinality as mentioned in the alert.
352 --
353 -- Parameters:
354 --       my_alert - The GDS alert.
355 -- Note
356 --       This will return the expected cardinality if it is a cardinality miss
357 --       GDS alert.
358 -------------------------------------------------------------------------------
359 FUNCTION get_expected_cardinality (my_alert IN ALERT_TYPE
360                  )
361           return BINARY_INTEGER;
362 
363 -------------------------------------------------------------------------------
364 --
365 -- FUNCTION   get_current_cardinality
366 --
367 -- Description:
368 --       Returns the current cardinality as mentioned in the alert.
369 --
370 -- Parameters:
371 --       my_alert - The GDS alert.
372 -- Note
373 --       This will return the current cardinality if it is a cardinality miss
374 --       GDS alert.
375 -------------------------------------------------------------------------------
376 FUNCTION get_current_cardinality (my_alert IN ALERT_TYPE
377                  )
378           return BINARY_INTEGER;
379 
380 END dbms_gsm_alerts;