Note:
Some of the PL/SQL procedures and functions des
cribed in the chapters in this part are overloaded. That is, two or more procedures or functions have the same name in a single packa
ge, but their formal parameters differ in number, order, or datatype family. When a procedure or function is overloaded, it is noted
in the description. See the PL/SQL User's Guide a
nd Reference for more information about overloading and for more information about PL/SQL in general.
|
Examples of Using Oracle's Replication Management API
To use Oracl
e's replication management API, you issue procedure or function calls using a query tool such as SQL*Plus or Enterprise Manager SQL W
orksheet. For example, the following call to the DBMS_REPCAT.CREATE_MASTER_REPOBJECT procedure creates a ne
w replicated table hr.employees in the hr_repg replication group:
B
EGIN
DBMS_REPCAT.CREATE_MASTER_REPOBJECT (
gname =>
'hr_repg',
type => 'TABLE',
oname => 'employees',
sname => 'hr',
use_existing_object => TRUE,
copy_rows => FALSE);
END;
/
To call a replication manag
ement API function, you must provide an environment to receive the return value of the function. For example, the following anonymous
PL/SQL block calls the DBMS_DEFER_SYS.DISABLED function in an IF statement.
BEGIN
IF DBMS_DEFER_SYS.DISABLED ('inst2') THEN
DBMS_OUTPUT.PUT_LINE('Propagation to INST2 is disabled.');
ELSE
DBMS_OUTPU
T.PUT_LINE('Propagation to INST2 is enabled.');
END IF;
END;
/
<
a name="39885">
Issues to Consider
When Using the Replication Management API
For many procedures and func
tions in the replication management API, there are important issues to consider. For example:
- Some procedures or functions are appropriate to call only from the master definition site in a multimas
ter configuration.
- To perform some administrative operations for master groups,
you must first suspend replication activity for the group before calling replication management API procedures and functions.
The order in which you call different procedures and functions in Oracle's replication
management API is extremely important. See the next section for more information about learning how to correctly issue replication ma
nagement calls.
The Replication Management Tool and the Replication Management API
The Replication Management tool uses the replication management API to perform most of its functions. Using the Replication Man
agement tool is much more convenient than issuing replication management API calls individually because the utility:
- Provides a GUI interface to type in and adjust API call parameters
- Automatically orders numerous, related API calls in the proper sequence
- Displays output returned from API calls in message boxes and error files
a>
An easy way to learn how to use Oracle's replication management API is to use the Replication Management tool's scr
ipting feature. When you start an administrative session with the Replication Management tool, turn scripting on. When you are finish
ed, turn scripting off and then review the script file. The script file contains all replication management API calls that were made
during the session. See the Replication Management tool's help for more information about its scripting feature.
Many of the datetime and inter
val datatypes have names that are too long to be used with the procedures and functions in the replication management API. Therefore,
you must use abbreviations for these datatypes instead of the full names. The following table lists each datatype and its abbreviati
on. No abbreviation is necessary for the DATE and TIMESTAMP datatypes.
For example, if
you want to use the DBMS_DEFER_QUERY.GET_datatype_ARG function to determine the value
of a TIMESTAMP LOCAL TIME ZONE argument in a deferred call, then you substitute
TSLTZ for datatype. Therefore, you run the DBMS_DEFER_QUERY.GET_TSLTZ_ARG function.
p>