Oracle9i Supplied PL/SQL Packages and Types Reference Release 2 (9.2) Part Number A96612-01 |
|
DBMS_LOGMNR_CDC_PUBLISH, 2 of 2
Through the DBMS_LOGMNR_CDC_PUBLISH
package, the publisher creates and maintains change sources, change sets, and change tables, and eventually drops them when they are no longer useful.
Note: To use the |
Table 26-1 describes the procedures in the DBMS_LOGMNR_CDC_PUBLISH
supplied package.
This procedure creates a change table in a specified schema.
The following syntax specifies columns and datatypes using a comma-delimited string.
DBMS_LOGMNR_CDC_PUBLISH.CREATE_CHANGE_TABLE ( owner IN VARCHAR2, change_table_name IN VARCHAR2, change_set_name IN VARCHAR2, source_schema IN VARCHAR2, source_table IN VARCHAR2, column_type_list IN VARCHAR2, capture_values IN VARCHAR2, rs_id IN CHAR, row_id IN CHAR, user_id IN CHAR, timestamp IN CHAR, object_id IN CHAR, source_colmap IN CHAR, target_colmap IN CHAR, options_string IN VARCHAR2);
INSERT
, UPDATE,
and DELETE)
made to a source table. A given change table can capture changes from only one source table.options_string
parameter. With the options_string
parameter, you can set any option that is valid for the CREATE TABLE
DDL statement.execute DBMS_CDC_PUBLISH.CREATE_CHANGE_TABLE(OWNER => 'cdc1', \ CHANGE_TABLE_NAME => 'emp_ct', \ CHANGE_SET_NAME => 'SYNC_SET', \ SOURCE_SCHEMA => 'scott', \ SOURCE_TABLE => 'emp', \ COLUMN_TYPE_LIST => 'empno number, ename varchar2(10), job varchar2(9), mgr number, hiredate date, deptno number', \ CAPTURE_VALUES => 'both', \ RS_ID => 'y', \ ROW_ID => 'n', \ USER_ID => 'n', \ TIMESTAMP => 'n', \ OBJECT_ID => 'n',\ SOURCE_COLMAP => 'n', \ TARGET_COLMAP => 'y', \ OPTIONS_STRING => NULL);
This procedure adds columns to, or drops columns from, an existing change table.
The following syntax specifies columns and datatypes as a comma-delimited list.
DBMS_LOGMNR_CDC_PUBLISH.ALTER_CHANGE_TABLE ( owner IN VARCHAR2, change_table_name IN VARCHAR2, operation IN VARCHAR2, column_list IN VARCHAR2, rs_id IN CHAR, row_id IN CHAR, user_id IN CHAR, timestamp IN CHAR, object_id IN CHAR, source_colmap IN CHAR, target_colmap IN CHAR);
ALTER_CHANGE_TABLE
procedure; these schema changes require separate calls.EXECUTE DBMS_LOGMNR_CDC_PUBLISH.ALTER_CHANGE_TABLE (OWNER => 'cdc1') \ CHANGE_TABLE_NAME => 'emp_ct' \ OPERATION => ADD \ ADD_COLUMN_LIST => '' \ RS_ID => 'Y' \ ROW_ID => 'N' \ USER_ID => 'N' \ TIMESTAMP => 'N' \ OBJECT_ID => 'N' \ SOURCE_COLMAP => 'N' \ TARGET_COLMAP => 'N');
This procedure allows a publisher to drop a subscriber view in the subscriber's schema.
Note: This procedure works the same way as the |
DBMS_LOGMNR_CDC_PUBLISH.DROP_SUBSCRIBER_VIEW ( subscription_handle IN NUMBER, source_schema IN VARCHAR2, source_table IN VARCHAR2)
DBMS_LOGMNR_CDC_SUBSCRIBE.DROP_SUBSCRIBER_VIEW
procedure.)DBMS_LOGMNR_CDC_SUBSCRIBE.PREPARE_SUBSCRIBER_VIEW
procedure.DBMS_LOGMNR_CDC_PUBLISH.DROP_SUBSCRIPTION
procedure.EXECUTE sys.DBMS_CDC_SUBSCRIBE.DROP_SUBSCRIBER_VIEW( \ SUBSCRIPTION_HANDLE =>:subhandle, \ SOURCE_SCHEMA =>'scott', \ SOURCE_TABLE => 'emp');
This procedure allows a publisher to drop a subscription that was created with a prior call to the DBMS_LOGMNR_CDC_SUBSCRIBE
.GET_SUBSCRIPTION_HANDLE procedure.
Note: This procedure works the same way as the |
DBMS_LOGMNR_CDC_PUBLISH.DROP_SUBSCRIPTION ( subscription_handle IN NUMBER)
Parameter | Description |
---|---|
subscription_handle |
Unique number of the subscription handle that was returned by a previous call to the |
DBMS_LOGMNR_CDC_SUBSCRIBE.DROP_SUBSCRIPTION
procedure.)DBMS_LOGMNR_CDC_PUBLISH.DROP_SUBSCRIBER_VIEW
procedure.EXECUTE DBMS_LOGMNR_CDC_PUBLISH.DROP_SUBSCRIPTION ( \ SUBSCRIPTION_HANDLE => :subhandle);
This procedure drops an existing change table.
DBMS_LOGMNR_CDC_PUBLISH.DROP_CHANGE_TABLE ( owner IN VARCHAR2, change_table_name IN VARCHAR2, force_flag IN CHAR)
EXECUTE DBMS_LOGMNR_CDC_PUBLISH.DROP_CHANGE_TABLE ( \ OWNER => 'cdc1', \ CHANGE_TABLE_NAME => 'emp_ct' \ FORCE_FLAG => 'N')
This procedure monitors change table usage by all subscriptions, determines which rows are no longer needed by subscriptions, and removes the unneeded rows to prevent change tables from growing endlessly.
DBMS_LOGMNR_CDC_PUBLISH.PURGE ( )
Only standard Oracle exceptions (for example, a privilege violation) are returned during a purge operation.
DBMS_LOGMNR_CDC_PUBLISH.PURGE
procedure runs, Change Data Capture performs partition maintenance automatically.EXECUTE DBMS_LOGMNR_CDC_PUBLISH.PURGE
|
Copyright © 2000, 2002 Oracle Corporation. All Rights Reserved. |
|