1: PACKAGE body MGMT_DB_LL_METRICS AS
2:
3: g_config_handle UTL_FILE.FILE_TYPE := NULL;
4: g_version_category VARCHAR2(10) := NULL;
5:
6: g_dbID v$database.DBID%TYPE := NULL;
7: g_db_version v$instance.version%TYPE := NULL;
97: Write em_error record
98: */
99: PROCEDURE write_error(p_error_msg VARCHAR2) IS
100: BEGIN
101: UTL_FILE.PUT_LINE(g_config_handle,'em_error=' || p_error_msg);
102: UTL_FILE.FFLUSH(g_config_handle);
103: END write_error;
104:
105:
98: */
99: PROCEDURE write_error(p_error_msg VARCHAR2) IS
100: BEGIN
101: UTL_FILE.PUT_LINE(g_config_handle,'em_error=' || p_error_msg);
102: UTL_FILE.FFLUSH(g_config_handle);
103: END write_error;
104:
105:
106: /*
111: instance_name in VARCHAR2 default null,
112: cell_name in VARCHAR2 default null )
113: IS
114: BEGIN
115: UTL_FILE.PUT( g_config_handle, metric );
116: IF instance_name is not NULL THEN
117: UTL_FILE.PUT( g_config_handle, INSTANCE_DELIMITER||instance_name);
118: END IF;
119: IF cell_name is not NULL THEN
113: IS
114: BEGIN
115: UTL_FILE.PUT( g_config_handle, metric );
116: IF instance_name is not NULL THEN
117: UTL_FILE.PUT( g_config_handle, INSTANCE_DELIMITER||instance_name);
118: END IF;
119: IF cell_name is not NULL THEN
120: UTL_FILE.PUT( g_config_handle, CELL_DELIMITER||cell_name);
121: END IF;
116: IF instance_name is not NULL THEN
117: UTL_FILE.PUT( g_config_handle, INSTANCE_DELIMITER||instance_name);
118: END IF;
119: IF cell_name is not NULL THEN
120: UTL_FILE.PUT( g_config_handle, CELL_DELIMITER||cell_name);
121: END IF;
122: UTL_FILE.PUT_LINE(g_config_handle,marker);
123: END put_metric_marker;
124:
118: END IF;
119: IF cell_name is not NULL THEN
120: UTL_FILE.PUT( g_config_handle, CELL_DELIMITER||cell_name);
121: END IF;
122: UTL_FILE.PUT_LINE(g_config_handle,marker);
123: END put_metric_marker;
124:
125:
126: /*
156: l_status := DBMS_SQL.EXECUTE (l_em_result_cur);
157:
158: LOOP
159: exit when (dbms_sql.fetch_rows(l_em_result_cur) <= 0);
160: UTL_FILE.PUT( g_config_handle, 'em_result=');
161: FOR i IN 1 .. l_col_cnt LOOP
162: IF i != 1 THEN
163: UTL_FILE.PUT( g_config_handle, separator);
164: END IF;
159: exit when (dbms_sql.fetch_rows(l_em_result_cur) <= 0);
160: UTL_FILE.PUT( g_config_handle, 'em_result=');
161: FOR i IN 1 .. l_col_cnt LOOP
162: IF i != 1 THEN
163: UTL_FILE.PUT( g_config_handle, separator);
164: END IF;
165: dbms_sql.column_value( l_em_result_cur, i, l_columnValue );
166: /* replace seperators with escaped separators */
167: l_columnValue := replace(l_columnValue,'#','##');
165: dbms_sql.column_value( l_em_result_cur, i, l_columnValue );
166: /* replace seperators with escaped separators */
167: l_columnValue := replace(l_columnValue,'#','##');
168: l_columnValue := replace(l_columnValue,separator,'#'|| separator);
169: UTL_FILE.PUT( g_config_handle, l_columnValue );
170: END LOOP;
171: UTL_FILE.NEW_LINE(g_config_handle );
172: END LOOP;
173:
167: l_columnValue := replace(l_columnValue,'#','##');
168: l_columnValue := replace(l_columnValue,separator,'#'|| separator);
169: UTL_FILE.PUT( g_config_handle, l_columnValue );
170: END LOOP;
171: UTL_FILE.NEW_LINE(g_config_handle );
172: END LOOP;
173:
174: dbms_sql.close_cursor(l_em_result_cur);
175:
173:
174: dbms_sql.close_cursor(l_em_result_cur);
175:
176: EXCEPTION
177: WHEN UTL_FILE.INVALID_FILEHANDLE
178: OR UTL_FILE.INVALID_OPERATION
179: OR UTL_FILE.WRITE_ERROR THEN
180: IF DBMS_SQL.IS_OPEN(l_em_result_cur) = TRUE THEN
181: dbms_sql.close_cursor(l_em_result_cur);
174: dbms_sql.close_cursor(l_em_result_cur);
175:
176: EXCEPTION
177: WHEN UTL_FILE.INVALID_FILEHANDLE
178: OR UTL_FILE.INVALID_OPERATION
179: OR UTL_FILE.WRITE_ERROR THEN
180: IF DBMS_SQL.IS_OPEN(l_em_result_cur) = TRUE THEN
181: dbms_sql.close_cursor(l_em_result_cur);
182: END IF;
175:
176: EXCEPTION
177: WHEN UTL_FILE.INVALID_FILEHANDLE
178: OR UTL_FILE.INVALID_OPERATION
179: OR UTL_FILE.WRITE_ERROR THEN
180: IF DBMS_SQL.IS_OPEN(l_em_result_cur) = TRUE THEN
181: dbms_sql.close_cursor(l_em_result_cur);
182: END IF;
183: RAISE;
185: IF DBMS_SQL.IS_OPEN(l_em_result_cur) = TRUE THEN
186: dbms_sql.close_cursor(l_em_result_cur);
187: END IF;
188: /*
189: On any non-utl file exceptions, log as em_error
190: for the metric.
191: */
192: write_error('SQLERRM: ' || SQLERRM || ' SQLCODE: ' || SQLCODE);
193: END;
205: put_metric_marker(METRIC_BEGIN_MARKER,metric,instance_name, cell_name);
206: write_results(query,separator);
207: put_metric_marker(METRIC_END_MARKER,metric,instance_name, cell_name);
208: l_end_done := TRUE;
209: UTL_FILE.FFLUSH(g_config_handle);
210: EXCEPTION
211: WHEN OTHERS THEN
212: IF NOT l_end_done THEN
213: put_metric_marker(METRIC_END_MARKER,metric,instance_name, cell_name);
210: EXCEPTION
211: WHEN OTHERS THEN
212: IF NOT l_end_done THEN
213: put_metric_marker(METRIC_END_MARKER,metric,instance_name, cell_name);
214: UTL_FILE.FFLUSH(g_config_handle);
215: END IF;
216: RAISE;
217: END write_metric;
218:
525: END;
526:
527: BEGIN
528: put_metric_marker(METRIC_BEGIN_MARKER,'db_scnInfo',null,null);
529: UTL_FILE.PUT_LINE( g_config_handle,
530: 'em_result=' || l_current_scn ||'|'|| l_headroom ||'|'|| l_growth_24hrs ||'|'|| l_scn_calls ||'|'|| l_dblink_out ||
531: '|'|| l_dblink_in ||'|'|| l_max_jump ||'|'|| l_max_jump_time ||'|'|| l_created ||'|'|| l_reject_thresh );
532:
533: put_metric_marker(METRIC_END_MARKER,'db_scnInfo',null,null);
531: '|'|| l_dblink_in ||'|'|| l_max_jump ||'|'|| l_max_jump_time ||'|'|| l_created ||'|'|| l_reject_thresh );
532:
533: put_metric_marker(METRIC_END_MARKER,'db_scnInfo',null,null);
534: l_end_done := TRUE;
535: UTL_FILE.FFLUSH(g_config_handle);
536: EXCEPTION
537: WHEN OTHERS THEN
538: IF NOT l_end_done THEN
539: put_metric_marker(METRIC_END_MARKER,'db_scnInfo',null,null);
536: EXCEPTION
537: WHEN OTHERS THEN
538: IF NOT l_end_done THEN
539: put_metric_marker(METRIC_END_MARKER,'db_scnInfo',null,null);
540: UTL_FILE.FFLUSH(g_config_handle);
541: END IF;
542: RAISE;
543: END;
544: END collect_db_scnInfo;
2630: l_comp_cnt NUMBER;
2631: l_checkXMLdb VARCHAR2(500);
2632: BEGIN
2633: select value into l_db_characterset from NLS_DATABASE_PARAMETERS where parameter = 'NLS_CHARACTERSET';
2634: UTL_FILE.PUT_LINE(g_config_handle,'META_VER=' || ORACLE_DATABASE_META_VER);
2635: UTL_FILE.PUT_LINE(g_config_handle,'TIMESTAMP=' || TO_CHAR(sysdate,'yyyy-mm-dd hh24:mi:ss'));
2636: UTL_FILE.PUT_LINE(g_config_handle,'NLS_CHARACTERSET=' || l_db_characterset);
2637: -- If 11+, check for XML DB before calling UTL_INADDR package, otherwise go ahead
2638: select LPAD(version,10,'0') into l_vers from v$instance;
2631: l_checkXMLdb VARCHAR2(500);
2632: BEGIN
2633: select value into l_db_characterset from NLS_DATABASE_PARAMETERS where parameter = 'NLS_CHARACTERSET';
2634: UTL_FILE.PUT_LINE(g_config_handle,'META_VER=' || ORACLE_DATABASE_META_VER);
2635: UTL_FILE.PUT_LINE(g_config_handle,'TIMESTAMP=' || TO_CHAR(sysdate,'yyyy-mm-dd hh24:mi:ss'));
2636: UTL_FILE.PUT_LINE(g_config_handle,'NLS_CHARACTERSET=' || l_db_characterset);
2637: -- If 11+, check for XML DB before calling UTL_INADDR package, otherwise go ahead
2638: select LPAD(version,10,'0') into l_vers from v$instance;
2639: IF l_vers >= '11.0.0.0.0' THEN
2632: BEGIN
2633: select value into l_db_characterset from NLS_DATABASE_PARAMETERS where parameter = 'NLS_CHARACTERSET';
2634: UTL_FILE.PUT_LINE(g_config_handle,'META_VER=' || ORACLE_DATABASE_META_VER);
2635: UTL_FILE.PUT_LINE(g_config_handle,'TIMESTAMP=' || TO_CHAR(sysdate,'yyyy-mm-dd hh24:mi:ss'));
2636: UTL_FILE.PUT_LINE(g_config_handle,'NLS_CHARACTERSET=' || l_db_characterset);
2637: -- If 11+, check for XML DB before calling UTL_INADDR package, otherwise go ahead
2638: select LPAD(version,10,'0') into l_vers from v$instance;
2639: IF l_vers >= '11.0.0.0.0' THEN
2640: l_checkXMLdb :=
2647: END IF;
2648: IF l_comp_cnt > 0 THEN
2649: -- wrap with exception block
2650: BEGIN
2651: UTL_FILE.PUT_LINE(g_config_handle,'IP_ADDRESS=' || UTL_INADDR.GET_HOST_ADDRESS);
2652: UTL_FILE.PUT_LINE(g_config_handle,'HOSTNAME=' || UTL_INADDR.GET_HOST_NAME);
2653: EXCEPTION
2654: WHEN OTHERS THEN NULL;
2655: END;
2648: IF l_comp_cnt > 0 THEN
2649: -- wrap with exception block
2650: BEGIN
2651: UTL_FILE.PUT_LINE(g_config_handle,'IP_ADDRESS=' || UTL_INADDR.GET_HOST_ADDRESS);
2652: UTL_FILE.PUT_LINE(g_config_handle,'HOSTNAME=' || UTL_INADDR.GET_HOST_NAME);
2653: EXCEPTION
2654: WHEN OTHERS THEN NULL;
2655: END;
2656: END IF;
2661: */
2662: PROCEDURE write_file_footer
2663: IS
2664: BEGIN
2665: UTL_FILE.PUT_LINE(g_config_handle,'_CCR_EOF_');
2666: END;
2667:
2668:
2669: /*
2682: ' select instance_name from v$asm_client) ' ||
2683: ' order by instance_name desc) ' ||
2684: ' where rownum = 1 ' into l_asm_instance_name;
2685: IF l_asm_instance_name != ' ' THEN
2686: UTL_FILE.PUT_LINE(g_config_handle,'OSMInstance=' || l_asm_instance_name);
2687: END IF;
2688: END IF;
2689:
2690: collect_db_init_params;
2733: end if;
2734:
2735: write_file_footer();
2736:
2737: UTL_FILE.FFLUSH(g_config_handle);
2738:
2739: END collect_config_metrics_impl;
2740:
2741: /*
2752:
2753: g_version_category := get_version_category();
2754: IF g_version_category != NOT_SUPPORTED_VERSION THEN
2755: BEGIN
2756: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name(),'W',32767);
2757: EXCEPTION
2758: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2759: UTL_FILE.INVALID_PATH OR
2760: UTL_FILE.INVALID_OPERATION OR
2754: IF g_version_category != NOT_SUPPORTED_VERSION THEN
2755: BEGIN
2756: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name(),'W',32767);
2757: EXCEPTION
2758: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2759: UTL_FILE.INVALID_PATH OR
2760: UTL_FILE.INVALID_OPERATION OR
2761: UTL_FILE.WRITE_ERROR THEN
2762: -- Just bail out, we cannot open or write to the ll file(s)
2755: BEGIN
2756: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name(),'W',32767);
2757: EXCEPTION
2758: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2759: UTL_FILE.INVALID_PATH OR
2760: UTL_FILE.INVALID_OPERATION OR
2761: UTL_FILE.WRITE_ERROR THEN
2762: -- Just bail out, we cannot open or write to the ll file(s)
2763: RETURN;
2756: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name(),'W',32767);
2757: EXCEPTION
2758: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2759: UTL_FILE.INVALID_PATH OR
2760: UTL_FILE.INVALID_OPERATION OR
2761: UTL_FILE.WRITE_ERROR THEN
2762: -- Just bail out, we cannot open or write to the ll file(s)
2763: RETURN;
2764: END;
2757: EXCEPTION
2758: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2759: UTL_FILE.INVALID_PATH OR
2760: UTL_FILE.INVALID_OPERATION OR
2761: UTL_FILE.WRITE_ERROR THEN
2762: -- Just bail out, we cannot open or write to the ll file(s)
2763: RETURN;
2764: END;
2765:
2768: CHECK_IS_CDB;
2769:
2770: MGMT_DB_LL_METRICS.collect_config_metrics_impl;
2771:
2772: UTL_FILE.FCLOSE(g_config_handle);
2773: END IF;
2774: EXCEPTION
2775: WHEN OTHERS THEN
2776: IF UTL_FILE.IS_OPEN (g_config_handle) = TRUE THEN
2772: UTL_FILE.FCLOSE(g_config_handle);
2773: END IF;
2774: EXCEPTION
2775: WHEN OTHERS THEN
2776: IF UTL_FILE.IS_OPEN (g_config_handle) = TRUE THEN
2777: UTL_FILE.FCLOSE(g_config_handle);
2778: END IF;
2779: g_config_handle := null;
2780: g_version_category := NULL;
2773: END IF;
2774: EXCEPTION
2775: WHEN OTHERS THEN
2776: IF UTL_FILE.IS_OPEN (g_config_handle) = TRUE THEN
2777: UTL_FILE.FCLOSE(g_config_handle);
2778: END IF;
2779: g_config_handle := null;
2780: g_version_category := NULL;
2781: -- Raise exception only if explicitly asked for, by passing TRUE
2800:
2801: g_version_category := get_version_category();
2802: IF g_version_category != NOT_SUPPORTED_VERSION THEN
2803: BEGIN
2804: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name('.ll-stat'),'W',32767);
2805: EXCEPTION
2806: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2807: UTL_FILE.INVALID_PATH OR
2808: UTL_FILE.INVALID_OPERATION OR
2802: IF g_version_category != NOT_SUPPORTED_VERSION THEN
2803: BEGIN
2804: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name('.ll-stat'),'W',32767);
2805: EXCEPTION
2806: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2807: UTL_FILE.INVALID_PATH OR
2808: UTL_FILE.INVALID_OPERATION OR
2809: UTL_FILE.WRITE_ERROR THEN
2810: -- Just bail out, we cannot open or write to the ll file(s)
2803: BEGIN
2804: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name('.ll-stat'),'W',32767);
2805: EXCEPTION
2806: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2807: UTL_FILE.INVALID_PATH OR
2808: UTL_FILE.INVALID_OPERATION OR
2809: UTL_FILE.WRITE_ERROR THEN
2810: -- Just bail out, we cannot open or write to the ll file(s)
2811: RETURN;
2804: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name('.ll-stat'),'W',32767);
2805: EXCEPTION
2806: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2807: UTL_FILE.INVALID_PATH OR
2808: UTL_FILE.INVALID_OPERATION OR
2809: UTL_FILE.WRITE_ERROR THEN
2810: -- Just bail out, we cannot open or write to the ll file(s)
2811: RETURN;
2812: END;
2805: EXCEPTION
2806: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2807: UTL_FILE.INVALID_PATH OR
2808: UTL_FILE.INVALID_OPERATION OR
2809: UTL_FILE.WRITE_ERROR THEN
2810: -- Just bail out, we cannot open or write to the ll file(s)
2811: RETURN;
2812: END;
2813:
2826: end if;
2827:
2828: write_file_footer();
2829:
2830: UTL_FILE.FFLUSH(g_config_handle);
2831: UTL_FILE.FCLOSE(g_config_handle);
2832:
2833: END IF;
2834: EXCEPTION
2827:
2828: write_file_footer();
2829:
2830: UTL_FILE.FFLUSH(g_config_handle);
2831: UTL_FILE.FCLOSE(g_config_handle);
2832:
2833: END IF;
2834: EXCEPTION
2835: WHEN OTHERS THEN
2832:
2833: END IF;
2834: EXCEPTION
2835: WHEN OTHERS THEN
2836: IF UTL_FILE.IS_OPEN (g_config_handle) = TRUE THEN
2837: UTL_FILE.FFLUSH(g_config_handle);
2838: UTL_FILE.FCLOSE(g_config_handle);
2839: END IF;
2840: g_config_handle := null;
2833: END IF;
2834: EXCEPTION
2835: WHEN OTHERS THEN
2836: IF UTL_FILE.IS_OPEN (g_config_handle) = TRUE THEN
2837: UTL_FILE.FFLUSH(g_config_handle);
2838: UTL_FILE.FCLOSE(g_config_handle);
2839: END IF;
2840: g_config_handle := null;
2841: g_version_category := NULL;
2834: EXCEPTION
2835: WHEN OTHERS THEN
2836: IF UTL_FILE.IS_OPEN (g_config_handle) = TRUE THEN
2837: UTL_FILE.FFLUSH(g_config_handle);
2838: UTL_FILE.FCLOSE(g_config_handle);
2839: END IF;
2840: g_config_handle := null;
2841: g_version_category := NULL;
2842: -- Raise exception only if explicitly asked for, by passing TRUE
2862: select host_name into l_hostName from v$instance;
2863: select value into l_dbUniqueName from v$parameter where name='db_unique_name';
2864: select value into l_dbDomain from v$parameter where name='db_domain';
2865:
2866: UTL_FILE.PUT_LINE(g_config_handle,'HOST_NAME=' || l_hostName);
2867: UTL_FILE.PUT_LINE(g_config_handle,'DB_UNIQUE_NAME=' || l_dbUniqueName);
2868: UTL_FILE.PUT_LINE(g_config_handle,'DB_DOMAIN=' || l_dbDomain);
2869:
2870: -- diagnostic_dest is property introduced from 11g
2863: select value into l_dbUniqueName from v$parameter where name='db_unique_name';
2864: select value into l_dbDomain from v$parameter where name='db_domain';
2865:
2866: UTL_FILE.PUT_LINE(g_config_handle,'HOST_NAME=' || l_hostName);
2867: UTL_FILE.PUT_LINE(g_config_handle,'DB_UNIQUE_NAME=' || l_dbUniqueName);
2868: UTL_FILE.PUT_LINE(g_config_handle,'DB_DOMAIN=' || l_dbDomain);
2869:
2870: -- diagnostic_dest is property introduced from 11g
2871: -- So, pre 11g db will not have this so prepare for that
2864: select value into l_dbDomain from v$parameter where name='db_domain';
2865:
2866: UTL_FILE.PUT_LINE(g_config_handle,'HOST_NAME=' || l_hostName);
2867: UTL_FILE.PUT_LINE(g_config_handle,'DB_UNIQUE_NAME=' || l_dbUniqueName);
2868: UTL_FILE.PUT_LINE(g_config_handle,'DB_DOMAIN=' || l_dbDomain);
2869:
2870: -- diagnostic_dest is property introduced from 11g
2871: -- So, pre 11g db will not have this so prepare for that
2872: BEGIN
2870: -- diagnostic_dest is property introduced from 11g
2871: -- So, pre 11g db will not have this so prepare for that
2872: BEGIN
2873: select value into l_diagDest from v$parameter where lower(name)='diagnostic_dest';
2874: UTL_FILE.PUT_LINE(g_config_handle,'DIAG_DEST=' || l_diagDest);
2875: EXCEPTION
2876: WHEN NO_DATA_FOUND THEN
2877: null;
2878: END;
2879:
2880: select value into l_dbName from v$parameter where name='db_name';
2881: select value into l_dbInstanceName from v$parameter where name='instance_name';
2882:
2883: UTL_FILE.PUT_LINE(g_config_handle,'DB_NAME=' || l_dbName);
2884: UTL_FILE.PUT_LINE(g_config_handle,'INSTANCE_NAME=' || l_dbInstanceName);
2885:
2886: collect_db_dbNInstanceInfo;
2887: if g_is_cdb = 'YES' then
2880: select value into l_dbName from v$parameter where name='db_name';
2881: select value into l_dbInstanceName from v$parameter where name='instance_name';
2882:
2883: UTL_FILE.PUT_LINE(g_config_handle,'DB_NAME=' || l_dbName);
2884: UTL_FILE.PUT_LINE(g_config_handle,'INSTANCE_NAME=' || l_dbInstanceName);
2885:
2886: collect_db_dbNInstanceInfo;
2887: if g_is_cdb = 'YES' then
2888: collect_pdb_list;
2907:
2908: g_version_category := get_version_category();
2909: IF g_version_category != NOT_SUPPORTED_VERSION THEN
2910: BEGIN
2911: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name('.ccr'),'W',32767);
2912: EXCEPTION
2913: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2914: UTL_FILE.INVALID_PATH OR
2915: UTL_FILE.INVALID_OPERATION OR
2909: IF g_version_category != NOT_SUPPORTED_VERSION THEN
2910: BEGIN
2911: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name('.ccr'),'W',32767);
2912: EXCEPTION
2913: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2914: UTL_FILE.INVALID_PATH OR
2915: UTL_FILE.INVALID_OPERATION OR
2916: UTL_FILE.WRITE_ERROR THEN
2917: -- Just bail out, we cannot open or write to the ll file(s)
2910: BEGIN
2911: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name('.ccr'),'W',32767);
2912: EXCEPTION
2913: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2914: UTL_FILE.INVALID_PATH OR
2915: UTL_FILE.INVALID_OPERATION OR
2916: UTL_FILE.WRITE_ERROR THEN
2917: -- Just bail out, we cannot open or write to the ll file(s)
2918: RETURN;
2911: g_config_handle := UTL_FILE.FOPEN(directory_location,get_dest_file_name('.ccr'),'W',32767);
2912: EXCEPTION
2913: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2914: UTL_FILE.INVALID_PATH OR
2915: UTL_FILE.INVALID_OPERATION OR
2916: UTL_FILE.WRITE_ERROR THEN
2917: -- Just bail out, we cannot open or write to the ll file(s)
2918: RETURN;
2919: END;
2912: EXCEPTION
2913: WHEN UTL_FILE.INVALID_FILEHANDLE OR
2914: UTL_FILE.INVALID_PATH OR
2915: UTL_FILE.INVALID_OPERATION OR
2916: UTL_FILE.WRITE_ERROR THEN
2917: -- Just bail out, we cannot open or write to the ll file(s)
2918: RETURN;
2919: END;
2920:
2922:
2923: CHECK_IS_CDB;
2924:
2925: MGMT_DB_LL_METRICS.write_db_ccr_file_impl;
2926: UTL_FILE.FFLUSH(g_config_handle);
2927: UTL_FILE.FCLOSE(g_config_handle);
2928: END IF;
2929: EXCEPTION
2930: WHEN OTHERS THEN
2923: CHECK_IS_CDB;
2924:
2925: MGMT_DB_LL_METRICS.write_db_ccr_file_impl;
2926: UTL_FILE.FFLUSH(g_config_handle);
2927: UTL_FILE.FCLOSE(g_config_handle);
2928: END IF;
2929: EXCEPTION
2930: WHEN OTHERS THEN
2931: IF UTL_FILE.IS_OPEN (g_config_handle) = TRUE THEN
2927: UTL_FILE.FCLOSE(g_config_handle);
2928: END IF;
2929: EXCEPTION
2930: WHEN OTHERS THEN
2931: IF UTL_FILE.IS_OPEN (g_config_handle) = TRUE THEN
2932: UTL_FILE.FFLUSH(g_config_handle);
2933: UTL_FILE.FCLOSE(g_config_handle);
2934: END IF;
2935: g_config_handle := null;
2928: END IF;
2929: EXCEPTION
2930: WHEN OTHERS THEN
2931: IF UTL_FILE.IS_OPEN (g_config_handle) = TRUE THEN
2932: UTL_FILE.FFLUSH(g_config_handle);
2933: UTL_FILE.FCLOSE(g_config_handle);
2934: END IF;
2935: g_config_handle := null;
2936: g_version_category := NULL;
2929: EXCEPTION
2930: WHEN OTHERS THEN
2931: IF UTL_FILE.IS_OPEN (g_config_handle) = TRUE THEN
2932: UTL_FILE.FFLUSH(g_config_handle);
2933: UTL_FILE.FCLOSE(g_config_handle);
2934: END IF;
2935: g_config_handle := null;
2936: g_version_category := NULL;
2937: -- Raise exception only if explicitly asked for, by passing TRUE