1 package fnd_adg_support AUTHID CURRENT_USER as
2 /* $Header: AFDGSUPS.pls 120.3 2010/08/13 15:23:45 rsanders noship $ */
3
4 /* fnd_adg_support
5 ===============
6
7 This package is part of Active Data Guard [ADG ] support.
8
9 Although it is not an internal package, the only methods that
10 developers should ever need to call are:
11
12 is_standby
13 is_connstr_registered
14
15 The other methods are not required for RPC coding.
16 */
17
18 /* Constants
19 =========
20
21 Oracle Read Only Error number
22 */
23
24 C_READ_ONLY_ERROR constant number := 16000;
25
26 /* is_standby
27 ==========
28
29 This method is public and returns true if standby RPC code should
30 be executed:
31
32 - "if is_standby " to demarcate RPC calls.
33 - "if not is_standby " to demarcate code that should not run
34 on the standby process.
35
36 is_standby returning TRUE does not mean that the session is
37 running on a standby instance. In simulation mode, is_standby will
38 return TRUE on primary. Users need not be concerned about this -
39 they just need to follow the above coding rules.
40
41 So long as is_standby is used for demarcation that's all that matters.
42
43 Because of simulation mode, never use is_standby to determine whether
44 you are running on a standby instance.
45
46 If you ever need to do this, use is_true_standby.
47 */
48
49 function is_standby return boolean;
50
51 /* is_primary
52 ==========
53
54 Return true if running on a READ-WRITE primary database.
55 */
56
57 function is_primary return boolean;
58
59 /* is_connstr_registered
60 =====================
61
62 This function is for concurrent manager support. It checks
63 whether the given connect string is registered as either
64 a standby or simulated standby connection.
65
66 The default is to just check that the connect string has been
67 registered. This is acceptable for admin forms.
68
69 The concurrent managers should in addition check that the connection
70 string is valid. The manager can optionally check that the target
71 database is open.
72
73 p_check_valid - connection string must be valid and
74 ADG support enabled.
75 p_check_available - connection target [ database ] must be open.
76
77 */
78
79 function is_connstr_registered(p_connstr varchar2,
80 p_check_valid boolean default false,
81 p_check_available boolean default false)
82 return boolean;
83
84 function is_connstr_registered(p_connstr varchar2,
85 p_check_valid number,
86 p_check_available number)
87 return number;
88
89 /* is_rpc_from_standby
90 ===================
91
92 Returns true if the session is a slave RPC session
93 - wrapper for fnd_adg_manage.is_session_slave_to_standby
94 */
95
96
97 function is_rpc_from_standby return boolean;
98
99 /* log_unhandled_exception
100 =======================
101
102 Logs information to the trace file for unhandled exceptions.
103 */
104
105 procedure log_unhandled_exception(p_location varchar2,p_sqlerr varchar2);
106
107 /* is_true_standby
108 ===============
109
110 Returns true if running on a READ-ONLY standby database.
111 */
112
113 function is_true_standby return boolean;
114
115 /* handle_request_row_change
116 =========================
117
118 Invoked by INSERT/UPDATE row trigger on FND_CONCURRENT_REQUESTS.
119
120 Only the INSERT trigger will update the column values.
121
122 The values that can be changed are :
123
124 p_connstr1
125 p_nodename1
126 p_request_class_application_id
127 p_concurrent_request_class_id
128
129 which map to the corresponding table columns.
130 */
131
132 procedure handle_request_row_change(p_is_inserting boolean,
133 p_program_application_id number,
134 p_concurrent_program_id number,
135 p_connstr1 in out nocopy varchar2,
136 p_nodename1 in out nocopy varchar2,
137 p_request_class_application_id
138 in out nocopy number,
139 p_concurrent_request_class_id
140 in out nocopy number,
141 p_phase_code varchar2,
142 p_status_code varchar2
143 );
144
145 /* handle_concurrent_program
146 =========================
147
148 This procedure is for administrative updates to
149 FND_ADG_CONCURRENT_PROGRAM.
150
151 It is never called directly - always use
152 fnd_adg_utility.manage_concurrent_program
153 */
154
155 procedure handle_concurrent_program
156 (p_code number,
157 p_application_id number,
158 p_concurrent_program_id number,
159 p_has_run_on_primary boolean default null,
160 p_has_run_on_simulated_standby boolean default null,
161 p_run_on_standby boolean default null,
162 p_no_standby_failures number default null,
163 p_max_standby_failures number default null,
164 p_no_simulated_stdby_failures number default null,
165 p_max_simulated_stdby_failures number default null,
166 p_always_redirect_if_valid boolean default null,
167 p_use_automatic_redirection boolean default null
168 );
169
170 /* handle_standby_error
171 ====================
172
173 This procedure is used to record either standby or
174 simulation errors. It is called either as a result of an
175 RPC call [ standby error trigger ] or at the end of a
176 simulation run.
177 */
178
179 procedure handle_standby_error ( p_request_id number,
180 p_simulation boolean,
181 p_logoff boolean,
182 p_error_count number);
183
184 /* handle_standby_error
185 ====================
186
187 As per previous procedure except uses app/program ids
188 rather than request_id.
189 */
190
191 procedure handle_standby_error ( p_program_application_id number,
192 p_concurrent_program_id number,
193 p_simulation boolean,
194 p_logoff boolean,
195 p_error_count number);
196
197 end fnd_adg_support;