12: END IF;
13:
14: IF l_debug_flag = 'Y' THEN
15: g_debug_msg := 'Setting the table name to '||g_tab_name;
16: FII_UTIL.put_line('');
17: FII_UTIL.put_line(g_debug_msg);
18: END IF;
19:
20: end set_table_name; -- set_table_name
13:
14: IF l_debug_flag = 'Y' THEN
15: g_debug_msg := 'Setting the table name to '||g_tab_name;
16: FII_UTIL.put_line('');
17: FII_UTIL.put_line(g_debug_msg);
18: END IF;
19:
20: end set_table_name; -- set_table_name
21:
63:
64: set_table_name(p_table_name, p_owner);
65:
66: IF l_debug_flag = 'Y' THEN
67: FII_UTIL.put_line('');
68: FII_UTIL.put_line(parallel_var);
69: g_debug_msg := 'Check if index exists, if not then they have already been dropped';
70: FII_UTIL.put_line('');
71: FII_UTIL.put_line(g_debug_msg);
64: set_table_name(p_table_name, p_owner);
65:
66: IF l_debug_flag = 'Y' THEN
67: FII_UTIL.put_line('');
68: FII_UTIL.put_line(parallel_var);
69: g_debug_msg := 'Check if index exists, if not then they have already been dropped';
70: FII_UTIL.put_line('');
71: FII_UTIL.put_line(g_debug_msg);
72: END IF;
66: IF l_debug_flag = 'Y' THEN
67: FII_UTIL.put_line('');
68: FII_UTIL.put_line(parallel_var);
69: g_debug_msg := 'Check if index exists, if not then they have already been dropped';
70: FII_UTIL.put_line('');
71: FII_UTIL.put_line(g_debug_msg);
72: END IF;
73:
74: -- bug 4177221: added filter for SNAP$ indexes
67: FII_UTIL.put_line('');
68: FII_UTIL.put_line(parallel_var);
69: g_debug_msg := 'Check if index exists, if not then they have already been dropped';
70: FII_UTIL.put_line('');
71: FII_UTIL.put_line(g_debug_msg);
72: END IF;
73:
74: -- bug 4177221: added filter for SNAP$ indexes
75: /* select count(*) into l_index_exists from dba_indexes
105: IF l_debug_flag = 'Y' THEN
106: -- if no information exists to recreate them, provide message
107: IF (l_rows=0) THEN
108: g_debug_msg := 'Indexes do not exist and no information found to create them, so please create manually';
109: FII_UTIL.put_line('');
110: FII_UTIL.put_line(g_debug_msg);
111: ELSE
112: g_debug_msg := 'Index do not exist , so no need to drop';
113: FII_UTIL.put_line('');
106: -- if no information exists to recreate them, provide message
107: IF (l_rows=0) THEN
108: g_debug_msg := 'Indexes do not exist and no information found to create them, so please create manually';
109: FII_UTIL.put_line('');
110: FII_UTIL.put_line(g_debug_msg);
111: ELSE
112: g_debug_msg := 'Index do not exist , so no need to drop';
113: FII_UTIL.put_line('');
114: FII_UTIL.put_line(g_debug_msg);
109: FII_UTIL.put_line('');
110: FII_UTIL.put_line(g_debug_msg);
111: ELSE
112: g_debug_msg := 'Index do not exist , so no need to drop';
113: FII_UTIL.put_line('');
114: FII_UTIL.put_line(g_debug_msg);
115: END IF;
116: END IF;
117:
110: FII_UTIL.put_line(g_debug_msg);
111: ELSE
112: g_debug_msg := 'Index do not exist , so no need to drop';
113: FII_UTIL.put_line('');
114: FII_UTIL.put_line(g_debug_msg);
115: END IF;
116: END IF;
117:
118: else -- indexes are there and need to be dropped
118: else -- indexes are there and need to be dropped
119:
120: IF l_debug_flag = 'Y' THEN
121: g_debug_msg := 'Index exist , so save definition and drop indexes';
122: FII_UTIL.put_line('');
123: FII_UTIL.put_line(g_debug_msg);
124: END IF;
125:
126: -- store index names in table fii_indexes
119:
120: IF l_debug_flag = 'Y' THEN
121: g_debug_msg := 'Index exist , so save definition and drop indexes';
122: FII_UTIL.put_line('');
123: FII_UTIL.put_line(g_debug_msg);
124: END IF;
125:
126: -- store index names in table fii_indexes
127: g_debug_msg := 'First, delete from fii_indexes for ' || g_tab_name;
190: and index_name=rec2.index_name;
191:
192: IF l_debug_flag = 'Y' THEN
193: g_debug_msg := 'Index definition saved in fii_indexes';
194: FII_UTIL.put_line('');
195: FII_UTIL.put_line(g_debug_msg);
196: END IF;
197:
198:
191:
192: IF l_debug_flag = 'Y' THEN
193: g_debug_msg := 'Index definition saved in fii_indexes';
194: FII_UTIL.put_line('');
195: FII_UTIL.put_line(g_debug_msg);
196: END IF;
197:
198:
199: end loop;
210: and (index_name like 'I_SNAP$_FII_%' OR
211: index_name like 'U_SNAP$_FII_%');
212:
213: IF l_debug_flag = 'Y' and SQL%ROWCOUNT > 0 THEN
214: FII_UTIL.put_line('');
215: FII_UTIL.put_line(g_debug_msg);
216: END IF;
217:
218: --bug 3162509: should commit after the above delete
211: index_name like 'U_SNAP$_FII_%');
212:
213: IF l_debug_flag = 'Y' and SQL%ROWCOUNT > 0 THEN
214: FII_UTIL.put_line('');
215: FII_UTIL.put_line(g_debug_msg);
216: END IF;
217:
218: --bug 3162509: should commit after the above delete
219: commit;
230: close c1;
231:
232: IF l_debug_flag = 'Y' THEN
233: g_debug_msg := 'Indexes dropped';
234: FII_UTIL.put_line('');
235: FII_UTIL.put_line(g_debug_msg);
236: END IF;
237:
238: end if; -- check on index exists
231:
232: IF l_debug_flag = 'Y' THEN
233: g_debug_msg := 'Indexes dropped';
234: FII_UTIL.put_line('');
235: FII_UTIL.put_line(g_debug_msg);
236: END IF;
237:
238: end if; -- check on index exists
239:
241: when others then
242: Errbuf:= sqlerrm;
243: p_retcode:=sqlcode;
244: if l_debug_flag = 'Y' then
245: FII_UTIL.put_line('ERROR in drop_index--> ' || p_retcode||':'||Errbuf);
246: FII_UTIL.put_line('Phase--> ' || g_debug_msg);
247: end if;
248:
249: end drop_index; -- drop index procedure
242: Errbuf:= sqlerrm;
243: p_retcode:=sqlcode;
244: if l_debug_flag = 'Y' then
245: FII_UTIL.put_line('ERROR in drop_index--> ' || p_retcode||':'||Errbuf);
246: FII_UTIL.put_line('Phase--> ' || g_debug_msg);
247: end if;
248:
249: end drop_index; -- drop index procedure
250:
281: end;
282:
283: IF l_debug_flag = 'Y' THEN
284: IF (l_rows=0) THEN
285: FII_UTIL.put_line('');
286: ELSE
287: g_debug_msg := 'Creating Indexes';
288: FII_UTIL.put_line('');
289: FII_UTIL.put_line(g_debug_msg);
284: IF (l_rows=0) THEN
285: FII_UTIL.put_line('');
286: ELSE
287: g_debug_msg := 'Creating Indexes';
288: FII_UTIL.put_line('');
289: FII_UTIL.put_line(g_debug_msg);
290: END IF;
291: END IF;
292:
285: FII_UTIL.put_line('');
286: ELSE
287: g_debug_msg := 'Creating Indexes';
288: FII_UTIL.put_line('');
289: FII_UTIL.put_line(g_debug_msg);
290: END IF;
291: END IF;
292:
293: g_debug_msg := 'Create indexes using statements from fii_indexes...';
303:
304:
305: IF l_debug_flag = 'Y' THEN
306: g_debug_msg := 'Indexes created';
307: FII_UTIL.put_line('');
308: FII_UTIL.put_line(g_debug_msg);
309: END IF;
310:
311:
304:
305: IF l_debug_flag = 'Y' THEN
306: g_debug_msg := 'Indexes created';
307: FII_UTIL.put_line('');
308: FII_UTIL.put_line(g_debug_msg);
309: END IF;
310:
311:
312:
314: when others then
315: Errbuf:= sqlerrm;
316: p_retcode:=sqlcode;
317: if l_debug_flag = 'Y' then
318: FII_UTIL.put_line('ERROR in create_index--> ' ||p_retcode||':'||Errbuf);
319: FII_UTIL.put_line('Phase--> ' || g_debug_msg);
320: FII_UTIL.put_line('Failing Statement: ' || var5);
321: end if;
322:
315: Errbuf:= sqlerrm;
316: p_retcode:=sqlcode;
317: if l_debug_flag = 'Y' then
318: FII_UTIL.put_line('ERROR in create_index--> ' ||p_retcode||':'||Errbuf);
319: FII_UTIL.put_line('Phase--> ' || g_debug_msg);
320: FII_UTIL.put_line('Failing Statement: ' || var5);
321: end if;
322:
323:
316: p_retcode:=sqlcode;
317: if l_debug_flag = 'Y' then
318: FII_UTIL.put_line('ERROR in create_index--> ' ||p_retcode||':'||Errbuf);
319: FII_UTIL.put_line('Phase--> ' || g_debug_msg);
320: FII_UTIL.put_line('Failing Statement: ' || var5);
321: end if;
322:
323:
324: -- Index creation has failed. Drop any indexes already created.
323:
324: -- Index creation has failed. Drop any indexes already created.
325: IF l_debug_flag = 'Y' THEN
326: g_debug_msg := 'Index creation failed. Dropping any indexes that may have been created';
327: FII_UTIL.put_line('');
328: FII_UTIL.put_line(g_debug_msg);
329: END IF;
330:
331: open c2;
324: -- Index creation has failed. Drop any indexes already created.
325: IF l_debug_flag = 'Y' THEN
326: g_debug_msg := 'Index creation failed. Dropping any indexes that may have been created';
327: FII_UTIL.put_line('');
328: FII_UTIL.put_line(g_debug_msg);
329: END IF;
330:
331: open c2;
332: loop