DBA Data[Home] [Help]

PACKAGE: SYS.DBMS_CAPTURE_ADM

Source


1 PACKAGE dbms_capture_adm AUTHID CURRENT_USER AS
2 
3   -------------
4   -- CONSTANTS
5   infinite           CONSTANT NUMBER := 4294967295;
6 
7   -------------
8   -- EXCEPTIONS
9   create_capture_proc EXCEPTION;
10     PRAGMA exception_init(create_capture_proc, -26678);
11     create_capture_proc_num NUMBER := -26678;
12 
13   inv_sync_capture_proc EXCEPTION;
14     PRAGMA exception_init(inv_sync_capture_proc, -25338);
15     inv_sync_capture_proc_num   NUMBER := -25338;
16 
17   exp_sync_capture      EXCEPTION;
18     PRAGMA exception_init(exp_sync_capture, -25339);
19     exp_sync_capture_num   NUMBER := -25339;
20 
21   -- prototype procedure for starting a capture process
22   PROCEDURE start_capture(capture_name IN VARCHAR2);
23 
24   -- prototype procedure for stopping a capture process
25   PROCEDURE stop_capture(capture_name IN VARCHAR2,
26                          force        IN BOOLEAN DEFAULT FALSE);
27 
28   -- procedure for setting capture process parameters
29   -- value=NULL will set the parameter to its default value.
30   PROCEDURE set_parameter(capture_name IN VARCHAR2,
31                           parameter    IN VARCHAR2,
32                           value        IN VARCHAR2 DEFAULT NULL);
33 
34 /*----------------------------------------------------------------------------
35 NAME
36   create_capture()
37 FUNCTION
38   Creates capture process
39 PARAMETERS
40   queue_name                (IN) - name of the queue
41   capture_name              (IN) - name of the capture process
42   rule_set_name             (IN) - name of the positive rule set
43   start_scn                 (IN) - scn from which changes should be captured
44   source_database           (IN) - global name of the source database
45   use_database_link         (IN) - downstream capture: is db_link to source
46                                    available?
47   first_scn                 (IN) - scn from which dictionary dump starts
48   logfile_assignment        (IN) - type of logfile assignment: implicit or
49                                    explicit
50   negative_rule_set_name    (IN) - name of the negative rule set
51   capture_user              (IN) - capture user
52   checkpoint_retention_time (IN) - checkpoint retention time in # of days
53   start_time                (IN) - capture start time
54 NOTES
55   - replaces dbms_aqadm.add_publisher()
56   - this procedure commits
57 ----------------------------------------------------------------------------*/
58   PROCEDURE create_capture(
59     queue_name                IN VARCHAR2,
60     capture_name              IN VARCHAR2,
61     rule_set_name             IN VARCHAR2 DEFAULT NULL,
62     start_scn                 IN NUMBER   DEFAULT NULL,
63     source_database           IN VARCHAR2 DEFAULT NULL,
64     use_database_link         IN BOOLEAN  DEFAULT FALSE,
65     first_scn                 IN NUMBER   DEFAULT NULL,
66     logfile_assignment        IN VARCHAR2 DEFAULT 'IMPLICIT',
67     negative_rule_set_name    IN VARCHAR2 DEFAULT NULL,
68     capture_user              IN VARCHAR2 DEFAULT NULL,
69     checkpoint_retention_time IN NUMBER   DEFAULT 60,
70     start_time                IN TIMESTAMP DEFAULT NULL,
71     source_root_name          IN VARCHAR2 DEFAULT NULL,
72     source_container_name     IN VARCHAR2 DEFAULT NULL,
73     capture_class             IN VARCHAR2 DEFAULT 'streams');
74 
75 /*----------------------------------------------------------------------------
76 NAME
77   alter_capture()
78 FUNCTION
79   Alters capture process ruleset, start scn or capture_user
80 PARAMETERS
81   capture_name              (IN)
82   rule_set_name             (IN)
83   remove_rule_set           (IN)
84   start_scn                 (IN)
85   use_database_link         (IN)
86   use_dblink                (IN)
87   first_scn                 (IN)
88   negative_rule_set_name    (IN)
89   remove_negative_rule_set  (IN)
90   capture_user              (IN)
91   checkpoint_retention_time (IN)
92   start_time                (IN) - capture start time
93 NOTES
94   - replaces dbms_aqadm.alter_publisher()
95   - a NULL value for rule_set_name, negative_rule_set_name, start_scn or
96     capture_user means it is not altered
97   - remove_rule_set must be either TRUE or FALSE
98   - if remove_rule_set is TRUE, then the existing rule set will be removed
99   - remove_rule_set can be TRUE only if rule_set_name is NULL
100   - if remove_negative_rule_set is TRUE, then any existing negative rule
101     set will be removed
102   - remove_negative_rule_set can be TRUE only if negative_rule_set_name is NULL
103   - this procedure first commits any existing user transaction,
104     then commits all metadata changes
105 ----------------------------------------------------------------------------*/
106   PROCEDURE alter_capture(capture_name              IN VARCHAR2,
107                           rule_set_name             IN VARCHAR2  DEFAULT NULL,
108                           remove_rule_set           IN BOOLEAN   DEFAULT FALSE,
109                           start_scn                 IN NUMBER    DEFAULT NULL,
110                           use_database_link         IN BOOLEAN   DEFAULT NULL,
111                           first_scn                 IN NUMBER    DEFAULT NULL,
112                           negative_rule_set_name    IN VARCHAR2  DEFAULT NULL,
113                           remove_negative_rule_set  IN BOOLEAN   DEFAULT FALSE,
114                           capture_user              IN VARCHAR2  DEFAULT NULL,
115                           checkpoint_retention_time IN NUMBER    DEFAULT NULL,
116                           start_time                IN TIMESTAMP DEFAULT NULL);
117 
118 /*----------------------------------------------------------------------------
119 NAME
120   drop_capture()
121 FUNCTION
122   Drops capture process
123 PARAMETERS
124   capture_name          (IN)
125   drop_unused_rule_sets (IN)
126 NOTES
127   - replaces dbms_aqadm.remove_publisher()
128   - this procedure commits
129 ----------------------------------------------------------------------------*/
130   PROCEDURE drop_capture(capture_name IN VARCHAR2,
131                          drop_unused_rule_sets IN BOOLEAN DEFAULT FALSE);
132 
133 /*----------------------------------------------------------------------------
134 NAME
135   prepare_table_instantiation()
136 FUNCTION
137   procedure to prepare a table for instantiation at the source DB
138 PARAMETERS
139   supplemental_logging   - (IN)  supplemental logging level
140                                  ('NONE', 'KEYS', or 'ALL')
141 NOTES
142   KEYS means PRIMARY KEY, UNIQUE INDEX, and FOREIGN KEY levels combined.
143 ----------------------------------------------------------------------------*/
144   PROCEDURE prepare_table_instantiation(
145     table_name                IN VARCHAR2,
146     supplemental_logging      IN VARCHAR2 DEFAULT 'KEYS',
147     container                 IN VARCHAR2 DEFAULT 'CURRENT');
148 
149 
150 /*----------------------------------------------------------------------------
151 NAME
152   prepare_schema_instantiation()
153 FUNCTION
154   prepare a schema for instantiation
155 PARAMETERS
156   schema_name            - (IN)  the name of the schema to prepare
157   supplemental_logging   - (IN)  supplemental logging level
158                                  ('NONE', 'KEYS', or 'ALL')
159 NOTES
160   KEYS means PRIMARY KEY, UNIQUE INDEX, and FOREIGN KEY levels combined.
161 ----------------------------------------------------------------------------*/
162   PROCEDURE prepare_schema_instantiation(
163     schema_name               IN VARCHAR2,
164     supplemental_logging      IN VARCHAR2 DEFAULT 'KEYS',
165     container                 IN VARCHAR2 DEFAULT 'CURRENT');
166 
167 /*----------------------------------------------------------------------------
168 NAME
169   prepare_global_instantiation()
170 FUNCTION
171   prepare a database for instantiation
172 PARAMETERS
173   supplemental_logging   - (IN)  supplemental logging level
174                                  ('NONE', 'KEYS', or 'ALL')
175 NOTES
176   KEYS means PRIMARY KEY, UNIQUE INDEX, and FOREIGN KEY levels combined.
177 ----------------------------------------------------------------------------*/
178   PROCEDURE prepare_global_instantiation(
179     supplemental_logging       IN VARCHAR2 DEFAULT 'KEYS',
180     container                  IN VARCHAR2 DEFAULT 'CURRENT');
181 
182 /*----------------------------------------------------------------------------
183 NAME
184   abort_table_instantiation()
185 FUNCTION
186   undo prepare_table_instantiation
187 PARAMETERS
188   table_name   - (IN)  the table name to abort the prepare
189 NOTES
190 ----------------------------------------------------------------------------*/
191   PROCEDURE abort_table_instantiation(table_name IN VARCHAR2,
192                           container IN VARCHAR2 DEFAULT 'CURRENT');
193 
194 /*----------------------------------------------------------------------------
195 NAME
196   abort_schema_instantiation()
197 FUNCTION
198   undo prepare_schema_instantiation
199 PARAMETERS
200   schema_name   - (IN)  the schema name to abort the prepare
201 NOTES
202 ----------------------------------------------------------------------------*/
203   PROCEDURE abort_schema_instantiation(schema_name IN VARCHAR2,
204                           container IN VARCHAR2 DEFAULT 'CURRENT');
205 
206 /*----------------------------------------------------------------------------
207 NAME
208   abort_global_instantiation()
209 FUNCTION
210   undo prepare_global_instantiation
211 PARAMETERS
212 NOTES
213 ----------------------------------------------------------------------------*/
214   PROCEDURE abort_global_instantiation(
215                           container IN VARCHAR2 DEFAULT 'CURRENT');
216 
217   PROCEDURE include_extra_attribute(
218                           capture_name        IN VARCHAR2,
219                           attribute_name      IN VARCHAR2,
220                           include             IN BOOLEAN DEFAULT TRUE);
221 
222   -- procedure for obtaining dictionary dump at the source database
223   PROCEDURE build;
224 
225   -- procedure for obtaining dictionary dump at the source database
226   PROCEDURE build (first_scn OUT NUMBER);
227 
228 /*----------------------------------------------------------------------------
229 NAME
230   create_sync_capture()
231 FUNCTION
232   Creates sync capture process. If the specified capture_name is
233   already being used by an existing synchronous or asynchronous capture,
234   then an error will be raised.
235 PARAMETERS
236   queue_name                (IN) - name of the queue
237   capture_name              (IN) - name of the sync capture process
238   rule_set_name             (IN) - name of the positive rule set
239   capture_user              (IN) - capture user
240 NOTES
241   - this procedure commits
242   - A valid rule_set_name must be specified
243 ----------------------------------------------------------------------------*/
244   PROCEDURE create_sync_capture(
245     queue_name                IN VARCHAR2,
246     capture_name              IN VARCHAR2,
247     rule_set_name             IN VARCHAR2,
248     capture_user              IN VARCHAR2 DEFAULT NULL);
249 
250 /*----------------------------------------------------------------------------
251 NAME
252   alter_sync_capture()
253 FUNCTION
254   Alters sync capture process ruleset or capture_user
255 PARAMETERS
256   capture_name              (IN) - name of the sync capture process
257   rule_set_name             (IN) - name of the positive rule set
258   capture_user              (IN) - capture user
259 NOTES
260   - capture_name must be a sync capture; otherwise, an error will be
261     raised.
262   - a NULL value for rule_set_name or capture_user means it is not altered
263   - this procedure first commits any existing user transaction,
264     then commits all metadata changes
265 ----------------------------------------------------------------------------*/
266   PROCEDURE alter_sync_capture(capture_name  IN VARCHAR2,
267                           rule_set_name             IN VARCHAR2  DEFAULT NULL,
268                           capture_user              IN VARCHAR2  DEFAULT NULL);
269 
270 /*----------------------------------------------------------------------------
271 NAME
272   prepare_sync_instantiation()
273 FUNCTION
274   procedure to prepare a list of tables for instantiation at the source DB
275 PARAMETERS
276   table_names   - (IN)  - list of comma-separated table names
277 RETURNS
278   The instantiation SCN
279 ----------------------------------------------------------------------------*/
280   FUNCTION prepare_sync_instantiation(
281     table_names    IN VARCHAR2) RETURN NUMBER;
282 
283 /*----------------------------------------------------------------------------
284 NAME
285   abort_sync_instantiation()
286 FUNCTION
287   undo prepare_sync_instantiation
288 PARAMETERS
289   table_name   - (IN)  the table name to abort the prepare
290 NOTES
291 ----------------------------------------------------------------------------*/
292   PROCEDURE abort_sync_instantiation(table_names IN VARCHAR2);
293 
294 /*----------------------------------------------------------------------------
295 NAME
296   prepare_sync_instantiation()
297 FUNCTION
298   procedure to prepare a list of tables for instantiation at the source DB
299 PARAMETERS
300   table_names  - (IN)  - array of table names
301 RETURNS
302   The instantiation SCN
303 ----------------------------------------------------------------------------*/
304   FUNCTION prepare_sync_instantiation(
305     table_names   IN DBMS_UTILITY.UNCL_ARRAY) RETURN NUMBER;
306 
307 /*----------------------------------------------------------------------------
308 NAME
309   abort_sync_instantiation()
310 FUNCTION
311   undo prepare_sync_instantiation
312 PARAMETERS
313   table_name   - (IN)  the table name to abort the prepare
314 NOTES
315 ----------------------------------------------------------------------------*/
316   PROCEDURE abort_sync_instantiation(table_names IN DBMS_UTILITY.UNCL_ARRAY);
317 
318 END dbms_capture_adm;