# OWBr10g.ctl: Collects Oracle Warehouse Builder Information (9.2, 10.1, 10.2) # $Id: OWBr10g.ctl,v 1.6 2015/08/21 15:30:22 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OFM/OWBr10g.ctl,v 1.6 2015/08/21 15:30:22 RDA Exp $ # # Change History # 20150821 MSC Improve time consistency. =for stopwords OWBr =head1 NAME OFM:OWBr10g - Collects Oracle Warehouse Builder Information (9.2, 10.1, or 10.2) =head1 DESCRIPTION This module collects Oracle Warehouse Builder-related information (9.2, 10.1, or 10.2). =cut # Initialization var $AGE = ${R_AGE/T:3} var $TAIL = ${N_TAIL:1000} import $TOC,$TOP # Load the common macros run DB:DBinfo() # Check if required tables are present debug ' Inside OWB module, checking 9.2, 10.1, or 10.2 repository objects' set $sql {SELECT DECODE(COUNT(*),0,'NOTFOUND','PRESENT') " FROM all_objects " WHERE object_name = 'WB_RTV_SERVICE_NODES' " AND OWNER != 'OWBSYS'; } if grepSql($sql,'NOTFOUND') {echo 'No (9.2, 10.1, or 10.2) design or runtime repositories found' return } =head2 report10g - Repository Information (9.2, 10.1, or 10.2) Gathers release-related information. =cut debug ' Inside OWB module, getting 9.2, 10.1, or 10.2 repository information' report report10g var $TTL = '---+!! Repository Information (9.2, 10.1, or 10.2)' var @TTL = ('',\ '---+ Design Repositories',\ '---+ Design Repository Multi User Environment',\ '---+ Design Repository Size',\ '---+ Design Repository Statistics Detection',\ '---+ Runtime Repositories',\ '---+ Runtime Access Users',\ '---+ Runtime Repository Size',\ '---+ Runtime Repository Statistics Detection',\ '',\ '---+ OWB OWBRT_SYS.OWBRTPS',\ '---+ OWB OWBRT_SYS.RAW_OWBREPOS',\ '---+ OWB Targets',\ '---+ OWB WB_RT_Service_Job_Logs',\ '---+ OWB Locations Registered',\ '---+ Enqueue Resources',\ '---+ Control Center Connections',\ '---+ OWB DBA_JAVA_POLICY') var @HDR = () set $sql {SET serveroutput on "DECLARE " l_own dba_objects.owner%TYPE; " l_sql VARCHAR2(1000) := NULL; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'ALL_IV_INSTALLATIONS' " AND owner != 'PUBLIC' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_own; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Design Repositories installed|'); " ELSE " dbms_output.put_line('|*Owner*|*Version*|*Release*|*Creation Date*|'); " LOOP " l_sql := 'BEGIN " FOR rec IN (SELECT installed_version,release,created_on " FROM ' || l_own || '.all_iv_installations) " LOOP " dbms_output.put_line(''|'' || " ''' || l_own || ''' || '' |'' || " rec.installed_version || '' |'' || " rec.release || '' |'' || " TO_CHAR(rec.created_on,''DD-Mon-YYYY'') || " '' |''); " END LOOP; "END;'; " EXECUTE IMMEDIATE l_sql; " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " END IF; " CLOSE c_own; "END; "/ "PROMPT ___Macro_separator(2)___ "DECLARE " l_rep dba_role_privs.granted_role%TYPE; " l_usr dba_role_privs.grantee%TYPE; " " CURSOR c_own IS " SELECT DISTINCT grantee, " SUBSTR(granted_role,5,25) " FROM dba_role_privs " WHERE SUBSTR(granted_role,1,4) = 'OWB_' " AND SUBSTR(granted_role,1,6) NOT IN ('OWB_A_','OWB_D_','OWB_O_','OWB_R_') " AND default_role = 'NO' " AND admin_option = 'NO'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_usr,l_rep; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line( " '|No OWB Design Users installed (no multi user environment)|'); " ELSE " dbms_output.put_line('|*Owner Design Repository*|*User Design Repository*|'); " LOOP " dbms_output.put_line('|' || l_rep || ' |' || l_usr || ' |'); " FETCH c_own " INTO l_usr,l_rep; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " END IF; " CLOSE c_own; "END; "/ "PROMPT ___Macro_separator(3)___ "DECLARE " l_cnt NUMBER; " l_flg BOOLEAN := TRUE; " l_sql VARCHAR2(800) := NULL; " l_tbl dba_tables.table_name%TYPE; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'ALL_IV_INSTALLATIONS' " AND owner != 'PUBLIC' " AND owner != 'OWBSYS'; " CURSOR c_tbl(p_own VARCHAR2) IS " SELECT table_name " FROM dba_tables " WHERE table_name IN ('CMPALLCLASSES','CMPMMMCLASSES') " AND owner = p_own " ORDER BY table_name; "BEGIN " FOR r1 IN c_own LOOP " OPEN c_tbl(r1.owner); " FETCH c_tbl " INTO l_tbl; " IF c_tbl%FOUND " THEN " l_sql := 'SELECT COUNT(*) " FROM ' || r1.owner || '.' || l_tbl; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " IF l_flg " THEN " dbms_output.put_line('|*Owner*| *Rows*|'); " l_flg := FALSE; " END IF; " dbms_output.put_line('|' || " r1.owner || ' ' || LOWER(l_tbl) || '| ' || " l_cnt || '|'); " END IF; " CLOSE c_tbl; " END LOOP; " IF l_flg " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Design Repositories installed (Size)|'); " END IF; "END; "/ "PROMPT ___Macro_separator(4)___ "DECLARE " l_idx NUMBER; " l_flg BOOLEAN := FALSE; " l_own dba_objects.owner%TYPE; " l_sql VARCHAR2(400) := NULL; " l_tbl NUMBER; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'ALL_IV_INSTALLATIONS' " AND owner != 'PUBLIC' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_own; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Design Repositories installed|'); " ELSE " dbms_output.put_line('|*Owner*|*Description*|'); " LOOP " l_sql := 'SELECT SUM(num_rows) " FROM dba_tables " WHERE owner = ''' || l_own || ''''; " EXECUTE IMMEDIATE l_sql " INTO l_tbl; " IF l_tbl > 0 " THEN " dbms_output.put_line('|' || l_own || ' |Statistics detected on tables.|'); " l_flg := TRUE; " END IF; " l_sql := 'SELECT SUM(num_rows) " FROM dba_indexes " WHERE owner = ''' || l_own || ''''; " EXECUTE IMMEDIATE l_sql " INTO l_idx; " IF l_idx > 0 " THEN " dbms_output.put_line('|' || l_own || ' |Statistics detected on indexes.|'); " l_flg := TRUE; " END IF; " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " IF NOT l_flg " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line( " '|The OWB Design Repositories are free from statistics|'); " END IF; " END IF; " CLOSE c_own; "END; "/ "PROMPT ___Macro_separator(5)___ "DECLARE " l_flg VARCHAR2(1); " l_lck VARCHAR2(128); " l_lim INTEGER := 0; " l_own dba_objects.owner%TYPE; " l_sql VARCHAR2(1500) := NULL; " l_sta NUMBER; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'WB_RTV_SERVICE_NODES' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_own; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Runtime Repositories installed|'); " ELSE " dbms_output.enable(100000); " dbms_output.put_line('|*Owner*| *Available* | *Node*| *Inst*|*Host*| ' || " '*Port*|*Service Name*| *Enabled*|*RT Version*|' || " '*Server Side Home*|*Instance Name*| ' || " '*Currently Active*|'); " LOOP " l_sql := 'BEGIN " FOR rec IN (SELECT node_id, " instance_number, " host, " port, " service_name, " enabled, " runtime_version, " server_side_home, " instance_name, " currently_active " FROM ' || l_own || '.wb_rtv_service_nodes) " LOOP " dbms_lock.allocate_unique(''WBLK_'' || :1,:2); " :3 := dbms_lock.request(:2,dbms_lock.x_mode,:4,TRUE); " IF :3 = 0 " THEN " :3 := dbms_lock.release(:2); " :5 := ''N''; " ELSE " :5 := ''Y''; " END IF; " dbms_output.put_line(''|'' || " :1 || '' | '' || " :5 || '' | '' || " rec.node_id || ''| '' || " rec.instance_number || ''|'' || " rec.host || '' | '' || " rec.port || ''|'' || " rec.service_name || '' | '' || " rec.enabled || ''|'' || " rec.runtime_version || '' |'' || " rec.server_side_home || '' |'' || " rec.instance_name || '' | '' || " rec.currently_active || ''|''); " END LOOP; "END;'; " EXECUTE IMMEDIATE l_sql USING IN l_own, " IN OUT l_lck, " IN OUT l_sta, " IN l_lim, " IN OUT l_flg; " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " END IF; " CLOSE c_own; "END; "/ "PROMPT ___Macro_separator(6)___ "DECLARE " l_rep dba_role_privs.granted_role%TYPE; " l_usr dba_role_privs.grantee%TYPE; " " CURSOR c_own IS " SELECT DISTINCT grantee, " SUBSTR(granted_role,6,25) rt_owner " FROM dba_role_privs " WHERE SUBSTR(granted_role,1,3) = 'WB_' " AND default_role = 'NO'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_usr,l_rep; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Runtime Access Users installed|'); " ELSE " dbms_output.put_line('|*Runtime Access User* |*Connected To Runtime* |'); " LOOP " dbms_output.put_line('|' || l_usr || ' |' || l_rep || ' |'); " FETCH c_own " INTO l_usr,l_rep; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " END IF; " CLOSE c_own; "END; "/ "PROMPT ___Macro_separator(7)___ "DECLARE " l_chk NUMBER; " l_cnt NUMBER; " l_sql VARCHAR2(800) := NULL; " l_own dba_objects.owner%TYPE; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'WB_RT_SERVICE_NODES' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_own; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Runtime Repositories installed|'); " ELSE " dbms_output.enable(100000); " dbms_output.put_line('|*Owner* |*Activity* | *Rows*|'); " LOOP " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_stores'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_stores " WHERE store_name = ''PlatformSchema'''; " EXECUTE IMMEDIATE l_sql " INTO l_chk; " IF l_chk = 1 " THEN " dbms_output.put_line('|' || " l_own || ' |wb_rt_stores| ' || " l_cnt || ' rows PlatformSchema seeded correctly|'); " ELSE " dbms_output.put_line('|' || " l_own || ' |wb_rt_stores| ' || " l_cnt || ' rows PlatformSchema not seeded|'); " END IF; " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_platform_properties'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " IF l_cnt > 2 " THEN " dbms_output.put_line('|' || " l_own || ' |wb_rt_platform_properties| ' || " l_cnt || ' rows Platform properties seeded correctly|'); " ELSE " dbms_output.put_line('|' || " l_own || ' |wb_rt_platform_properties| ' || " l_cnt || ' rows Not all platform properties loaded|'); " END IF; " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_audit_executions'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_audit_executions| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_audit_deployments'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_audit_deployments| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_tasks'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_tasks| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_deployment_adapters'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_deployment_adapters| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_execution_adapters'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_execution_adapters| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_execution_operators'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_execution_operators| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_file_types'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_file_types| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_object_types'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_object_types| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_object_type_defs'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_object_type_defs| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_operator_results'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_operator_results| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_store_types'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_store_types| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_store_type_params'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_store_type_params| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_system_parameters'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_system_parameters| ' || " l_cnt || '|'); " l_sql := 'SELECT COUNT(*) " FROM dba_tables " WHERE table_name = ''WB_RT_DEF_IMPL_TYPES'' " AND OWNER = ''' || l_own || ''''; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " IF l_cnt = 1 " THEN " -- This is Paris " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_impl_types'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_impl_types| ' || " l_cnt || '|'); " END IF; " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_def_system_parameters'; " EXECUTE IMMEDIATE l_sql " INTO l_cnt; " dbms_output.put_line('|' || " l_own || ' |wb_rt_def_system_parameters| ' || " l_cnt || '|'); " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " END IF; " CLOSE c_own; "END; "/ "PROMPT ___Macro_separator(8)___ "DECLARE " l_flg BOOLEAN := FALSE; " l_idx NUMBER; " l_own dba_objects.owner%TYPE; " l_sql VARCHAR2(800) := NULL; " l_tbl NUMBER; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'WB_RT_SERVICE_NODES' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_own; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Design Repositories installed|'); " ELSE " dbms_output.put_line('|*Owner*|*Description*|'); " LOOP " l_sql := 'SELECT SUM(num_rows) " FROM dba_tables " WHERE owner = ''' || l_own || ''''; " EXECUTE IMMEDIATE l_sql " INTO l_tbl; " IF l_tbl > 0 " THEN " dbms_output.put_line('|' || l_own || ' |Statistics detected on tables.|'); " l_flg := TRUE; " END IF; " l_sql := 'SELECT SUM(num_rows) " FROM dba_indexes " WHERE owner = ''' || l_own || ''''; " EXECUTE IMMEDIATE l_sql " INTO l_idx; " IF l_idx > 0 " THEN " dbms_output.put_line('|' || l_own || ' |Statistics detected on indexes.|'); " l_flg := TRUE; " END IF; " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " IF NOT l_flg " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line( " '|The OWB Runtime Repositories are free from statistics|'); " END IF; " END IF; " CLOSE c_own; "END; "/ "PROMPT ___Macro_separator(10)___ "DECLARE " l_cnt NUMBER; " l_key owbrt_sys.owbrtps.key%TYPE; " l_sql VARCHAR2(800); " l_val owbrt_sys.owbrtps.value%TYPE; " " TYPE t_cursor IS REF CURSOR; " c_dyn t_cursor; "BEGIN " SELECT COUNT(*) " INTO l_cnt " FROM dba_objects " WHERE object_name = 'OWBRTPS' " AND OWNER = 'OWBRT_SYS'; " IF l_cnt = 0 " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|OWBRT_SYS.OWBRTPS not found|'); " ELSE " l_sql := 'SELECT key,value " FROM owbrt_sys.owbrtps " ORDER BY key'; " dbms_output.put_line('|*Key*|*Value*|'); " OPEN c_dyn FOR l_sql; " LOOP " FETCH c_dyn " INTO l_key,l_val; " EXIT WHEN c_dyn%NOTFOUND; " dbms_output.put_line('|' || l_key || ' |' || l_val || '|'); " END LOOP; " CLOSE c_dyn; " END IF; "END; "/ "PROMPT ___Macro_separator(11)___ "DECLARE " l_usr owbrt_sys.raw_owbrepos.schemaname%TYPE; " l_ver owbrt_sys.raw_owbrepos.version_no%TYPE; " l_str VARCHAR2(800); " l_cnt NUMBER; " TYPE t_cursor IS REF CURSOR; " l_cursor t_cursor; "BEGIN " SELECT count(*) " INTO l_cnt " FROM dba_objects " WHERE object_name='RAW_OWBREPOS' " AND OWNER='OWBRT_SYS'; " IF l_cnt = 0 THEN " DBMS_OUTPUT.PUT_LINE('|*Description*|'); " DBMS_OUTPUT.PUT_LINE('|Warning: OWBRT_SYS.RAW_OWBREPOS not found.|'); " ELSE " SELECT count(*) " INTO l_cnt " FROM OWBRT_SYS.RAW_OWBREPOS; " IF l_cnt = 0 THEN " DBMS_OUTPUT.PUT_LINE('|*Description*|'); " DBMS_OUTPUT.PUT_LINE('|Warning: Table OWBRT_SYS.RAW_OWBREPOS is empty.|'); " ELSE " DBMS_OUTPUT.PUT_LINE('|*Schema Name*|*Version*|'); " l_str := 'SELECT schemaname, " version_no " FROM owbrt_sys.raw_owbrepos " ORDER BY schemaname'; " OPEN l_cursor FOR l_str; " LOOP " FETCH l_cursor INTO l_usr, l_ver; " EXIT WHEN l_cursor%notfound; " DBMS_OUTPUT.PUT_LINE('|' || l_usr || ' |' || l_ver || '|'); " END LOOP; " CLOSE l_cursor; " END IF; " END IF; "END; "/ "PROMPT ___Macro_separator(12)___ "DECLARE " l_own dba_objects.owner%TYPE; " l_sql VARCHAR2(800) := NULL; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'WB_RT_PLATFORM_REPOSITORY' " AND owner != 'OWBSYS' " AND owner NOT IN (SELECT owner " FROM dba_objects " WHERE OBJECT_NAME = 'CMPMMMCLASSES'); "BEGIN " OPEN c_own; " FETCH c_own " INTO l_own; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Target Schemas installed|'); " ELSE " dbms_output.put_line( " '|*Target*|*RTP/Control Center Service*|*RT Version*|'); " LOOP " l_sql := 'BEGIN " FOR rec IN (SELECT ' || l_own " || '.wb_rt_platform_repository l_rep,' " || l_own || '.wb_rt_version l_ver " FROM sys.dual) " LOOP " dbms_output.put_line(''|'' || " ''' || l_own || ''' || '' |'' || " rec.l_rep || '' |'' || " rec.l_ver || '' |''); " END LOOP; "END;'; " EXECUTE IMMEDIATE l_sql; " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " END IF; " CLOSE c_own; "END; "/ "PROMPT ___Macro_separator(13)___ "DECLARE " l_cnt NUMBER; " l_max NUMBER; " l_off NUMBER; " l_own dba_objects.owner%TYPE; " l_sql VARCHAR2(1500) := NULL; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'WB_RT_SERVICE_JOB_LOGS' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_own; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Runtime Repositories installed|'); " ELSE " dbms_output.enable(300000); " dbms_output.put_line('|*Owner*|*Time Stamp*|*File Path*|*Message*|'); " LOOP " l_sql := 'SELECT COUNT(*) " FROM ' || l_own || '.wb_rt_service_job_logs'; " EXECUTE IMMEDIATE l_sql " INTO l_max; " l_sql := 'BEGIN " :1 := 0; " FOR rec IN ( " SELECT TO_CHAR(time_stamp,''DD-Mon-YYYY HH24:MI:SS'') l_tim, " REPLACE(SUBSTR(message,9+instr(message,''command''),500), " CHR(10),''%BR%'') l_msg " FROM ' || l_own || '.wb_rt_service_job_logs " ORDER BY time_stamp ) " LOOP " IF :1 >= :2 - 10 " THEN " :3 := INSTR(rec.l_msg,''run_service''); " IF :3 > 0 " THEN " dbms_output.put_line(''|'' || " :4 || '' |'' || " rec.l_tim || '' |'' || " SUBSTR(rec.l_msg,1,14 + :3) || '' |\''); " dbms_output.put_line(SUBSTR(rec.l_msg,15 + :3,200) || '' |''); " ELSE " dbms_output.put_line(''|'' || " :4 || '' |'' || " rec.l_tim || '' |\''); " dbms_output.put_line(SUBSTR(rec.l_msg,1,240) || '' ||''); " END IF; " END IF; " :1 := :1 + 1; " END LOOP; "END;'; " EXECUTE IMMEDIATE l_sql USING IN OUT l_cnt, " IN l_max, " IN OUT l_off, " IN l_own; " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " END IF; " CLOSE c_own; "END; "/ "PROMPT ___Macro_separator(14)___ "DECLARE " l_loc VARCHAR2(128); " l_sql VARCHAR2(2000) := NULL; " l_own dba_objects.owner%TYPE; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'WB_RT_SERVICE_NODES' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_own; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Runtime Repositories installed|'); " ELSE " dbms_output.enable(1000000); " dbms_output.put_line('|*Owner*|*Store Name*|*Store Type Name*| ' || " '*Store Type Ver*|*Parameter Name*|*Parameter Value*|'); " LOOP " l_sql := 'BEGIN " :1 := ''X''; " FOR rec IN ( " SELECT store_name l_str_nam, " REPLACE(store_type_name,'' '','' '') l_typ_nam, " store_type_version l_typ_ver, " parameter_name l_par_nam, " parameter_value l_par_val " FROM ' || l_own || '.wb_rt_stores, " ' || l_own || '.wb_rt_store_parameters, " ' || l_own || '.wb_rt_def_store_types " WHERE wb_rt_stores.store_id = wb_rt_store_parameters.store_id " AND wb_rt_stores.store_type_id = " wb_rt_def_store_types.store_type_id " AND parameter_name <> ''Password'' " AND parameter_value IS NOT NULL " ORDER BY store_name,parameter_name ) " LOOP " IF :1 <> rec.l_str_nam " THEN " dbms_output.put_line(''|'' || " :2 || '' |'' || " rec.l_str_nam || '' |'' || " rec.l_typ_nam || '' |'' || " rec.l_typ_ver || '' |'' || " rec.l_par_nam || '' |'' || " rec.l_par_val || '' |''); " :1 := rec.l_str_nam; " ELSE " dbms_output.put_line(''| ||||'' || " rec.l_par_nam || '' |'' || " rec.l_par_val || '' |''); " END IF; " END LOOP; "END;'; " EXECUTE IMMEDIATE l_sql USING IN OUT l_loc, " IN l_own; " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " END IF; " CLOSE c_own; "END; "/ "PROMPT ___Macro_separator(15)___ "DECLARE " l_cnt NUMBER; " l_val NUMBER; "BEGIN " dbms_output.put_line('|*Description*| *Value*| *Recommended Value*|'); " SELECT COUNT(*) " INTO l_cnt " FROM v$parameter " WHERE name = 'enqueue_resources'; " IF l_cnt <> 0 " THEN " SELECT value " INTO l_val " FROM v$parameter " WHERE name = 'enqueue_resources'; " IF l_val < 3000 " THEN " dbms_output.put_line('|ENQUEUE_RESOURCES| ' || l_val || " '|Should be = 3000|'); " END IF; " END IF; "END; "/ "PROMPT ___Macro_separator(16)___ "DECLARE " l_fst_pas INTEGER; " l_str VARCHAR2(1500) := null; " l_own dba_objects.owner%TYPE; " " CURSOR l_owner_cursor IS " SELECT owner " FROM dba_objects " WHERE object_name = 'ALL_IV_CONTROL_CENTERS' " AND owner <> 'PUBLIC' " AND owner != 'OWBSYS'; "BEGIN " OPEN l_owner_cursor; " FETCH l_owner_cursor " INTO l_own; " IF l_owner_cursor%NOTFOUND " THEN " DBMS_OUTPUT.PUT_LINE('|*Description*|'); " DBMS_OUTPUT.PUT_LINE('|No OWB Design Repositories installed|'); " ELSE " DBMS_OUTPUT.PUT_LINE " ('|*Repository*|*Control Center Name*|*Host:Port:Service Name*|'); " LOOP " l_str := 'BEGIN " :1 := 1; " FOR rec IN (SELECT control_center_name l_ctl_cen_nam, " host l_hst, " port l_prt, " service_name l_srv_nam " FROM ' || l_own || '.all_iv_control_centers) " LOOP " IF :1 = 1 " THEN " DBMS_OUTPUT.PUT_LINE(''|'' || " :2 || '' |'' || " rec.l_ctl_cen_nam || '' |'' || " rec.l_hst || '':'' || " rec.l_prt || '':'' || " rec.l_srv_nam || '' |''); " :1 := 0; " ELSE " DBMS_OUTPUT.PUT_LINE(''| |'' || " rec.l_ctl_cen_nam || '' |'' || " rec.l_hst || '':'' || " rec.l_prt || '':'' || " rec.l_srv_nam || '' |''); " END IF; " END LOOP; "END;'; " EXECUTE IMMEDIATE l_str USING IN OUT l_fst_pas, " IN l_own; " FETCH l_owner_cursor " INTO l_own; " EXIT WHEN l_owner_cursor%NOTFOUND; " END LOOP; " END IF; " CLOSE l_owner_cursor; "END; "/ "PROMPT ___Macro_separator(17)___ "DECLARE " l_own dba_objects.owner%TYPE; " l_sql VARCHAR2(1500) := NULL; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'WB_RT_SERVICE_NODES' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_own; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Runtime Repositories installed|'); " ELSE " dbms_output.enable(100000); " dbms_output.put_line('|*Kind*|*Grantee*|*Type Schema*|*Type Name*|*Name*|' || " '*Action*|*Enabled*| *Seq*|'); " LOOP " l_sql := 'BEGIN " FOR rec IN (SELECT kind, " grantee, " type_schema, " type_name, " name, " action, " enabled, " seq " FROM dba_java_policy " WHERE grantee = ' || l_own) " LOOP " dbms_output.put_line(''|'' || " rec.kind || '' |'' || " rec.grantee || '' |'' || " rec.type_schema || '' |'' || " rec.type_name || '' |'' || " rec.name || '' |'' || " rec.action || '' |'' || " rec.enabled || '' | '' || " rec.seq || ''|''); " END LOOP; "END;'; " EXECUTE IMMEDIATE l_sql USING IN l_own; " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " END IF; " CLOSE c_own; "END; "/ } call separator(1) call writeSql($sql) call separator(0,'Repository Information (9.2, 10.1, or 10.2)') # OWB WB_RT_PLATFORM_REPOSITORY Information set $sql {SET serveroutput on "DECLARE " l_flg INTEGER; " l_sql VARCHAR2(3000) := NULL; " l_own dba_objects.owner%TYPE; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'WB_RT_SERVICE_NODES' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " FETCH c_own " INTO l_own; " IF c_own%NOTFOUND " THEN " dbms_output.put_line('---+ RuntimePlatform Properties'); " dbms_output.put_line('|*Description*|'); " dbms_output.put_line('|No OWB Runtime Repositories installed|'); " dbms_output.put_line('[[#Top][Back to top]]'); " ELSE " dbms_output.enable(100000); " LOOP " l_sql := 'BEGIN " :1 := 1; " FOR rec IN ( " SELECT property_path l_pth, " property_value l_val " FROM ' || l_own || '.wb_rt_platform_properties " WHERE property_path IN ( " ''property.RuntimePlatform.0.delete_all_job_on_complete'', " ''property.RuntimePlatform.0.exceptions'', " ''property.RuntimePlatform.0.logfile_max_size'', " ''property.RuntimePlatform.0.max_number_logfiles'', " ''property.RuntimePlatform.0.messages'', " ''property.RuntimePlatform.0.platform'', " ''property.RuntimePlatform.0.platform_net_host_name'', " ''property.RuntimePlatform.0.platform_net_service_name'', " ''property.RuntimePlatform.0.purge_delay_hours'', " ''property.RuntimePlatform.0.purge_minimum_minutes'', " ''property.RuntimePlatform.0.recovery'', " ''property.RuntimePlatform.0.runtime_home'', " ''property.RuntimePlatform.0.service_command'', " ''property.RuntimePlatform.0.service_parameters'', " ''property.RuntimePlatform.0.temp_dir_name'', " ''property.RuntimePlatform.0.trace'', " ''property.RuntimePlatform.0.trace_control_on'', " ''property.RuntimePlatform.0.uoid'', " ''property.RuntimePlatform.0.version'', " ''property.RuntimePlatform.0.min_service_version'') ) " LOOP " IF :1 = 1 " THEN " dbms_output.put_line( " ''---+ RuntimePlatform Properties for '' || :2); " dbms_output.put_line(''|*Property Path*|*Property Value*|''); " :1 := 0; " ELSE " dbms_output.put_line(''|'' || " rec.l_pth || '' |'' || " rec.l_val || '' |''); " END IF; " END LOOP; " IF :1 = 0 " THEN " dbms_output.put_line(''[[#Top][Back to top]]''); " END IF; "END;'; " EXECUTE IMMEDIATE l_sql USING IN OUT l_flg, " IN l_own; " l_sql := 'BEGIN " :1 := 1; " FOR rec IN ( " SELECT SUBSTR(property_path,1,75) l_pth, " SUBSTR(property_value,1,75) l_val " FROM ' || l_own || '.wb_rt_platform_properties " WHERE property_path LIKE " ''property.RuntimePlatform.0.NativeExecution.SQLLoader%'' " AND property_path NOT LIKE ''%oem%'' ) " LOOP " IF :1 = 1 " THEN " dbms_output.put_line( " ''---+ RuntimePlatform Properties SQLLDR for '' || :2); " dbms_output.put_line(''|*Property Path*|*Property Value*|''); " :1 := 0; " ELSE " dbms_output.put_line(''|'' || " rec.l_pth || '' |'' || " rec.l_val || '' |''); " END IF; " END LOOP; " IF :1 = 0 " THEN " dbms_output.put_line(''[[#Top][Back to top]]''); " END IF; "END;'; " EXECUTE IMMEDIATE l_sql USING IN OUT l_flg, " IN l_own; " l_sql := 'BEGIN " :1 := 1; " FOR rec IN ( " SELECT SUBSTR(property_path,1,75) l_pth, " SUBSTR(property_value,1,75) l_val " FROM ' || l_own || '.wb_rt_platform_properties " WHERE property_path LIKE " ''property.RuntimePlatform.0.NativeExecution.SQLPlus%'' " AND property_path NOT LIKE ''%oem%'' ) " LOOP " IF :1 = 1 " THEN " dbms_output.put_line( " ''---+ RuntimePlatform Properties SQLPLUS for '' || :2); " dbms_output.put_line(''|*Property Path*|*Property Value*|''); " :1 := 0; " ELSE " dbms_output.put_line(''|'' || " rec.l_pth || '' |'' || " rec.l_val || '' |''); " END IF; " END LOOP; " IF :1 = 0 " THEN " dbms_output.put_line(''[[#Top][Back to top]]''); " END IF; "END;'; " EXECUTE IMMEDIATE l_sql USING IN OUT l_flg, " IN l_own; " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " END LOOP; " CLOSE c_own; " END IF; "END; "/ } call writeSql($sql) # RUN_SERVICE.SH / RUN_SERVICE.BAT set $sql {SET serveroutput on "DECLARE " l_own dba_objects.owner%TYPE; " l_sql VARCHAR2(1000) := NULL; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'WB_RT_SERVICE_NODES' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " LOOP " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " l_sql := 'BEGIN " FOR r1 IN (SELECT server_side_home l_hom " FROM ' || l_own || '.wb_rt_service_nodes) " LOOP " FOR r2 IN (SELECT property_value l_pth " FROM ' || l_own || '.wb_rt_platform_properties " WHERE property_path = " ''property.RuntimePlatform.0.service_command'') " LOOP " dbms_output.put_line(:1 || ''|'' || " r1.l_hom || ''|'' || " r2.l_pth); " END LOOP; " END LOOP; "END;'; " EXECUTE IMMEDIATE l_sql USING l_own; " END LOOP; " CLOSE c_own; "END; "/ } prefix {write '---+ RUN_SERVICE.SH / RUN_SERVICE.BAT' write '|*Runtime Repository*|*Run Service*|' } call loadSql($sql) var ($cnt,$err) = (0,0) var %hom loop $lin (getSqlLines()) {break match($lin,'(ORA-|ERROR)') var ($key,$hom,$pth) = split('\|',$lin,3) var $hom{$key} = $hom if or($hom,$pth) {if match($pth,'run_service\.sh') var $fil = catFile($hom,'owb','bin','unix','run_service.sh') else var $fil = catFile($hom,'owb','bin','win32','run_service.bat') var $lnk = encode($fil) if ?testFile('r',$fil) {var $siz = getSize($fil) if $siz {output d,$key if ${CUR.O_LAST}->write_data($fil) var $lnk = concat('[[',${CUR.O_LAST}->get_raw(true),'][_blank][',$lnk,']]') end ${CUR.O_LAST} } incr $cnt } else incr $err write '|',$key,'|',$lnk,'|' } else write '|',$key,'| |' } if hasOutput(true) {if $cnt write ' * Links point to files that have been collected in their original \ format. Opening them directly in your browser can present \ security risks. To prevent them, access the file outside the \ browser or use the link to save them and use an adequate viewer.' if $err {if $OWB_LOCAL write ' * Files are not accessible for RDA. Permission problems or \ incorrect ``SERVER_SIDE_HOME`` in table ``WB_RT_SERVICE_NODES`` \ are possible causes.' else write ' * Files are not accessible for RDA. When not located on a remote \ system, permission problems or incorrect ``SERVER_SIDE_HOME`` \ in table ``WB_RT_SERVICE_NODES`` are possible causes.' } write $TOP } # Runtime properties var ($cnt,$err) = (0,0) if %hom {prefix {write '---+ Runtime Properties' write '|*Runtime Repository*|*Runtime Properties*|' } loop $key (keys(%hom)) {var $fil = catFile($hom{$key},'owb','bin','admin','Runtime.properties') var $lnk = encode($fil) if ?testFile('r',$fil) {var $siz = getSize($fil) if $siz {output d,"runtime_properties" if ${CUR.O_LAST}->write_data($fil) var $lnk = concat('[[',${CUR.O_LAST}->get_raw(true),'][_blank][',$lnk,']]') end ${CUR.O_LAST} } incr $cnt } else incr $err write '|',$key,'|',$lnk,'|' } } if hasOutput(true) {if $cnt write ' * Links point to files that have been collected in their original \ format. Opening them directly in your browser can present \ security risks. To prevent them, access the file outside the \ browser or use the link to save them and use an adequate viewer.' if $err {if $OWB_LOCAL write ' * Files are not accessible for RDA. Permission problems or \ incorrect ``SERVER_SIDE_HOME`` in table ``WB_RT_SERVICE_NODES`` \ are possible causes.' else write ' * Files are not accessible for RDA. When not located on a remote \ system, permission problems or incorrect ``SERVER_SIDE_HOME`` \ in table ``WB_RT_SERVICE_NODES`` are possible causes.' } write $TOP } # Log files set $sql {SET serveroutput on "DECLARE " l_own dba_objects.owner%TYPE; " l_sql VARCHAR2(800) := NULL; " " CURSOR c_own IS " SELECT owner " FROM dba_objects " WHERE object_name = 'WB_RT_SERVICE_NODES' " AND owner != 'OWBSYS'; "BEGIN " OPEN c_own; " LOOP " FETCH c_own " INTO l_own; " EXIT WHEN c_own%NOTFOUND; " l_sql := 'BEGIN " FOR rec IN (SELECT server_side_home l_hom " FROM ' || l_own || '.wb_rt_service_nodes) " LOOP " dbms_output.put_line(''hom='' || rec.l_hom); " END LOOP; "END;'; " EXECUTE IMMEDIATE l_sql; " END LOOP; "END; "/ } prefix {write '---+ Log Files' write ' * Links point to files that have been collected in their original \ format. Opening them directly in your browser can present \ risks. To prevent them, access the file outside the browser or \ use the link to save them and use an adequate viewer.' write '|*File Name*| *Size*|*Last Modified Date*|' } var $opt = concat('inpm',$AGE) loop $lin (grepSql($sql,'^hom=')) {var $hom = value($lin) loop $fil (grepDir(catDir($hom,'owb','log'),'\.log$',$opt)) {var $lnk = encode($fil) var $siz = getSize($fil) if $siz {output => d,basename($fil) if ${CUR.O_LAST}->write_tail($fil,$TAIL) var $lnk = concat('[[',${CUR.O_LAST}->get_raw(true),'][_blank][',$lnk,']]') end ${CUR.O_LAST} } write '|',$lnk,' | ',$siz,'|',getLastModify($fil,''),' |' } if isUnix() {loop $fil (grepDir(catDir($hom,'owb','log','unix'),'HS_ERR_PID.*\.log$',$opt)) {var $lnk = encode($fil) var $siz = getSize($fil) if $siz {output => d,basename($fil) if ${CUR.O_LAST}->write_tail($fil,$TAIL) var $lnk = concat('[[',${CUR.O_LAST}->get_raw(true),'][_blank][',$lnk,']]') end ${CUR.O_LAST} } write '|',$lnk,' | ',$siz,'|',getLastModify($fil,''),' |' } } } =begin credits =over 10 =item RDA 4.10: Sarath Babu, Jean-Philippe Peelman. =item RDA 4.20: Mark Rovers. =item RDA 4.22: Mark Rovers. =item RDA 8.00: Mark Rovers. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut