1 package fnd_adg_manage AUTHID CURRENT_USER as
2 /* $Header: AFDGMGRS.pls 120.0 2010/03/01 11:20:05 rsanders noship $ */
3
4 /* fnd_adg_manage
5 ==============
6
7 This package is part of Active Data Guard [ADG ] support.
8
9 It is for INTERNAL use only and is NEVER referenced outside of
10 FND_ADG packages. It should never be called by product developers.
11
12 Documentation is intended only for developers maintaining this package.
13 */
14
15 /* validate_standby_to_primary
16 ===========================
17
18 This is a support function invoked by the RPC packages. It is a
19 runtime check that the database link resolves to the correct primary
20 database. It is a protection against DB link and TNS alias
21 tampering.
22 */
23
24 procedure validate_standby_to_primary
25 (p_err out nocopy number,
26 p_msg out nocopy varchar2,
27 p_once_per_session boolean default false);
28
29 /* validate_primary_private
30 ========================
31
32 This method is the RPC called invoked by validate_standby_to_primary.
33 Although private it of course must be in the spec. in order for the
34 RPC to work.
35 */
36
37 procedure validate_primary_private(p_dbid number, p_dbname varchar2,
38 p_slave_session_id out nocopy number,
39 p_sid number, p_serial number,
40 p_audsid number,p_is_true_standby boolean,
41 p_valid out nocopy number);
42
43 /* rpcDescriptor
44 =============
45
46 This is used in the RPC packages to record package information. The data
47 is used for runtime and compile time support.
48 */
49
50 type rpcDescriptor is record
51 ( owner fnd_adg_package.owner%type,
52 package_name fnd_adg_package.package_name%type,
53 rpc_package_name fnd_adg_package.rpc_package_name%type,
54 rpc_synonym_name fnd_adg_package.rpc_synonym_name%type,
55 method_name varchar2(30),
56 auto_tx_wrapper varchar2(10),
57 use_commit_wait_on_autotx varchar2(10)
58 );
59
60 /* raise_rpc_exec_error
61 ====================
62
63 This is used by the RPC packages to format are raise RPC runtime
64 errors.
65 */
66
67 procedure raise_rpc_exec_error(p_rpcDescriptor rpcDescriptor,
68 p_location varchar2,
69 p_additional_info varchar2 default null);
70
71 /* validate_rpc_timestamp
72 ======================
73
74 This is used by the RPC packages for runtime validation. It ensures
75 that the RPC package timestamp is ahead of the referencing package. This
76 should always be the case as the RPC spec. has an embedded constant
77 time string which ensures that the RPC spec is always compiled.
78
79 It is possible to disable this validation if you need to apply
80 a patch to the referencing package. See
81
82 fnd_adg_utility.set_control_options
83 ( ... p_runtime_validate_timestamp ... )
84
85 Howeever, a better solution is to just switch the rpc state off and on.
86 */
87
88 function validate_rpc_timestamp(p_rpcDescriptor rpcDescriptor) return boolean;
89
90 /* validate_rpc_synonym
91 ====================
92
93 This is used by the RPC packages for runtime validation. It checks that
94 the synonym used to invoke the remote package resolves to the same
95 link used by validate_standby_to_primary. This protects against
96 db link and TNS alias tampering.
97 */
98
99 function validate_rpc_synonym(p_rpcDescriptor rpcDescriptor) return boolean;
100
101 /* is_session_slave_to_standby
102 ===========================
103
104 Returns true if the session is the slave RPC session running
105 on primary. Used internally for simulation support - see
106 fnd_adg_support.
107 */
108
109 function is_session_slave_to_standby return boolean;
110
111 /* handle_rpc_debug
112 ================
113
114 This is used in the RPC packages to enable standby trace.
115
116 Currently only SQL_TRACE is supported. It is enabled via:
117
118 fnd_adg_utility.set_control_options
119 ( ... p_debug_rpc ... )
120
121 See fnd_adg_utility for further details.
122 */
123
124 procedure handle_rpc_debug(p_once_per_session boolean default true);
125
126 /* handle_slave_rpc_debug
127 ======================
128
129 This is used in the RPC packages to enable slave RPC trace - i.e.
130 the session running on the primary.
131
132 Currently only SQL_TRACE is supported. It is enabled via:
133
134 fnd_adg_utility.set_control_options
135 ( ... p_debug_slave_rpc ... )
136
137 See fnd_adg_utility for further details.
138
139 */
140
141 procedure handle_slave_rpc_debug(p_once_per_session boolean default true);
142
143 /* get_commit_wait_seq
144 ===================
145
146 This is used in the RPC packages to record the commit wait
147 sequence when commit-wait processing has been enabled. Used by the
148 RPC session.
149 */
150
151 function get_commit_wait_seq(p_rpcDescriptor rpcDescriptor) return number;
152
153 /* increment_commit_count
154 ======================
155
156 This is used in the RPC packages to increment the commit wait
157 count when commit-wait processing has been enabled. Used by the
158 slave RPC session.
159 */
160
161 procedure increment_commit_count(p_rpcDescriptor rpcDescriptor);
162
163 /* wait_for_commit_count
164 =====================
165
166 This is used in the RPC packages to wait for the next commit sequence
167 to arrive on the standby. Used by the RPC session.
168 */
169
170 function wait_for_commit_count(p_rpcDescriptor rpcDescriptor,
171 p_wait_seq number) return boolean;
172
173 /* boolean_to_char
174 ===============
175
176 Support function to convert boolean to Y|N.
177 */
178
179 function boolean_to_char(p_bool boolean) return varchar2;
180
181 /* invoke_standby_error_handler
182 ============================
183
184 This is used by the error handler trigger. It is the slave RPC
185 entry point to record read only errors - i.e. it is invoked as an
186 RPC.
187 */
188
189 procedure invoke_standby_error_handler(p_request_id number);
190
191 /* rpc_invoke_standby_error
192 ========================
193
194 This is used by the error handler trigger. It is the RPC entry point for
195 remote execution of invoke_standby_error_handler.
196 */
197
198 procedure rpc_invoke_standby_error ( p_request_id number);
199
200 end fnd_adg_manage;