46:
47: l_soln_comp_index VARCHAR2(250) := 'CS_KB_SETS_TL_N3';
48:
49: BEGIN
50: x_return_status := fnd_api.G_RET_STS_SUCCESS;
51:
52: -- Fetch out the list of IDs for all published solutions
53: OPEN all_published_solutions;
54: LOOP
67: p_conc_request_name => 'CS_KB_SYNC_SOLUTIONS_INDEX',
68: x_msg_error => x_msg_error,
69: x_return_status => x_return_status );
70:
71: IF x_return_status != fnd_api.G_RET_STS_SUCCESS THEN
72: EXIT;
73: END IF;
74:
75: x_return_status := fnd_api.G_RET_STS_SUCCESS;
71: IF x_return_status != fnd_api.G_RET_STS_SUCCESS THEN
72: EXIT;
73: END IF;
74:
75: x_return_status := fnd_api.G_RET_STS_SUCCESS;
76: */
77:
78: -- Check if all_published_solutions is notfound.
79: -- NOTE: this check should come at the end because for the last batch
91: WHEN OTHERS THEN
92: ROLLBACK; -- do not use savepoint because savepoint is cleared when commit.
93: x_msg_error := 'populate_set_index: '
94: ||fnd_message.GET_STRING('CS','CS_KB_C_UNEXP_ERR')||' '||SQLERRM;
95: x_return_status := fnd_api.G_RET_STS_ERROR;
96: END populate_set_index;
97:
98: /*
99: * Populate element text index.
105: )
106: IS
107: l_statement_comp_index VARCHAR2(250) := 'CS_KB_ELEMENTS_TL_N2';
108: BEGIN
109: x_return_status := fnd_api.G_RET_STS_SUCCESS;
110:
111: SAVEPOINT populate_element_index_SAV;
112:
113: -- We do not use bulk update in this case because the concurrent request
128: WHEN OTHERS THEN
129: ROLLBACK TO populate_element_index_SAV;
130: x_msg_error := 'populate_element_index: '
131: ||fnd_message.GET_STRING('CS','CS_KB_C_UNEXP_ERR')||' '||SQLERRM;
132: x_return_status := fnd_api.G_RET_STS_ERROR;
133: END populate_element_index;
134:
135:
136: /*
144: IS
145: index1 VARCHAR2(250) := 'CS_KB_SOLN_CAT_TL_N1';
146:
147: BEGIN
148: x_return_status := fnd_api.G_RET_STS_SUCCESS;
149: SAVEPOINT populate_soln_cat_index_SAV;
150: UPDATE /*+ parallel(t) */ cs_kb_soln_categories_tl t
151: SET t.name = t.name;
152:
162: WHEN OTHERS THEN
163: ROLLBACK TO populate_soln_cat_index_SAV;
164: x_msg_error := 'populate_sol_cat_index: '
165: ||fnd_message.GET_STRING('CS','CS_KB_C_UNEXP_ERR')||' '||SQLERRM;
166: x_return_status := fnd_api.G_RET_STS_ERROR;
167: END populate_soln_cat_index;
168:
169:
170: /*
177: )
178: IS
179: index3 VARCHAR2(250) := 'CS_FORUM_MESSAGES_TL_N4';
180: BEGIN
181: x_return_status := fnd_api.G_RET_STS_SUCCESS;
182:
183: SAVEPOINT populate_forum_index_SAV;
184:
185: UPDATE /*+ parallel(t) */ cs_forum_messages_tl t
196: WHEN OTHERS THEN
197: ROLLBACK TO populate_forum_index_SAV;
198: x_msg_error := 'populate_forum_index: '
199: ||fnd_message.GET_STRING('CS','CS_KB_C_UNEXP_ERR')||' '||SQLERRM;
200: x_return_status := fnd_api.G_RET_STS_ERROR;
201: END populate_forum_index;
202: -- 4321268_new_apis_eof
203: /*
204: * get_max_parallel_worker: get THE job_queue_processes value.
267:
268: l_update VARCHAR2(1) := 'Y';
269: BEGIN
270: -- initialize return status
271: x_return_status := fnd_api.G_RET_STS_ERROR;
272:
273: EXECUTE IMMEDIATE p_create_cmd;
274:
275: x_return_status := fnd_api.G_RET_STS_SUCCESS;
271: x_return_status := fnd_api.G_RET_STS_ERROR;
272:
273: EXECUTE IMMEDIATE p_create_cmd;
274:
275: x_return_status := fnd_api.G_RET_STS_SUCCESS;
276: EXCEPTION
277: WHEN OTHERS THEN
278: x_msg_error := 'do_create: '||p_index_name||' :'
279: ||fnd_message.GET_STRING('CS','CS_KB_C_UNEXP_ERR')||' '||SQLERRM;
276: EXCEPTION
277: WHEN OTHERS THEN
278: x_msg_error := 'do_create: '||p_index_name||' :'
279: ||fnd_message.GET_STRING('CS','CS_KB_C_UNEXP_ERR')||' '||SQLERRM;
280: x_return_status := fnd_api.G_RET_STS_ERROR;
281: END do_create;
282:
283:
284: /*
413: --4321268
414: || ' storage ' ||g_apps_short_name||'.CS_KB_INDEX_STORAGE '; -- <-command not yet completed
415: -- 4321268_eof
416:
417: x_return_status := fnd_api.G_RET_STS_ERROR;
418:
419: -- 4321268
420: IF nvl(pworker,0) = 0 THEN
421: -- Create index online
433: p_index_version => l_index_version,
434: x_msg_error => x_msg_error,
435: x_return_status => x_return_status );
436:
437: IF x_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
438: RAISE create_index_error;
439: END IF;
440:
441: -- 4321268
444: x_msg_error ,
445: x_return_status
446: );
447: END IF;
448: IF x_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
449: RAISE create_index_error;
450: END IF;
451: -- 4321268_eof
452:
450: END IF;
451: -- 4321268_eof
452:
453:
454: x_return_status := fnd_api.G_RET_STS_SUCCESS;
455:
456: EXCEPTION
457: WHEN create_index_error THEN
458: NULL; -- x_msg_error is set in the do_create api.
489: --4321268
490: || ' storage ' ||g_apps_short_name||'.CS_KB_INDEX_STORAGE '; -- <-command not yet completed
491: -- 4321268_eof
492:
493: x_return_status := fnd_api.G_RET_STS_ERROR;
494:
495: -- 4321268
496: IF nvl(pworker,0) = 0 THEN
497: -- Create index online
518: x_msg_error ,
519: x_return_status
520: );
521: END IF;
522: IF x_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
523: RAISE create_index_error;
524: END IF;
525: -- 4321268_eof
526:
523: RAISE create_index_error;
524: END IF;
525: -- 4321268_eof
526:
527: IF x_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
528: RAISE create_index_error;
529: END IF;
530: x_return_status := fnd_api.G_RET_STS_SUCCESS;
531:
526:
527: IF x_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
528: RAISE create_index_error;
529: END IF;
530: x_return_status := fnd_api.G_RET_STS_SUCCESS;
531:
532: EXCEPTION
533: WHEN create_index_error THEN
534: NULL; -- x_msg_error is set in the do_create api.
564: --4321268
565: || ' storage ' ||g_apps_short_name||'.CS_KB_INDEX_STORAGE '; -- <-command not yet completed
566: -- 4321268_eof
567:
568: x_return_status := fnd_api.G_RET_STS_ERROR;
569:
570: -- 4321268
571: IF nvl(pworker,0) = 0 THEN
572: -- Create index online
594: x_msg_error ,
595: x_return_status
596: );
597: END IF;
598: IF x_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
599: RAISE create_index_error;
600: END IF;
601: -- 4321268_eof
602: x_return_status := fnd_api.G_RET_STS_SUCCESS;
598: IF x_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
599: RAISE create_index_error;
600: END IF;
601: -- 4321268_eof
602: x_return_status := fnd_api.G_RET_STS_SUCCESS;
603:
604: EXCEPTION
605: WHEN create_index_error THEN
606: NULL; -- x_msg_error is set in the do_create api.
636: --4321268
637: || ' storage ' ||g_apps_short_name||'.CS_KB_INDEX_STORAGE '; -- <-command not yet completed
638: -- 4321268_eof
639:
640: x_return_status := fnd_api.G_RET_STS_ERROR;
641:
642: -- 4321268
643: IF nvl(pworker,0) = 0 THEN
644: -- Create index online
665: x_msg_error ,
666: x_return_status
667: );
668: END IF;
669: IF x_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
670: RAISE create_index_error;
671: END IF;
672: -- 4321268_eof
673: x_return_status := fnd_api.G_RET_STS_SUCCESS;
669: IF x_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
670: RAISE create_index_error;
671: END IF;
672: -- 4321268_eof
673: x_return_status := fnd_api.G_RET_STS_SUCCESS;
674:
675: EXCEPTION
676: WHEN create_index_error THEN
677: NULL; -- x_msg_error is set in the do_create api.
697:
698: l_total NUMBER := 0;
699:
700: BEGIN
701: x_return_status := fnd_api.G_RET_STS_ERROR;
702: IF p_index_name IS NULL THEN
703: RETURN;
704: END IF;
705:
712: drop_index := 'drop index '||g_cs_short_name||'.'||p_index_name||' force ';
713: EXECUTE IMMEDIATE drop_index;
714: END IF;
715:
716: x_return_status := fnd_api.G_RET_STS_SUCCESS;
717:
718: -- Logic to remove the index version in the
719: -- global system table.
720: EXCEPTION
750: l_num_batch_rows_updated NUMBER := 0;
751: l_reindex_batch_size NUMBER := 300;
752: l_mode VARCHAR2(10) := bmode;
753:
754: l_return_status VARCHAR2(1) := fnd_api.G_RET_STS_ERROR;
755: BEGIN
756:
757: -- Initialize some variables
758: retcode := 2; -- init return val to FAIL
770: -- At this point we can assume that we can safely drop the index.
771: Drop_Index(l_soln_comp_index,
772: errbuf,
773: l_return_status);
774: IF l_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
775: RAISE drop_index_error;
776: END IF;
777:
778: Create_Set_Index(pworker,
777:
778: Create_Set_Index(pworker,
779: errbuf,
780: l_return_status);
781: IF l_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
782: RAISE create_index_error;
783: END IF;
784: ELSIF l_mode = 'RC' THEN
785: -- Rebuild content cache
913: l_statement_comp_index VARCHAR2(250) := 'CS_KB_ELEMENTS_TL_N2';
914: l_num_batch_rows_updated NUMBER := 0;
915: l_reindex_batch_size NUMBER := 300;
916: l_mode VARCHAR2(10) := bmode;
917: l_return_status VARCHAR2(1) := fnd_api.G_RET_STS_ERROR;
918: BEGIN
919: -- Initialize some variables
920: retcode := 2; -- init return val to FAIL
921:
932: -- At this point we can assume that we can safely drop the index.
933: Drop_Index(l_statement_comp_index,
934: errbuf,
935: l_return_status);
936: IF l_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
937: RAISE drop_index_error;
938: END IF;
939:
940: Create_Element_Index(pworker,
939:
940: Create_Element_Index(pworker,
941: errbuf,
942: l_return_status);
943: IF l_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
944: RAISE create_index_error;
945: END IF;
946: ELSE
947: fnd_profile.get('CS_KB_REINDEX_BATCH_SIZE', l_reindex_batch_size);
1044:
1045: IS
1046: index3 VARCHAR2(250) := 'CS_FORUM_MESSAGES_TL_N4';
1047: l_mode VARCHAR2(10) := bmode;
1048: l_return_status VARCHAR2(1) := fnd_api.G_RET_STS_ERROR;
1049: BEGIN
1050: -- Initialize some variables
1051: retcode := 2; -- init return val to FAIL
1052:
1063: -- At this point we can assume that we can safely drop the index.
1064: Drop_Index(index3,
1065: errbuf,
1066: l_return_status);
1067: IF l_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
1068: RAISE drop_index_error;
1069: END IF;
1070:
1071: Create_Forum_Index(pworker,
1070:
1071: Create_Forum_Index(pworker,
1072: errbuf,
1073: l_return_status);
1074: IF l_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
1075: RAISE create_index_error;
1076: END IF;
1077: ELSE
1078: -- 4321268
1127: pworker IN NUMBER DEFAULT 0)
1128: IS
1129: index1 VARCHAR2(250) := 'CS_KB_SOLN_CAT_TL_N1';
1130: l_mode VARCHAR2(10) := bmode;
1131: l_return_status VARCHAR2(1) := fnd_api.G_RET_STS_ERROR;
1132:
1133: BEGIN
1134: retcode := 2;
1135:
1146: -- At this point we can assume that we can safely drop the index.
1147: Drop_Index(index1,
1148: errbuf,
1149: l_return_status);
1150: IF l_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
1151: RAISE drop_index_error;
1152: END IF;
1153:
1154: Create_Soln_Cat_Index(pworker,
1153:
1154: Create_Soln_Cat_Index(pworker,
1155: errbuf,
1156: l_return_status);
1157: IF l_return_status <> fnd_api.G_RET_STS_SUCCESS THEN
1158: RAISE create_index_error;
1159: END IF;
1160: ELSE
1161: -- 4321268
1404: RETCODE OUT NOCOPY NUMBER) AS
1405:
1406: BEGIN
1407: SAVEPOINT Update_Usage_Score_Sav;
1408: Cs_Knowledge_Audit_Pvt.Update_Solution_Usage_Score(p_commit =>fnd_api.g_true);
1409: errbuf := fnd_message.get_string('CS', 'CS_KB_C_SUCCESS');
1410: retcode := 0;
1411: EXCEPTION
1412: WHEN OTHERS THEN