1 PACKAGE dbms_repcat AUTHID CURRENT_USER AS
2 -------------------------
3 -- OVERVIEW
4 --
5 -- This package provides routines to administer and update the replication
6 -- catalog and environment. An alternative would be to invent SQL DDL syntax.
7
8 --------
9 -- TYPES
10 --
11
12 --
13 -- NOTE: The type varchar2s is equivalent to the type varchar2s
14 -- in the package dbms_repcat_sna. If you make changes to this
15 -- version, please make the same changes to the other version.
16 --
17 TYPE varchar2s IS TABLE OF VARCHAR(60) INDEX BY BINARY_INTEGER;
18
19 TYPE validate_err_record IS RECORD (err_msg VARCHAR2(2000), err_num number);
20 TYPE validate_err_table IS TABLE OF validate_err_record
21 INDEX BY BINARY_INTEGER;
22
23 ------------
24 -- CONSTANTS
25 --
26
27 -- The are constants for the rep_type parameter used in snapshot group
28 -- registration
29 -- These constants have to be kept in sync with those defined in
30 -- prvthdcl.sql
31 reg_unknown CONSTANT NUMBER := 0;
32 reg_v7_group CONSTANT NUMBER := 1;
33 reg_v8_group CONSTANT NUMBER := 2;
34 reg_repapi_group CONSTANT NUMBER := 3;
35
36 -- constants for conflict resolution result enumeration type
37 --
38 -- These constants must be kept in sync with the macros in
39 -- knip.h
40 --
41 resolved_false CONSTANT NUMBER := 1; -- fail to resolve
42 resolved_error CONSTANT NUMBER := 2; -- similar to raise exception
43 resolved_ignore CONSTANT NUMBER := 3; -- ignore the remote rpc
44 resolved_proceed CONSTANT NUMBER := 4; -- possibly using changed values
45
46 -------------
47 -- EXCEPTIONS
48 --
49 -- These exceptions must be kept in sync with those defined in
50 -- prvthdcl.sql
51
52 missingschema EXCEPTION;
53 PRAGMA exception_init(missingschema, -23306);
54 missschema_num NUMBER := -23306;
55
56 duplicateschema EXCEPTION;
57 PRAGMA exception_init(duplicateschema, -23307);
58 duplschema_num NUMBER := -23307;
59
60 missingobject EXCEPTION;
61 PRAGMA exception_init(missingobject, -23308);
62 missobj_num NUMBER := -23308;
63
64 duplicateobject EXCEPTION;
65 PRAGMA exception_init(duplicateobject, -23309);
66 duplobj_num NUMBER := -23309;
67
68 notquiesced EXCEPTION;
69 PRAGMA exception_init(notquiesced, -23310);
70 notquiesced_num NUMBER := -23310;
71
72 notnormal EXCEPTION;
73 PRAGMA exception_init(notnormal, -23326);
74 notnormal_num NUMBER := -23326;
75
76 nonmasterdef EXCEPTION;
77 PRAGMA exception_init(nonmasterdef, -23312);
78 nonmasterdef_num NUMBER := -23312;
79
80 nonmaster EXCEPTION;
81 PRAGMA exception_init(nonmaster, -23313);
82 nonmaster_num NUMBER := -23313;
83
84 nonsnapshot EXCEPTION;
85 PRAGMA exception_init(nonsnapshot, -23314);
86 nonsnapshot_num NUMBER := -23314;
87
88 nonmview EXCEPTION;
89 PRAGMA exception_init(nonmview, -23314);
90 nonmview_num NUMBER := -23314;
91
92 version EXCEPTION;
93 PRAGMA exception_init(version, -23315);
94 version_num NUMBER := -23315;
95
96 reconfigerror EXCEPTION;
97 PRAGMA exception_init(reconfigerror, -23316);
98 reconfig_num NUMBER := -23316;
99
100 commfailure EXCEPTION;
101 PRAGMA exception_init(commfailure, -23317);
102 commfail_num NUMBER := -23317;
103
104 ddlfailure EXCEPTION;
105 PRAGMA exception_init(ddlfailure, -23318);
106 ddlfail_num NUMBER := -23318;
107
108 typefailure EXCEPTION;
109 PRAGMA exception_init(typefailure, -23319);
110 typefail_num NUMBER := -23319;
111
112 corrupt EXCEPTION;
113 PRAGMA exception_init(corrupt, -23320);
114 corrupt_num NUMBER := -23320;
115
116 badsnapname EXCEPTION;
117 PRAGMA exception_init(badsnapname, -23328);
118 badsnapname_num NUMBER := -23328;
119
120 badmviewname EXCEPTION;
121 PRAGMA exception_init(badmviewname, -23328);
122 badmviewname_num NUMBER := -23328;
123
124 badsnapddl EXCEPTION;
125 PRAGMA exception_init(badsnapddl, -23329);
126 badsnapddl_num NUMBER := -23329;
127
128 badmviewddl EXCEPTION;
129 PRAGMA exception_init(badmviewddl, -23329);
130 badmviewddl_num NUMBER := -23329;
131
132 fullqueue EXCEPTION;
133 PRAGMA exception_init(fullqueue, -23353);
134 fullqueue_num NUMBER := -23353;
135
136 misssnapobject EXCEPTION;
137 PRAGMA exception_init(misssnapobject, -23355);
138 misssnapobj_num NUMBER := -23355;
139
140 missmviewobject EXCEPTION;
141 PRAGMA exception_init(missmviewobject, -23355);
142 missmviewobj_num NUMBER := -23355;
143
144 masternotremoved EXCEPTION;
145 PRAGMA exception_init(masternotremoved,-23356);
146 mstrntrmvd_num NUMBER := -23356;
147
148 invalidqualifier EXCEPTION;
149 PRAGMA exception_init(invalidqualifier,-23378);
150 invldqual_num NUMBER := -23378;
151
152 qualifiertoolong EXCEPTION;
153 PRAGMA exception_init(qualifiertoolong,-23379);
154 qualtoolong_num NUMBER := -23379;
155
156 invalidpropmode EXCEPTION;
157 PRAGMA exception_init(invalidpropmode,-23380);
158 invldpmode_num NUMBER := -23380;
159
160 missingremoteobject EXCEPTION;
161 PRAGMA exception_init(missingremoteobject, -23381);
162 missrmtobj_num NUMBER := -23381;
163
164 invalidremoteuser EXCEPTION;
165 PRAGMA exception_init(invalidremoteuser, -23358);
166 invalidremoteuser_num NUMBER := -23358;
167
168 addrepddlerror EXCEPTION;
169 PRAGMA exception_init(addrepddlerror, -23359);
170 addrepddlerror_num NUMBER := -23359;
171
172 failaltersnaprop EXCEPTION;
173 PRAGMA exception_init(failaltersnaprop, -23477);
174 failaltersnaprop_num NUMBER := -23477;
175
176 failaltermviewrop EXCEPTION;
177 PRAGMA exception_init(failaltermviewrop, -23477);
178 failaltermviewrop_num NUMBER := -23477;
179
180 alreadymastered EXCEPTION;
181 PRAGMA exception_init(alreadymastered, -23478);
182 alreadymastered_num NUMBER := -23478;
183
184 -----
185 -- Conflict Resolution exceptions
186 -----
187
188 paramtype EXCEPTION;
189 PRAGMA exception_init(paramtype, -23325);
190 paramtype_num NUMBER := -23325;
191
192 duplicategroup EXCEPTION;
193 PRAGMA exception_init(duplicategroup, -23330);
194 dupgrp_num NUMBER := -23330;
195
196 missinggroup EXCEPTION;
197 PRAGMA exception_init(missinggroup, -23331);
198 missgrp_num NUMBER := -23331;
199
200 referenced EXCEPTION;
201 PRAGMA exception_init(referenced, -23332);
202 ref_num NUMBER := -23332;
203
204 duplicatecolumn EXCEPTION;
205 PRAGMA exception_init(duplicatecolumn, -23333);
206 dupcol_num NUMBER := -23333;
207
208 missingcolumn EXCEPTION;
209 PRAGMA exception_init(missingcolumn, -23334);
210 misscol_num NUMBER := -23334;
211
212 duplicateprioritygroup EXCEPTION;
213 PRAGMA exception_init(duplicateprioritygroup, -23335);
214 duppriorgrp_num NUMBER := -23335;
215
216 missingprioritygroup EXCEPTION;
217 PRAGMA exception_init(missingprioritygroup, -23336);
218 misspriorgrp_num NUMBER := -23336;
219
220 missingvalue EXCEPTION;
221 PRAGMA exception_init(missingvalue, -23337);
222 missval_num NUMBER := -23337;
223
224 duplicatevalue EXCEPTION;
225 PRAGMA exception_init(duplicatevalue, -23338);
226 dupval_num NUMBER := -23338;
227
228 duplicateresolution EXCEPTION;
229 PRAGMA exception_init(duplicateresolution, -23339);
230 dupres_num NUMBER := -23339;
231
232 invalidmethod EXCEPTION;
233 PRAGMA exception_init(invalidmethod, -23340);
234 badmeth_num NUMBER := -23340;
235
236 missingfunction EXCEPTION;
237 PRAGMA exception_init(missingfunction, -23341);
238 missfunc_num NUMBER := -23341;
239
240 invalidparameter EXCEPTION;
241 PRAGMA exception_init(invalidparameter, -23342);
242 badparam_num NUMBER := -23342;
243
244 missingresolution EXCEPTION;
245 PRAGMA exception_init(missingresolution, -23343);
246 missres_num NUMBER := -23343;
247
248 missingconstraint EXCEPTION;
249 PRAGMA exception_init(missingconstraint, -23344);
250 missconst_num NUMBER := -23344;
251
252 statnotreg EXCEPTION;
253 PRAGMA exception_init(statnotreg, -23345);
254 statnotreg_num NUMBER := -23345;
255
256 onlyonesnap EXCEPTION;
257 PRAGMA exception_init(onlyonesnap, -23360);
258 onlyonesnap_num NUMBER := -23360;
259
260 onlyonemview EXCEPTION;
261 PRAGMA exception_init(onlyonemview, -23360);
262 onlyonemview_num NUMBER := -23360;
263
264 keysendcomp EXCEPTION;
265 PRAGMA exception_init(keysendcomp, -23475);
266 keysendcomp_num NUMBER := -23475;
267
268 onlyonecol EXCEPTION;
269 PRAGMA exception_init(onlyonecol, -23485);
270 onlyonecol_num NUMBER := -23485;
271
272 -----
273 -- Product factoring exceptions
274 -----
275
276 norepoption EXCEPTION;
277 PRAGMA exception_init(norepoption, -23364);
278 norepoption_num NUMBER := -23364;
279
280 ------
281 --- Object Group exceptions
282 ------
283
284 missingrepgroup EXCEPTION;
285 PRAGMA exception_init(missingrepgroup, -23373);
286 missrepgrp_num NUMBER := -23373;
287
288 duplicaterepgroup EXCEPTION;
289 PRAGMA exception_init(duplicaterepgroup, -23374);
290 duplrepgrp_num NUMBER := -23374;
291
292 dbnotcompatible EXCEPTION;
293 PRAGMA exception_init(dbnotcompatible, -23375);
294 notcompat_num NUMBER := -23375;
295
296 repnotcompatible EXCEPTION;
297 PRAGMA exception_init(repnotcompatible, -23376);
298 repcompat_num NUMBER := -23376;
299
300 ------
301 --- Materialized View Repgroup Registration
302 ------
303
304 unregsnaprepgroup EXCEPTION;
305 PRAGMA exception_init(unregsnaprepgroup, -23382);
306 unreggrp_num NUMBER := -23382;
307
308 unregmviewrepgroup EXCEPTION;
309 PRAGMA exception_init(unregmviewrepgroup, -23382);
310 unreggrpmv_num NUMBER := -23382;
311
312 failregsnaprepgroup EXCEPTION;
313 PRAGMA exception_init(failregsnaprepgroup, -23383);
314 failreggrp_num NUMBER := -23383;
315
316 failregmviewrepgroup EXCEPTION;
317 PRAGMA exception_init(failregmviewrepgroup, -23383);
318 failreggrpmv_num NUMBER := -23383;
319
320 ------
321 --- V8 exceptions
322 ------
323
324 qrytoolong EXCEPTION;
325 PRAGMA exception_init(qrytoolong, -23389);
326 qrytoolong_num NUMBER := -23389;
327
328 misssna EXCEPTION;
329 PRAGMA exception_init(misssna, -23392);
330 misssna_num NUMBER := -23392;
331
332 missmview EXCEPTION;
333 PRAGMA exception_init(missmview, -23392);
334 missmview_num NUMBER := -23392;
335
336 incorrectobjtype EXCEPTION;
337 PRAGMA exception_init(incorrectobjtype, -23395);
338 incorrectobjtype_num NUMBER := -23395;
339
340 missingdblink EXCEPTION;
341 PRAGMA exception_init(missingdblink, -23396);
342 missingdblink_num NUMBER := -23396;
343
344 dblinkmismatch EXCEPTION;
345 PRAGMA exception_init(dblinkmismatch, -23397);
346 dblinkmismatch_num NUMBER := -23397;
347
348 dblinkuidmismatch EXCEPTION;
349 PRAGMA exception_init(dblinkuidmismatch, -23398);
350 dblinkuidmismatch_num NUMBER := -23398;
351
352 objectnotgenerated EXCEPTION;
353 PRAGMA exception_init(objectnotgenerated, -23399);
354 objectnotgenerated_num NUMBER := -23399;
355
356 opnotsupported EXCEPTION;
357 PRAGMA exception_init(opnotsupported, -23408);
358 opnotsupported_num NUMBER := -23408;
359
360 notallgenerated EXCEPTION;
361 PRAGMA exception_init(notallgenerated, -23419);
362 notallgenerated_num NUMBER := -23419;
363
364 updlobnotsupported EXCEPTION;
365 PRAGMA exception_init(updlobnotsupported, -23435);
366 updlobnotsupported_num NUMBER := -23435;
367
368 flavorduplicateobj EXCEPTION;
369 PRAGMA exception_init(flavorduplicateobj, -23450);
370 flavorduplicateobj_num NUMBER := -23450;
371
372 duplicateflavor EXCEPTION;
373 PRAGMA exception_init(duplicateflavor, -23451);
374 duplicateflavor_num NUMBER := -23451;
375
376 flavorpublished EXCEPTION;
377 PRAGMA exception_init(flavorpublished, -23452);
378 flavorpublished_num NUMBER := -23452;
379
380 topflavor EXCEPTION;
381 PRAGMA exception_init(topflavor, -23453);
382 topflavor_num NUMBER := -23453;
383
384 missingflavor EXCEPTION;
385 PRAGMA exception_init(missingflavor, -23454);
386 missingflavor_num NUMBER := -23454;
387
388 flavorobject EXCEPTION;
389 PRAGMA exception_init(flavorobject, -23455);
390 flavorobject_num NUMBER := -23455;
391
392 flavornoobject EXCEPTION;
393 PRAGMA exception_init(flavornoobject, -23456);
394 flavornoobject_num NUMBER := -23456;
395
396 flavorbad EXCEPTION;
397 PRAGMA exception_init(flavorbad, -23458);
398 flavorbad_num NUMBER := -23458;
399
400 flavorcontains EXCEPTION;
401 PRAGMA exception_init(flavorcontains, -23459);
402 flavorcontains_num NUMBER := -23459;
403
404 flavorinuse EXCEPTION;
405 PRAGMA exception_init(flavorinuse, -23462);
406 flavorinuse_num NUMBER := -23462;
407
408 flavorbadshape EXCEPTION;
409 PRAGMA exception_init(flavorbadshape, -23463);
410 flavorbadshape_num NUMBER := -23463;
411
412 flavormissingcol EXCEPTION;
413 PRAGMA exception_init(flavormissingcol, -23464);
414 flavormissingcol_num NUMBER := -23464;
415
416 flavorduplicatecol EXCEPTION;
417 PRAGMA exception_init(flavorduplicatecol, -23465);
418 flavorduplicatecol_num NUMBER := -23465;
419
420 flavorobjrequired EXCEPTION;
421 PRAGMA exception_init(flavorobjrequired, -23466);
422 flavorobjrequired_num NUMBER := -23466;
423
424 flavormissingobj EXCEPTION;
425 PRAGMA exception_init(flavormissingobj, -23467);
426 flavormissingobj_num NUMBER := -23467;
427
428 ------
429 --- Objects Replication exceptions
430 ------
431 nottopcolumn EXCEPTION;
432 PRAGMA exception_init(nottopcolumn, -23480);
433 nottopcolumn_num NUMBER := -23480;
434
435 invalidnamestr EXCEPTION;
436 PRAGMA exception_init(invalidnamestr, -23481);
437 invalidnamestr_num NUMBER := -23481;
438
439 adtcolumn EXCEPTION;
440 PRAGMA exception_init(adtcolumn, -23482);
441 adtcolumn_num NUMBER := -23482;
442
443 objectnotallowed EXCEPTION;
444 PRAGMA exception_init(objectnotallowed, -23483);
445 objectnotallowed_num NUMBER := -23483;
446
447 ------
448 --- Multi-tier mview exceptions
449 ------
450 nonmasterrepgrp EXCEPTION;
451 PRAGMA exception_init(nonmasterrepgrp, -23500);
452 nonmasterrepgrp_num NUMBER := -23500;
453
454 reftmplinvalidcompat EXCEPTION;
455 PRAGMA exception_init(reftmplinvalidcompat, -23501);
459 -- Reduce Quiesce exceptions
456 reftmplinvalidcompat_num NUMBER := -23501;
457
458 -------
460 -------
461 rqduplcolumn EXCEPTION;
462 pragma exception_init(rqduplcolumn, -23504);
463 rqduplcolumn_num NUMBER := -23504;
464
465 ------
466 --- add_master_db w/o quiesce exceptions
467 ------
468 notsamecq EXCEPTION; -- not having same connection qualifier
469 PRAGMA exception_init(notsamecq, -23487);
470 notsamecq_num NUMBER := -23487;
471
472 propmodenotallowed EXCEPTION; -- propagation mode is not allowed for this op
473 PRAGMA exception_init(propmodenotallowed, -23488);
474 propmodenotallowed_num NUMBER := -23488;
475
476 dupentry EXCEPTION; -- duplicated entry
477 PRAGMA exception_init(dupentry, -23489);
478 dupentry_num NUMBER := -23489;
479
480 extstinapp EXCEPTION; -- extension status is inappropriate
481 PRAGMA exception_init(extstinapp, -23490);
482 extstinapp_num NUMBER := -23490;
483
484 novalidextreq EXCEPTION; -- no valid extension request
485 PRAGMA exception_init(novalidextreq, -23491);
486 novalidextreq_num NUMBER := -23491;
487
488 nonewsites EXCEPTION; -- no new sites for extension request
489 PRAGMA exception_init(nonewsites, -23492);
490 nonewsites_num NUMBER := -23492;
491
492 notanewsite EXCEPTION; -- not a new site for extension request
493 PRAGMA exception_init(notanewsite, -23493);
494 notanewsite_num NUMBER := -23493;
495
496 toomanydes EXCEPTION; -- too many rows for destination.
497 PRAGMA exception_init(toomanydes, -23494);
498 toomanydes_num NUMBER := -23494;
499
500 insufficientprivs EXCEPTION; -- Insufficient Privileges
501 PRAGMA exception_init(insufficientprivs, -1031);
502 insufficientprivs_num NUMBER := -1031;
503
504 -------------
505 -- VARIABLES
506 --
507
508 err_table dbms_repcat.validate_err_table;
509
510 ---------------------------------------------------------------------------
511 --
512 -- MASTER REPLICATION PROCEDURES
513 --
514 -- The following procedure are used to create and manage master replication
515 -- sites.
516 --
517 ---------------------------------------------------------------------------
518 PROCEDURE register_mview_repgroup(gname IN VARCHAR2,
519 mviewsite IN VARCHAR2,
520 comment IN VARCHAR2 := NULL,
521 rep_type IN NUMBER := reg_unknown,
522 fname IN VARCHAR2 := NULL,
523 gowner IN VARCHAR2 := 'PUBLIC');
524
525 -- This procedure is used at master sites to manually register
526 -- a materialized view repgroup.
527 --
528 -- Arguments:
529 -- gname: Name of the repgroup
530 -- snapsite: Site of the materialized view repgroup
531 -- comment: comment describing the materialized view repgroup
532 -- rep_type: Version and type of the materialized view group (valid
533 -- constants are defined in dbms_repcat package header)
534 -- fname: This parameter is reserved for internal use.
535 -- Do not specify this parameter unless directed
536 -- by Oracle Worldwide Customer Support.
537 -- gowner: owner of the materialized view repgroup
538 --
539 -- Exceptions:
540 -- failregmviewrepgroup: registration failed
541 -- missingrepgroup: given repgroup does not exist
542 -- nonmaster: given repgroup is not mastered at the master site
543 -- duplicaterepgroup: repgroup is already registered
544 ---------------------------------------------------------------------------
545 PROCEDURE unregister_mview_repgroup(gname IN VARCHAR2,
546 mviewsite IN VARCHAR2,
547 gowner IN VARCHAR2 := 'PUBLIC');
548 -- This procedure is used at master sites to manually unregister
549 -- a materialized view repgroup.
550 --
551 -- Arguments:
552 -- gname: Name of the repgroup
553 -- snapsite: Site of the materialized view repgroup
554 -- gowner: owner of the repgroup
555 --
556 -- Exceptions:
557 -- unregmviewrepgroup: materialized view repgroup is not registered
558 ---------------------------------------------------------------------------
559 PROCEDURE add_master_database(gname IN VARCHAR2,
560 master IN VARCHAR2,
561 use_existing_objects IN BOOLEAN := TRUE,
562 copy_rows IN BOOLEAN := TRUE,
563 comment IN VARCHAR2 := '',
564 propagation_mode IN VARCHAR2
565 := 'ASYNCHRONOUS',
566 fname IN VARCHAR2 := NULL);
567 -- Adds the given master site to the given repgroup. This must be called
568 -- at the master definition site. All master repgroup replicas must have
569 -- been quiesced with an earlier call to suspend_master_activity.
570 --
571 -- The new master database is initialized with a consistent copy of all of
572 -- the contents of the repgroup at the master definition site. If a
573 -- replicated object does not exist at the new master, it is created at the
574 -- new master. If copy_rows is TRUE, then it copies any contents from the
575 -- masterdef site.
576 --
577 -- If a replicated object already exists at the new master, the situation
581 -- and if use_existing_objects is TRUE, the object is reused.
578 -- is more complicated. If use_existing_objects is FALSE, or if the
579 -- object has the wrong type or "shape," the name conflict is recorded.
580 -- On the contrary, if the object has the right name, type, and "shape,"
582 -- If copy_rows is TRUE, the contents of the two objects are compared
583 -- piece by piece, and any discrepancies are rectified by using the
584 -- contents of the masterdef's object. A probabilistic comparison
585 -- algorithm (such as one based on a checksum) may be used. Such an
586 -- algorithm never states that two objects with identical contents are
587 -- different.
588 --
589 -- If prop_mode is "ASYNCHRONOUS", then the new site's repgroup propagation
590 -- mode will be asynchronous to all other masters, and all other masters
591 -- will be asynchronous to it. If prop_mode is "SYNCHRONOUS", then the new
592 -- site's repgroup propagation mode will be synchronous to all other masters,
593 -- and all other masters will be synchronous to it.
594 --
595 -- The fname parameter is reserved for internal use.
596 -- Do not specify this parameter unless directed
597 -- by Oracle Worldwide Customer Support.
598 --
599 -- Because this procedure may use asynchronous activities, interim status
600 -- and all asynchronous errors are recorded in the RepCatlog. If the
601 -- request completes successfully, the new master is added to all
602 -- RepSites views, and no mention of the request appears in the RepCatlog.
603 --
604 -- Arguments:
605 -- gname: name of the object group being replicated
606 -- master: name of the new master being added to the replicated environment
607 -- use_existing_objects: (see comment above)
608 -- copy_rows: (see comment above)
609 -- comment: comment added to the master_comment field of RepSites view
610 -- propagation_mode: method of forwarding and receiving changes from
611 -- the new master
612 --
613 -- Exceptions:
614 -- nonmasterdef: if the invocation site is not the masterdef site for
615 -- the given replicated object group
616 -- notquiesced: if the replicated object group has not been suspended.
617 -- commfailure: if the new master is not accessible.
618 -- typefailure: incorrect propagation mode specified
619 -- notcompat: new master must have compatibility 7.3 or greater
620 -- duplicaterepgroup: object group already exists, master is already
621 -- part of this replicatd environment
622 -- missingobject: a member of the replicated object group does not
623 -- exist at the masterdef site with a status of VALID
624 ---------------------------------------------------------------------------
625 PROCEDURE alter_master_propagation(gname IN VARCHAR2,
626 master IN VARCHAR2,
627 dblink_table IN dbms_utility.dblink_array,
628 propagation_mode IN VARCHAR2 :=
629 'ASYNCHRONOUS',
630 comment IN VARCHAR2 := '');
631
632 PROCEDURE alter_master_propagation(gname IN VARCHAR2,
633 master IN VARCHAR2,
634 dblink_list IN VARCHAR2,
635 propagation_mode IN VARCHAR2 :=
636 'ASYNCHRONOUS',
637 comment IN VARCHAR2 := '');
638
639 -- This call modifies the propagation method for the given object group
640 -- at the given master site for the destinations specified by the list
641 -- of dblinks. This must be called at the masterdef and requires the object
642 -- group to be quiesced.
643 --
644 -- Arguments:
645 -- gname: object group that is having its propagation mode altered
646 -- master: master at which to alter the propagation mode
647 -- dblink_table/dblink_list: PL/SQL table or list of dblinks for which
648 -- to alter propagation
649 -- propagation_mode: can be SYNCHRONOUS or ASYNCHRONOUS
650 -- comment: comment added to the repprop view
651 --
652 -- Exceptions:
653 -- nonmasterdef: if local site is not the masterdef site
654 -- notquiesced: if given object group is not quiesced
655 -- typefailure: an unknown propagation type was specified
656 -- nonmaster: given site is not a master site for the given object group
657 -- or the list of dblinks contains a site which is not a master site
658 -- for the given object group.
659 ---------------------------------------------------------------------------
660 PROCEDURE alter_master_repobject(sname IN VARCHAR2,
661 oname IN VARCHAR2,
662 type IN VARCHAR2,
663 ddl_text IN VARCHAR2,
664 comment IN VARCHAR2 := '',
665 retry IN BOOLEAN := FALSE,
666 safe_table_change in BOOLEAN := FALSE);
667
668 -- This applies DDL changes to a replicated object at the masterdef site
669 -- and the changes are synchronously multicast to all the master sites.
670 -- Each master asynchronously checks that the object exists locally and
671 -- then applies the DDL to its replica. If comment is not NULL, then each
672 -- altered object's comment is updated. If retry is TRUE,
673 -- alter_master_repobject alters the object only at masters whose object
674 -- status is not 'valid'. The RepCatlog contains interim status and any
675 -- asynchronous error messages generated by the request. This requires the
679 -- scope of RepCat. Replication administrators should ensure that local
676 -- object group be quiesced with suspend_master_activity.
677 --
678 -- Local customization of individual replicas is outside the
680 -- customizations do not interfere with the global customizations done
681 -- with alter_master_repobject.
682 --
683 -- Arguments:
684 -- sname: schema containing the replicated object
685 -- oname: the replicated object
686 -- type: type of object (TABLE, INDEX, SYNONYM, TRIGGER, VIEW, PROCEDURE,
687 -- FUNCTION, PACKAGE or PACKAGE BODY)
688 -- ddl_text: ddl text used to alter the object
689 -- comment: comment to be added to the RepObject view
690 -- retry: (see comment above)
691 -- safe_table_change: when true and used with type TABLE objects,
692 -- indicates that change is safe to do without quiesce.
693 --
694 -- Exceptions:
695 -- nonmasterdef: if the invocation site is not the masterdef site.
696 -- notquiesced: if the replicated object group has not been suspended.
697 -- missingobject: if the given object does not exist.
698 -- typefailure: if the given type parameter is not supported.
699 -- ddlfailure: if any DDL at the masterdef does not succeed.
700 -- commfailure: if a master is not accessible.
701 ---------------------------------------------------------------------------
702 PROCEDURE comment_on_repgroup(gname IN VARCHAR2,
703 comment IN VARCHAR2);
704 -- Update the comment field for the given repgroup in RepCat view.
705 --
706 -- in 8.1, this procedure is always executed at master sites, no need
707 -- to include gowner
708 --
709 -- Arguments:
710 -- gname: name of object group to comment on
711 -- comment: updated comment
712 --
713 -- Exceptions:
714 -- nonmasterdef: if the invocation site is not the masterdef site.
715 -- commfailure: if any master is not accessible.
716 ---------------------------------------------------------------------------
717 PROCEDURE comment_on_repobject(sname IN VARCHAR2,
718 oname IN VARCHAR2,
719 type IN VARCHAR2,
720 comment IN VARCHAR2);
721 -- Update the comment field for the given repobject in RepObject view.
722 --
723 -- Arguments:
724 -- sname: name od schema containing the object
725 -- oname: name of replicated object to comment on
726 -- type: type of object (TABLE, INDEX, SYNONYM, TRIGGER, VIEW, PROCEDURE,
727 -- FUNCTION, PACKAGE or PACKAGE BODY)
728 -- comment: updated comment
729 --
730 -- Exceptions:
731 -- nonmasterdef: if the invocation site is not the masterdef site.
732 -- missingobject: if the given object does not exist.
733 -- typefailure: if the given type parameter is not supported.
734 -- commfailure: if any master is not accessible.
735 ---------------------------------------------------------------------------
736 PROCEDURE comment_on_repsites(gname IN VARCHAR2,
737 master IN VARCHAR,
738 comment IN VARCHAR2);
739 -- Update the comment field for the given master in RepGroup view
740 -- The group name must be registered locally as a replicated
741 -- master object group. Must be issued from a masterdef site.
742 --
743 -- Arguments:
744 -- gname: name of the object group
745 -- master: master site that you want to comment on
746 -- comment: updated comment
747 --
748 -- Exceptions:
749 -- missingrepgroup: object group does not exist
750 -- nonmasterdef: if the invocation site is not the masterdef site.
751 -- nonmaster: if the given master is not a master.
752 -- commfailure: if any master is not accessible.
753 -- corrupt: inconsistency in repcat views.
754 ---------------------------------------------------------------------------
755 PROCEDURE comment_on_repsites(gname IN VARCHAR2,
756 comment IN VARCHAR2);
757 -- Update the comment field for the given materialized view object group.
758 -- The group name must be registered locally as a replicated
759 -- materialized view object group. Must be issued from a materialized view
760 -- site.
761 --
762 -- Arguments:
763 -- gname: name of object group
764 -- comment: updated comment
765 --
766 -- Exceptions:
767 -- missingrepgroup: if the object group does not exist
768 -- nonmview: if the invocation site is not a materialized view site.
769 ---------------------------------------------------------------------------
770 PROCEDURE comment_on_mview_repsites(gowner IN VARCHAR2,
771 gname IN VARCHAR2,
772 comment IN VARCHAR2);
773 -- Update the comment field for the given materialized view object group.
774 -- The group name must be registered locally as a replicated
775 -- materialized view object group. Must be issued from a materialized view
776 -- site.
777 --
778 -- Arguments:
779 -- gowner: owner of the object group
780 -- gname: name of object group
781 -- comment: updated comment
782 --
783 -- Exceptions:
784 -- missingrepgroup: if the object group does not exist
785 -- nonmview: if the invocation site is not a materialized view site.
786 ---------------------------------------------------------------------------
787 PROCEDURE create_master_repgroup(gname IN VARCHAR2,
788 group_comment IN VARCHAR2 := '',
792 -- the first replica and the masterdef.
789 master_comment IN VARCHAR2 := '',
790 qualifier IN VARCHAR2 := '');
791 -- Create a new, empty, quiesced master repgroup, making the local database
793 --
794 -- Arguments:
795 -- gname: name of the object group to be created
796 -- group_comment: comment added in the RepCat view
797 -- master_comment: comment added in the RepSites view
798 -- qualifier: connection qualifier for object group
799 --
800 -- Exceptions:
801 -- duplicaterepgroup: if the object group already exists as a repgroup.
802 -- norepopt: advanced replication option not installed
803 -- missingrepgrp: object group name not specified
804 -- qualifiertoolong: connection qualifier too long (the maximum length
805 -- of a database link including connection qualifier is 128 bytes)
806 ---------------------------------------------------------------------------
807 PROCEDURE create_master_repobject(sname IN VARCHAR2,
808 oname IN VARCHAR2,
809 type IN VARCHAR2,
810 use_existing_object IN BOOLEAN := TRUE,
811 ddl_text IN VARCHAR2 := NULL,
812 comment IN VARCHAR2 := '',
813 retry IN BOOLEAN := FALSE,
814 copy_rows IN BOOLEAN := TRUE,
815 gname IN VARCHAR2 := '');
816 -- This adds an object of the given name and type to the replicated
817 -- object group. This operates in an asynchronous fashion, and requires
818 -- that the replicated object group be quiesced with suspend_master_activity.
819 --
820 -- It optionally uses the given DDL text to create the object at the
821 -- masterdef site. If no DDL text is provided, the object must already
822 -- exist at the masterdef site. If retry is TRUE, it creates the object
823 -- only at masters whose object status is not 'valid'.
824 --
825 -- If the object does not exist at a non-masterdef site, the object is
826 -- is created at that site. If copy_rows is TRUE, it then copies any
827 -- contents from the masterdef site.
828 --
829 -- If the object already exists at a non-masterdef site, the situation is
830 -- more complicated. If use_existing_object is FALSE, or if the object has
831 -- the wrong type or "shape," a duplicateobject exception is stored in the
832 -- RepCatlog. On the contrary, if the object has the right name, type,
833 -- and "shape," and if use_existing_object is TRUE, the object is reused.
834 -- If copy_rows is TRUE, the contents of the two objects are
835 -- (probabilistically) compared piece by piece and any discrepancies are
836 -- rectified by using the contents of the masterdef's object.
837 --
838 -- The RepCatlog contains interim status and any asynchronous error
839 -- messages generated by the request.
840 --
841 -- Arguments:
842 -- sname: name of schema containing object to be replicated
843 -- oname: name of the object to be replicated
844 -- type: type of object (TABLE, INDEX, SYNONYM, TRIGGER, VIEW, PROCEDURE,
845 -- FUNCTION, PACKAGE or PACKAGE BODY)
846 -- use_existing_object: (see comment above)
847 -- ddl_text: (see comment above)
848 -- comment: comment added to the object_comment field of RepObject view
849 -- retry:
850 -- copy_rows: (see comment above)
851 -- gname: name of the object group in which to create the replicated object
852 --
853 -- Exceptions:
854 -- nonmasterdef: if the invocation site is not the masterdef site.
855 -- notquiesced: if the replicated object group has not been suspended.
856 -- duplicateobject: if the given object already exists in the repgroup
857 -- and retry is FALSE, or if a name conflict occurs.
858 -- missingobject: if the given object does not exist and no DDL text is
859 -- given, or if oname directly or indirectly refers to a remote object.
860 -- typefailure: if objects of the given type can not be replicated.
861 -- ddlfailure: if any DDL at the masterdef does not succeed.
862 -- commfailure: if any master is not accessible.
863 ---------------------------------------------------------------------------
864 PROCEDURE do_deferred_repcat_admin(gname IN VARCHAR2,
865 all_sites IN BOOLEAN := FALSE);
866 -- Execute local outstanding deferred administrative procedures for the
867 -- given replicated object group requested by the current user. If all_sites
868 -- is TRUE, do this at each master.
869 --
870 -- Arguments:
871 -- gname: name of replicated object group
872 -- all_sites: (see comment above)
873 --
874 -- Exceptions:
875 -- nonmaster: if the invocation site is not a master site.
876 -- commfailure: if all_sites is TRUE and a master is not accessible
877 ---------------------------------------------------------------------------
878 PROCEDURE drop_master_repgroup(gname IN VARCHAR2,
879 drop_contents IN BOOLEAN := FALSE,
880 all_sites IN BOOLEAN := FALSE);
881 -- Drop the master repgroup and optionally all of its contents (drop_contents
882 -- is TRUE). If all_sites is TRUE and the invocation site is the masterdef,
883 -- synchronously multicast the request to all masters. In this case
884 -- execution is immediate at the masterdef and possibly deferred at all
885 -- other master sites. Note that this procedure may leave some dangling
889 -- gname: name of the replicated object group to be dropped
886 -- materialized views.
887 --
888 -- Arguments:
890 -- drop_contents: (see comment above)
891 -- all_sites: (see comment above)
892 --
893 -- Exceptions:
894 -- nonmaster: if the invocation site is not a master site.
895 -- nonmasterdef: if all_sites is TRUE and the invocation site is not
896 -- the masterdef site
897 -- fullqueue: if the deferred RPC queue has entries for the repgroup.
898 -- commfailure: if a master is not accessible and all_sites is TRUE.
899 ---------------------------------------------------------------------------
900 PROCEDURE drop_master_repobject(sname IN VARCHAR2,
901 oname IN VARCHAR2,
902 type IN VARCHAR2,
903 drop_objects IN BOOLEAN := FALSE);
904 -- This procedure drops a replicated object from a replicated object group.
905 -- This removes the given object name from the RepObject view at all sites,
906 -- and optionally drops the object and dependent objects at all sites
907 -- (drop_objects is TRUE). This procedure typically operates in an
908 -- asynchronous fashion. The RepCatlog contains interim status and any
909 -- asynchronous error messages generated by the request.
910 --
911 -- Arguments:
912 -- sname: name of schema containing the repobject
913 -- oname: name of the replicated object to be dropped
914 -- type: type of object
915 -- drop_objects: (see comment above)
916 --
917 -- Exceptions:
918 -- nonmasterdef: if the invocation site is not the masterdef site.
919 -- missingobject: if the given object does not exist.
920 -- typefailure: if the given type parameter is not supported.
921 -- commfailure: if a master is not accessible.
922 ---------------------------------------------------------------------------
923 PROCEDURE execute_DDL(gname IN VARCHAR2,
924 master_list IN VARCHAR2 := NULL,
925 ddl_text IN VARCHAR2);
926
927 PROCEDURE execute_DDL(gname IN VARCHAR2,
928 master_table IN dbms_utility.dblink_array,
929 ddl_text IN VARCHAR2);
930 -- Executes the DDL provided in ddl_text. The DDL is applied at the given
931 -- set of masters. master_list is a comma-separated list of masters.
932 -- master_table is a PL/SL table of masters. If NULL, it means all masters
933 -- including the masterdef. The DDL is typically applied asynchronously.
934 -- The RepCatlog contains interim status and any asynchronous error messages
935 -- generated by the request. Although the repgroup need not be quiesced
936 -- when execute_DDL is invoked, an administrator may quiesce the group first.
937 --
938 -- Arguments:
939 -- gname: name of replicated object group
940 -- master_list/master_table: (see comment above)
941 -- ddl_text: DDL to be executed at the given master sites
942 --
943 -- Exceptions:
944 -- nonmasterdef: if the invocation site is not the masterdef site.
945 -- nonmaster: if any site is not a master.
946 -- ddlfailure: if any DDL at the masterdef does not succeed.
947 -- commfailure: if a master is not accessible.
948 ---------------------------------------------------------------------------
949 PROCEDURE generate_replication_package(sname IN VARCHAR2,
950 oname IN VARCHAR2);
951 --- Internal packages:
952 --- This is obsolete in 8.1?
953 ---
954 -- This generates the $RP, $RL and conflict resolution packages
955 -- for a particular object at ALL masters. The object group that contains
956 -- the specified replication object must be quiesced for this operation.
957 -- The RepCatLog contains interim status and any asynchronous error messages
958 -- generated by the request.
959 --
960 -- Arguments:
961 -- sname: schema containing replicated object
962 -- oname: name of replicated object for which to generate replication
963 -- package
964 --
965 -- Exceptions:
966 -- nonmasterdef: invocation site is not the masterdef site
967 -- missingobject: given object does not exist
968 -- notquiesced: object group not quiesced
969 -- notcompat: all the the masters in the replicated object group must have
970 -- compatibility 73 or greater
971 ---------------------------------------------------------------------------
972 PROCEDURE generate_replication_support(sname IN VARCHAR2,
973 oname IN VARCHAR2,
974 type IN VARCHAR2,
975 package_prefix IN VARCHAR2 := NULL,
976 procedure_prefix IN VARCHAR2 := NULL,
977 distributed IN BOOLEAN := TRUE,
978 gen_objs_owner IN VARCHAR2 := NULL,
979 min_communication IN BOOLEAN := TRUE,
980 generate_80_compatible
981 IN BOOLEAN := TRUE);
982 -- This generates packages and procedures needed to support replication.
983 -- If the object exists in the replicated object group as a table using
984 -- row/column-level replication, this procedure generates the stored package.
985 -- When row-level or column-level replication is used for an object,
986 -- generate_replication_support should be called immediately after all
987 -- calls to set_columns.
988 --
992 -- this procedure generates the procedure wrappers using the given package
989 -- If the object exists in the replicated object group as a procedure,
990 -- the procedure generates the procedure wrapper using the given procedure
991 -- prefix. If the object exists in the object group as a package (body),
993 -- and procedure prefixes. In either case generate_replication_support should
994 -- be called immediately after create_master_repobject or
995 -- alter_master_repobject.
996 --
997 -- The parameter gen_objs_owner specifies the schema in which the generated
998 -- procedural wrapper should be installed. If this value if NULL, then
999 -- the generated procedural wrapper will be installed in the schema
1000 -- specified by the sname parameter.
1001 --
1002 -- If min_communication is TRUE and type is 'TABLE', then the update trigger
1003 -- sends the new value of a column only if the update statement modifies the
1004 -- column. The update trigger sends the old value of the column only if it
1005 -- is a key column or a column in a modified column group. If the specified
1006 -- object is a replicated table and contains BLOB, CLOB, and/or NCLOB columns
1007 -- the input value for this parameter will be ignored and the value is always
1008 -- set to TRUE.
1009 --
1010 -- If generate_80_compatible is true, deferred RPC's from sites with the TOP
1011 -- flavor are generated using the 8.0 protocol.
1012 --
1013 -- The RepCatLog contains interim status and any asynchronous error
1014 -- messages generated by the request.
1015 --
1016 -- Arguments:
1017 -- sname: name of schema containing the object
1018 -- oname: name of object
1019 -- type: type of object (TABLE, PACKAGE, PACKAGE BODY, PROCEDURE)
1020 -- package_prefix: for PACKAGE and PACKAGE BODY, prepend this to the
1021 -- generated wrapper package name (default is DEFER_).
1022 -- procedure_prefix: for PROCEDURE, prepend this to the generate
1023 -- wrapper procedure name (default is DEFER_).
1024 -- distributed: is always TRUE
1025 -- gen_objs_owner: (see comment above)
1026 -- min_communication: (see comment above)
1027 --
1028 -- Exceptions:
1029 -- nonmasterdef: if the invocation site is not the masterdef site.
1030 -- missingobject: if the given object does not exist as a table in the
1031 -- replicated object group awaiting row/column-level replication
1032 -- information or as a procedure or package (body) awaiting wrapper
1033 -- generation.
1034 -- missingschema: if specified schema does not exist
1035 -- typefailure: if the given type parameter is not supported.
1036 -- notquiesced: if the replicated object group has not been suspended.
1037 -- commfailure: if any master is not accessible.
1038 -- notcompat: all the the masters in the replicated object group must have
1039 -- compatibility 73 or greater
1040 ---------------------------------------------------------------------------
1041 PROCEDURE purge_master_log(id IN NATURAL,
1042 source IN VARCHAR2,
1043 gname IN VARCHAR2);
1044 -- Removes all local log records corresponding to the request on a given
1045 -- replicated object group that originated at the given master with the
1046 -- given identification. If any parameter is NULL, treats it as a wildcard.
1047 --
1048 -- Arguments:
1049 -- id: id of the request
1050 -- source: master site from which request originated
1051 -- gname: name of the replicated object group
1052 --
1053 -- Exceptions:
1054 -- nonmaster: if sname is not NULL and the invocation site is not a
1055 -- master site.
1056 ---------------------------------------------------------------------------
1057 PROCEDURE relocate_masterdef(gname IN VARCHAR2,
1058 old_masterdef IN VARCHAR2,
1059 new_masterdef IN VARCHAR2,
1060 notify_masters IN BOOLEAN := TRUE,
1061 include_old_masterdef IN BOOLEAN := TRUE,
1062 require_flavor_change IN BOOLEAN := FALSE);
1063 -- Move the masterdef designation from old_masterdef to new_masterdef.
1064 -- Old_masterdef must be the current masterdef, and new_masterdef must be
1065 -- a master. If notify_masters is TRUE, sychronously multicast the change
1066 -- to all masters (including old_masterdef only if include_old_masterdef
1067 -- is TRUE). If any master does not make the change, rollback the changes
1068 -- at all masters.
1069 --
1070 -- In a planned reconfiguration, relocate_masterdef should be invoked
1071 -- with notify_masters TRUE and include_old_masterdef TRUE. If just the
1072 -- masterdef fails, relocate_masterdef should be invoked with
1073 -- notify_masters TRUE and include_old_masterdef FALSE. If several
1074 -- masters and the masterdef fail, the administrator should invoke
1075 -- relocate_masterdef at each operational master with notify_masters FALSE.
1076 --
1077 -- The require_flavor_change is reserved for internal use.
1078 -- Do not specify this parameter unless directed
1079 -- by Oracle Worldwide Customer Support.
1080 --
1081 -- Arguments:
1082 -- gname: name of replicated object group
1083 -- old_masterdef: current masterdef site
1084 -- new_masterdef: name of an existing master site that is now going
1085 -- to be the new masterdef site
1086 -- notify_masters: (see comment above)
1087 -- include_old_masterdef: (see comment above)
1088 --
1089 -- Exceptions:
1090 -- nonmaster: if new_masterdef is not a master site or if the invocation
1091 -- site is not a master site.
1095 PROCEDURE resume_master_activity(gname IN VARCHAR2,
1092 -- nonmasterdef: if old_masterdef is not the masterdef site.
1093 -- commfailure: if a master is not accessible and notify_masters is TRUE.
1094 ---------------------------------------------------------------------------
1096 override IN BOOLEAN := FALSE);
1097 -- This resumes normal replication activity after a repgroup has been
1098 -- quiesced. So the replicated object group must be quiescing or quiesced
1099 -- when this procedure is called. If override is TRUE, it ignores any
1100 -- pending RepCat administration requests and restores normal replication
1101 -- activity at each master as quickly as possible. If override is FALSE,
1102 -- it restores normal replication activity at each master only when there
1103 -- is no pending RepCat administration request for the object group at
1104 -- that master. The RepCatlog contains interim status and any asynchronous
1105 -- error messages generated by the request.
1106 --
1107 -- Arguments:
1108 -- gname: name of replicated object group
1109 -- override: (see comment above)
1110 --
1111 -- Exceptions:
1112 -- nonmasterdef: if the invocation site is not the masterdef site.
1113 -- notquiesced: if the status of the replicated object group is not
1114 -- quiescing or quiesced.
1115 -- commfailure: if any master is not accessible.
1116 -- notallgenerated: need to generate replication support before
1117 -- resuming replication activity
1118 ---------------------------------------------------------------------------
1119
1120 -- ***********************************************************************
1121 -- WARNING: send_and_compare_old_values must be used with extreme caution.
1122 -- Indiscriminate use may hide conflicts from symmetric replication.
1123 -- This in turn can lead to replicated data divergence.
1124 -- ***********************************************************************
1125
1126 PROCEDURE send_and_compare_old_values(sname IN VARCHAR2,
1127 oname IN VARCHAR2,
1128 column_list IN VARCHAR2,
1129 operation IN VARCHAR2 := 'UPDATE',
1130 send IN BOOLEAN := TRUE);
1131
1132 PROCEDURE send_and_compare_old_values(sname IN VARCHAR2,
1133 oname IN VARCHAR2,
1134 column_table IN dbms_repcat.varchar2s,
1135 operation IN VARCHAR2 := 'UPDATE',
1136 send IN BOOLEAN := TRUE);
1137
1138 -- Determine whether or not to send and compare old column values for
1139 -- deletes or updates. sname.oname must be a replicated table.
1140 -- column_list is a comma-separated list of columns in the table
1141 -- (column_table is a PL/SQL table of columns in the table)
1142 -- or '*' for all non-key columns. Operation must be 'UPDATE,' 'DELETE,'
1143 -- or '*,' with '*' meaning both 'UPDATE' and 'DELETE'. If send is TRUE,
1144 -- the old values of the specified columns are sent. If send is FALSE,
1145 -- the old values of the specified columns are not sent. Unspecified
1146 -- columns and unspecified operations are not affected. The specified
1147 -- change takes effect at the master definition site as soon as
1148 -- min_communication is TRUE for the table. The change takes effect at a
1149 -- master site or at a materialized view site the next time replication
1150 -- support is generated at that site with min_communication TRUE.
1151 --
1152 -- Arguments:
1153 -- sname: schema in which table is located
1154 -- oname: name of the table
1155 -- column_list/column_table: (see comment above)
1156 -- operation: (see comment above)
1157 -- send: (see comment above)
1158 --
1159 -- Exceptions:
1160 -- nonmasterdef: if the invocation site is not the masterdef site.
1161 -- notquiesced: if the replicated object group has not been suspended.
1162 -- missingobject: if the given object does not exist as a replicated table.
1163 -- missingcolumn: if any column doesn't exist as a replicated column.
1164 -- typefailure: if an illegal operation is given.
1165 -- keysendcomp: if any column is not a non-key column in the table.
1166 -- dbnotcompatible: if node is not compatible with replication version.
1167 -- flavornoobject: if any column does not exist.
1168 ---------------------------------------------------------------------------
1169
1170 -- ***********************************************************************
1171 -- WARNING: send_old_values must be used with extreme caution.
1172 -- Indiscriminate use may hide conflicts from symmetric replication.
1173 -- This in turn can lead to replicated data divergence.
1174 -- ***********************************************************************
1175
1176 PROCEDURE send_old_values(sname IN VARCHAR2,
1177 oname IN VARCHAR2,
1178 column_list IN VARCHAR2,
1179 operation IN VARCHAR2 := 'UPDATE',
1180 send IN BOOLEAN := TRUE);
1181
1182 PROCEDURE send_old_values(sname IN VARCHAR2,
1183 oname IN VARCHAR2,
1184 column_table IN dbms_repcat.varchar2s,
1185 operation IN VARCHAR2 := 'UPDATE',
1186 send IN BOOLEAN := TRUE);
1187
1188 PROCEDURE send_old_values(sname IN VARCHAR2,
1189 oname IN VARCHAR2,
1193
1190 column_table IN dbms_utility.lname_array,
1191 operation IN VARCHAR2 := 'UPDATE',
1192 send IN BOOLEAN := TRUE);
1194 -- Determine whether or not to send old column values for
1195 -- deletes or updates. sname.oname must be a replicated table.
1196 -- column_list is a comma-separated list of columns in the table
1197 -- (column_table is a PL/SQL table of columns in the table)
1198 -- or '*' for all non-key columns. Columns cannot be an object type,
1199 -- including top-level and embedded object types. Operation must be
1200 -- 'UPDATE,' 'DELETE,' or '*,' with '*' meaning both 'UPDATE' and
1201 -- 'DELETE'. If send is TRUE, the old values of the specified columns
1202 -- are sent. If send is FALSE, the old values of the specified
1203 -- columns are not sent. Unspecified columns and unspecified
1204 -- operations are not affected. The specified change takes effect at
1205 -- the master definition site as soon as min_communication is TRUE for
1206 -- the table. The change takes effect at a master site or at a
1207 -- materialized view site the next time replication support is generated at
1208 -- that site with min_communication TRUE.
1209 --
1210 -- Arguments:
1211 -- sname: schema in which table is located
1212 -- oname: name of the table
1213 -- column_list/column_table: (see comment above)
1214 -- operation: (see comment above)
1215 -- send: (see comment above)
1216 --
1217 -- Exceptions:
1218 -- nonmasterdef: if the invocation site is not the masterdef site.
1219 -- notquiesced: if the replicated object group has not been suspended.
1220 -- missingobject: if the given object does not exist as a replicated table.
1221 -- missingcolumn: if any column doesn't exist as a replicated column.
1222 -- typefailure: if an illegal operation is given.
1223 -- keysendcomp: if any column is not a non-key column in the table.
1224 -- dbnotcompatible: if node is not compatible with replication version.
1225 -- flavornoobject: if any column does not exist.
1226 ---------------------------------------------------------------------------
1227
1228 -- ***********************************************************************
1229 -- WARNING: compare_old_values must be used with extreme caution.
1230 -- Indiscriminate use may hide conflicts from symmetric replication.
1231 -- This in turn can lead to replicated data divergence.
1232 -- ***********************************************************************
1233
1234 PROCEDURE compare_old_values(sname IN VARCHAR2,
1235 oname IN VARCHAR2,
1236 column_list IN VARCHAR2,
1237 operation IN VARCHAR2 := 'UPDATE',
1238 compare IN BOOLEAN := TRUE);
1239
1240 PROCEDURE compare_old_values(sname IN VARCHAR2,
1241 oname IN VARCHAR2,
1242 column_table IN dbms_repcat.varchar2s,
1243 operation IN VARCHAR2 := 'UPDATE',
1244 compare IN BOOLEAN := TRUE);
1245
1246 PROCEDURE compare_old_values(sname IN VARCHAR2,
1247 oname IN VARCHAR2,
1248 column_table IN dbms_utility.lname_array,
1249 operation IN VARCHAR2 := 'UPDATE',
1250 compare IN BOOLEAN := TRUE);
1251
1252 -- Determine whether or not to compare old column values for deletes or
1253 -- updates when they are sent. sname.oname must be a replicated table.
1254 -- column_list is a comma-separated list of columns in the table
1255 -- (column_table is a PL/SQL table of columns in the table) or '*' for
1256 -- all non-key columns. Columns cannot be an object type, including
1257 -- top-level and embedded object types. Operation must be 'UPDATE,'
1258 -- 'DELETE,' or '*,' with '*' meaning both 'UPDATE' and 'DELETE'. If
1259 -- compare is TRUE, the old values of the specified columns are
1260 -- compared when sent. If compare is FALSE, the old values of the
1261 -- specified columns are not compared when sent. Unspecified columns
1262 -- and unspecified operations are not affected. The specified change
1263 -- takes effect at the master definition site as soon as
1264 -- min_communication is TRUE for the table. The change takes effect
1265 -- at a master site or at a materialized view site the next time replication
1266 -- support is generated at that site with min_communication TRUE.
1267 --
1268 -- Arguments:
1269 -- sname: schema in which table is located
1270 -- oname: name of the table
1271 -- column_list/column_table: (see comment above)
1272 -- operation: (see comment above)
1273 -- send: (see comment above)
1274 --
1275 -- Exceptions:
1276 -- nonmasterdef: if the invocation site is not the masterdef site.
1277 -- notquiesced: if the replicated object group has not been suspended.
1278 -- missingobject: if the given object does not exist as a replicated table.
1279 -- missingcolumn: if any column doesn't exist as a replicated column.
1280 -- typefailure: if an illegal operation is given.
1281 -- keysendcomp: if any column is not a non-key column in the table.
1282 -- dbnotcompatible: if node is not compatible with replication version.
1283 -- flavornoobject: if any column does not exist.
1284 ---------------------------------------------------------------------------
1285 PROCEDURE set_columns(sname IN VARCHAR2,
1286 oname IN VARCHAR2,
1287 column_list IN VARCHAR2);
1288
1292
1289 PROCEDURE set_columns(sname IN VARCHAR2,
1290 oname IN VARCHAR2,
1291 column_table IN dbms_utility.name_array);
1293 PROCEDURE set_columns(sname IN VARCHAR2,
1294 oname IN VARCHAR2,
1295 column_table IN dbms_utility.lname_array);
1296
1297 -- If oname exists in the replicated object group as a table using
1298 -- column-level replication, record the set of columns to be used as the
1299 -- "primary key" for replication purposes. Unlike true primary keys, these
1300 -- columns may contain NULLS. Set_columns does not affect the generated
1301 -- PL/SQL until the next call to generate_replication_support on the
1302 -- given object.
1303 --
1304 -- Arguments:
1305 -- sname: schema containing the table
1306 -- oname: name of the table
1307 -- column_list: a comma-separated list of column names
1308 -- column_table: a PL/SQL table of column names
1309 --
1310 -- Exceptions:
1311 -- nonmasterdef: if the invocation site is not the masterdef site.
1312 -- missingobject: if the given object does not exist as a table in the
1313 -- replicated object group awaiting column-level replication information.
1314 -- missingcolumn: if any column is not in the table.
1315 -- notquiesced: replication object group not quiesced
1316 ---------------------------------------------------------------------------
1317 PROCEDURE suspend_master_activity(gname IN VARCHAR2);
1318 -- This suspends replication activity for the given object group.
1319 -- So the repgroup must be in normal operation when this procedure
1320 -- is called. It quiesces all activity at all master sites, disables
1321 -- deferred procedure calls, and processes all pending queued procedure
1322 -- calls. Each master remains in this state until resume_master_activity
1323 -- is invoked. Queued Deferred RPCs are pushed to remote masters
1324 --
1325 -- Several of the above administrative procedures (e.g. adding a master
1326 -- database) must first suspend activity. Administrators may wish to
1327 -- suspend activity and manually perform a distributed query and update
1328 -- on the replicas in order to restore equivalence in the event of an
1329 -- errant conflict resolution.
1330 --
1331 -- This procedure typically operates asynchronously at the masterdef and
1332 -- the masters. The RepCatlog contains interim status.
1333 --
1334 -- Arguments:
1335 -- gname: name of the replicated object group for which to suspend
1336 -- master activity
1337 --
1338 -- Exceptions:
1339 -- nonmasterdef: if the invocation site is not the masterdef site.
1340 -- notnormal: if the replicated object group is not in normal operation.
1341 -- commfailure: if any master is not accessible.
1342 ---------------------------------------------------------------------------
1343 PROCEDURE tickle_job(canon_sname IN VARCHAR2,
1344 start_now IN BOOLEAN := FALSE);
1345
1346 -- Start the background job for processing the group's repcatlog records,
1347 -- creating the job if necessary. This procedure is normally called by
1348 -- repcat executing as the user, and is here only for privilege reasons.
1349 -- NOTE: for v7 compatibility, do not move the above procedure or
1350 -- change its interface.
1351 ---------------------------------------------------------------------------
1352 FUNCTION validate(gname IN VARCHAR2,
1353 check_genflags IN BOOLEAN := FALSE,
1354 check_valid_objs IN BOOLEAN := FALSE,
1355 check_links_sched IN BOOLEAN := FALSE,
1356 check_links IN BOOLEAN := FALSE,
1357 error_table OUT dbms_repcat.validate_err_table)
1358 RETURN BINARY_INTEGER;
1359 -- Validate the configuration of the specified object group.
1360 -- This procedure should be called from the master definition site
1361 -- when check_genflags and check_valide_objs are set to TRUE.
1362 --
1363 -- INPUT:
1364 -- gname - The name of the object group to validate
1365 -- check_genflags - Check if all the replicated objects in the group
1366 -- have generated replication support. The validity
1367 -- check is done at master definition site.
1368 -- check_valid_objs - Check if all replicated object in the group are
1369 -- valid. The validity check is done at all master
1370 -- sites.
1371 -- check_links_sched - Check if all database links are scheduled for
1372 -- execution.
1373 -- check_links - Check if the connected user, usually the repadmin,
1374 -- has the necessary database links from adminitering
1375 -- the replication environment.
1376 -- OUTPUT:
1377 -- error_table - This table contains any errors found.
1378 -- The return value of this function is the number of errors found
1379 -- (i.e., the number of elements in error_table).
1380
1381 ---------------------------------------------------------------------------
1382 FUNCTION validate(gname IN VARCHAR2,
1383 check_genflags IN BOOLEAN := FALSE,
1384 check_valid_objs IN BOOLEAN := FALSE,
1385 check_links_sched IN BOOLEAN := FALSE,
1386 check_links IN BOOLEAN := FALSE,
1387 error_msg_table OUT dbms_utility.uncl_array,
1388 error_num_table OUT dbms_utility.number_array)
1389 RETURN BINARY_INTEGER;
1390 -- Validate the configuration of the specified object group.
1394 -- INPUT:
1391 -- This procedure should be called from the master definition site
1392 -- when check_genflags and check_valide_objs are set to TRUE.
1393 --
1395 -- gname - The name of the object group to validate
1396 -- check_genflags - Check if all the replicated objects in the group
1397 -- have generated replication support.
1398 -- check_valid_objs - Check if all replicated object in the group are
1399 -- valid. The validity check is done at all master
1400 -- sites.
1401 -- check_links_sched - Check if all database links are scheduled for
1402 -- execution.
1403 -- check_links - Check if the connected user, usually the repadmin,
1404 -- has the necessary database links from adminitering
1405 -- the replication environment.
1406 -- OUTPUT:
1407 -- error_msg_table - This table contains the text of any errors found.
1408 -- error_num_table - This table contains the error number of any errors
1409 -- found.
1410 -- The return value of this function is the number of errors found
1411 -- (i.e., the number of elements in error_num_table and error_msg_table).
1412
1413 ---------------------------------------------------------------------------
1414 PROCEDURE wait_master_log(gname IN VARCHAR2,
1415 record_count IN NATURAL,
1416 timeout IN NATURAL,
1417 true_count OUT NATURAL);
1418 -- Wait until either timeout seconds have passed or there are at most
1419 -- record_count records in the local RepCatlog that represent administrative
1420 -- activities for the given replicated object group that have not completed.
1421 -- Activities that have completed with or without an error are not
1422 -- considered. The number of incomplete activities is returned in the
1423 -- parameter true_count.
1424 --
1425 -- If there are N masters and 1 masterdef for a replicated object group, most
1426 -- asynchronous administrative requests eventually create N+1 log records
1427 -- at the masterdef and 1 log record at each master. Add_master_database
1428 -- is an exception and may create a log record at the masterdef and a log
1429 -- record at the new master for each object in the replicated object group.
1430 --
1431 -- Arguments:
1432 -- gname: replicated object group
1433 -- record_count: procedure returns whenever the number of incomplete
1434 -- requests is at or below this limit
1435 -- timeout: maximum number of seconds to wait before the procedure returns
1436 -- true_count: returns number of incomplete requests
1437 --
1438 -- Exceptions:
1439 -- nonmaster: if the invocation site is not a master site.
1440 ---------------------------------------------------------------------------
1441 PROCEDURE generate_replication_trigger(sname IN VARCHAR2,
1442 oname IN VARCHAR2,
1443 gen_objs_owner IN VARCHAR2 := NULL,
1444 min_communication IN BOOLEAN := TRUE);
1445
1446 -- NOTE: This procedure is obsolete in Oracle8 and is included only for
1447 -- backward compatibility in replication configurations that contain
1448 -- one or more pre-Oracle8 site.
1449 --
1450 -- The system must be quiesced. The procedure must be called at
1451 -- the masterdef.
1452 --
1453 -- It generates the $TP package and triggers for the specified particular
1454 -- object at all masters.
1455 --
1456 -- Parameter gen_objs_owner specifies the schema in which the generated
1457 -- replication trigger and trigger package or procedural wrapper should
1458 -- be installed. If this value if NULL, then the generated trigger and
1459 -- trigger package or procedural wrapper will be installed in the schema
1460 -- specified by the sname parameter.
1461 --
1462 --
1463 -- If min_communication is TRUE, then the update trigger sends the new value
1464 -- of a column only if the update statement modifies the column. The
1465 -- update trigger sends the old value of the column only if it is a
1466 -- key column or a column in a modified column group.
1467 --
1468 -- Good in conjunction with generate_replication_package for asynch-only
1469 -- configurations when adding replication support for a new replicated
1470 -- object.
1471 --
1472 -- Do not call generate_replication_trigger without previously having
1473 -- called generate_replication_support or generate_replication_package
1474 -- for the same object.
1475 --
1476 -- Exceptions:
1477 -- missingschema if specified owner of generated objects does not exist
1478
1479 PROCEDURE generate_replication_trigger(gname IN VARCHAR2,
1480 gen_objs_owner IN VARCHAR2 := NULL,
1481 min_communication IN BOOLEAN := NULL);
1482 -- NOTE: This procedure is obsolete in Oracle8 and is included only for
1483 -- backward compatibility in replication configurations that contain
1484 -- one or more pre-Oracle8 site.
1485 --
1486 -- The system must be quiesced. The procedure must be called at the
1487 -- masterdef.
1488 --
1489 -- It generates the $TP package and triggers and procedural replication
1490 -- wrappers for all generated objects in the repgroup at all masters.
1491 --
1492 -- Parameter gen_objs_owner specifies the schema in which the generated
1493 -- replication trigger and trigger package or procedural wrapper should
1497 --
1494 -- be installed. If this value if NULL, then the generated trigger and
1495 -- trigger package or procedural wrapper will be installed in the schema
1496 -- in which they currently reside.
1498 -- If min_communication is TRUE, then the update trigger sends the new value
1499 -- of a column only if the update statement modifies the column. The
1500 -- update trigger sends the old value of the column only if it is a key
1501 -- column or a column in a modified column group. If min_communication is
1502 -- FALSE, the update trigger always send both the new and old values
1503 -- of each column. If min_communication is NULL, the current setting is
1504 -- retained.
1505 --
1506 -- This procedure will normally be called after calls to
1507 -- alter_master_propagation.
1508 --
1509 -- Triggers that have synchronous destinations require that the $RP
1510 -- package for the oname is already generated at that site. This lock-step
1511 -- generation is provided automatically if generate_replication_support
1512 -- or add_master_database is used to generate the triggers.
1513 --
1514 -- Exceptions:
1515 -- missingschema if specified owner of generated objects does not exist
1516 ---------------------------------------------------------------------------
1517 PROCEDURE remove_master_databases(gname IN VARCHAR2,
1518 master_list IN VARCHAR2);
1519
1520 PROCEDURE remove_master_databases(gname IN VARCHAR2,
1521 master_table IN dbms_utility.dblink_array);
1522 -- To handle the case where several masters are inaccessible and must be
1523 -- removed at one time, we provide a procedure that deletes a set of
1524 -- masters. Master_list is a comma-separated list of masters.
1525 -- Remove_master_databases does not require any removed database to be
1526 -- accessible. The other masters must be accessible.
1527 --
1528 -- For example, suppose A is the masterdef site and sites B, C, D, and E
1529 -- are master sites for object group G. If masters C and E become
1530 -- inaccessible and should no longer be masters, the following should
1531 -- be executed at site A:
1532 --
1533 -- remove C, E from RepGroup G at A, B, D
1534 -- remove_master_databases(`G', `C,E');
1535 --
1536 -- If master_table is a PL/SQL table of type dbms_utility.dblink_array -
1537 -- master_table(1) := `C';
1538 -- master_table(2) := `E';
1539 -- remove_master_databases(`G', master_table);
1540 --
1541 -- Replication packages are regenerated at the remaining sites.
1542 --
1543 -- Arguments:
1544 -- gname: name of the replicated object group
1545 -- master_list: comma separated list of masters to be removed
1546 -- master_table: PL/SQL table of masters to be removed
1547 --
1548 -- Exceptions:
1549 -- nonmasterdef: if the invocation site is not the masterdef site.
1550 -- nonmaster: if any of the given databases is not a master site.
1551 -- reconfigerror: if any of the given masters is the masterdef site.
1552 -- commfailure: if any remaining master is not accessible.
1553 ---------------------------------------------------------------------------
1554 PROCEDURE comma_to_table(list IN VARCHAR2,
1555 len OUT BINARY_INTEGER,
1556 result OUT dbms_utility.dblink_array);
1557 -- convert a comma-separated list to a PL/SQL table
1558 -- the table is 1-based, increasing, dense, and terminated by a NULL
1559 -- the dbms_utility.comma_to_table procedure cannot handle dblinks
1560 ---------------------------------------------------------------------------
1561 PROCEDURE repcat_import_check(gname IN VARCHAR2,
1562 master IN BOOLEAN,
1563 gowner IN VARCHAR2 := 'PUBLIC');
1564 -- Update the object identifiers and status values in repcat$_repobject
1565 -- for the given repgroup, preserving object status values other than VALID.
1566 --
1567 -- Exceptions:
1568 -- missingschema if the replicated object group does not exist.
1569 -- nonmaster if master is TRUE and either the database is not a master or
1570 -- the database is not the expected database.
1571 -- nonmview if master is FALSE and the database is not a materialized view
1572 -- site.
1573 -- missingobject if a valid replicated object in the object group does
1574 -- not exist.
1575 ---------------------------------------------------------------------------
1576 PROCEDURE repcat_import_check;
1577 -- Invoke repcat_import_check(gowner, gname) for each replicated object group
1578 --
1579 -- Exceptions:
1580 -- nonmaster if the database is not the expected database for any
1581 -- replicated object group.
1582 -- missingobject if a valid replicated object in any schema does not exist.
1583
1584 ---------------------------------------------------------------------------
1585 PROCEDURE specify_new_masters(
1586 gname IN VARCHAR2,
1587 master_list IN VARCHAR2);
1588 -- Specify the masters you intend to add to existing replication groups.
1589 --
1590 -- This routine will replace any masters in the local DBA_REPSITES_NEW view
1591 -- for the given replication group with the masters in the list.
1592 --
1593 -- Arguments:
1594 -- gname: name of an existing replication group.
1595 -- master_list: the set of masters that will be instantiated.
1596 --
1597 -- Notes:
1598 -- If master_list is empty, all masters for the given replication group
1599 -- will be removed from the DBA_REPSITES_NEW view.
1600 -- This procedure must be called at the masterdef site for the given
1604 -- duplicaterepgroup: object group already exists.
1601 -- replication group.
1602 --
1603 -- Exceptions:
1605 -- nonmasterdef: not the masterdef.
1606 -- propmodenotallowed: propagation mode not allowed for this operation.
1607 -- extstinapp: extension request with status not allowed.
1608 -- dbnotcompatible: feature is incompatible with database version.
1609 -- notsamecq: object group \"%s\".\"%s\" and \"%s\".\"%s\" do not
1610 -- have the same connection qualifier."
1611 --
1612
1613 ---------------------------------------------------------------------------
1614 PROCEDURE specify_new_masters(
1615 gname IN VARCHAR2,
1616 master_table IN dbms_utility.dblink_array);
1617 ---------------------------------------------------------------------------
1618 -- Please see the comment in the above overloaded version.
1619 --
1620 -- master_table is the set of masters that will be instantiated.
1621 -- The first master site should be at position 1, the second
1622 -- at position 2, and so on. A terminating NULL is
1623 -- permitted, but not required.
1624 --
1625
1626 ---------------------------------------------------------------------------
1627 PROCEDURE add_new_masters(
1628 export_required IN BOOLEAN,
1629 available_master_table IN dbms_utility.dblink_array,
1630 masterdef_flashback_scn OUT NUMBER,
1631 extension_id OUT RAW,
1632 break_trans_to_masterdef IN BOOLEAN := FALSE,
1633 break_trans_to_new_masters IN BOOLEAN := FALSE,
1634 percentage_for_catchup_mdef IN BINARY_INTEGER := 100,
1635 cycle_seconds_mdef IN BINARY_INTEGER := 60,
1636 percentage_for_catchup_new IN BINARY_INTEGER := 100,
1637 cycle_seconds_new IN BINARY_INTEGER := 60);
1638 --
1639 -- Add the masters in the DBA_REPSITES_NEW view to the replication
1640 -- catalog at all available masters. All masters instantiated with
1641 -- table-level export must be accessible at this time. Their
1642 -- new replication groups are added in the quiesced state. Masters
1643 -- instantiated via full database export-import or via changed-based
1644 -- recovery need not be accessible.
1645 --
1646 -- Arguments:
1647 --
1648 -- export_required: set it to TRUE if and only if export is required.
1649 -- available_master_table: list of masters to be instantiated using
1650 -- table-level export/import.
1651 -- Do NOT specify masters which will be
1652 -- instantiated using full database export-import
1653 -- or change-based recovery.
1654 -- The first master site should be at position 1,
1655 -- the second at position 2, and so on.
1656 -- A terminating NULL is permitted, but not
1657 -- required.
1658 -- masterdef_flashback_scn: the instantiation FLASHBACK_SCN that should be
1659 -- used for export or change-based recovery.
1660 -- extension_id: the identifier for the current pending add master database
1661 -- without quiesce request.
1662 -- break_trans_to_masterdef: If TRUE and export_required, existing masters
1663 -- may continue to propagate their deferred RPC
1664 -- queues to the masterdef for replication
1665 -- groups that are not changing membership.
1666 -- break_trans_to_new_masters: If TRUE, existing masters may continue to
1667 -- propagate their deferred RPC queues to
1668 -- the new masters for replication groups that
1669 -- are not changing membership. Otherwise,
1670 -- propagation to the new masters will be
1671 -- disabled.
1672 -- percentage_for_catchup_mdef: The percentage of propagation resources
1673 -- that should be used for catching up to
1674 -- masterdef. Must be a multiple of 10
1675 -- between 0 and 100.
1676 -- cycle_seconds_mdef: This parameter is meaningful when
1677 -- percentage_for_catchup_mdef is both meaningful and
1678 -- between 10 and 90, inclusive. In this case,
1679 -- propagation to the masterdef alternates between
1680 -- non-extended replication groups and extended
1681 -- replication groups, with one push to each during
1682 -- each cycle. This parameter indicates the length of
1683 -- the cycle in seconds.
1684 -- percentage_for_catchup_new: The percentage of propagation resources that
1685 -- should be used for catching up to new.
1686 -- masters. Must be a multiple of 10 between 0
1687 -- and 100.
1688 -- cycle_seconds_new: This parameter is meaningful when
1689 -- percentage_for_catchup_new is both meaningful and
1690 -- between 10 and 90, inclusive. In this case,
1691 -- propagation to a new master alternates between
1692 -- non-extended replication groups and extended
1693 -- replication groups, with one push to
1694 -- each during each cycle. This parameter indicates
1695 -- the length of the cycle in seconds.
1696 --
1697 -- Notes:
1701 -- For table-level export-import, ensure that all the repcatlog requests
1698 -- For masters to be instantiated via change-based recovery or full db
1699 -- export-import, they must get all repgroups in the masterdef.
1700 --
1702 -- in DBA_REPCATLOG view for the extended groups have been processed
1703 -- without any error before import.
1704 --
1705 -- Exceptions:
1706 -- nonmasterdef: not the masterdef.
1707 -- typefail: parameter value %s is not appropriate
1708 -- novalidextreq: no valid extension request
1709 -- nonewsites: no new sites for extension request
1710 -- notanewsite: not a new site for extension request
1711 -- dbnotcompatible: feature is incompatible with database version.
1712 --
1713 ---------------------------------------------------------------------------
1714 PROCEDURE add_new_masters(
1715 export_required IN BOOLEAN,
1716 available_master_list IN VARCHAR2,
1717 masterdef_flashback_scn OUT NUMBER,
1718 extension_id OUT RAW,
1719 break_trans_to_masterdef IN BOOLEAN := FALSE,
1720 break_trans_to_new_masters IN BOOLEAN := FALSE,
1721 percentage_for_catchup_mdef IN BINARY_INTEGER := 100,
1722 cycle_seconds_mdef IN BINARY_INTEGER := 60,
1723 percentage_for_catchup_new IN BINARY_INTEGER := 100,
1724 cycle_seconds_new IN BINARY_INTEGER := 60);
1725 -- See the comment in the overloaded version with available_master_table.
1726 -- available_master_list is a comma-separated list of masters to be
1727 -- instantiated using table-level export-import.
1728
1729 ---------------------------------------------------------------------------
1730 PROCEDURE alter_catchup_parameters(
1731 extension_id IN RAW,
1732 percentage_for_catchup_mdef IN BINARY_INTEGER := NULL,
1733 cycle_seconds_mdef IN BINARY_INTEGER := NULL,
1734 percentage_for_catchup_new IN BINARY_INTEGER := NULL,
1735 cycle_seconds_new IN BINARY_INTEGER := NULL);
1736 --
1737 -- This procedure alters percentage_for_catchup_mdef, cycle_seconds_mdef,
1738 -- percentage_for_catchup_new and cycle_seconds_new stored in
1739 -- DBA_REPEXTENSIONS.
1740 -- It is executed at each master, including masterdef. The effect is only
1741 -- local to the local site.
1742 --
1743 -- Arguments:
1744 -- extension_id: extension request identifier.
1745 -- percentage_for_catchup_mdef: The percentage of propagation resources
1746 -- that should be used for catching up to
1747 -- masterdef. Must be a multiple of 10
1748 -- between 0 and 100.
1749 -- cycle_seconds_mdef: This parameter is meaningful when
1750 -- percentage_for_catchup_mdef is both meaningful and
1751 -- between 10 and 90, inclusive. In this case,
1752 -- propagation to the masterdef alternates between
1753 -- non-extended replication groups and extended
1754 -- replication groups, with one push to each during
1755 -- each cycle. This parameter indicates the length of
1756 -- the cycle in seconds.
1757 -- percentage_for_catchup_new: The percentage of propagation resources that
1758 -- should be used for catching up to new.
1759 -- masters. Must be a multiple of 10 between 0
1760 -- and 100.
1761 -- cycle_seconds_new: This parameter is meaningful when
1762 -- percentage_for_catchup_new is both meaningful and
1763 -- between 10 and 90, inclusive. In this case,
1764 -- propagation to a new master alternates between
1765 -- non-extended replication groups and extended
1766 -- replication groups, with one push to
1767 -- each during each cycle. This parameter indicates
1768 -- the length of the cycle in seconds.
1769 --
1770 -- Exceptions:
1771 -- dbnotcompatible: feature is incompatible with database version.
1772 -- typefail: parameter value %s is not appropriate
1773 --
1774
1775 ---------------------------------------------------------------------------
1776 PROCEDURE resume_propagation_to_mdef(extension_id IN RAW);
1777 -- This indicates that export has been effectively finished and
1778 -- propagation for both extended and unaffect replication groups from
1779 -- existing masters to masterdef can be enabled if break_trans_to_masterdef
1780 -- is FALSE.
1781 --
1782 -- Arguments:
1783 -- extension_id: extension request identifier.
1784 --
1785 -- Exceptions:
1786 -- nonmasterdef: not the masterdef.
1787 -- extstinapp: extension status is inappropriate
1788 -- dbnotcompatible: feature is incompatible with database version.
1789 --
1790
1791 ---------------------------------------------------------------------------
1792 PROCEDURE prepare_instantiated_master(
1793 extension_id IN RAW);
1794 --
1795 -- This procedure enables the propagation of deferred transactions from
1796 -- other prepared new master sites and existing master sites to the
1797 -- invocation master site. This procedure also enables the propagation of
1798 -- deferred transactions from the invocation master site to the other
1799 -- prepared new master sites and existing master sites.
1800 --
1801 -- Before invoking this procedure for a new master instantiated using
1805 -- global_name, which must be the same name as specified
1802 -- change based recovery or full database export/import, perform the
1803 -- following two additional steps at the new master:
1804 -- 1. Ensure that the new master has the right
1806 -- when invoking dbms_repcat.specify_new_masters at the master
1807 -- definition site. Use ALTER DATABASE RENAME GLOBAL_NAME to change
1808 -- the global_name if necessary.
1809 --
1810 -- 2. Ensure the new master has the appropriate database link(s) to the
1811 -- master definition site.
1812 --
1813 --
1814 -- The deferrend transaction queue should be empty before the import is done
1815 -- for the full database export/import.
1816 --
1817 -- For the full database export/import and changed-based recovery,
1818 -- no transactions should be added during or after the import until this
1819 -- procedure completes successfully.
1820 --
1821 -- For the full database export/import and changed-based recovery,
1822 -- no job queue processes at the invocation until this procedure
1823 -- completes. Otherwise, deferred transactions could be pushed
1824 -- before this procedure deletes them.
1825 --
1826 -- Do NOT invoke this procedure until instantiation, export-import or
1827 -- change-based recovery, for the new master is done.
1828 --
1829 -- Do NOT perform any DMLs directly on the objects in the extended
1830 -- group in the new master until prepare_instantiated_master returns
1831 -- successfully. Those DMLs may not be replicated.
1832 --
1833 -- For table-level export-import, ensure that all the repcatlog requests
1834 -- in DBA_REPCATLOG view for the extended groups have been processed
1835 -- without error before import.
1836 --
1837 -- Arguments:
1838 -- extension_id: extension request identifier.
1839 --
1840 -- Exceptions:
1841 -- dbnotcompatible: feature is incompatible with database version.
1842 -- typefail: parameter value %s is not appropriate
1843 -- notanewsite: not a new site for extension request
1844 --
1845
1846 ---------------------------------------------------------------------------
1847 PROCEDURE undo_add_new_masters_request(
1848 extension_id IN RAW,
1849 drop_contents IN BOOLEAN := TRUE);
1850 -- This procedure undoes the add_new_masters and specify_new_masters
1851 -- invocation for a given extension_id.
1852 --
1853 -- This procedure is executed at masters, including master definition site.
1854 -- Its effect is local.
1855 --
1856 -- ***********************************************************************
1857 -- WARNING:
1858 -- This procedure is used in emergency when add new masters without quiesce
1859 -- can not proceed after specify_new_masters and add_new_masters, but
1860 -- BEFORE resume_propagation_to_mdef and prepare_instantiated_master.
1861 -- ***********************************************************************
1862 --
1863 -- Arguments:
1864 -- extension_id: extension request identifier.
1865 -- drop_contents: drop the contents of objects in new repgroups being
1866 -- extended at the local site if TRUE.
1867 --
1868 -- Exceptions:
1869 -- dbnotcompatible: feature is incompatible with database version.
1870 -- typefail: parameter value %s is not appropriate
1871
1872 ---------------------------------------------------------------------------
1873 --
1874 -- MATERIALIZED VIEW REPLICATION PROCEDURES
1875 --
1876 -- The following procedure are used to create and manage materialized view
1877 -- replication sites.
1878 --
1879 PROCEDURE create_mview_repgroup(gname IN VARCHAR2,
1880 master IN VARCHAR2,
1881 comment IN VARCHAR2 := '',
1882 propagation_mode IN VARCHAR2
1883 := 'ASYNCHRONOUS',
1884 fname IN VARCHAR2 := NULL,
1885 gowner IN VARCHAR2 := 'PUBLIC');
1886 -- Create a new empty materialized view repgroup at the local site. The
1887 -- group name must be a master repgroup at the master database.
1888 --
1889 -- Arguments:
1890 -- gname: name of the replicated object group
1891 -- master: database to use as the master
1892 -- comment: comment added to the schema_comment field of RepCat view
1893 -- propagation_mode: method of propagation for all updatable materialized
1894 -- views in the object group (SYNCHRONOUS or ASYNCHRONOUS)
1895 -- fname: This parameter is reserved for internal use.
1896 -- Do not specify this parameter unless directed
1897 -- gowner: owner of replicated materialized view group
1898 --
1899 -- Exceptions:
1900 -- duplicaterepgroup: if the objectgroup already exists as a repgroup
1901 -- at the invocation site.
1902 -- nonmaster: if the given database is not a master site.
1903 -- commfailure: if the given database is not accessible.
1904 -- norepoption: if advanced replication option not installed
1905 -- typefailure: if propagation mode specified incorrectly
1906 -- missingrepgroup: object group missing at master site
1907 -- invalidqualifier: connection qualifier specified for master is not
1908 -- valid for the object group
1909 -- alreadymastered: if at the local site there is another materialized view
1910 -- repgroup with the same group name, but different master.
1911 ---------------------------------------------------------------------------
1912 PROCEDURE drop_mview_repgroup(gname IN VARCHAR2,
1916 -- contents at this materialized view site.
1913 drop_contents IN BOOLEAN := FALSE,
1914 gowner IN VARCHAR2 := 'PUBLIC');
1915 -- Drop the given materialized view repgroup and optionally all of its
1917 --
1918 -- Arguments:
1919 -- gname: name of the replicated object group to be dropped
1920 -- drop_contents: (see comment above)
1921 -- gowner: owner of the replicated object group
1922 --
1923 -- Exceptions:
1924 -- nonmview: if the invocation site is not a materialized view site.
1925 -- missingrepgroup: the replicated object group does not exist
1926 ---------------------------------------------------------------------------
1927 PROCEDURE refresh_mview_repgroup(gname IN VARCHAR2,
1928 drop_missing_contents IN BOOLEAN := FALSE,
1929 refresh_mviews IN BOOLEAN := FALSE,
1930 refresh_other_objects IN BOOLEAN := FALSE,
1931 gowner IN VARCHAR2
1932 := 'PUBLIC');
1933 -- Refresh the RepCat views for the given repgroup and optionally drop
1934 -- objects no longer in the repgroup. Consistently refresh the materialized
1935 -- views iff refresh_snapshots is TRUE. Refresh the other objects if
1936 -- refresh_other_objects is TRUE. The value in gname must be an existing
1937 -- object group in the local database. The value of gowner is the
1938 -- owner of the object group.
1939 --
1940 -- Exceptions:
1941 -- nonmview: if the invocation site is not a materialized view site.
1942 -- nonmaster: if the master is no longer a master site.
1943 -- commfailure: if the master is not accessible.
1944 -- missingrepgroup: if the replicated object group does not exist
1945 ---------------------------------------------------------------------------
1946 PROCEDURE switch_mview_master(gname IN VARCHAR2,
1947 master IN VARCHAR2,
1948 gowner IN VARCHAR2 := 'PUBLIC');
1949 -- Change the master database of the materialized view repgroup to the given
1950 -- database. The new database must contain a replica of the master
1951 -- repgroup. Each materialized view in the local repgroup will be completely
1952 -- refreshed from the new master the next time it is refreshed.
1953 -- This procedure will raise an error if any materialized view definition
1954 -- query is bigger than 32K.
1955 --
1956 -- Any materialized view logs should be created at all masters to avoid
1957 -- future complete refreshes.
1958 --
1959 -- Arguments:
1960 -- gname: name of the materialized view object group
1961 -- master: name of the new master
1962 -- gowner: owner of the materialized view object group
1963 --
1964 -- Exceptions:
1965 -- nonmview: if the invocation site is not a materialized view site.
1966 -- nonmaster: if the given database is not a master site.
1967 -- commfailure: if the given database is not accessible.
1968 -- missingrepgroup: materialized view repgroup does not exist
1969 -- qrytoolong: materialized view definition query is > 32K
1970 -- alreadymastered: if at the local site there is another materialized
1971 -- view repgroup with the same group name and mastered at the old master.
1972 ---------------------------------------------------------------------------
1973 PROCEDURE create_mview_repobject(sname IN VARCHAR2,
1974 oname IN VARCHAR2,
1975 type IN VARCHAR2,
1976 ddl_text IN VARCHAR2 := '',
1977 comment IN VARCHAR2 := '',
1978 gname IN VARCHAR2 := '',
1979 gen_objs_owner IN VARCHAR2 := '',
1980 min_communication IN BOOLEAN := TRUE,
1981 generate_80_compatible IN BOOLEAN := TRUE,
1982 gowner IN VARCHAR2 := 'PUBLIC');
1983 -- Add the given object name and type to the RepObject view at the local
1984 -- materialized view repgroup. The allowed types are `package',
1985 -- `package body', `procedure', `snapshot', `synonym', 'trigger', 'index',
1986 -- `view', 'type', 'type body', 'operator', 'indextype'.
1987 --
1988 -- For objects of type `snapshot', generate the client-side half of the
1989 -- replication packages if the underlying table uses row/column-level
1990 -- replication.
1991 --
1992 -- The parameter ddl_text defines the materialized view if the materialized
1993 -- view does not already exist. The value of oname should match the
1994 -- materialized view name defined in the ddl_text. The snaphot's master
1995 -- should match the master stored in all_repgroup, this includes the
1996 -- connection qualifier that may be associated with the master group.
1997 --
1998 -- gen_objs_owner indicates the schema in which the generated procedural
1999 -- wrapper should be install. If this parameter is NULL, the value of the
2000 -- sname parameter is used.
2001 --
2002 -- If min_communication is TRUE and type is 'SNAPSHOT', the update trigger
2003 -- sends the new value of a column only if the update statement modifies the
2004 -- column. The update trigger sends the old value of the column only if it
2005 -- is a key column or a column in a modified column group.
2006 --
2007 -- If generate_80_compatible is true, deferred RPC's with the TOP
2008 -- flavor are generated using the 8.0 protocol.
2009 --
2010 -- gowner is the owner of the replicated group
2014 -- nonmview if the invocation site is not a materialized view site.
2011 --
2012 -- Exceptions:
2013 -- missingschema if specified owner of generated objects does not exist
2015 -- nonmaster if the master is no longer a master site.
2016 -- missingobject if the given object does not exist in the master's
2017 -- replicated object group.
2018 -- duplicateobject if the given object already exists.
2019 -- typefailure if the type is not an allowable type.
2020 -- ddlfailure if the DDL does not succeed.
2021 -- commfailure if the master is not accessible.
2022 -- badmviewddl if th ddl was executed but materialized view does not exist
2023 -- onlyonemview if only one materialized view for master table can be
2024 -- created badmviewname if materialized view base table differs from
2025 -- master table misingrepgroup if replicated object group does not exist
2026 ---------------------------------------------------------------------------
2027 PROCEDURE generate_mview_support(sname IN VARCHAR2,
2028 oname IN VARCHAR2,
2029 type IN VARCHAR2,
2030 gen_objs_owner IN VARCHAR2 := '',
2031 min_communication IN BOOLEAN := TRUE,
2032 generate_80_compatible
2033 IN BOOLEAN := TRUE);
2034 -- If the object exists in the replicated materialized view object group
2035 -- as an updatable materialized view using row/column-level replication,
2036 -- create the row-level replication trigger and stored package.
2037 --
2038 -- If the object exists in the replicated object group as a procedure
2039 -- or package (body), then generate the appropriate wrappers.
2040 --
2041 -- Parameter gen_objs_owner specifies the schema in which the generated
2042 -- replication package and wrapper should be installed. If this value is
2043 -- NULL, then the generated package or wrapper will be installed in the
2044 -- schema specified by the sname parameter.
2045 --
2046 -- If min_communication is TRUE, then the update trigger sends the new value
2047 -- of a column only if the update statement modifies the column. The update
2048 -- trigger sends the old value of the column only if it is a key column or
2049 -- a column in a modified column group.
2050 --
2051 -- If generate_80_compatible is true, deferred RPC's with the TOP
2052 -- flavor are generated using the 8.0 protocol.
2053 --
2054 -- Exceptions:
2055 -- nonmview if the invocation site is not a materialized view site.
2056 -- missingobject if the given object does not exist as a materialized view
2057 -- in the replicated object group awaiting row/column-level replication
2058 -- information or as a procedure or package (body) awaiting wrapper
2059 -- generation.
2060 -- typefailure if the given type parameter is not supported.
2061 -- missingschema if specified owner of generated objects does not exist
2062 -- missingremoteobject if the master object has not yet generated
2063 -- replication support.
2064 -- commfailure if the master is not accessible
2065 ---------------------------------------------------------------------------
2066 PROCEDURE drop_mview_repobject(sname IN VARCHAR2,
2067 oname IN VARCHAR2,
2068 type IN VARCHAR2,
2069 drop_objects IN BOOLEAN := FALSE);
2070 -- Remove the given object name from the local replication catalog
2071 -- and optionally drop the object and dependent objects.
2072 --
2073 -- Exceptions:
2074 -- nonmview if the invocation site is not a materialized view site.
2075 -- missingobject if the given object does not exist.
2076 -- typefailure if the given type parameter is not supported.
2077 ---------------------------------------------------------------------------
2078 PROCEDURE alter_mview_propagation(gname IN VARCHAR2,
2079 propagation_mode IN VARCHAR2,
2080 comment IN VARCHAR2 := '',
2081 gowner IN VARCHAR2 := 'PUBLIC');
2082 -- Alter the propagation method of all replication materialized views,
2083 -- procedure, packages, and package bodies for all materialized view
2084 -- repobjects in the specified materialized view repgroup.
2085 --
2086 -- Altering the propagation method involves regenerating replication
2087 -- support at the materialized view site. When converting from asynchronous
2088 -- replication to synchronous replication, the deferred RPC queue is
2089 -- pushed before conversion.
2090 --
2091 -- Queued Deferred RPCs are pushed to remote masters
2092 --
2093 -- Exceptions:
2094 -- notcompat: only databases operating in 7.3 (or later) mode can
2095 -- use this procedure.
2096 -- failaltermviewrop: materialized view repgroup propagation can be
2097 -- altered only when there is no other repgroup with the same master
2098 -- sharing the site.
2099 ---------------------------------------------------------------------------
2100 --
2101 -- CONFLICT RESOLUTION PROCEDURES
2102 --
2103 -- The following procedures are added to support automatic conflict
2104 -- resolution. Note that these procedures are available only on master
2105 -- sites. Conflict resolution is not available on materialized view sites.
2106 ---------------------------------------------------------------------------
2107 PROCEDURE define_column_group(sname IN VARCHAR2,
2108 oname IN VARCHAR2,
2112 -- has no members yet. Define_column_group does not affect the generated
2109 column_group IN VARCHAR2,
2110 comment IN VARCHAR2 := NULL);
2111 -- Create a new column group for the given repobject. The column group
2113 -- PL/SQL until the next call to generate_replication_support.
2114 -- Input Parameters:
2115 -- sname: The name of the schema containing the table to be replicated.
2116 -- Defaults to invoking user.
2117 -- oname: The name of the table being replicated.
2118 -- column_group: The name of the column group being defined.
2119 -- comment: Comment text for the column group being defined.
2120 -- Exceptions:
2121 -- nonmasterdef: if the invocation site is not the masterdef site.
2122 -- duplicategroup: if the given column group already exists for the
2123 -- repobject.
2124 -- missingobject: if the given repobject does not exist.
2125 -- notquiesced: if the object group that the replicated table belongs
2126 -- to is not quiesced
2127 ---------------------------------------------------------------------------
2128 PROCEDURE comment_on_column_group(sname IN VARCHAR2,
2129 oname IN VARCHAR2,
2130 column_group IN VARCHAR2,
2131 comment IN VARCHAR2);
2132
2133 -- Update the comment field for the given column group in the
2134 -- *_RepColumn_Group views.
2135 -- Input Parameters:
2136 -- sname: The name of the schema containing the table to be replicated.
2137 -- Defaults to invoking user.
2138 -- oname: The name of the table being replicated.
2139 -- column_group: The name of the column group.
2140 -- comment: Comment text for the column group being defined.
2141 -- Exceptions:
2142 -- nonmasterdef: if the invocation site is not the masterdef site.
2143 -- missinggroup: if the given column group does not exist.
2144 -- missingobj: if the given repobject does not exist
2145 ---------------------------------------------------------------------------
2146 PROCEDURE drop_column_group(sname IN VARCHAR2,
2147 oname IN VARCHAR2,
2148 column_group IN VARCHAR2);
2149 -- Drop the given column group. Drop_column_group does not affect the
2150 -- PL/SQL until the next call to generate_replication_support.
2151 -- Input Parameters:
2152 -- sname: The name of the schema containing the table to be replicated.
2153 -- Defaults to invoking user.
2154 -- oname: The name of the table being replicated.
2155 -- column_group: The name of the column group to be dropped
2156 -- Exceptions:
2157 -- nonmasterdef: if the invocation site is not the masterdef site.
2158 -- referenced: if the given column group is being used in conflict
2159 -- detection and resolution.
2160 -- missingobject: if given table does not exist
2161 -- missinggroup: if given column group does not exist
2162 -- notquiesced: if object group that the replicated table belongs to
2163 -- is not quiesced
2164 ---------------------------------------------------------------------------
2165 PROCEDURE add_grouped_column(sname IN VARCHAR2,
2166 oname IN VARCHAR2,
2167 column_group IN VARCHAR2,
2168 list_of_column_names IN VARCHAR2);
2169
2170 PROCEDURE add_grouped_column(sname IN VARCHAR2,
2171 oname IN VARCHAR2,
2172 column_group IN VARCHAR2,
2173 list_of_column_names IN dbms_repcat.varchar2s);
2174 -- Assign a set of columns to the given column group. Add_grouped_column
2175 -- does not affect the generated PL/SQL until the next call to
2176 -- generate_replication_support.
2177 -- Arguments:
2178 -- sname: The name of the schema containing the table to be replicated.
2179 -- Defaults to invoking user.
2180 -- oname: The name of the table being replicated.
2181 -- column_group: The name of the column group.
2182 -- list_of_column_names: A list of columns being added to the column .
2183 -- group. The list can be a comma separated list of columns or
2184 -- a pl/sql table of columns.
2185 -- a '*' as the only entry in the list results in all the
2186 -- columns in the table being entered as part of the column group
2187 -- Exceptions:
2188 -- nonmasterdef: if the invocation site is not the masterdef site.
2189 -- missingobject: if the given table does not exist
2190 -- duplicatecolumn: if the given column already exists in the column group
2191 -- missinggroup: if the given column group does not exist.
2192 -- missingcolumn: if the given column does not exist in the repobject.
2193 -- missingschema: if the given schema does not exist
2194 -- notquiesced: the object group that the given table belongs to is
2195 -- not quiesced
2196 ---------------------------------------------------------------------------
2197 PROCEDURE make_column_group (sname IN VARCHAR2,
2198 oname IN VARCHAR2,
2199 column_group IN VARCHAR2,
2200 list_of_column_names IN VARCHAR2);
2201
2202 PROCEDURE make_column_group (sname IN VARCHAR2,
2203 oname IN VARCHAR2,
2204 column_group IN VARCHAR2,
2208 -- Input parameters:
2205 list_of_column_names IN dbms_repcat.varchar2s);
2206 -- Create a new column group with one or more members
2207 -- i.e. do a combined define and add
2209 -- sname: name of schema containing the replicated table
2210 -- oname: name of the replicated table
2211 -- colgrp: name of the new column group
2212 -- list_of_column_name: names of columns in the new column group
2213 ---------------------------------------------------------------------------
2214 PROCEDURE drop_grouped_column(sname IN VARCHAR2,
2215 oname IN VARCHAR2,
2216 column_group IN VARCHAR2,
2217 list_of_column_names IN dbms_repcat.varchar2s);
2218
2219 PROCEDURE drop_grouped_column(sname IN VARCHAR2,
2220 oname IN VARCHAR2,
2221 column_group IN VARCHAR2,
2222 list_of_column_names IN VARCHAR2);
2223 -- Remove a column from the given column group. Drop_grouped_column does not
2224 -- affect the generated PL/SQL until the next call to
2225 -- generate_replication_support.
2226 -- Input Parameters:
2227 -- sname: The name of the schema containing the table to be replicated.
2228 -- Defaults to invoking user.
2229 -- oname: The name of the table being replicated.
2230 -- column_group: The name of the column group.
2231 -- list_of_column_names: names of columns to be removed
2232 -- Exceptions:
2233 -- nonmasterdef: if the invocation site is not the masterdef site.
2234 -- missingobject: if given table does not exist
2235 -- notquiesced: if the object group the replicated table belongs to
2236 -- is not quiesced
2237 ---------------------------------------------------------------------------
2238 PROCEDURE define_priority_group(gname IN VARCHAR2,
2239 pgroup IN VARCHAR2,
2240 datatype IN VARCHAR2,
2241 fixed_length IN INTEGER := NULL,
2242 comment IN VARCHAR2 := NULL);
2243 -- Create a new priority group. The name of the priority group must be
2244 -- unique in a repgroup. The valid values of datatype are those, except
2245 -- rowid, that are supported by Rep2.
2246 -- Define_priority_group does not affect the generated PL/SQL until the
2247 -- next call to generate_replication_support.
2248 -- Input Parameters:
2249 -- gname: The name of the repgroup containing the table to be replicated.
2250 -- pgroup: The name of the priority group being created.
2251 -- datatype: The datatype of value in the priority group being created.
2252 -- Supported datatypes are: `CHAR', `VARCHAR2', `NUMBER', `DATE',
2253 -- `RAW', `NCHAR' and `NVARCHAR2'.
2254 -- fixed_length: The fixed length for data of type CHAR.
2255 -- comment: Comment text for the priority group being created.
2256 -- Exceptions:
2257 -- nonmasterdef: if the invocation site is not the masterdef site.
2258 -- duplicateprioritygroup: if the given priority group already exists
2259 -- in the replicated object group.
2260 -- typefailure: if the given datatype is not an allowable type.
2261 -- missingrepgroup: if given replicated object group does not exist
2262 -- notquiesced: if replicated object group is not quiesced
2263 ---------------------------------------------------------------------------
2264 PROCEDURE comment_on_priority_group(gname IN VARCHAR2,
2265 pgroup IN VARCHAR2,
2266 comment IN VARCHAR2);
2267 -- Update the comment field for the given priority group in the
2268 -- *_RepPriority_Group views
2269 -- Input Parameters:
2270 -- gname: The name of the repgroup containing the table to be replicated.
2271 -- pgroup: The name of the priority group.
2272 -- comment: Comment text for the priority group being created.
2273 -- Exceptions:
2274 -- nonmasterdef: if the invocation site is not the masterdef site.
2275 -- missingprioritygroup: if the given priority group does not exist.
2276 -- missingrepgroup: if the replicated object group does not exist
2277 ---------------------------------------------------------------------------
2278 PROCEDURE drop_priority_group(gname IN VARCHAR2,
2279 pgroup IN VARCHAR2);
2280 -- Drop the given priority group. Drop_priority_group does not affect the
2281 -- generated PL/SQL until the next call to generate_replication_support.
2282 -- Users cannot drop a priority group if the priority group is still
2283 -- referenced in any generated resolution packages.
2284 -- Input Parameters:
2285 -- gname: The name of the repgroup containing the table to be replicated.
2286 -- pgroup: The name of the priority group.
2287 -- Exceptions:
2288 -- nonmasterdef: if the invocation site is not the masterdef site.
2289 -- referenced: if the given priority group is being used in conflict
2290 -- resolution.
2291 -- missingrepgroup: if the given replicated object group does not exist
2292 -- notquiesced: if the given replicated object group is not quiesced
2293 ---------------------------------------------------------------------------
2294 PROCEDURE add_priority_char(gname IN VARCHAR2,
2295 pgroup IN VARCHAR2,
2296 value IN CHAR,
2297 priority IN NUMBER);
2298
2299 PROCEDURE add_priority_nchar(gname IN VARCHAR2,
2300 pgroup IN VARCHAR2,
2304 PROCEDURE add_priority_date(gname IN VARCHAR2,
2301 value IN NCHAR,
2302 priority IN NUMBER);
2303
2305 pgroup IN VARCHAR2,
2306 value IN DATE,
2307 priority IN NUMBER);
2308
2309 PROCEDURE add_priority_number(gname IN VARCHAR2,
2310 pgroup IN VARCHAR2,
2311 value IN NUMBER,
2312 priority IN NUMBER);
2313
2314 PROCEDURE add_priority_raw(gname IN VARCHAR2,
2315 pgroup IN VARCHAR2,
2316 value IN RAW,
2317 priority IN NUMBER);
2318
2319 PROCEDURE add_priority_varchar2(gname IN VARCHAR2,
2320 pgroup IN VARCHAR2,
2321 value IN VARCHAR2,
2322 priority IN NUMBER);
2323
2324 PROCEDURE add_priority_nvarchar2(gname IN VARCHAR2,
2325 pgroup IN VARCHAR2,
2326 value IN NVARCHAR2,
2327 priority IN NUMBER);
2328 -- Add a new value to the given priority group. The new value
2329 -- must be unique, and the priority must be unique. The addition of this
2330 -- value becomes effective immediately.
2331 -- Input Parameters:
2332 -- gname: The name of the repgroup.
2333 -- pgroup: The name of the priority group.
2334 -- value: A new value for the priority group.
2335 -- priority: The priority for the new value.
2336 -- Exceptions:
2337 -- nonmasterdef: if the invocation site is not the masterdef site.
2338 -- duplicatevalue: if the given value already exists in the priority group.
2339 -- duplicatepriority: if the given priority already exists in the
2340 -- priority group.
2341 -- missingprioritygroup: if the given priority group does not exist.
2342 -- typefailure: if the given value has an incorrect datatype for the
2343 -- priority group.
2344 ---------------------------------------------------------------------------
2345 PROCEDURE alter_priority_char(gname IN VARCHAR2,
2346 pgroup IN VARCHAR2,
2347 old_value IN CHAR,
2348 new_value IN CHAR);
2349
2350 PROCEDURE alter_priority_nchar(gname IN VARCHAR2,
2351 pgroup IN VARCHAR2,
2352 old_value IN NCHAR,
2353 new_value IN NCHAR);
2354
2355 PROCEDURE alter_priority_date(gname IN VARCHAR2,
2356 pgroup IN VARCHAR2,
2357 old_value IN DATE,
2358 new_value IN DATE);
2359
2360 PROCEDURE alter_priority_number(gname IN VARCHAR2,
2361 pgroup IN VARCHAR2,
2362 old_value IN NUMBER,
2363 new_value IN NUMBER);
2364
2365 PROCEDURE alter_priority_raw(gname IN VARCHAR2,
2366 pgroup IN VARCHAR2,
2367 old_value IN RAW,
2368 new_value IN RAW);
2369
2370 PROCEDURE alter_priority_varchar2(gname IN VARCHAR2,
2371 pgroup IN VARCHAR2,
2372 old_value IN VARCHAR2,
2373 new_value IN VARCHAR2);
2374
2375 PROCEDURE alter_priority_nvarchar2(gname IN VARCHAR2,
2376 pgroup IN VARCHAR2,
2377 old_value IN NVARCHAR2,
2378 new_value IN NVARCHAR2);
2379 -- Alter the priority value of a member in a priority group. The new value
2380 -- must be unique. The change in value becomes effective immediately.
2381 -- Note that implicit conversion will work from many different
2382 -- data types into VARCHAR2.
2383 -- Input Parameters:
2384 -- gname: The name of the repgroup containing the table to be replicated.
2385 -- pgroup: The name of the priority group.
2386 -- old_value: The old value to be altered.
2387 -- new_value: The new value.
2388 -- Exceptions:
2389 -- nonmasterdef: if the invocation site is not the masterdef site.
2390 -- duplicatevalue: if the given new value already exists in the priority
2391 -- group.
2392 -- missingprioritygroup: if the given priority group does not exist.
2393 -- misingrepgroup: if given object group does not exist
2394 -- missingvalue: if old_value does not exist
2395 -- paramtype: if new vvalue has incorrect datatype for priority group
2396 -- notquiesced: if replicated object group is not quiesced
2397 ---------------------------------------------------------------------------
2398 PROCEDURE alter_priority(gname IN VARCHAR2,
2399 pgroup IN VARCHAR2,
2400 old_priority IN NUMBER,
2401 new_priority IN NUMBER);
2402 -- Update an old priority to a new priority. The new priority must be unique.
2403 -- The change in priority becomes effective immediately.
2404 -- Input Parameters:
2405 -- gname: The name of the object group containing the table to be
2406 -- replicated.
2407 -- pgroup: The name of the priority group.
2408 -- old_priority: The priority to be altered.
2409 -- new_priority: The new priority.
2413 -- priority group.
2410 -- Exceptions:
2411 -- nonmasterdef: if the invocation site is not the masterdef site.
2412 -- duplicatepriority: if the given new priority already exists in the
2414 -- missingprioritygroup: if the given priority group does not exist.
2415 -- missingvalue: if the value was not previously registered by
2416 -- a call to dbms_repcat.add_priority_"dataytype"
2417 -- notquiesced: if the given replicated object group is not quiesced
2418 ---------------------------------------------------------------------------
2419 PROCEDURE drop_priority(gname IN VARCHAR2,
2420 pgroup IN VARCHAR2,
2421 priority_num IN NUMBER);
2422 -- Remove a value from the given priority group by priority.
2423 -- The removal of this value becomes effective immediately.
2424 -- Input Parameters:
2425 -- gname: The name of the repgroup containing the table to be replicated.
2426 -- pgroup: The name of the priority group.
2427 -- priority: The priority for the value being dropped.
2428 -- Exceptions:
2429 -- nonmasterdef: if the invocation site is not the masterdef site.
2430 -- missingprioritygroup: if the given priority group does not exist.
2431 -- missingrepgroup: if given replicated object group does not exist
2432 -- notquiesced: if given replicated object group is not quiesced
2433 ---------------------------------------------------------------------------
2434 PROCEDURE drop_priority_char(gname IN VARCHAR2,
2435 pgroup IN VARCHAR2,
2436 value IN CHAR);
2437
2438 PROCEDURE drop_priority_nchar(gname IN VARCHAR2,
2439 pgroup IN VARCHAR2,
2440 value IN NCHAR);
2441
2442 PROCEDURE drop_priority_date(gname IN VARCHAR2,
2443 pgroup IN VARCHAR2,
2444 value IN DATE);
2445
2446 PROCEDURE drop_priority_number(gname IN VARCHAR2,
2447 pgroup IN VARCHAR2,
2448 value IN NUMBER);
2449
2450 PROCEDURE drop_priority_raw (gname IN VARCHAR2,
2451 pgroup IN VARCHAR2,
2452 value IN RAW);
2453
2454 PROCEDURE drop_priority_varchar2(gname IN VARCHAR2,
2455 pgroup IN VARCHAR2,
2456 value IN VARCHAR2);
2457
2458 PROCEDURE drop_priority_nvarchar2(gname IN VARCHAR2,
2459 pgroup IN VARCHAR2,
2460 value IN NVARCHAR2);
2461 -- Remove a value from the given priority group.
2462 -- The removal of this value becomes effective immediately.
2463 -- Note that implicit conversion will work from many different
2464 -- data types into VARCHAR2.
2465 -- Input Parameters:
2466 -- gname: The replicated object group with which the priority group
2467 -- is associated
2468 -- pgroup: The name of the priority group.
2469 -- value: The value to be dropped
2470 -- Exceptions:
2471 -- nonmasterdef: if the invocation site is not the masterdef site.
2472 -- missingprioritygroup: if the given priority group does not exist.
2473 -- paramtype: if the given value has an incorrect datatype for the
2474 -- priority group.
2475 -- notquiesced: if the replicated object group is not quiesced
2476 -- missingrepgroup: if the replicated object group does not exist
2477 ---------------------------------------------------------------------------
2478 PROCEDURE define_site_priority(gname IN VARCHAR2,
2479 name IN VARCHAR2,
2480 comment IN VARCHAR2 := NULL);
2481 -- Create a new site priority group. The site priority name must be unique
2482 -- in a repgroup. Define_site_priority does not affect the generated PL/SQL
2483 -- until the next call to generate_replication_support.
2484 -- Input Parameters:
2485 -- gname: The name of the repgroup containing the table to be replicated.
2486 -- name: The name of the site priority being created.
2487 -- comment: Comment text for the site priority being created.
2488 -- Exceptions:
2489 -- nonmasterdef: if the invocation site is not the masterdef site.
2490 -- duplicateprioritygroup: if the given site priority group already
2491 -- exists in the repgroup.
2492 -- notquiesced: if the given replicated object group is not quiesced
2493 -- missingrepgroup: if given replicated object group does not exist
2494 ---------------------------------------------------------------------------
2495 PROCEDURE comment_on_site_priority(gname IN VARCHAR2,
2496 name IN VARCHAR2,
2497 comment IN VARCHAR2);
2498 -- Update the comment field for the given site priority group in the
2499 -- *_RepPriority_Group views
2500 -- Input Parameters:
2501 -- gname: The name of the schema containing the table to be replicated.
2502 -- name: The name of the site priority.
2503 -- comment: Comment text for the site priority being created.
2504 -- Exceptions:
2505 -- nonmasterdef: if the invocation site is not the masterdef site.
2506 -- missingpriority: if the given site priority does not exist.
2507 ---------------------------------------------------------------------------
2508 PROCEDURE drop_site_priority(gname IN VARCHAR2,
2509 name IN VARCHAR2);
2510 -- Drop the given site priority. Drop_site_priority does not affect the
2511 -- generated PL/SQL until the next call to generate_replication_support.
2515 -- gname: The name of the repgroup containing the table to be replicated.
2512 -- Users cannot drop a site priority if the site priority is still referenced
2513 -- in any generated resolution packages.
2514 -- Input Parameters:
2516 -- name: The name of the site priority.
2517 -- Exceptions:
2518 -- nonmasterdef: if the invocation site is not the masterdef site.
2519 -- referenced: if the given priority group is being used in conflict
2520 -- resolution.
2521 -- missingrepgroup: if the given replicated object group does not exist
2522 -- notquiesced: if the given replicated object group is not quiesced
2523 ---------------------------------------------------------------------------
2524 PROCEDURE add_site_priority_site(gname IN VARCHAR2,
2525 name IN VARCHAR2,
2526 site IN VARCHAR2,
2527 priority IN NUMBER);
2528 -- Add a new site to the given site priority. The new site must be unique,
2529 -- and the priority must be unique. The addition of this site becomes
2530 -- effective immediately.
2531 -- Input Parameters:
2532 -- gname: The name of the replicated object group.
2533 -- name: The name of the site priority.
2534 -- site: A new site for the site priority. The site value should come
2535 -- from global_name view. It must already be canonicalized.
2536 -- priority: The priority for the new site.
2537 -- Exceptions:
2538 -- nonmasterdef: if the invocation site is not the masterdef site.
2539 -- duplicateval: if the given site already exists in the site priority.
2540 -- duplicatepriority: if the given priority already exists in the site
2541 -- priority.
2542 -- missingpriority: if the given site priority group does not exist.
2543 -- missingrepgroup: if the replicated object group does not exist
2544 -- notquiesced: if the replicated object group is not quiesced
2545 ---------------------------------------------------------------------------
2546 PROCEDURE alter_site_priority_site(gname IN VARCHAR2,
2547 name IN VARCHAR2,
2548 old_site IN VARCHAR2,
2549 new_site IN VARCHAR2);
2550 -- Alter the site associated with a priority level. The new site must
2551 -- be unique. The change in site becomes effective immediately.
2552 -- Input Parameters:
2553 -- gname: The name of the object group containing the table to be
2554 -- replicated. Defaults to invoking user.
2555 -- name: The name of the site priority group.
2556 -- old_site: The old site to be altered.
2557 -- old_site: The new site.
2558 -- Exceptions:
2559 -- nonmasterdef if the invocation site is not the masterdef site.
2560 -- missingpriority if the given site priority does not exist.
2561 -- missingrepgroup: if given replicated object group does not exist
2562 -- missingvalue: if old_site is not a group membeer
2563 -- notquiesced: if object group is not quiesced
2564 ---------------------------------------------------------------------------
2565 PROCEDURE alter_site_priority(gname IN VARCHAR2,
2566 name IN VARCHAR2,
2567 old_priority IN NUMBER,
2568 new_priority IN NUMBER);
2569 -- Alter the priority level of a site. The new priority must be unique.
2570 -- The change in priority becomes effective immediately.
2571 -- Input Parameters:
2572 -- gname: The name of the repgroup containing the table to be replicated.
2573 -- name: The name of the site priority.
2574 -- old_priority: The priority to be altered.
2575 -- new_priority: The new priority.
2576 -- Exceptions:
2577 -- nonmasterdef: if the invocation site is not the masterdef site.
2578 -- missingpriority: if the given site priority does not exist.
2579 -- missingrepgroup: if the given replicated object group does not exist
2580 -- missingvalue: if old value does not exist
2581 -- notquiesced: if replicated object group is not quiesced
2582 ---------------------------------------------------------------------------
2583 PROCEDURE drop_site_priority_site(gname IN VARCHAR2,
2584 name IN VARCHAR2,
2585 site IN VARCHAR2);
2586 -- Remove a site, by name, from the given site priority group. The removal
2587 -- of this site becomes effective immediately.
2588 -- Input Parameters:
2589 -- gname: The name of the schema containing the table to be replicated.
2590 -- Defaults to invoking user.
2591 -- name: The name of the site priority.
2592 -- site: The site to be dropped.
2593 -- Exceptions:
2594 -- nonmasterdef: if the invocation site is not the masterdef site.
2595 -- missingpriority: if the given site priority does not exist.
2596 -- missingrepgroup: if given replicated object group does not exist
2597 -- notquiesced: if given replicated object group is not quiesced
2598 ---------------------------------------------------------------------------
2599 PROCEDURE add_update_resolution(sname IN VARCHAR2,
2600 oname IN VARCHAR2,
2601 column_group IN VARCHAR2,
2602 sequence_no IN NUMBER,
2603 method IN VARCHAR2,
2604 parameter_column_name
2605 IN dbms_repcat.varchar2s,
2606 priority_group IN VARCHAR2 := NULL,
2610 PROCEDURE add_update_resolution(sname IN VARCHAR2,
2607 function_name IN VARCHAR2 := NULL,
2608 comment IN VARCHAR2 := NULL);
2609
2611 oname IN VARCHAR2,
2612 column_group IN VARCHAR2,
2613 sequence_no IN NUMBER,
2614 method IN VARCHAR2,
2615 parameter_column_name
2616 IN dbms_utility.lname_array,
2617 priority_group IN VARCHAR2 := NULL,
2618 function_name IN VARCHAR2 := NULL,
2619 comment IN VARCHAR2 := NULL);
2620
2621 PROCEDURE add_update_resolution(sname IN VARCHAR2,
2622 oname IN VARCHAR2,
2623 column_group IN VARCHAR2,
2624 sequence_no IN NUMBER,
2625 method IN VARCHAR2,
2626 parameter_column_name IN VARCHAR2,
2627 priority_group IN VARCHAR2 := NULL,
2628 function_name IN VARCHAR2 := NULL,
2629 comment IN VARCHAR2 := NULL);
2630 -- Add a new conflict resolution for the given object.
2631 -- Add_update_resolution does not affect the generated PL/SQL until the
2632 -- next call to generate_replication_support on the given object.
2633 -- Input Parameters:
2634 -- sname: The name of the schema containing the table to be replicated.
2635 -- Defaults to invoking user.
2636 -- oname: The name of the table being replicated.
2637 -- column_group: name of the column_group
2638 -- sequence_no: A number which indicates the order conflict resolutions
2639 -- are applied. A smaller sequence number precedes a larger one.
2640 -- method: The conflict resolution method.
2641 -- parameter_column_name: An ordered list of columns to be used for
2642 -- resolving the conflict. May also be a comma-separated list.
2643 -- a '*' as the only entry in the list results in all the
2644 -- columns in the column group being entered in the alphebetical
2645 -- order (only applicable for 'user function').
2646 -- Scalar leaf attribute of an object type for system built-in
2647 -- resolution routine may be allowed.
2648 -- priority_group: If the method is `PRIORITY GROUP', enter the name of
2649 -- priority group used for resolving the conflict.
2650 -- function_name: If the method is `USER FUNCTION', enter the user
2651 -- resolution function name here.
2652 -- comment: Comment text for the conflict resolution being defined.
2653 -- Exceptions:
2654 -- nonmasterdef: if the invocation site is not the masterdef site.
2655 -- missingobject: if the given object does not exist as a table in the
2656 -- replicated object group awaiting replication information.
2657 -- duplicatesequence: if the sequence number already exists for the given
2658 -- object.
2659 -- missingcolumn: if the given columns do not exist in the table.
2660 -- missinggroup: if the given column group does not exist for the table.
2661 -- invalidmethod: if the given resolution method does not exist.
2662 -- invalidprioritygroup: if the given priority group does not exist.
2663 -- invalidparameter: if the given number of parameter columns is invalid.
2664 -- missingfunction: if the user function does not exist.
2665 ---------------------------------------------------------------------------
2666 PROCEDURE add_delete_resolution(sname IN VARCHAR2,
2667 oname IN VARCHAR2,
2668 sequence_no IN NUMBER,
2669 parameter_column_name
2670 IN dbms_repcat.varchar2s,
2671 function_name IN VARCHAR2,
2672 comment IN VARCHAR2 := NULL,
2673 method IN VARCHAR2 :=
2674 'USER FUNCTION');
2675
2676 PROCEDURE add_delete_resolution(sname IN VARCHAR2,
2677 oname IN VARCHAR2,
2678 sequence_no IN NUMBER,
2679 parameter_column_name IN VARCHAR2,
2680 function_name IN VARCHAR2,
2681 comment IN VARCHAR2 := NULL,
2682 method IN VARCHAR2 :=
2683 'USER FUNCTION');
2684 -- Designates a method for resolving delete conflicts. This must be called
2685 -- from the masterdef site.
2686 -- Arguments:
2687 -- sname: name of schema containing the replicated table. Defaults to
2688 -- invoking user.
2689 -- oname: table name
2690 -- sequence_no: order in which the conflict resolution menthod should
2691 -- be applied. This is a number which indicates the order conflict
2692 -- resolutions are applied. A smaller sequence number precedes a
2693 -- larger one.
2694 -- parameter_column_name: name of columns used to resolve the conflict,
2695 -- only top-level column is allowed.
2696 -- function_name: name of the conflict resolution routine
2700 ---------------------------------------------------------------------------
2697 -- comment: comment text for the conflict resolution being defined. This
2698 -- is inserted in the *_represoluton views.
2699 -- method: must be either 'USER FUNCTION' or 'USER FLAVOR FUNCTION'
2701 PROCEDURE add_unique_resolution(sname IN VARCHAR2,
2702 oname IN VARCHAR2,
2703 constraint_name IN VARCHAR2,
2704 sequence_no IN NUMBER,
2705 method IN VARCHAR2,
2706 parameter_column_name
2707 IN dbms_repcat.varchar2s,
2708 function_name IN VARCHAR2 := NULL,
2709 comment IN VARCHAR2 := NULL);
2710
2711 PROCEDURE add_unique_resolution(sname IN VARCHAR2,
2712 oname IN VARCHAR2,
2713 constraint_name IN VARCHAR2,
2714 sequence_no IN NUMBER,
2715 method IN VARCHAR2,
2716 parameter_column_name
2717 IN dbms_utility.lname_array,
2718 function_name IN VARCHAR2 := NULL,
2719 comment IN VARCHAR2 := NULL);
2720
2721 PROCEDURE add_unique_resolution(sname IN VARCHAR2,
2722 oname IN VARCHAR2,
2723 constraint_name IN VARCHAR2,
2724 sequence_no IN NUMBER,
2725 method IN VARCHAR2,
2726 parameter_column_name IN VARCHAR2,
2727 function_name IN VARCHAR2 := NULL,
2728 comment IN VARCHAR2 := NULL);
2729 -- Designate a method for resolving uniqueness conflicts involving a given
2730 -- unique constraint.
2731 -- Input parameters:
2732 -- sname: name of schema containing the replicated table
2733 -- oname: name of the replicated table
2734 -- constraint_name: name of unique constraint for which to add a conflict
2735 -- resolution routine
2736 -- sequence_no: order in which the conflict resolution menthod should
2737 -- be applied. This is a number which indicates the order conflict
2738 -- resolutions are applied. A smaller sequence number precedes a
2739 -- larger one.
2740 -- method: type of conflict resolution method to be created
2741 -- parameter_column_name: columns used to resolve conflict.
2742 -- Scalar leaf attribute of an object type for
2743 -- system built-in resolution routine may be
2744 -- allowed.
2745 -- function_name: name of conflict resolution reutine. If using one of
2746 -- the standard ones, use the default value, NULL
2747 -- comment: comment text for the conflict resolution being added
2748 ---------------------------------------------------------------------------
2749 PROCEDURE comment_on_update_resolution(sname IN VARCHAR2,
2750 oname IN VARCHAR2,
2751 column_group IN VARCHAR2,
2752 sequence_no IN NUMBER,
2753 comment IN VARCHAR2);
2754 -- Update the comment field for the given update conflict resolution
2755 -- in the *_RepResolution views
2756 -- Input parameters:
2757 -- sname: name of schema containing the replicated table. Defaults to
2758 -- invoking user
2759 -- oname: name of replicated table with which the conflict resoluton
2760 -- routine is associated
2761 -- column_group: name of the column group with which the update
2762 -- conflict resolution routine is associated
2763 -- sequence_no: seq number of the conflict resolution routine.
2764 -- This is a number which indicates the order conflict resolutions
2765 -- are applied. A smaller sequence number precedes a larger one.
2766 -- comment: new comment text for the conflict type resolution
2767 -- Exceptions:
2768 -- nonmasterdef: if the invocation site is not the masterdef site.
2769 -- missingobject: if the given object does not exist as a table in the
2770 -- replicated object group awaiting replication information.
2771 -- missingresolution: if the given conflict resolution does not exist
2772 ---------------------------------------------------------------------------
2773 PROCEDURE comment_on_delete_resolution(sname IN VARCHAR2,
2774 oname IN VARCHAR2,
2775 sequence_no IN NUMBER,
2776 comment IN VARCHAR2) ;
2777 -- Update the comment field for the given delete conflict resolution
2778 -- in the *_RepResolution views
2779 -- Input Parameters:
2780 -- sname: The name of the schema containing the table to be replicated.
2781 -- Defaults to invoking user.
2782 -- oname: The name of the table being replicated.
2783 -- sequence_no: A number which indicates the order conflict resolutions
2784 -- are applied. A smaller sequence number precedes a larger one.
2785 -- comment: Comment text for the conflict resolution being defined.
2786 -- Exceptions:
2787 -- nonmasterdef: if the invocation site is not the masterdef site.
2791 ---------------------------------------------------------------------------
2788 -- missingobject: if the given object does not exist as a table in the
2789 -- replicated object group awaiting replication information.
2790 -- missingresolution: if the given conflict resolution does not exist.
2792 PROCEDURE comment_on_unique_resolution(sname IN VARCHAR2,
2793 oname IN VARCHAR2,
2794 constraint_name IN VARCHAR2,
2795 sequence_no IN NUMBER,
2796 comment IN VARCHAR2) ;
2797 -- Update the comment field for the given unique conflict resolution in the
2798 -- *_RepResolution views
2799 -- Input parameters:
2800 -- sname: name of schema containing the replicated table. Defaults to
2801 -- invoking user
2802 -- oname: name of replicated table with which the conflict resoluton
2803 -- routine is associated
2804 -- constraint_name: name of unique constraint with which the unique
2805 -- conflict resolution routine is associated
2806 -- sequence_no: seq number of the conflict resolution routine.
2807 -- This is a number which indicates the order conflict resolutions
2808 -- are applied. A smaller sequence number precedes a larger one.
2809 -- comment: new comment text for the conflict type resolution
2810 -- Exceptions:
2811 -- nonmasterdef: if the invocation site is not the masterdef site.
2812 -- missingobject: if the given object does not exist as a table in the
2813 -- replicated object group awaiting replication information.
2814 -- missingresolution: if the given conflict resolution does not exist
2815 ---------------------------------------------------------------------------
2816 PROCEDURE drop_update_resolution(sname IN VARCHAR2,
2817 oname IN VARCHAR2,
2818 column_group IN VARCHAR2,
2819 sequence_no IN NUMBER) ;
2820
2821 -- Remove an update conflict resolution for the given object.
2822 -- Drop_update_resolution does not affect the generated PL/SQL until the
2823 -- next call to generate_replication_support on the given object.
2824 -- Input Parameters:
2825 -- sname: The name of the schema containing the table to be replicated.
2826 -- Defaults to invoking user.
2827 -- oname: The name of the table being replicated.
2828 -- column_group_name: name of the column group for which you want to
2829 -- drop an update conflict resolution routine
2830 -- sequence_no: A number which indicates the order conflict resolutions
2831 -- are applied. A smaller sequence number precedes a larger one.
2832 -- Exceptions:
2833 -- nonmasterdef: if the invocation site is not the masterdef site.
2834 -- missingobject: if the given object does not exist as a table in
2835 -- the replicated object group awaiting replication information.
2836 ---------------------------------------------------------------------------
2837 PROCEDURE drop_delete_resolution(sname IN VARCHAR2,
2838 oname IN VARCHAR2,
2839 sequence_no IN NUMBER) ;
2840 -- Remove a delete conflict resolution for the given object.
2841 -- Drop_delete_resolution does not affect the generated PL/SQL until
2842 -- the next call to generate_replication_support on the given object.
2843 -- Input Parameters:
2844 -- sname: The name of the schema containing the table to be replicated.
2845 -- Defaults to invoking user.
2846 -- oname: The name of the table being replicated.
2847 -- sequence_no: A number which indicates the order conflict resolutions
2848 -- are applied. A smaller sequence number precedes a larger one.
2849 -- Exceptions:
2850 -- nonmasterdef: if the invocation site is not the masterdef site.
2851 -- missingobject: if the given object does not exist as a table in
2852 -- the replicated object group awaiting replication information.
2853 ---------------------------------------------------------------------------
2854 PROCEDURE drop_unique_resolution(sname IN VARCHAR2,
2855 oname IN VARCHAR2,
2856 constraint_name IN VARCHAR2,
2857 sequence_no IN NUMBER) ;
2858 -- Remove a uniqueness conflict resolution for the given object.
2859 -- Drop_unique_resolution does not affect the generated PL/SQL
2860 -- until the next call to generate_replication_support on the given object.
2861 -- Input Parameters:
2862 -- sname: The name of the schema containing the table to be replicated.
2863 -- Defaults to invoking user.
2864 -- oname: The name of the table being replicated.
2865 -- constraint_name: The name of the unique constraint for which you
2866 -- want to drop a unique conflict resolution routine
2867 -- sequence_no: A number which indicates the order conflict resolutions
2868 -- are applied. A smaller sequence number precedes a larger one.
2869 -- Exceptions:
2870 -- nonmasterdef: if the invocation site is not the masterdef site.
2871 -- missingobject: if the given object does not exist as a table in
2872 -- the replicated object group awaiting replication information.
2873 ---------------------------------------------------------------------------
2874 PROCEDURE purge_statistics(sname IN VARCHAR2,
2878 -- Purge the collected statistics for the given range of date in which
2875 oname IN VARCHAR2,
2876 start_date IN DATE,
2877 end_date IN DATE);
2879 -- conflicts were resolved.
2880 -- Input Parameters:
2881 -- sname: The name of the schema containing the table to be replicated.
2882 -- oname: The name of the table being replicated.
2883 -- start_date: The start date of the given range. If NULL, assume no
2884 -- start date.
2885 -- end_date: The end date of the given range. If NULL, assume no end date.
2886 ---------------------------------------------------------------------------
2887 PROCEDURE register_statistics(sname IN VARCHAR2,
2888 oname IN VARCHAR2);
2889 -- Enable the collection of conflict resolution statistics for the given
2890 -- replicated table.
2891 -- Input Parameters:
2892 -- sname: The name of the schema containing the table to be replicated.
2893 -- oname: The name of the table being replicated.
2894 ---------------------------------------------------------------------------
2895 PROCEDURE cancel_statistics(sname IN VARCHAR2,
2896 oname IN VARCHAR2);
2897 -- Cancel the collection of conflict resolution statistics for the given
2898 -- replicated table.
2899 -- Input Parameters:
2900 -- sname: The name of the schema containing the table to be replicated.
2901 -- oname: The name of the table being replicated.
2902 ---------------------------------------------------------------------------
2903 procedure rename_shadow_column_group(sname in VARCHAR2,
2904 oname in VARCHAR2,
2905 new_col_group_name in VARCHAR2);
2906 -- renames shadow column group to a named column group
2907 -- Input Parameters:
2908 -- sname: the name of the schema containing the table
2909 -- oname: the name of the table with the column group to be renamed
2910 ---------------------------------------------------------------------------
2911 PROCEDURE streams_migration (
2912 gnames IN DBMS_UTILITY.NAME_ARRAY,
2913 file_location IN VARCHAR2,
2914 filename IN VARCHAR2);
2915 -- This procedure is called at the masterdef site to generate a script
2916 -- that can be run at all the master sites in the repgroup to migrate
2917 -- repgroup from a repcat environment to the Streams environment.
2918 -- Input Parameters:
2919 -- gnames: A list of repgroup to be migrated from repcat to Streams env.
2920 -- It is a PL/SQL index-by table of type DBMS_UTILITY.NAME_ARRAY,
2921 -- the index must be 1-based, increasing, dense, and need not
2922 -- be terminated by a NULL. The repgroups listed in gnames
2923 -- must have exactly the same masters.
2924 -- file_location: location of the generated script
2925 -- filename: name of the generated script
2926 ---------------------------------------------------------------------------
2927 ---
2928 --- #######################################################################
2929 --- #######################################################################
2930 --- INTERNAL PROCEDURES
2931 ---
2932 --- The following procedures provide internal functionality and should
2933 --- not be called directly. Invoking these procedures may corrupt your
2934 --- replication environment.
2935 ---
2936 --- #######################################################################
2937 --- #######################################################################
2938 PROCEDURE repcat_import_repschema;
2939
2940 FUNCTION repcat_import_repschema_string RETURN VARCHAR2;
2941
2942 PROCEDURE order_user_objects(owners IN dbms_repcat.varchar2s,
2943 objects IN dbms_repcat.varchar2s,
2944 types IN dbms_repcat.varchar2s,
2945 len IN BINARY_INTEGER,
2946 indices OUT dbms_utility.number_array);
2947
2948 PROCEDURE order_user_objects(owners IN VARCHAR2,
2949 objects IN VARCHAR2,
2950 types IN VARCHAR2,
2951 len IN BINARY_INTEGER,
2952 indices OUT dbms_utility.number_array);
2953
2954 PROCEDURE begin_flavor_definition(
2955 gname IN VARCHAR2,
2956 fname IN VARCHAR2);
2957
2958 PROCEDURE begin_flavor_definition(
2959 gname IN VARCHAR2,
2960 fname IN VARCHAR2,
2961 copy_fname IN VARCHAR2);
2962
2963 PROCEDURE add_object_to_flavor(
2964 gname IN VARCHAR2,
2965 fname IN VARCHAR2,
2966 sname IN VARCHAR2,
2967 oname IN VARCHAR2,
2968 type IN VARCHAR2,
2969 defer_validate IN BOOLEAN := FALSE );
2970
2971 PROCEDURE drop_object_from_flavor(
2972 gname IN VARCHAR2,
2973 fname IN VARCHAR2,
2974 sname IN VARCHAR2,
2975 oname IN VARCHAR2,
2976 type IN VARCHAR2,
2977 defer_validate IN BOOLEAN := FALSE );
2978
2979 PROCEDURE add_columns_to_flavor(
2980 gname IN VARCHAR2,
2981 fname IN VARCHAR2,
2982 sname IN VARCHAR2,
2983 oname IN VARCHAR2,
2984 cname_list IN VARCHAR2,
2985 defer_validate IN BOOLEAN := FALSE );
2986
2987 PROCEDURE add_columns_to_flavor(
2988 gname IN VARCHAR2,
2992 cname_table IN dbms_repcat.varchar2s,
2989 fname IN VARCHAR2,
2990 sname IN VARCHAR2,
2991 oname IN VARCHAR2,
2993 defer_validate IN BOOLEAN := FALSE );
2994
2995 PROCEDURE add_column_group_to_flavor(
2996 gname IN VARCHAR2,
2997 fname IN VARCHAR2,
2998 sname IN VARCHAR2,
2999 oname IN VARCHAR2,
3000 column_group IN VARCHAR2,
3001 defer_validate IN BOOLEAN := FALSE );
3002
3003 PROCEDURE drop_columns_from_flavor(
3004 gname IN VARCHAR2,
3005 fname IN VARCHAR2,
3006 sname IN VARCHAR2,
3007 oname IN VARCHAR2,
3008 cname_list IN VARCHAR2,
3009 defer_validate IN BOOLEAN := FALSE );
3010
3011 PROCEDURE drop_columns_from_flavor(
3012 gname IN VARCHAR2,
3013 fname IN VARCHAR2,
3014 sname IN VARCHAR2,
3015 oname IN VARCHAR2,
3016 cname_table IN dbms_repcat.varchar2s,
3017 defer_validate IN BOOLEAN := FALSE );
3018
3019 PROCEDURE drop_column_group_from_flavor(
3020 gname IN VARCHAR2,
3021 fname IN VARCHAR2,
3022 sname IN VARCHAR2,
3023 oname IN VARCHAR2,
3024 column_group IN VARCHAR2,
3025 defer_validate IN BOOLEAN := FALSE );
3026
3027 PROCEDURE validate_flavor_definition(
3028 gname IN VARCHAR2,
3029 fname IN VARCHAR2 );
3030
3031 PROCEDURE abort_flavor_definition(
3032 gname IN VARCHAR2,
3033 fname IN VARCHAR2 );
3034
3035 PROCEDURE publish_flavor_definition(
3036 gname IN VARCHAR2,
3037 fname IN VARCHAR2,
3038 skip_validate IN BOOLEAN := FALSE );
3039
3040 PROCEDURE obsolete_flavor_definition(
3041 gname IN VARCHAR2,
3042 fname IN VARCHAR2);
3043
3044 PROCEDURE purge_flavor_definition(
3045 gname IN VARCHAR2,
3046 fname IN VARCHAR2);
3047
3048 PROCEDURE validate_for_local_flavor(
3049 gname IN VARCHAR2,
3050 fname IN VARCHAR2,
3051 gowner IN VARCHAR2 := 'PUBLIC' );
3052
3053 PROCEDURE set_local_flavor(
3054 gname IN VARCHAR2,
3055 fname IN VARCHAR2,
3056 validate IN BOOLEAN := TRUE,
3057 gowner IN VARCHAR2 := 'PUBLIC' );
3058
3059 FUNCTION generate_flavor_name(
3060 gname IN VARCHAR2) RETURN VARCHAR2;
3061
3062
3063 --- #######################################################################
3064 --- #######################################################################
3065 --- DEPRECATED PROCEDURES
3066 ---
3067 --- The following procedures will soon obsolete due to the materialized
3068 --- view integration with snapshots. They are kept around for backwards
3069 --- compatibility purposes.
3070 ---
3071 --- #######################################################################
3072 --- #######################################################################
3073 PROCEDURE register_snapshot_repgroup(
3074 gname IN VARCHAR2,
3075 snapsite IN VARCHAR2,
3076 comment IN VARCHAR2 := NULL,
3077 rep_type IN NUMBER := reg_unknown,
3078 fname IN VARCHAR2 := NULL,
3079 gowner IN VARCHAR2 := 'PUBLIC');
3080
3081 PROCEDURE unregister_snapshot_repgroup(
3082 gname IN VARCHAR2,
3083 snapsite IN VARCHAR2,
3084 gowner IN VARCHAR2 := 'PUBLIC');
3085
3086 PROCEDURE comment_on_snapshot_repsites(
3087 gowner IN VARCHAR2,
3088 gname IN VARCHAR2,
3089 comment IN VARCHAR2);
3090
3091 PROCEDURE create_snapshot_repgroup(
3092 gname IN VARCHAR2,
3093 master IN VARCHAR2,
3094 comment IN VARCHAR2 := '',
3095 propagation_mode IN VARCHAR2 := 'ASYNCHRONOUS',
3096 fname IN VARCHAR2 := NULL,
3097 gowner IN VARCHAR2 := 'PUBLIC');
3098
3099 PROCEDURE drop_snapshot_repgroup(
3100 gname IN VARCHAR2,
3101 drop_contents IN BOOLEAN := FALSE,
3102 gowner IN VARCHAR2 := 'PUBLIC');
3103
3104 PROCEDURE refresh_snapshot_repgroup(
3105 gname IN VARCHAR2,
3106 drop_missing_contents IN BOOLEAN := FALSE,
3107 refresh_snapshots IN BOOLEAN := FALSE,
3108 refresh_other_objects IN BOOLEAN := FALSE,
3109 gowner IN VARCHAR2 := 'PUBLIC');
3110
3111 PROCEDURE switch_snapshot_master(
3112 gname IN VARCHAR2,
3113 master IN VARCHAR2,
3114 gowner IN VARCHAR2 := 'PUBLIC');
3115
3116 PROCEDURE create_snapshot_repobject(
3117 sname IN VARCHAR2,
3118 oname IN VARCHAR2,
3119 type IN VARCHAR2,
3120 ddl_text IN VARCHAR2 := '',
3121 comment IN VARCHAR2 := '',
3122 gname IN VARCHAR2 := '',
3123 gen_objs_owner IN VARCHAR2 := '',
3124 min_communication IN BOOLEAN := TRUE,
3125 generate_80_compatible IN BOOLEAN := TRUE,
3126 gowner IN VARCHAR2 := 'PUBLIC');
3127
3128 PROCEDURE generate_snapshot_support(
3129 sname IN VARCHAR2,
3130 oname IN VARCHAR2,
3131 type IN VARCHAR2,
3132 gen_objs_owner IN VARCHAR2 := '',
3133 min_communication IN BOOLEAN := TRUE,
3134 generate_80_compatible IN BOOLEAN := TRUE);
3135
3136 PROCEDURE drop_snapshot_repobject(
3137 sname IN VARCHAR2,
3138 oname IN VARCHAR2,
3139 type IN VARCHAR2,
3140 drop_objects IN BOOLEAN := FALSE);
3141
3142 PROCEDURE alter_snapshot_propagation(
3143 gname IN VARCHAR2,
3144 propagation_mode IN VARCHAR2,
3145 comment IN VARCHAR2 := '',
3146 gowner IN VARCHAR2 := 'PUBLIC');
3147
3148 END dbms_repcat;