1 package dbms_repcat_instantiate AUTHID CURRENT_USER as
2
3 -------------------------
4 -- OVERVIEW
5 --
6 -- This package provides routines to instantiate deployment templates
7 -- and drop instantiations of a deployment template.
8
9 ------------------------
10 -- EXCEPTIONS
11
12 miss_refresh_template exception;
13 pragma exception_init(miss_refresh_template, -23438);
14 miss_refresh_template_num NUMBER := -23438;
15
16 miss_template_site exception;
17 pragma exception_init(miss_template_site, -23445);
18 miss_template_site_num NUMBER := -23445;
19
20 dupl_template_site exception;
21 pragma exception_init(dupl_template_site, -23446);
22 dupl_template_site_num NUMBER := -23446;
23
24 not_authorized exception;
25 pragma exception_init(not_authorized, -23471);
26 not_authorized_num NUMBER := -23471;
27
28 ----------------------------------------
29 -- CONSTANTS
30 --
31
32 -- For RepAPI offline instantiation
33 -- NOTE: if you make any changes here, you must change the
34 -- corresponding constants in dbmsrgt.sql
35 --
36 NO_TRACE_DUMP CONSTANT NUMBER := 0;
37 RESULTSET_THRESHOLD CONSTANT NUMBER := 32768;
38 LOB_THRESHOLD CONSTANT NUMBER := 32768;
39
40 -------------------------
41 -- PUBLIC PROCEDURES
42 --
43
44 procedure drop_site_instantiation(REFRESH_TEMPLATE_NAME in VARCHAR2,
45 SITE_NAME in VARCHAR2);
46
47 -- This procedure drops a previously instantiated deployment
48 -- template at a given site.
49 --
50 -- Note: this procedure does not physically remove the instantiated
51 -- template. This procedure makes the snapshots in the template
52 -- unable to be refreshed.
53 --
54 -- Arguments:
55 -- refresh_template_name: Name of the deployment template
56 -- site_name: name of the site where the template was previously
57 -- instantiated
58 -- Exceptions:
59 -- miss_refresh_template - deployment template does not exist
60 -- miss_template_site - template is not instantiated for this
61 -- site and connected user.
62
63
64 function instantiate_online(refresh_template_name in varchar2,
65 site_name in varchar2,
66 runtime_parm_id in number default -1e-130,
67 next_date in date default sysdate,
68 interval in varchar2 default 'SYSDATE+1',
69 use_default_gowner in boolean default TRUE)
70 return number;
71
72 -- The instantiate_online function creates the DDL required for
73 -- the online instantiation of a template. The results are stored
74 -- in the user_repcat_temp_output view.
75 --
76 -- Arguments:
77 -- refresh_template_name: Name of the deployment template.
78 -- site_name: id of runtime parameters associated with this
79 -- instantiation (optional)
80 -- next_date: next refresh date (optional)
81 -- interval: refresh interval (optional)
82 -- use_default_gowner: If true than the owner of any snapshot object
83 -- groups created will be owned by the default user, PUBLIC. Otherwise
84 -- the owner of snapshot object groups will be the user performing the
85 -- instantiation.
86 --
87 -- return value is a id used to access the generated template
88 -- definition in the user_repcat_temp_output table.
89 --
90 -- Exceptions:
91 -- miss_refresh_template - deployment template does not exist
92 -- dupl_template_site - template already instantiated at site
93 -- not_authorized - the connected user has not been authorized
94 -- to instantiate the template. Deployment templates can
95 -- only be instantiated by authorized user or as public
96 -- templates.
97
98
99 function instantiate_offline(refresh_template_name in varchar2,
100 site_name in varchar2,
101 runtime_parm_id in number default -1e-130,
102 next_date in date default sysdate,
103 interval in varchar2 default 'SYSDATE+1',
104 use_default_gowner in boolean default TRUE,
105 dest_dbversion in number default NULL)
106 return number;
107
108 -- The instantiate_ofline function creates the DDL required for
109 -- the offline instantiation of a template. The results are stored
110 -- in the user_repcat_temp_output view.
111 --
112 -- Arguments:
113 -- refresh_template_name: Name of the deployment template.
114 -- site_name: id of runtime parameters associated with this
115 -- instantiation (optional)
116 -- next_date: next refresh date (optional)
117 -- interval: refresh interval (optional)
118 -- use_default_gowner: If true than the owner of any snapshot object
119 -- groups created will be owned by the default user, PUBLIC. Otherwise
120 -- the owner of snapshot object groups will be the user performing the
121 -- instantiation.
122 -- dest_dbversion: database version of the site where template
123 -- will be instantiated. For example: 8.2, 8.1
124 -- default value of NULL indicates
125 -- that the local database compatibility will be used.
126 --
127 -- return value is a id used to access the generated template
128 -- definition in the user_repcat_temp_output table.
129 --
130 -- Exceptions:
131 -- miss_refresh_template - deployment template does not exist
132 -- dupl_template_site - template already instantiated at site
133 -- not_authorized - the connected user has not been authorized
134 -- to instantiate the template. Deployment templates can
135 -- only be instantiated by authorized user or as public
136 -- templates.
137 -- reftmplinvalidcomp - template can not be instantiate to database with
138 -- compatiblity is 8.0-
139
140 FUNCTION instantiate_offline_repapi(
141 refresh_template_name IN VARCHAR2,
142 offline_dirpath IN VARCHAR2 DEFAULT NULL,
143 site_id IN VARCHAR2 DEFAULT NULL,
144 master IN VARCHAR2 DEFAULT NULL,
145 url IN VARCHAR2 DEFAULT NULL,
146 ssl IN NUMBER DEFAULT 0,
147 trace_vector IN NUMBER
148 DEFAULT DBMS_REPCAT_INSTANTIATE.NO_TRACE_DUMP,
149 resultset_threshold IN NUMBER
150 DEFAULT DBMS_REPCAT_INSTANTIATE.RESULTSET_THRESHOLD,
151 lob_threshold IN NUMBER
152 DEFAULT DBMS_REPCAT_INSTANTIATE.LOB_THRESHOLD
153 )
154 RETURN NUMBER;
155
156 -- The instantiate_offline_repapi function performs a server side
157 -- offline instantiation of a repapi based template.
158 --
159 -- Arguments:
160 -- refresh_template_name - name of the template to offline instantiate
161 -- offline_dirpath - The target directory to create offline file
162 -- site_id - repapi site_id of the site instantiating for
163 -- master - an alias used for the URL by the JAVA REPAPI client
164 -- url - service name with which the JAVA REPAPI server is published
165 -- ssl - a boolean which determines whether SSL is to be used with the URL
166 -- trace_vector - trace level for debugging
167 -- resultset_threshold - buffer size for outputing result sets
168 -- lob_threshold - buffer size for outputing lob values
169
170 end dbms_repcat_instantiate;