Cisco Transport Manager Server Database Schema, 6.0
Chapter 2: Database Schema Views

Table Of Contents

Database Schema Views

2.1  Common PM Views

2.1.1  Sdh_Ho_FarEnd_pm_view

2.1.2  Sdh_Ho_NearEnd_pm_view

2.1.3  Sdh_Ms_FarEnd_pm_view

2.1.4  Sdh_Ms_NearEnd_pm_view

2.1.5  Sdh_Rs_NearEnd_pm_view

2.1.6  SONET_ENET_PM_VIEW

2.1.7  Sonet_Line_FarEnd_pm_view

2.1.8  Sonet_Line_NearEnd_pm_view

2.1.9  SONET_PHYSICAL_PM_VIEW

2.1.10  SONET_POS_PM_VIEW

2.1.11  Sonet_Section_NearEnd_pm_view

2.1.12  Sonet_STSPATH_FarEnd_pm_view

2.1.13  Sonet_STSPATH_NearEnd_pm_view

2.2  CTM Base Views

2.2.1  active_alarm_view_with_ack

2.2.2  Admin_Job_View

2.2.3  alarm_count_view

2.2.4  alarm_log_view

2.2.5  audit_log_view

2.2.6  BLSR_TABLE_VIEW

2.2.7  children_view

2.2.8  circuit_ctpspan_view

2.2.9  circuit_ctp_drop_view

2.2.10  circuit_ctp_sec_view

2.2.11  circuit_ctp_src_view

2.2.12  CIRCUIT_CTP_VIEW

2.2.13  circuit_node_gui_view

2.2.14  circuit_node_gui_view_ctm46

2.2.15  circuit_node_view

2.2.16  Circuit_Span_View

2.2.17  Circuit_Span_View_ctm46

2.2.18  Circuit_View

2.2.19  circuit_vlan_view

2.2.20  ckt_span_dest_mt_view

2.2.21  ckt_span_src_mt_view

2.2.22  Client_User_VIEW

2.2.23  CTM_Unknown_User_View

2.2.24  DATA_CARD_VIEW

2.2.25  domain_ne_inventory_view

2.2.26  DSP_CIRCUIT_VIEW

2.2.27  DSP_EQPT_VIEW

2.2.28  GWCORBA_PM_MAPPING_VIEW

2.2.29  INTF_SUB_INTF_VIEW

2.2.30  Inventory_Table_View

2.2.31  IOS_ACTIVE_CARDS

2.2.32  IOS_USERS_VIEW

2.2.33  link_utilization_view

2.2.34  LINK_UTILIZATION_VIEW

2.2.35  link_view

2.2.36  mcard_l2topology_map_view

2.2.37  MLL_INV_VIEW

2.2.38  NE_Alarm_View

2.2.39  NE_Circuit_NodeID_View

2.2.40  NE_Circuit_Vlan_View

2.2.41  NE_Info_NP_VIEW

2.2.42  NE_Inventory_View

2.2.43  NE_SWIMAGE_VIEW

2.2.44  OSS_Alarm_Fltr_AidDeny_VIEW

2.2.45  OSS_Alarm_Fltr_TidDeny_VIEW

2.2.46  OSS_Corba_User_View

2.2.47  OSS_User_View

2.2.48  POS_PORTS_VIEW

2.2.49  QOSTEMPLATE_GENERAL_VIEW

2.2.50  QOS_VIEW

2.2.51  roll_view

2.2.52  Self_Monitoring_view

2.2.53  SPR_VIEW

2.2.54  SW_Active_Alarm_View

2.2.55  SW_User_Port_View

2.2.56  tl1_active_alarm_view

2.2.57  TL1_NE_View

2.2.58  TOPOLOGY_CIRCUIT_VIEW

2.2.59  TOPOLOGY_CIRCUIT_VIEW_CTM5_0

2.2.60  topology_gui_view

2.2.61  trace_vlan_view

2.2.62  UNMANAGED_NE_INVENTORY_VIEW

2.2.63  User_NE_View

2.2.64  User_View

2.2.65  VLAN_DROP_PORTS_QOS_VIEW

2.2.66  VLAN_DROP_PORTS_VIEW

2.2.67  VLAN_SERVICE_VIEW

2.3  Cisco Catalyst 6509 Views

2.4  Cisco CRS-1 (HFR) Views

2.4.1  HFR_BGP_PEER_PM_VIEW

2.4.2  HFR_INTERFACE_DRC_PM_VIEW

2.4.3  HFR_INTERFACE_GC_PM_VIEW

2.4.4  HFR_inventory_view

2.4.5  HFR_MPLS_INTERFACE_PM_VIEW

2.4.6  HFR_MPLS_LDP_PM_VIEW

2.4.7  HFR_MPLS_TE_LINK_PM_VIEW

2.4.8  HFR_MPLS_TE_TUNNEL_PM_VIEW

2.4.9  HFR_NODE_CPU_PM_VIEW

2.4.10  HFR_NODE_MEMORY_PM_VIEW

2.4.11  HFR_NODE_PROCESS_PM_VIEW

2.4.12  HFR_OSPF_V2_PM_VIEW

2.4.13  HFR_OSPF_V3_PM_VIEW

2.5  Cisco MGX Media Gateway Views

2.5.1  access_node

2.5.2  bis_object

2.5.3  card

2.5.4  line

2.5.5  MGX8880_inventory_view

2.5.6  node

2.5.7  node_info

2.5.8  peripheral

2.5.9  sensor

2.5.10  xpvc

2.5.11  xpvc_segment

2.6  Cisco ONS 152xx Views

2.7  Cisco ONS 15216 Views

2.7.1  ONS15216_Active_User_view

2.7.2  ONS15216_INVENTORY_VIEW

2.7.3  ONS15216_User_view

2.8  Cisco ONS 153xx Views

2.8.1  ons1530x_dcc_pm_view

2.8.2  ons1530x_ho_fe_pm_view

2.8.3  ons1530x_ho_pm_view

2.8.4  ONS1530x_inventory_view

2.8.5  ons1530x_lan_pm_view

2.8.6  ons1530x_lo_fe_pm_view

2.8.7  ons1530x_lo_pm_view

2.8.8  ons1530x_ms_fe_pm_view

2.8.9  ons1530x_ms_pm_view

2.8.10  ons1530x_rs_pm_view

2.8.11  ons1530x_wan_pm_view

2.9  Cisco ONS 15454 Views

2.9.1  Ctc_User_Profiles_view

2.9.2  NE_Audit_Trail_view

2.9.3  ONS15454sdh_E1_pm_fe_view

2.9.4  ONS15454sdh_E1_pm_view

2.9.5  ONS15454sdh_E3_pm_view

2.9.6  ONS15454sdh_E4_pm_view

2.9.7  ONS15454sdh_ho_pm_fe_view

2.9.8  ONS15454sdh_ho_pm_view

2.9.9  ONS15454sdh_lo_vc11_pm_fe_view

2.9.10  ONS15454sdh_lo_vc11_pm_view

2.9.11  ONS15454sdh_lo_vc12_pm_fe_view

2.9.12  ONS15454sdh_lo_vc12_pm_view

2.9.13  ONS15454sdh_lo_vc3_pm_fe_view

2.9.14  ONS15454sdh_lo_vc3_pm_view

2.9.15  ONS15454sdh_ms_pm_fe_view

2.9.16  ONS15454sdh_ms_pm_view

2.9.17  ONS15454sdh_rs_pm_view

2.9.18  ONS15454_8B10B_PM_VIEW

2.9.19  ONS15454_Active_User_view

2.9.20  ONS15454_BLSR_CONFIG_VIEW

2.9.21  ONS15454_BLSR_SQUELCH_VIEW

2.9.22  ONS15454_CMS_Storage_View

2.9.23  ONS15454_COS_pm_view

2.9.24  ONS15454_DS1_PM_FE_VIEW

2.9.25  ONS15454_ds1_pm_view

2.9.26  ONS15454_ds3_pm_fe_view

2.9.27  ONS15454_ds3_pm_view

2.9.28  ONS15454_DWDM_RING_VIEW

2.9.29  ONS15454_enet_pm_view

2.9.30  ONS15454_FC_PM_VIEW

2.9.31  ONS15454_gfp_pm_view

2.9.32  ONS15454_inventory_view

2.9.33  ONS15454_OPTICS_PM_VIEW

2.9.34  ONS15454_OSPF_AREA_RANGE_VIEW

2.9.35  ONS15454_OTN_fec_pm_view

2.9.36  ONS15454_otn_path_pm_fe_view

2.9.37  ONS15454_OTN_path_pm_view

2.9.38  ONS15454_otn_sec_pm_fe_view

2.9.39  ONS15454_OTN_sec_pm_view

2.9.40  ONS15454_PHY_LAYER_PM_VIEW

2.9.41  ONS15454_pos_pm_view

2.9.42  ONS15454_RING_MAP_VIEW

2.9.43  ONS15454_SECURITY_VIEW

2.9.44  ONS15454_SNMP_TRAP_DEST_VIEW

2.9.45  ONS15454_sonet_line_pm_fe_view

2.9.46  ONS15454_sonet_line_pm_view

2.9.47  ONS15454_sonet_path_pm_fe_view

2.9.48  ONS15454_sonet_path_pm_view

2.9.49  ONS15454_sonet_section_pm_view

2.9.50  ONS15454_sonet_vt2_pm_fe_view

2.9.51  ONS15454_sonet_vt2_pm_view

2.9.52  ONS15454_sonet_vt_pm_fe_view

2.9.53  ONS15454_sonet_vt_pm_view

2.9.54  ONS15454_SPANING_TREES_VIEW

2.9.55  ons15454_static_route_view

2.9.56  ONS15454_THRESHOLD_VIEW

2.9.57  ONS15454_User_view

2.9.58  ONS15454_VIRTUAL_LINK_VIEW

2.9.59  PM_METADATA_INFO_VIEW

2.9.60  PM_METADATA_VIEW

2.10  Cisco ONS 155xx Views

2.10.1  ONS15501_opt_power_pm_view

2.10.2  ONS155xx_CDL_FLOW_CONFIG_VIEW

2.10.3  ONS155xx_CDL_pm_view

2.10.4  ONS155xx_Circuit_CC_View

2.10.5  ONS155xx_Circuit_Dest_View

2.10.6  ONS155xx_Circuit_Final_View

2.10.7  ONS155xx_CIRCUIT_PATH_VIEW

2.10.8  ONS155xx_Circuit_Segment_View

2.10.9  ONS155xx_Circuit_Span_View

2.10.10  ONS155xx_Circuit_SRCDEST_VIEW

2.10.11  ONS155xx_Circuit_Stack_View

2.10.12  ONS155xx_Circuit_View

2.10.13  ONS155xx_ckt_cc_dest_mt_view

2.10.14  ONS155xx_CKT_CC_DETAILED_View

2.10.15  ONS155xx_CKT_CC_LINK_View

2.10.16  ONS155xx_CKT_CC_Path_View

2.10.17  ONS155XX_CKT_CC_SRC_DEST_VIEW

2.10.18  ONS155xx_ckt_cc_src_mt_view

2.10.19   ONS155xx_CKT_ENDPOINT_VIEW

2.10.20  ONS155XX_CKT_LINK_FINAL_VIEW

2.10.21  ONS155xx_CKT_LINK_View

2.10.22  ONS155XX_CKT_NE_FINAL_VIEW

2.10.23  ONS155xx_CKT_OPT_PWR_VIEW

2.10.24  ONS155xx_CKT_PATH_FINAL_VIEW

2.10.25  ONS155xx_CKT_PATH_JOIN_VIEW

2.10.26  ONS155xx_Ckt_Path_Stack_View

2.10.27  ONS155xx_CKT_Segment_Path_View

2.10.28  ONS155xx_CKT_SEG_DETAILED_View

2.10.29  ONS155xx_ckt_span_dest_mt_view

2.10.30  ONS155xx_CKT_SPAN_DET_VIEW

2.10.31  ONS155xx_CKT_SPAN_JOIN_View

2.10.32  ONS155xx_CKT_SPAN_MT_VIEW

2.10.33  ONS155xx_ckt_span_src_mt_view

2.10.34  ONS155xx_CKT_SPAN_VIEW

2.10.35  ONS155xx_CKT_SRCDEST_MT_VIEW

2.10.36  ONS155xx_CKT_SRC_CDL_VIEW

2.10.37  ONS155XX_CKT_STACK_FINAL_VIEW

2.10.38  ONS155xx_Discovery_Info_View

2.10.39  Ons155xx_Dcrp_View

2.10.40  ONS155xx_Ether_Hist_pm_view

2.10.41  ONS155xx_FCM_PE_pm_view

2.10.42  Ons155xx_Flash_Part_View

2.10.43  ONS155xx_INVENTORY_VIEW

2.10.44  ONS155XX_LINK_CORRELATOR

2.10.45  ONS155xx_Module_Type_view

2.10.46  ONS155xx_opt_power_pm_view

2.10.47  ONS155XX_PATH_CKT_FINAL_VIEW

2.10.48   ONS155xx_PATH_DEST_PWR_VIEW

2.10.49  ONS155XX_PATH_LINK_FINAL_VIEW

2.10.50   ONS155xx_Path_Link_View

2.10.51  ONS155xx_PATH_PWR_MONITOR_VIEW

2.10.52  ONS155xx_PATH_PWR_NO_AVA_VIEW

2.10.53  ONS155xx_PATH_PWR_NO_MON_VIEW

2.10.54  ONS155xx_PATH_STACK_FINAL_VIEW

2.10.55  ONS155xx_phy_pm_view

2.10.56  ONS155xx_sonet_section_pm_view

2.10.57  ONS155xx_tca_pm_view

2.11  Cisco ONS 156xx Views

2.11.1  ONS15600sdh_ho_pm_fe_view

2.11.2  ONS15600sdh_ho_pm_view

2.11.3  ONS15600sdh_ms_pm_fe_view

2.11.4  ONS15600sdh_ms_pm_view

2.11.5  ONS15600sdh_rs_pm_view

2.11.6  ONS15600_enet_pm_view

2.11.7  ONS15600_pos_pm_view

2.11.8  ONS15600_SONET_LINE_FE_PM_VIEW

2.11.9  ONS15600_SONET_LINE_PM_VIEW

2.11.10  ONS15600_SONET_PATH_FE_PM_VIEW

2.11.11  ONS15600_SONET_PATH_PM_VIEW

2.11.12  ONS15600_Sonet_Sec_PM_View

2.12  Cisco ONS 158xx Views

2.12.1  ons158xx_ada_24h_pm_view

2.12.2  ons158xx_ada_pm_view

2.12.3  ons158xx_aiu_24h_pm_view

2.12.4  ons158xx_aiu_pm_view

2.12.5  ons158xx_all_ampl_24h_pm_view

2.12.6  ons158xx_all_ampl_elh_pm_view

2.12.7  ons158xx_all_ampl_pm_view

2.12.8  ons158xx_all_mux_24h_pm_view

2.12.9  ons158xx_all_mux_pm_view

2.12.10  ons158xx_all_tran_24h_pm_view

2.12.11  ons158xx_all_tran_pm_view

2.12.12  ons158xx_all_wd_24h_pm_view

2.12.13  ons158xx_all_wd_pm_view

2.12.14  ons158xx_ampl_elh_24h_pm_view

2.12.15  ons158xx_amplifier_24h_pm_view

2.12.16  ons158xx_amplifier_pm_view

2.12.17  ons158xx_b1_24h_pm_view

2.12.18  ons158xx_b1_fec_24h_pm_view

2.12.19  ons158xx_b1_fec_pm_view

2.12.20  ons158xx_b1_pm_view

2.12.21  ons158xx_bba_24h_pm_view

2.12.22  ons158xx_bba_pm_view

2.12.23  ons158xx_bcs_24h_pm_view

2.12.24  ons158xx_bcs_pm_view

2.12.25  ons158xx_bt_24h_pm_view

2.12.26  ons158xx_bt_pm_view

2.12.27  ons158xx_cmp_24h_pm_view

2.12.28  ons158xx_cmp_pm_view

2.12.29  ons158xx_demux_24h_pm_view

2.12.30  ons158xx_demux_pm_view

2.12.31  ons158xx_eth_24h_pm_view

2.12.32  ons158xx_eth_pm_view

2.12.33  ons158xx_fec_24h_pm_view

2.12.34  ons158xx_fec_pm_view

2.12.35  ONS158XX_inventory_view

2.12.36  ons158xx_ioc_card_24h_pm_view

2.12.37  ons158xx_ioc_card_pm_view

2.12.38  ons158xx_irba_24h_pm_view

2.12.39  ons158xx_irba_pm_view

2.12.40  ONS158xx_LAC_ACTIVE_USERS_VIEW

2.12.41  ONS158xx_LAC_LOG_STATUS_VIEW

2.12.42  ONS158xx_LAC_LOG_VIEW

2.12.43  ONS158xx_LAC_PROFILE_VIEW

2.12.44  ONS158xx_LAC_USERS_VIEW

2.12.45  ons158xx_lem_24h_pm_view

2.12.46  ons158xx_lem_b1_24h_pm_view

2.12.47  ons158xx_lem_b1_pm_view

2.12.48  ons158xx_lem_fec_24h_pm_view

2.12.49  ons158xx_lem_fec_pm_view

2.12.50  ons158xx_lem_pm_view

2.12.51  ons158xx_lsm_24h_pm_view

2.12.52   ons158xx_lsm_pm_view

2.12.53  ons158xx_lt_24h_pm_view

2.12.54  ons158xx_lt_pm_view

2.12.55  ons158xx_mux_24h_pm_view

2.12.56  ons158xx_mux_pm_view

2.12.57  ons158xx_oa_elh_24h_pm_view

2.12.58  ons158xx_oa_elh_pm_view

2.12.59  ons158xx_oad_24h_pm_view

2.12.60  ons158xx_oad_pm_view

2.12.61  ons158xx_oadm_24h_pm_view

2.12.62  ons158xx_oadm_pm_view

2.12.63  ons158xx_oba_c_24h_pm_view

2.12.64  ons158xx_oba_c_pm_view

2.12.65  ons158xx_ocp_24h_pm_view

2.12.66  ons158xx_ocp_pm_view

2.12.67  ons158xx_oecp_24h_pm_view

2.12.68  ons158xx_oecp_pm_view

2.12.69  ons158xx_oep_c_24h_pm_view

2.12.70  ons158xx_oep_c_pm_view

2.12.71  ons158xx_op_elh_24h_pm_view

2.12.72  ons158xx_op_elh_pm_view

2.12.73  ons158xx_opa_c_24h_pm_view

2.12.74  ons158xx_opa_c_pm_view

2.12.75  ons158xx_orp_elh_24h_pm_view

2.12.76   ons158xx_orp_elh_pm_view

2.12.77  ons158xx_oscm_24h_pm_view

2.12.78  ons158xx_oscm_pm_view

2.12.79  ons158xx_osu_24h_pm_view

2.12.80  ons158xx_osu_pm_view

2.12.81  ons158xx_pm_module_view

2.12.82  ons158xx_pre_l_ir_24h_pm_view

2.12.83  ons158xx_pre_l_ir_pm_view

2.12.84  ons158xx_prel_24h_pm_view

2.12.85  ons158xx_prel_pm_view

2.12.86  ons158xx_rba_24h_pm_view

2.12.87  ons158xx_rba_pm_view

2.12.88  ons158xx_rt_24h_pm_view

2.12.89  ons158xx_rt_pm_view

2.12.90  ons158xx_rxt_24h_pm_view

2.12.91   ons158xx_rxt_b1_24h_pm_view

2.12.92  ons158xx_rxt_b1_pm_view

2.12.93  ons158xx_rxt_fec_24h_pm_view

2.12.94  ons158xx_rxt_fec_pm_view

2.12.95  ons158xx_rxt_pm_view

2.12.96  ons158xx_scf_24h_pm_view

2.12.97  ons158xx_scf_pm_view

2.12.98  ons158xx_scu_24h_pm_view

2.12.99  ons158xx_scu_pm_view

2.12.100  ons158xx_simple_24h_pm_view

2.12.101  ons158xx_simple_pm_view

2.12.102  ons158xx_tpa_24h_pm_view

2.12.103  ons158xx_tpa_pm_view

2.12.104  ons158xx_trans_b1_24h_pm_view

2.12.105  ons158xx_trans_b1_pm_view

2.12.106  ons158xx_trans_fec_24h_pm_view

2.12.107  ons158xx_transp_24h_pm_view

2.12.108  ons158xx_transp_fec_pm_view

2.12.109  ons158xx_transponder_pm_view

2.12.110  ons158xx_tt_24h_pm_view

2.12.111  ons158xx_tt_pm_view

2.12.112  ons158xx_wcm_24h_pm_view

2.12.113  ons158xx_wcm_b1_24h_pm_view

2.12.114  ons158xx_wcm_b1_pm_view

2.12.115  ons158xx_wcm_fec_24h_pm_view

2.12.116   ons158xx_wcm_fec_pm_view

2.12.117  ons158xx_wcm_pm_view

2.12.118  ons158xx_wd_24h_pm_view

2.12.119  ons158xx_wd_pm_view

2.12.120  ons158xx_wd_rx_24h_pm_view

2.12.121  ons158xx_wd_rx_pm_view

2.12.122  pirelli_inventory_view

2.13   Cisco XR 12000 Views


Database Schema Views


This chapter describes the database views that CTM creates and uses. The following CTM views are listed in alphabetical order by category.

2.1  Common PM Views

2.1.1  Sdh_Ho_FarEnd_pm_view

CREATE OR REPLACE VIEW Sdh_Ho_FarEnd_pm_view AS
SELECT
       ne.NESysID,
       ne.NEDbaccessid,
       en.ModuleName, 
       ho454sdh.ModuleType,
       ho454sdh.Physicalloc, 
       ho454sdh.NEIfIndex,
       ho454sdh.TimeStamp,
       ho454sdh.NEIfPMStatus,
       ho454sdh.inMaintenance,
       ho454sdh.fehpeb as FEHPEB,
       ho454sdh.fehpes as FEHPES,
       ho454sdh.fehpses as FEHPSES,
       ho454sdh.fehpuas as FEHPUAS,
       to_number('-1') as FEHPFC,
       ho454sdh.fehpbbe as FEHPBBE,
       ho454sdh.fehpesr as FEHPESR,
       ho454sdh.fehpsesr as FEHPSESR,
       ho454sdh.fehpbber as FEHPBBER,
       ho454sdh.thresholdList as ThresholdList,
       ho454sdh.IS24H as IS24H,
	 ho454sdh.ModelType,
       ho454sdh.ObjectType,
       ho454sdh.StrObjInstance,
       ho454sdh.INVALIDITYLIST,
       ho454sdh.rowid as Myrow
FROM   ONS15454SDH_HO_PM_TABLE ho454sdh,
       ne_info_table ne,
       module_type_table en
WHERE
       ho454sdh.Nedbaccessid = ne.nedbaccessid AND
       ho454sdh.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype
UNION ALL
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       ho600sdh.ModuleType,
       ho600sdh.Physicalloc, 
       ho600sdh.NEIfIndex, 
       ho600sdh.TimeStamp, 
       ho600sdh.NEIfPMStatus,
       ho600sdh.inMaintenance,
       ho600sdh.fehpeb as FEHPEB,
       ho600sdh.fehpes as FEHPES,
       ho600sdh.fehpses as FEHPSES,
       ho600sdh.fehpuas as FEHPUAS,
       ho600sdh.fehpfc as FEHPFC,
       ho600sdh.fehpbbe as FEHPBBE,
       ho600sdh.fehpesr as FEHPESR,
       ho600sdh.fehpsesr as FEHPSESR,
       ho600sdh.fehpbber as FEHPBBER,
       ho600sdh.thresholdList as ThresholdList,
       ho600sdh.IS24H as IS24H,
	 ho600sdh.ModelType,
       ho600sdh.ObjectType,
       ho600sdh.StrObjInstance,
       ho600sdh.INVALIDITYLIST,
       ho600sdh.rowid as Myrow
FROM   ONS15600SDH_HO_PM_TABLE ho600sdh,
       ne_info_table ne,
       module_type_table en
WHERE
       ho600sdh.Nedbaccessid = ne.nedbaccessid AND
       ho600sdh.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype;

2.1.2  Sdh_Ho_NearEnd_pm_view

CREATE OR REPLACE VIEW Sdh_Ho_NearEnd_pm_view AS
SELECT 
       ne.NESysID, 
       ne.NEDbaccessid,
       getModuleName_pm(ne.nenodeid, ho454sdh.ModuleType) as ModuleName, 
       decode(ho454sdh.ModuleType,'',ms454sdh.ModuleType,ho454sdh.ModuleType) as 
ModuleType,
       ho454sdh.Physicalloc, 
       ho454sdh.NEIfIndex, 
       decode(ho454sdh.TimeStamp,'',ms454sdh.timestamp,ho454sdh.Timestamp) as Timestamp, 
       ho454sdh.NEIfPMStatus,
       ho454sdh.inMaintenance,
       ho454sdh.hpeb as HPEB,
       ho454sdh.hpes as HPES,
       ho454sdh.hpses as HPSES,
       ho454sdh.hpuas as HPUAS,
       to_number('-1') as HPFC,
       ho454sdh.hpbbe as HPBBE,
       GETPMPARAMETERVALUE(ho454sdh.hpppjcpdet,ms454sdh.msppjcpdet) as PPJC_PDET,
       GETPMPARAMETERVALUE(ho454sdh.hpnpjcpdet,ms454sdh.msnpjcpdet) as NPJC_PDET,
       GETPMPARAMETERVALUE(ho454sdh.hpppjcpgen,ms454sdh.msppjcpgen) as PPJC_PGEN,
       GETPMPARAMETERVALUE(ho454sdh.hpnpjcpgen,ms454sdh.msnpjcpgen) as NPJC_PGEN,
       ho454sdh.hppjdiff as PJ_DIFF,
       ho454sdh.hppjpsec as PJP_SEC,
       ho454sdh.hppjnsec as PJN_SEC,
       ho454sdh.hpesr as HPESR,
       ho454sdh.hpsesr as HPSESR,
       ho454sdh.hpbber as HPBBER,
       ho454sdh.thresholdList as ThresholdList,
       ho454sdh.IS24H as IS24H,
       ho454sdh.ModelType,
       ho454sdh.ObjectType,
       ho454sdh.StrObjInstance,
       ho454sdh.INVALIDITYLIST,
       ho454sdh.rowid as Myrow
FROM   ONS15454SDH_HO_PM_TABLE ho454sdh,
       ONS15454SDH_MS_PM_TABLE ms454sdh,
       ne_info_table ne
WHERE
        ms454sdh.Nedbaccessid(+) = ho454sdh.nedbaccessid and
        ms454sdh.timestamp(+) = ho454sdh.Timestamp and
        ms454sdh.moduletype(+)   =ho454sdh.ModuleType and
        ms454sdh.physicalloc(+) = ho454sdh.physicalloc and
        ms454sdh.IS24H(+)      = ho454sdh.IS24H  and
        ho454sdh.Nedbaccessid = ne.nedbaccessid
UNION ALL
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       ho600sdh.ModuleType,
       ho600sdh.Physicalloc, 
       ho600sdh.NEIfIndex, 
       ho600sdh.TimeStamp, 
       ho600sdh.NEIfPMStatus,
       ho600sdh.inMaintenance,
       ho600sdh.hpeb as HPEB,
       ho600sdh.hpes as HPES,
       ho600sdh.hpses as HPSES,
       ho600sdh.hpuas as HPUAS,
       ho600sdh.hpfc as HPFC,
       ho600sdh.hpbbe as HPBBE,
       ho600sdh.hppjpin as PPJC_PDET,
       ho600sdh.hppjnin as NPJC_PDET,
       ho600sdh.hppjpout as PPJC_PGEN,
       ho600sdh.hppjnout as NPJC_PGEN,
       to_number('-1') as PJ_DIFF,
       to_number('-1') as PJP_SEC,
       to_number('-1') as PJN_SEC,
       ho600sdh.hpesr as HPESR,
       ho600sdh.hpsesr as HPSESR,
       ho600sdh.hpbber as HPBBER,
       ho600sdh.thresholdList as ThresholdList,
       ho600sdh.IS24H as IS24H,
       ho600sdh.ModelType,
       ho600sdh.ObjectType,
       ho600sdh.StrObjInstance,
       ho600sdh.INVALIDITYLIST,
       ho600sdh.rowid as Myrow
FROM   ONS15600SDH_HO_PM_TABLE ho600sdh,
       ne_info_table ne,
       module_type_table en
WHERE
       ho600sdh.Nedbaccessid = ne.nedbaccessid AND
       ho600sdh.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype;

2.1.3  Sdh_Ms_FarEnd_pm_view

CREATE OR REPLACE VIEW Sdh_Ms_FarEnd_pm_view AS
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       ms454sdh.ModuleType,
       ms454sdh.Physicalloc, 
       ms454sdh.NEIfIndex, 
       ms454sdh.TimeStamp, 
       ms454sdh.NEIfPMStatus,
       ms454sdh.inMaintenance,
       ms454sdh.femseb as FEMSEB,
       ms454sdh.femses as FEMSES,
       ms454sdh.femsses as FEMSSES,
       ms454sdh.femsuas as FEMSUAS,
       to_number('-1') as FEMSFC,
       ms454sdh.femsbbe as FEMSBBE,
       ms454sdh.femsesr as FEMSESR,
       ms454sdh.femssesr as FEMSSESR,
       ms454sdh.femsbber as FEMSBBER,
       ms454sdh.thresholdList as ThresholdList,
       ms454sdh.IS24H as IS24H,
	 ms454sdh.ModelType,
       ms454sdh.ObjectType,
       ms454sdh.StrObjInstance,
       ms454sdh.INVALIDITYLIST,
       ms454sdh.rowid as Myrow
FROM   ONS15454SDH_MS_PM_TABLE ms454sdh,
       ne_info_table ne,
       module_type_table en
WHERE
       ms454sdh.Nedbaccessid = ne.nedbaccessid AND
       ms454sdh.ModuleType    = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype
UNION ALL
SELECT
       ne.NESysID,
       ne.NEDbaccessid,
       en.ModuleName,
       ms600sdh.ModuleType,
       ms600sdh.Physicalloc,
       ms600sdh.NEIfIndex,
       ms600sdh.TimeStamp,
       ms600sdh.NEIfPMStatus,
       ms600sdh.inMaintenance,
       ms600sdh.femseb as FEMSEB,
       ms600sdh.femses as FEMSES,
       ms600sdh.femsses as FEMSSES,
       ms600sdh.femsuas as FEMSUAS,
       ms600sdh.femsfc as FEMSFC,
       ms600sdh.femsbbe as FEMSBBE,
       to_number('-1') as FEMSESR,
       to_number('-1') as FEMSSESR,
       to_number('-1') as FEMSBBER,
       ms600sdh.thresholdList as ThresholdList,
       ms600sdh.IS24H as IS24H,
	ms600sdh.ModelType,
       ms600sdh.ObjectType,
       ms600sdh.StrObjInstance,
       ms600sdh.INVALIDITYLIST,
       ms600sdh.rowid as Myrow
FROM   ONS15600SDH_MS_PM_TABLE ms600sdh,
       ne_info_table ne,
       module_type_table en
WHERE
       ms600sdh.Nedbaccessid = ne.nedbaccessid AND
       ms600sdh.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype;

2.1.4  Sdh_Ms_NearEnd_pm_view

CREATE OR REPLACE VIEW Sdh_Ms_NearEnd_pm_view AS
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       ms454sdh.ModuleType,
       ms454sdh.Physicalloc, 
       ms454sdh.NEIfIndex, 
       ms454sdh.TimeStamp, 
       ms454sdh.NEIfPMStatus,
       ms454sdh.inMaintenance,
       ms454sdh.mseb as MSEB,
       ms454sdh.mses as MSES,
       ms454sdh.msses as MSSES,
       ms454sdh.msuas as MSUAS,
       ms454sdh.msfc as MSFC,
       ms454sdh.msbbe as MSBBE,
       ms454sdh.mspsc as MSPSC,
       ms454sdh.mspsd as MSPSD,
       ms454sdh.mspscw as MSPSCW,
       ms454sdh.mspsdw as MSPSDW,
       ms454sdh.mspscs as MSPSCS,
       ms454sdh.mspsds as MSPSDS,
       ms454sdh.mspscr as MSPSCR,
       ms454sdh.mspsdr as MSPSDR,
       ms454sdh.msesr as MSESR,
       ms454sdh.mssesr as MSSESR,
       ms454sdh.msbber as MSBBER,
       ms454sdh.thresholdList as ThresholdList,
       ms454sdh.IS24H as IS24H,
       ms454sdh.ModelType,
       ms454sdh.ObjectType,
       ms454sdh.StrObjInstance,
       ms454sdh.INVALIDITYLIST,
       ms454sdh.rowid as Myrow
FROM   ONS15454SDH_MS_PM_TABLE ms454sdh,
       ne_info_table ne,
       module_type_table en
WHERE
       ms454sdh.Nedbaccessid = ne.nedbaccessid AND
       ms454sdh.ModuleType    = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype
UNION ALL
SELECT
       ne.NESysID,
       ne.NEDbaccessid,
       en.ModuleName,
       ms600sdh.ModuleType,
       ms600sdh.Physicalloc,
       ms600sdh.NEIfIndex,
       ms600sdh.TimeStamp,
       ms600sdh.NEIfPMStatus,
       ms600sdh.inMaintenance,
       ms600sdh.mseb as MSEB,
       ms600sdh.mses as MSES,
       ms600sdh.msses as MSSES,
       ms600sdh.msuas as MSUAS,
       ms600sdh.msfc as MSFC,
       ms600sdh.msbbe as MSBBE,
       ms600sdh.mspsc as MSPSC,
       ms600sdh.mspsd as MSPSD,
       ms600sdh.mspscw as MSPSCW,
       ms600sdh.mspsdw as MSPSDW,
       ms600sdh.mspscs as MSPSCS,
       ms600sdh.mspsds as MSPSDS,
       ms600sdh.mspscr as MSPSCR,
       ms600sdh.mspsdr as MSPSDR,
       to_number('-1') as MSESR,
       to_number('-1') as MSSESR,
       to_number('-1') as MSBBER,
       ms600sdh.thresholdList as ThresholdList,
       ms600sdh.IS24H as IS24H,
       ms600sdh.ModelType,
       ms600sdh.ObjectType,
       ms600sdh.StrObjInstance,
       ms600sdh.INVALIDITYLIST,
       ms600sdh.rowid as Myrow
FROM   ONS15600SDH_MS_PM_TABLE ms600sdh,
       ne_info_table ne,
       module_type_table en
WHERE
       ms600sdh.Nedbaccessid = ne.nedbaccessid AND
       ms600sdh.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype;

2.1.5  Sdh_Rs_NearEnd_pm_view

CREATE OR REPLACE VIEW Sdh_Rs_NearEnd_pm_view AS
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       rs454sdh.ModuleType,
       rs454sdh.Physicalloc, 
       rs454sdh.NEIfIndex, 
       rs454sdh.TimeStamp, 
       rs454sdh.NEIfPMStatus,
       rs454sdh.inMaintenance,
       rs454sdh.rseb as RSEB,
       rs454sdh.rses as RSES,
       rs454sdh.rsses as RSSES,
       rs454sdh.rssefs as RSSEFS,
       rs454sdh.rsbbe as RSBBE,
       rs454sdh.rsesr as RSESR,
       rs454sdh.rssesr as RSSESR,
       rs454sdh.rsbber as RSBBER,
       rs454sdh.thresholdList as ThresholdList,
       rs454sdh.IS24H as IS24H,
       rs454sdh.ModelType,
       rs454sdh.ObjectType,
       rs454sdh.StrObjInstance,
       rs454sdh.INVALIDITYLIST,
       rs454sdh.rowid as Myrow
FROM   ONS15454SDH_RS_PM_TABLE rs454sdh,
       ne_info_table ne,
       module_type_table en
WHERE
       rs454sdh.Nedbaccessid = ne.nedbaccessid AND
       rs454sdh.ModuleType    = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype
UNION ALL
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       rs600sdh.ModuleType,
       rs600sdh.Physicalloc, 
       rs600sdh.NEIfIndex, 
       rs600sdh.TimeStamp, 
       rs600sdh.NEIfPMStatus,
       rs600sdh.inMaintenance,
       rs600sdh.rseb as RSEB,
       rs600sdh.rses as RSES,
       rs600sdh.rsses as RSSES,
       rs600sdh.rssefs as RSSEFS,
       rs600sdh.rsbbe as RSBBE,
		to_number('-1')  as RSESR,
       to_number('-1') as RSSESR,
       to_number('-1') as RSBBER,
       rs600sdh.thresholdList as ThresholdList,
       rs600sdh.IS24H as IS24H,
       rs600sdh.ModelType,
       rs600sdh.ObjectType,
       rs600sdh.StrObjInstance,
       rs600sdh.INVALIDITYLIST,
       rs600sdh.rowid as Myrow
FROM   ONS15600SDH_RS_PM_TABLE rs600sdh,
       ne_info_table ne,
       module_type_table en
WHERE
       rs600sdh.Nedbaccessid = ne.nedbaccessid AND
       rs600sdh.ModuleType    = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype;

2.1.6  SONET_ENET_PM_VIEW

CREATE OR REPLACE VIEW SONET_ENET_PM_VIEW  AS 
SELECT
       ni.NESysID,				 
       ni.NEDbaccessid,				                                                                                
       en.ModuleName,	 
       en.ModuleType,				                                                                                
       enet.Physicalloc,			 
       enet.NEIfIndex,				 
       enet.TimeStamp,				 
       enet.NEIfPmStatus,
       enet.InMaintenance,
       enet.ThresholdList,
       enet.IfInOctets,
       enet.RxPackets,
       enet.IfInUcastPkts,
       enet.IfInMulticastPkts,
       enet.IfInBroadcastPkts,
       enet.IfInErrors,
       enet.IfOutOctets,
       decode(en.Moduletype,102,to_char(enet.TxPackets),
                            103,to_char(enet.TxPackets),
		            118,to_char(enet.TxPackets),
                            119,to_char(enet.TxPackets),
			    181,to_char(enet.TxPackets),
			    182,to_char(enet.TxPackets),
			    183,to_char(enet.TxPackets),
			    184,to_char(enet.TxPackets),
                                
get_enet_value2(enet.IfOutUcastPkts,enet.IfOutMulticastPkts,enet.IfOutBroadcastPkts)
             ) as TxPackets,
       enet.IfOutUcastPkts,
       enet.IfOutMulticastPkts,
       enet.IfOutBroadcastPkts,
       enet.Dot3StatsAlignmentErrors,
       enet.Dot3StatsFCSErrors,
       enet.Dot3StatsSingleCollisionFrames,
       enet.Dot3StatsMultiCollisionFrames,
       enet.Dot3StatsDeferredTransmissions,
       enet.Dot3StatsLateCollisions,
       enet.Dot3StatsExcessiveCollisions,
       enet.EtherStatsUndersizePkts,
       enet.EtherStatsFragments,
       enet.EtherStatsOversizePkts,
       enet.EtherStatsJabbers,
       decode(en.Moduletype,102, to_char(enet.RxTotalErrors),
                            103, to_char(enet.RxTotalErrors),
			    118, to_char(enet.RxTotalErrors),
                            119, to_char(enet.RxTotalErrors),
                             62, to_char(enet.RxTotalErrors),
                                 
get_enet_value2(enet.Dot3StatsFCSErrors,enet.Dot3StatsAlignmentErrors,enet.EtherStatsUnder
SizePKTS, enet.ETHERSTATSOVERSIZEPKTS,enet.ETHERSTATSFRAGMENTS,enet.ETHERSTATSJABBERS)
              )  as Rx_TOTAL_ERRORS,
       decode(en.Moduletype, 102, enet.RxRunts,
                             103, enet.RxRunts,
			     118, enet.RxRunts,
                             119, enet.RxRunts,
                              62, enet.RxRunts,
				enet.ETHERSTATSFRAGMENTS
             ) as Rx_RUNTS,
       enet.RxGIANTS as rx_giants,
       decode(en.Moduletype, 102, enet.TxCollisions,
                             103, enet.TxCollisions,
			     118, enet.TxCollisions,
                             119, enet.TxCollisions,
                                  
get_enet_value(enet.Dot3StatsSingleCollisionFrames,enet.Dot3StatsMultiCollisionFrames)
             ) as Tx_Collisions,
       enet.RxPauseFrames,
       enet.TxPauseFrames,
       enet.RxPktsDropInternalCongestion,
       enet.TxPktsDropInternalCongestion,
       enet.IS24H,
       enet.EtherUtilizationStats,
       enet.RxGMACDropCounts,
       enet.RxThresholdOversizes,
       enet.PortDropCounts,
       enet.TxGiants,
       enet.HDLCPktDrops,
       enet.RxControlFrames,
       enet.RXUnknownOpCodeFrames,
       enet.IfInErrorBytePkts,
       enet.IfInFramingErrorPkts,
       enet.IfInJunkInterPkts,
       enet.IfInDiscards,
       enet.IfOutDiscards,
       enet.Dot3StatsFrameTooLong,
       enet.Dot3StatsCarrierSenseErrors,
       enet.Dot3StatsSQETestErrors,
       enet.EtherStatsPkts64Octets,
       enet.EtherStatsPkts65to127Octets,
       enet.EtherStatsPkts128to255Octets,
       enet.EtherStatsPkts256to511Octets,
       enet.EtherStatsPkts512to1023Octets,
       enet.EtherStatsPkts1024to1518Octets,
       enet.EtherStatsBroadcastPkts,
       enet.EtherStatsMulticastPkts,
       enet.EtherStatsOctets,
       enet.EtherStatsCollisions,
       enet.EtherStatsCollisionFrames,
       enet.EtherStatsCRCAlignErrors,
       enet.MediaIndStatsRxFramesTruncated,
       enet.MediaIndStatsRxFramesTooLong,
       enet.MediaIndStatsRxFramesBadCRC,
       enet.MediaIndStatsTxFramesBadCRC,
       enet.MediaIndStatsRxShortPkts,
       enet.MediaIndStatsOversizeDropped,
       enet.IfOutErrors,
       enet.EtherStatsPkts,
       enet.Dot3StatsInternalMacTxErrors,
       enet.Dot3StatsInternalMacRxErrors,
       enet.Dot3StatsSymbolErrors,
       enet.RxEtherUtilizationStats,
       enet.TxEtherUtilizationStats,
       enet.StatsLineLastClearedTime,
       enet.MEDIAINDSTATSTXFRAMESTOOLONG,
       enet.ModelType,
       enet.ObjectType,
       enet.StrObjInstance,
       enet.InvalidityList,
       enet.rowid as myrow
FROM
       ons15454_enet_pm_table enet,
       ne_info_table ni,
       module_type_table en
WHERE
       enet.ModuleType    = en.ModuleType   AND
       ni.NEModelType     = en.ModelType    AND
       enet.NEDBAccessID  = ni.NEDBAccessID
UNION ALL
SELECT
       ni.NESysID,
       ni.NEDbaccessid,
       en.ModuleName,
       en.ModuleType,
       enet.Physicalloc,
       enet.NEIfIndex,
       enet.TimeStamp,
       enet.NEIfPmStatus,
       enet.InMaintenance,
       enet.thresholdList as ThresholdList,
       enet.IfInOctets,
       to_number('-1') as RXPACKETS,
       enet.IfInUcastPkts,
       enet.IfInMulticastPkts,
       enet.IfInBroadcastPkts,
       enet.IfInErrors,
       enet.IfOutOctets,
       to_char(-1) as TXPACKETS,
       enet.IfOutUcastPkts,
       enet.IfOutMulticastPkts,
       enet.IfOutBroadcastPkts,
       enet.Dot3StatsAlignmentErrors,
       enet.Dot3StatsFCSErrors,
	to_number('-1') as DOT3STATSSINGLECOLLISIONFRAMES,
 	to_number('-1') as DOT3STATSMULTICOLLISIONFRAMES,
	to_number('-1') as DOT3STATSDEFERREDTRANSMISSIONS,
	to_number('-1') as DOT3STATSLATECOLLISIONS,
	to_number('-1') as DOT3STATSEXCESSIVECOLLISIONS,
       enet.EtherStatsUndersizePkts,
       enet.EtherStatsFragments,
	enet.EtherStatsOversizePkts,
	enet.EtherStatsJabbers,
	to_char(-1) as RX_TOTAL_ERRORS,
	to_number('-1') as RX_RUNTS,
	to_number('-1') as RX_GIANTS,
	to_number('-1') as TX_COLLISIONS,
 	enet.RxPauseFrames,
       enet.TxPauseFrames,
	to_number('-1') as RXPKTSDROPINTERNALCONGESTION,
	to_number('-1') as TXPKTSDROPINTERNALCONGESTION,
	enet.IS24H,
	to_number('-1') as ETHERUTILIZATIONSTATS,
	to_number('-1') as RXGMACDROPCOUNTS,
	to_number('-1') as RXTHRESHOLDOVERSIZES,
	enet.EtherStatsDropEvents,
	to_number('-1') as TXGIANTS,
	to_number('-1') as HDLCPKTDROPS,
	to_number('-1') as RXCONTROLFRAMES,
	to_number('-1') as RXUNKNOWNOPCODEFRAMES,
	to_number('-1') as IFINERRORBYTEPKTS,
	to_number('-1') as IFINFRAMINGERRORPKTS,
	to_number('-1') as IFINJUNKINTERPKTS,
	enet.IfInDiscards,
    	enet.IfOutDiscards,
	enet.Dot3StatsFrameTooLong,
	to_number('-1') as DOT3STATSCARRIERSENSEERRORS,
	to_number('-1') as DOT3STATSSQETESTERRORS,
       enet.EtherStatsPkts64Octets,
       enet.EtherStatsPkts65to127Octets,
       enet.EtherStatsPkts128to255Octets,
       enet.EtherStatsPkts256to511Octets,
       enet.EtherStatsPkts512to1023Octets,
       enet.EtherStatsPkts1024to1518Octets,
       enet.EtherStatsBroadcastPkts,
       enet.EtherStatsMulticastPkts,
       enet.EtherStatsOctets,
	to_number('-1') as ETHERSTATSCOLLISIONS,
	to_number('-1') as ETHERSTATSCOLLISIONFRAMES,
	to_number('-1') as ETHERSTATSCRCALIGNERRORS,
	to_number('-1') as MEDIAINDSTATSRXFRAMESTRUNCATED,
	to_number('-1') as MEDIAINDSTATSRXFRAMESTOOLONG,
	to_number('-1') as MEDIAINDSTATSRXFRAMESBADCRC,
	to_number('-1') as MEDIAINDSTATSTXFRAMESBADCRC,
	to_number('-1') as MEDIAINDSTATSRXSHORTPKTS,
	to_number('-1') as MEDIAINDSTATSOVERSIZEDROPPED,
       enet.IfOutErrors,
       enet.EtherStatsPkts,
       enet.Dot3StatsInternalMacTxErrors,
       enet.Dot3StatsInternalMacRxErrors,
        enet.Dot3StatsSymbolErrors,
       enet.RxEtherUtilizationStats,
       enet.TxEtherUtilizationStats,
       to_Date('') as STATSLINELASTCLEAREDTIME,
       to_number('-1') as MEDIAINDSTATSTXFRAMESTOOLONG,
       enet.ModelType,
       enet.ObjectType,
       enet.StrObjInstance,
       enet.InvalidityList,
       enet.rowid as myrow
FROM
       ons15600_enet_pm_table enet,
       ne_info_table ni,
       module_type_table en
WHERE
       enet.ModuleType    = en.ModuleType   AND
       ni.NEModelType     = en.ModelType    AND
       enet.NEDBAccessID  = ni.NEDBAccessID;

2.1.7  Sonet_Line_FarEnd_pm_view

CREATE OR REPLACE VIEW Sonet_Line_FarEnd_pm_view AS
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       line454.ModuleType,
       line454.Physicalloc, 
       line454.NEIfIndex, 
       line454.TimeStamp, 
       line454.NEIfPMStatus,
       line454.inMaintenance,
       line454.fecodeviolations as CV_LFE,
       line454.feerrsecs as ES_LFE,
       line454.feseverrsecs as SES_LFE,
       line454.feunavailablesecs as UAS_LFE,
       line454.fefcl as FC_LFE,
       line454.thresholdList as ThresholdList,
       line454.IS24H as IS24H,
       line454.ModelType,
       line454.ObjectType,
       line454.StrObjInstance,
       line454.InvalidityList as InvalidityList,
       line454.rowid as Myrow
FROM   ONS15454_SONET_LINE_PM_TABLE line454,
       ne_info_table ne,
       module_type_table en
WHERE
       line454.Nedbaccessid = ne.nedbaccessid AND
       line454.ModuleType    = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype
UNION ALL
SELECT
       ne.NESysID,
       ne.NEDbaccessid,
       en.ModuleName,
       line600.ModuleType,
       line600.Physicalloc,
       line600.NEIfIndex,
       line600.TimeStamp,
       line600.NEIfPMStatus,
       line600.inMaintenance,
       line600.codeviolationsfe as CV_LFE,
       line600.errsecsfe as ES_LFE,
       line600.severrsecsfe as SES_LFE,
       line600.unavailablesecsfe as UAS_LFE,
       line600.FCLFE as FC_LFE,
       line600.thresholdList as ThresholdList,
       line600.IS24H as IS24H,
       line600.ModelType,
       line600.ObjectType,
       line600.StrObjInstance,
       line600.InvalidityList as InvalidityList,
       line600.rowid as Myrow
FROM   ONS15600_SONET_LINE_PM_TABLE line600,
       ne_info_table ne,
       module_type_table en
WHERE
       line600.Nedbaccessid = ne.nedbaccessid AND
       line600.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype;

2.1.8  Sonet_Line_NearEnd_pm_view

CREATE OR REPLACE VIEW Sonet_Line_NearEnd_pm_view AS
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       line454.ModuleType,
       line454.Physicalloc, 
       line454.NEIfIndex, 
       line454.TimeStamp, 
       line454.NEIfPMStatus,
       line454.inMaintenance,
       line454.codeviolations as CV_L,
       line454.errsecs as ES_L,
       line454.severrsecs as SES_L,
       line454.unavailablesecs as UAS_L,
       line454.PpjcPdet as PpjcPdet,	
       line454.NpjcPdet as NpjcPdet,
       line454.PpjcPgen as PpjcPgen,	
       line454.NpjcPgen as NpjcPgen,
       line454.FCL as FC_L,
       line454.PSC as PSC,
       line454.PSD as PSD,
       line454.PjDiff as PjDiff,
       line454.PjpSec as PjpSec,
       line454.PjnSec as PjnSec,
       line454.PSCW as PSC_W,
       line454.PSDW as PSD_W,
       line454.PSCR as PSC_R,
       line454.PSDR as PSD_R,
       line454.PSCS as PSC_S,
       line454.PSDS as PSD_S,
       line454.thresholdList as ThresholdList,
       line454.IS24H as IS24H,
       line454.ModelType,
       line454.ObjectType,
       line454.StrObjInstance,
       line454.InvalidityList as InvalidityList,
       line454.rowid as Myrow
FROM   ONS15454_SONET_LINE_PM_TABLE line454,
       ne_info_table ne,
       module_type_table en
WHERE
       line454.Nedbaccessid = ne.nedbaccessid AND
       line454.ModuleType    = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype
UNION ALL
SELECT
       ne.NESysID,
       ne.NEDbaccessid,
       en.ModuleName,
       line600.ModuleType,
       line600.Physicalloc,
       line600.NEIfIndex,
       line600.TimeStamp,
       line600.NEIfPMStatus,
       line600.inMaintenance,
       line600.codeviolations as CV_L,
       line600.errsecs as ES_L,
       line600.severrsecs as SES_L,
       line600.unavailablesecs as UAS_L,
       line600.PpjcPdet as PpjcPdet,	
       line600.NpjcPdet as NpjcPdet,
       line600.PpjcPgen as PpjcPgen,	
       line600.NpjcPgen as NpjcPgen,
       line600.FCL as FC_L,
       line600.PSC as PSC,
       line600.PSD as PSD,
       line600.PjDiff as PjDiff,
       line600.PjpSec as PjpSec,
       line600.PjnSec as PjnSec,
       line600.PSCW as PSC_W,
       line600.PSDW as PSD_W,
       line600.PSCR as PSC_R,
       line600.PSDR as PSD_R,
       line600.PSCS as PSC_S,
       line600.PSDS as PSD_S,
       line600.thresholdList as ThresholdList,
       line600.IS24H as IS24H,
       line600.ModelType,
       line600.ObjectType,
       line600.StrObjInstance,
       line600.InvalidityList as InvalidityList,
       line600.rowid as Myrow
FROM   ONS15600_SONET_LINE_PM_TABLE line600,
       ne_info_table ne,
       module_type_table en
WHERE
       line600.Nedbaccessid = ne.nedbaccessid AND
       line600.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype;

2.1.9  SONET_PHYSICAL_PM_VIEW

CREATE OR REPLACE VIEW SONET_PHYSICAL_PM_VIEW AS
SELECT 
        ni.NESysID as NESYSID, 
        en.ModuleName as MODULENAME, 
        phy.PhysicalLoc as PHYSICALLOC, 
        phy.NEIfIndex as NEIFINDEX, 
        phy.TimeStamp as TIMESTAMP, 
        phy.NEIfPMStatus as NEIFPMSTATUS,
        phy.inMaintenance as INMAINTENANCE,
        phy.LaserBiasCurrent,
        phy.OpticalPowerTransmitted,
        phy.OpticalPowerReceived,
        phy.MinLaserBias as MINLASERBIAS,
        phy.AvgLaserBias as AVGLASERBIAS,
        phy.MaxLaserBias as MAXLASERBIAS,
        phy.MinLaserTemp as MINLASERTEMP,
        phy.AvgLaserTemp as AVGLASERTEMP,
        phy.MaxLaserTemp as MAXLASERTEMP,
        phy.MinReceivedLaserTemp as MINRECEIVEDLASERTEMP,
        phy.AvgReceivedLaserTemp as AVGRECEIVEDLASERTEMP,
        phy.MaxReceivedLaserTemp as MAXRECEIVEDLASERTEMP,
	phy.MinTransReceiverVoltage as MINTRANSRECEIVERVOLTAGE,
        phy.AvgTransReceiverVoltage as AVGTRANSRECEIVERVOLTAGE,
        phy.MaxTransReceiverVoltage as MAXTRANSRECEIVERVOLTAGE,
        phy.MinTransmittedPower as MINTRANSMITTEDPOWER,
        phy.AvgTransmittedPower as AVGTRANSMITTEDPOWER,
        phy.MaxTransmittedPower as MAXTRANSMITTEDPOWER,
        phy.MinReceivedPower as MINRECEIVEDPOWER,
        phy.AvgReceivedPower as AVGRECEIVEDPOWER,
        phy.MaxReceivedPower as MAXRECEIVEDPOWER,
	phy.MinPassThroughPower as MINPASSTHROUGHPOWER,
	phy.AvgPassThroughPower as AVGPASSTHROUGHPOWER,
	phy.MaxPassThroughPower as MAXPASSTHROUGHPOWER,
        ni.NEDbaccessid as NEDBACCESSID,
        phy.thresholdList as ThresholdList,
        en.ModuleType as MODULETYPE,
        phy.IS24H  as IS24H,
        phy.ModelType,
        phy.ObjectType,
        phy.StrObjInstance,
        phy.InvalidityList as InvalidityList,
        phy.rowid as myrow
FROM
        ONS15454_PHY_LAYER_PM_Table phy,
        ne_info_table ni,
        module_type_table en
WHERE
        phy.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        phy.NEDBAccessID = ni.NEDBAccessID;

2.1.10  SONET_POS_PM_VIEW

CREATE OR REPLACE VIEW SONET_POS_PM_VIEW  AS 
SELECT
       ni.NESysID,				 
       ni.NEDbaccessid,				                                                                                
       en.ModuleName,	 
       en.ModuleType,				                                                                                
       pos.Physicalloc,			 
       pos.NEIfIndex,				 
       pos.TimeStamp,				 
       pos.NEIfPmStatus,
       pos.InMaintenance,
       pos.PosStatsRxPreHdlcBytes, 
       pos.PosStatsRxPostHdlcBytes,
       pos.PosStatsRxPackets,
       pos.PosStatsRxNormalPackets,
       pos.PosStatsRxShorts,
       pos.PosStatsRxRunts,
       pos.PosStatsRxLongs,
       pos.PosStatsRxTotalErrors,
       pos.PosStatsRxCrcErrors,
       pos.PosStatsRxInputDropPackets,
       pos.PosStatsRxInputAbortPackets,
       pos.PosStatsTxPreHdlcBytes,
       pos.PosStatsTxPostHdlcBytes,
       pos.PosStatsTxPackets,
       pos.PosStatsDropCounts,
       pos.EtherStatsDropEvents,  
       pos.GfpStatsRxSBitErrors,  
       pos.GfpStatsRxMBitErrors,  
       pos.GfpStatsRxTypeInvalid, 
       pos.GfpStatsRxCRCErrors,   
       pos.GfpStatsRxCIDInvalid,  
       pos.GfpStatsCSFRaised,     
       pos.GfpStatsRxFrame,       
       pos.GfpStatsTxFrame,       
       pos.GfpStatsRxOctets,      
       pos.GfpStatsTxOctets,  
       pos.GfpStatsLFDRaised,              
       pos.MediaIndStatsRxFramesTruncated, 
       pos.MediaIndStatsRxFramesTooLong,   
       pos.MediaIndStatsRxFramesBadCRC,    
       pos.MediaIndStatsRxShortPkts,       
       pos.hdlcInOctets,                   
       pos.hdlcRxAborts,                   
       pos.hdlcOutOctets,
       pos.ifInOctets,	
       pos.ifOutOctets,
       pos.rxPktsDropInternalCongestion,
       pos.ifInDiscards,
       pos.RxEtherUtilizationStats as Rx_Utilization_Stats, 
       pos.TxEtherUtilizationStats as Tx_Utilization_Stats,
       pos.StatsLineLastClearedTime,
       pos.ifInPayloadCrcErrors,
       pos.ifOutPayloadCrcErrors,
       pos.ifOutOversizePackets,
       pos.ThresholdList,
       pos.IS24H,
       pos.ModelType,
       pos.ObjectType,
       pos.StrObjInstance,
       pos.InvalidityList,
       pos.rowid as myrow
FROM
       ons15454_pos_pm_table pos,
       ne_info_table ni,
       module_type_table en
WHERE
       pos.ModuleType    = en.ModuleType   AND
       ni.NEModelType     = en.ModelType    AND
       pos.NEDBAccessID  = ni.NEDBAccessID
UNION ALL
SELECT
       ni.NESysID,
       ni.NEDbaccessid,
       en.ModuleName,
       en.ModuleType,
       pos.Physicalloc,
       pos.NEIfIndex,
       pos.TimeStamp,
       pos.NEIfPmStatus,
       pos.InMaintenance,
       to_number('-1') as PosStatsRxPreHdlcBytes, 
       to_number('-1') as PosStatsRxPostHdlcBytes,
       pos.RXTOTALPACKETS,
       to_number('-1') as PosStatsRxNormalPackets,
       to_number('-1') as PosStatsRxShorts,
       to_number('-1') as PosStatsRxRunts,
       to_number('-1') as PosStatsRxLongs,
       to_number('-1') as PosStatsRxTotalErrors,
       to_number('-1') as PosStatsRxCrcErrors,
       to_number('-1') as PosStatsRxInputDropPackets,
       to_number('-1') as PosStatsRxInputAbortPackets,
       to_number('-1') as PosStatsTxPreHdlcBytes,
       to_number('-1') as PosStatsTxPostHdlcBytes,
       pos.TXTOTALPACKETS,
       to_number('-1') as PosStatsDropCounts,
       to_number('-1') as EtherStatsDropEvents,  
       pos.GfpStatsRxSBitErrors,  
       pos.GfpStatsRxMBitErrors,  
       pos.GfpStatsRxTypeInvalid, 
       pos.GfpStatsRxCRCErrors,   
       to_number('-1') as GfpStatsRxCIDInvalid,  
       to_number('-1') as GfpStatsCSFRaised,     
       pos.GfpStatsRxFrame,       
       pos.GfpStatsTxFrame,       
       pos.GfpStatsRxOctets,      
       pos.GfpStatsTxOctets,  
       to_number('-1') as GfpStatsLFDRaised,              
       pos.MediaIndStatsRxFramesTruncated, 
       pos.MediaIndStatsRxFramesTooLong,   
       pos.MediaIndStatsRxFramesBadCRC,    
       pos.MediaIndStatsRxShortPkts,       
       pos.hdlcInOctets,                   
       pos.hdlcRxAborts,                   
       pos.hdlcOutOctets,
       to_number('-1') as ifInOctets,	
       to_number('-1') as ifOutOctets,
       pos.RXPKTSDROPPEDINERNALCONGESTION,
       to_number('-1') as ifInDiscards,
       pos.RxEtherUtilizationStats as Rx_Utilization_Stats, 
       pos.TxEtherUtilizationStats as Tx_Utilization_Stats,
       to_Date('') as StatsLineLastClearedTime,
       to_number('-1') as ifInPayloadCrcErrors,
       to_number('-1') as ifOutPayloadCrcErrors,
       to_number('-1') as ifOutOversizePackets,
       pos.thresholdList as ThresholdList,
       pos.IS24H,
       pos.ModelType,
       pos.ObjectType,
       pos.StrObjInstance,
       pos.InvalidityList,
       pos.rowid as myrow
FROM
       ons15600_pos_pm_table pos,
       ne_info_table ni,
       module_type_table en
WHERE
       pos.ModuleType    = en.ModuleType   AND
       ni.NEModelType     = en.ModelType    AND
       pos.NEDBAccessID  = ni.NEDBAccessID;

2.1.11  Sonet_Section_NearEnd_pm_view

CREATE OR REPLACE VIEW Sonet_Section_NearEnd_pm_view AS
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       sec454.ModuleType,
       sec454.Physicalloc, 
       sec454.NEIfIndex, 
       sec454.TimeStamp, 
       sec454.NEIfPMStatus,
       sec454.inMaintenance,
       sec454.severrframesecs as SEFS_S,
       sec454.codeviolations as CV_S,
       sec454.errsecs as ES_S,
       sec454.severrsecs as SES_S,
       sec454.thresholdList as ThresholdList,
       sec454.IS24H as IS24H,
       sec454.ModelType,
       sec454.ObjectType,
       sec454.StrObjInstance,
       sec454.InvalidityList as InvalidityList,
       sec454.rowid as Myrow
FROM   ONS15454_SONET_SEC_PM_TABLE sec454,
       ne_info_table ne,
       module_type_table en
WHERE
       sec454.Nedbaccessid = ne.nedbaccessid AND
       sec454.ModuleType    = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype 
UNION ALL
SELECT 
       ne.NESysID,  
       ne.NEDbaccessid,
       en.ModuleName,               
       sec600.ModuleType,
       sec600.Physicalloc,     
       sec600.NEIfIndex,  
       sec600.TimeStamp, 
       sec600.NEIfPMStatus,
       sec600.inMaintenance,
       sec600.severrframesecs as SEFS_S,
       sec600.codeviolations as CV_S,
       sec600.errsecs as ES_S,
       sec600.severrsecs as SES_S,
       sec600.thresholdList as ThresholdList,
       sec600.IS24H as IS24H,
       sec600.ModelType,
       sec600.ObjectType,
       sec600.StrObjInstance,
       sec600.InvalidityList as InvalidityList,
       sec600.rowid as Myrow
FROM   ONS15600_SONET_SEC_PM_TABLE sec600,
       ne_info_table ne,
       module_type_table en
WHERE
       sec600.Nedbaccessid = ne.nedbaccessid AND
       sec600.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype;

2.1.12  Sonet_STSPATH_FarEnd_pm_view

CREATE OR REPLACE VIEW Sonet_STSPATH_FarEnd_pm_view AS
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       path454.ModuleType,
       path454.Physicalloc, 
       path454.NEIfIndex, 
       path454.TimeStamp, 
       path454.NEIfPMStatus,
       path454.inMaintenance,
       path454.fesonetpathcodeviolations as CV_PFE,
       path454.fesonetpatherrsecs as ES_PFE,
       path454.fesonetpathseverrsecs as SES_PFE,
       path454.fesonetpathunavailablesecs as UAS_PFE,
       path454.fesonetpathfc as FC_PFE,
       path454.thresholdList as ThresholdList,
       path454.IS24H as IS24H,
       path454.ModelType,
       path454.ObjectType,
       path454.StrObjInstance,
       path454.InvalidityList as InvalidityList,
       path454.rowid as Myrow
FROM   ONS15454_SONET_PATH_PM_TABLE path454,
       ne_info_table ne,
       module_type_table en
WHERE
       path454.Nedbaccessid = ne.nedbaccessid AND
       path454.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype
UNION ALL
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       path600.ModuleType,
       path600.Physicalloc, 
       path600.NEIfIndex, 
       path600.TimeStamp, 
       path600.NEIfPMStatus,
       path600.inMaintenance,
       path600.sonetpathcodeviolationsfe as CV_PFE,
       path600.sonetpatherrsecsfe as ES_PFE,
       path600.sonetpathseverrsecsfe as SES_PFE,
       path600.sonetpathunavailablesecsfe as UAS_PFE,
       path600.sonetpathfcfe as FC_PFE,
       path600.thresholdList as ThresholdList,
       path600.IS24H as IS24H,
       path600.ModelType,
       path600.ObjectType,
       path600.StrObjInstance,
       path600.InvalidityList as InvalidityList,
       path600.rowid as Myrow
FROM   ONS15600_SONET_PATH_PM_TABLE path600,
       ne_info_table ne,
       module_type_table en
WHERE
       path600.Nedbaccessid = ne.nedbaccessid AND
       path600.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype;

2.1.13  Sonet_STSPATH_NearEnd_pm_view

CREATE OR REPLACE VIEW Sonet_STSPATH_NearEnd_pm_view AS
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       decode(path454.ModuleType,'',line454.ModuleType,
				    path454.ModuleType) as ModuleType,
       path454.Physicalloc, 
       path454.NEIfIndex, 
       decode(path454.TimeStamp,'',line454.timestamp,
					    path454.Timestamp) as Timestamp, 
       path454.NEIfPMStatus,
       path454.inMaintenance,
       path454.sonetpathcodeviolations as CV_P,
       path454.sonetpatherrsecs as ES_P,
       path454.sonetpathseverrsecs as SES_P,
       path454.sonetpathunavailablesecs as UAS_P,
       path454.sonetpathfc as FC_P,
       GETPMPARAMETERVALUE(path454.ppjcpdet,line454.ppjcpdet) as PPJC_PDET,
       GETPMPARAMETERVALUE(path454.npjcpdet,line454.npjcpdet) as NPJC_PDET,
       GETPMPARAMETERVALUE(path454.ppjcpgen,line454.ppjcpgen) as PPJC_PGEN,
       GETPMPARAMETERVALUE(path454.npjcpgen,line454.npjcpgen) as NPJC_PGEN,
       GETPMPARAMETERVALUE(path454.pjdiff,line454.pjdiff) as PJ_DIFF,
       GETPMPARAMETERVALUE(path454.pjpsec,line454.pjpsec) as PJP_SEC,
       GETPMPARAMETERVALUE(path454.pjnsec,line454.pjnsec) as PJN_SEC,
       path454.StsPathWidth,
       mergedinvaliditylist(line454.pjnsec,line454.ThresholdList,path454.ThresholdList) as 
ThresholdList,
       path454.IS24H as IS24H,
       path454.ModelType,
       path454.ObjectType,
       path454.StrObjInstance,
       mergedinvaliditylist(line454.pjnsec,line454.invaliditylist,path454.invaliditylist) 
as InvalidityList,
       path454.rowid as Myrow
FROM   ONS15454_SONET_PATH_PM_TABLE path454,
       ONS15454_SONET_LINE_PM_TABLE line454,	
       ne_info_table ne,
       module_type_table en
WHERE
       (path454.Nedbaccessid = ne.nedbaccessid and
        path454.ModuleType   = en.ModuleType ) and
       (line454.Nedbaccessid(+) = path454.nedbaccessid and
        line454.moduletype(+)   =path454.ModuleType   and
        line454.timestamp(+) = path454.Timestamp and
        line454.physicalloc(+) = path454.physicalloc and
        line454.IS24H(+)      = path454.IS24H ) and
        ne.nemodeltype      = en.modeltype 
UNION ALL
SELECT
       ne.NESysID, 
       ne.NEDbaccessid,
       en.ModuleName, 
       path600.ModuleType,
       path600.Physicalloc, 
       path600.NEIfIndex, 
       path600.TimeStamp, 
       path600.NEIfPMStatus,
       path600.inMaintenance,
       path600.sonetpathcodeviolations as CV_P,
       path600.sonetpatherrsecs as ES_P,
       path600.sonetpathseverrsecs as SES_P,
       path600.sonetpathunavailablesecs as UAS_P,
       path600.sonetpathfc as FC_P,
       path600.ppjcpdet as PPJC_PDET,
       path600.npjcpdet as NPJC_PDET,
       path600.ppjcpgen as PPJC_PGEN,
       path600.npjcpgen as NPJC_PGEN,
       path600.pjdiff as PJ_DIFF,
       path600.pjpsec as PJP_SEC,
       path600.pjnsec as PJN_SEC,
       path600.StsPathWidth as StsPathWidth,
       path600.thresholdList as ThresholdList,
       path600.IS24H as IS24H,
       path600.ModelType,
       path600.ObjectType,
       path600.StrObjInstance,
       path600.InvalidityList as InvalidityList,
       path600.rowid as Myrow
FROM   ONS15600_SONET_PATH_PM_TABLE path600,
       ne_info_table ne,
       module_type_table en
WHERE
       path600.Nedbaccessid = ne.nedbaccessid AND
       path600.ModuleType   = en.ModuleType   AND
       ne.nemodeltype      = en.modeltype;

2.2  CTM Base Views

2.2.1  active_alarm_view_with_ack

CREATE OR REPLACE VIEW active_alarm_view_with_ack AS 
SELECT 
       aa.ActiveAlarmSeverity AS severityIcon,
       ack.AckIndex AS AckIcon,
       aa.ActiveAlarmComment AS noteIcon,
       aa.ActiveAlarmServEff,    	
       aa.ActiveAlarmIndex AS ID,	
       ni.NESysID AS NetworkElement, 
       aa.PhysicalLoc, 
       getModuleName(aa.NEDBAccessID, aa.ModuleType, en.EventType) AS ModuleType,	
       getInterfaceId(aa.nedbaccessid,aa.ModuleOrIfIndex,aa.ObjectType,en.EnumString) AS 
InterfaceID,		
       en.EnumString AS Type, 
       aa.ActiveAlarmSeverity AS Severity, 
       aa.ActiveAlarmTimeStamp AS RaisedTimeStamp, 	
       aa.ClearAlarmTimeStamp AS ClearTimeStamp, 
       aa.ActiveAlarmAdditionalInfo AS Description,
       ack.AckUserName AS AckUser,
       
decode(to_char(ack.AckTimeStamp,'DD-MON-YYYY'),'01-JAN-0001',aa.ClearAlarmTimeStamp,
                                                      '','',
                                                         ack.acktimestamp) AS 
AckTimeStamp, 
       aa.ActiveAlarmComment AS NoteDescription,
       aa.NEDBAccessID, 
       aa.nealarmtimestamp, 
       ack.IsAutoAck,
       aa.AlarmStatus, 
       aa.NeAlarmClearTimestamp, 
       aa.AlarmSeqNum,
       GetPortName(aa.nedbaccessid, aa.physicalloc, aa.ModuleorIfindex, aa.moduletype) as 
PortName,
       aa.ModuleOrIfIndex as IntegerInterfaceid,
       aa.ExternalCondition,
       aa.ActiveAlarmType,
       en.eventtype,
       aa.rowid AS myrow,
       aa.ModelType,
       aa.ObjectType,
       aa.StrObjInstance
FROM
       ne_info_table ni, 
       active_alarm_table aa,
       alarm_event_type_enum_table en,
       ack_table ack
WHERE 
       aa.NEDBAccessID    = ni.NEDBAccessID AND 
       aa.ActiveAlarmType = en.EnumIndex    AND
       aa.AckIndex        = ack.AckIndex    AND
       ((aa.alarmstatus=1 and aa.ackindex=0) or
       aa.alarmstatus=0 )
union all
SELECT 
       aa.ActiveAlarmSeverity AS severityIcon, 
       ack.AckIndex AS AckIcon,
       aa.ActiveAlarmComment AS noteIcon,
       aa.ActiveAlarmServEff, 
       aa.ActiveAlarmIndex AS ID,	
       (select activevalue from ctm_config_table where sectionname='transportManager' and 
propertyname='ems-sys-id') as  NetworkElement, 
       aa.PhysicalLoc, 
       getModuleName(aa.NEDBAccessID, aa.ModuleType, en.EventType) AS ModuleType,	
       getInterfaceId(aa.nedbaccessid,aa.ModuleOrIfIndex,aa.ObjectType,en.EnumString) AS 
InterfaceID, 
       en.EnumString AS Type, 
       aa.ActiveAlarmSeverity AS Severity, 
       aa.ActiveAlarmTimeStamp AS RaisedTimeStamp, 
       aa.ClearAlarmTimeStamp AS ClearTimeStamp, 
       aa.ActiveAlarmAdditionalInfo AS Description,
       ack.AckUserName AS AckUser,
       
decode(to_char(ack.AckTimeStamp,'DD-MON-YYYY'),'01-JAN-0001',aa.ClearAlarmTimeStamp,
                                                      '','',
                                                         ack.acktimestamp) AS 
AckTimeStamp, 
       aa.ActiveAlarmComment AS NoteDescription,
       aa.NEDBAccessID,
       to_date('') AS NEAlarmTimestamp, 
       ack.IsAutoAck,
       aa.AlarmStatus, 
       aa.NEAlarmClearTimestamp, 
       aa.AlarmSeqNum,
       '' as PortName,
       aa.ModuleOrIfIndex   as IntegerInterfaceId,
       aa.ExternalCondition,
       aa.ActiveAlarmType,
       en.eventtype,
       aa.rowid AS myrow,       
       aa.ModelType,
       aa.ObjectType,
       aa.StrObjInstance
FROM
       active_alarm_table aa,
       alarm_event_type_enum_table en,
       ack_table ack
Where aa.ActiveAlarmType = en.EnumIndex   AND
      aa.AckIndex        = ack.AckIndex   AND
      ((aa.alarmstatus=1 and aa.ackindex=0) or
       aa.alarmstatus=0 )                 and
      aa.nedbaccessid=0;

2.2.2  Admin_Job_View

create or replace view Admin_Job_View as
select 
        ajt.jobid, 
        ajt.taskid, 
        ajt.jobtype, 
        ajt.jobowner, 
        ni.nesysid, 
        ajt.jobstatus, 
        ajt.creationtime, 
        ajt.scheduledtime, 
        ajt.starttime, 
        ajt.endtime, 
        ajt.usercomments,
        ajt.additionalinfo,
        ajt.nedbaccessid,
        ni.nemodeltype,
        ajt.rowid as myrow,
        ajt.operation_info,
        ajt.display_info
from
        Admin_Job_Table ajt,
        ne_info_Table ni
where
        ajt.nedbaccessid = ni.nedbaccessid;

2.2.3  alarm_count_view

create or replace view alarm_count_view as
select
       mn.nedbaccessid,
       mn.minoralarmcount,
       mj.majoralarmcount,
       cr.criticalalarmcount,
       wr.warningalarmcount,
       cl.clearedalarmcount,
       ack.ackalarmcount  
  from (select nedbaccessid, totalalarmcount as majoralarmcount
          from alarm_count_table
         where alarmcounttype=6) mj,
       (select nedbaccessid, totalalarmcount as minoralarmcount
          from alarm_count_table
         where alarmcounttype=5) mn,
       (select nedbaccessid, totalalarmcount as criticalalarmcount
          from alarm_count_table
         where alarmcounttype=7) cr,
       (select nedbaccessid, totalalarmcount as warningalarmcount
          from alarm_count_table 
         where alarmcounttype=4) wr,
       (select nedbaccessid, totalalarmcount as clearedalarmcount
          from alarm_count_table
         where alarmcounttype=-1) cl,
       (select nedbaccessid, totalalarmcount as ackalarmcount
          from alarm_count_table
         where alarmcounttype=-2) ack
  where mj.nedbaccessid=mn.nedbaccessid
    and mj.nedbaccessid=cr.nedbaccessid
    and mj.nedbaccessid=wr.nedbaccessid
    and mj.nedbaccessid=cl.nedbaccessid
    and mj.nedbaccessid=ack.nedbaccessid;

2.2.4  alarm_log_view

create or replace view alarm_log_view AS
SELECT 
       ae.AlarmEventSeverity AS severityIcon,							
       0 as AckIcon,
       ''                as NoteIcon,
       ae.ServiceEffecting,									
       ae.EventIndex as ID,									
       nvl(ni.NESysID,'CTM')  AS NetworkElement,						 
       ae.PhysicalLoc as Physicalloc,
       GetModuleName(ae.nedbaccessid, ae.moduletype, en.EventType) AS ModuleType,	
       GetInterfaceId(ae.nedbaccessid, ae.ModuleOrIfIndex, ae.ObjectType, en.EnumString) 
AS InterfaceID, 
       en.EnumString AS Type,
       ec.EnumString AS Cause,
       ae.AlarmEventSeverity AS severity,	
       ae.AlarmEventTimeStamp AS RaisedTimeStamp,						
       to_date('')  as ClearTimestamp,
       ae.OtherInfo AS Description,
       '' as Ackuser,
       to_date('')  as AckTimestamp,								
       ''           as NoteDescription,
       ae.Nedbaccessid as Nedbaccessid,
       decode(ae.nedbaccessid,0,to_date(''),
       ae.NEEventtimestamp) as NeAlarmTimestamp,	
       -1 as Alarmstatus,									
       2 as IsAutoAck,										
       to_char('Event')      as EventOrAlarm,
       to_date('') as NEAlarmClearTimestamp,							
       ''          as CTMDuration,
       GetPortName(ae.nedbaccessid, ae.physicalloc, ae.ModuleOrIfindex, ae.Moduletype) as 
PortName,
       ae.ModuleOrIfIndex  as IntegerInterfaceId,
       en.eventtype,
       ae.rowid AS myrow,
       ae.ModelType,
       ae.ObjectType,
       ae.StrObjInstance
FROM
       ne_info_table ni,
       alarm_event_table ae,
       alarm_event_type_enum_table en,
       alarm_event_cause_table ec
WHERE
       ae.NEDBAccessID    = ni.NEDBAccessID(+) AND
       ae.AlarmEventType  = en.EnumIndex    AND
       ae.AlarmEventCause = ec.EnumIndex
UNION 
SELECT 
      aa.ActiveAlarmSeverity   as SeverityIcon,
      aa.AckIndex        as AckIcon,
      aa.ActiveAlarmComment       as NoteIcon,
      aa.ActiveAlarmServeff  as ServiceEffecting,
      aa.ActiveAlarmIndex    as ID,
      nvl(ni.NESysID,(select activevalue from ctm_config_table where 
sectionname='transportManager' and propertyname='ems-sys-id'))  as NetworkElement,
      aa.Physicalloc    as Physicalloc,
      GetModulename(aa.nedbaccessid, aa.moduletype, en.EventType)  as ModuleType,
      GetInterfaceId(aa.nedbaccessid, aa.ModuleOrIfIndex, aa.ObjectType, en.EnumString)       
as InterfaceId,
      en.EnumString           as Type,
      ''             as Cause,
      aa.ActiveAlarmSeverity       as Severity,
      aa.ActiveAlarmTimeStamp  as RaisedTimestamp,
      aa.ClearAlarmTimeStamp   as ClearTimestamp,
      aa.ActiveAlarmAdditionalInfo      as Description,
      ack.AckUserName          as AckUser,
      decode(to_char(ack.AckTimeStamp,'DD-MON-YYYY'),'01-JAN-0001',aa.ClearAlarmTimeStamp,
                                                     '','',
                                                        ack.acktimestamp) AS AckTimeStamp,
      aa.ActiveAlarmComment  as NoteDescription,
      aa.NEDBAccessID     as Nedbaccessid,
      decode(aa.nedbaccessid,0,to_date(''),
                               aa.NeAlarmTimestamp) as NeAlarmtimestamp,
      aa.AlarmStatus      as AlarmStatus,
      ack.IsAutoAck        as IsAutoAck,
      to_char('Alarm')          as EventOrAlarm,
      aa.NEAlarmClearTimestamp  as NEAlarmClearTimestamp,
      ctmduration(aa.ClearAlarmTimeStamp-aa.ActiveAlarmTimeStamp) as CTMDuration,
      GetPortName(aa.nedbaccessid, aa.physicalloc, aa.ModuleOrIfindex, aa.moduletype) as 
PortName,
      aa.ModuleOrIfIndex   as IntegerInterfaceId,
      en.eventtype,
      aa.rowid            as Myrow,
      aa.ModelType,
      aa.ObjectType,
      aa.StrObjInstance
From
       ne_info_table ni,
       active_alarm_table aa,
       alarm_event_type_enum_table en,
       ack_table ack
Where
       aa.NEDBAccessID    = ni.NEDBAccessID(+) AND
       aa.ActiveAlarmType = en.EnumIndex    AND
       aa.AckIndex        = ack.AckIndex    AND
       aa.alarmstatus     = 1               AND
       aa.ackindex        <> 0;

2.2.5  audit_log_view

create or replace view audit_log_view AS
SELECT nvl(n.nesysid,'CTM') as NESYSID, 
       nvl(t.username, 'Internal') as username, 
       t.timestamp, 
       t.module, 
       t.classname,
       0 as linenumber,
       (t.actionname || t.logmessage) as LogMessage,
       nvl(t.nedbaccessid,0)  as nedbaccessid,
       t.service,
       t.rowid as Myrow
FROM   transaction_log_table t,
       ne_info_table         n
WHERE  t.nedbaccessid=n.nedbaccessid(+);

2.2.6  BLSR_TABLE_VIEW

create or replace view BLSR_TABLE_VIEW as
SELECT
        blsr.BLSRID as BLSRID, 
    	blsr.RINGID as RINGID, 
        blsr.RINGTYPE as RINGTYPE,
        blsr.LINERATE as LINERATE,
        blsr.STATUS as STATUS,
        blsr.RINGREVERSION as RINGREVERSION,
        blsr.SPANREVERSION as SPANREVERSION, 
        blsr.NODES as NODES,
        node.NODEID as NODEID,
		blsr.rowid as myrow
FROM    BLSR_TABLE blsr,
        BLSR_NODE node
WHERE
        blsr.BLSRID = node.BLSRID;

2.2.7  children_view

CREATE OR REPLACE VIEW children_view AS
SELECT
        eit.NEDBAccessId,
        eit.PhysicalLoc,
        eit.IfIndex,
        eit.ModuleType,
        mm.ParentIndex,
        eit.rowid as myrow,
        eit.ModelType, 
        eit.ObjectIndex,
        eit.StrObjInstance
FROM
        eqpt_info_table eit,
        objecttypetable mm
WHERE  
        eit.ObjectIndex = mm.ObjectIndex AND eit.ModelType = mm.ModelType;

2.2.8  circuit_ctpspan_view

create or replace view circuit_ctpspan_view as
select 
       span.cktnodeid,
       span.cktuniqueid,
       ctpsrc.cktctpnodeid as spansrcnodeid,
       ctpdest.cktctpnodeid as spandestnodeid,
       span.cktlinkid as cktlinkid
  from circuit_ctp_tbl ctpsrc,
       circuit_ctp_tbl ctpdest,
       circuit_span_bs_tbl   span
 where ctpsrc.ctpaccessid=span.cktspansrcctpaccessid and
       ctpdest.ctpaccessid=span.cktspandstctpaccessid;

2.2.9  circuit_ctp_drop_view

create or replace view circuit_ctp_drop_view as
select ne.nesysid,
       ctp.cktnodeid,
       ctp.cktuniqueid,
       ctp.cktctpnodeid,
       ctp.cktctpPhysicalLoc,
       ctp.CktctpIfIndex,
       ctp.cktctpModuleType,
       ctp.cktctpDropProt,
       ctp.CktctpPathProt,
       ctp.cktctpnedbaccessid,
       ctp.CktctpModelType,
       ctp.CktctpObjectType
from ne_info_table ne,
     circuit_ctp_tbl ctp
where  ne.nedbaccessid=ctp.CKTCTPNeDBAccessId 
  and  ctp.ctp_type=2;

2.2.10  circuit_ctp_sec_view

create or replace view circuit_ctp_sec_view as 
select ne.nesysid,
       ctp.cktnodeid,
       ctp.cktuniqueid,
       ctp.cktctpnodeid,
       ctp.cktctpPhysicalLoc,
       ctp.CktctpIfIndex,
       ctp.cktctpModuleType,
       ctp.cktctpDropProt,
       ctp.cktctpnedbaccessid,
       ctp.CktctpModelType,
       ctp.CktctpObjectType
from ne_info_table ne,
     circuit_ctp_tbl ctp
where  ne.nedbaccessid=ctp.CKTCTPNeDBAccessId 
  and  ctp.ctp_type=1;

2.2.11  circuit_ctp_src_view

create or replace view circuit_ctp_src_view as
select ne.nesysid,
       ctp.cktnodeid,
       ctp.cktuniqueid,
       ctp.cktctpnodeid,
       ctp.cktctpPhysicalLoc,
       ctp.CktctpIfIndex,
       ctp.cktctpModuleType,
       ctp.cktctpDropProt,
       ctp.cktctpnedbaccessid,
       ctp.CktctpModelType,
       ctp.CktctpObjectType
from ne_info_table ne,
     circuit_ctp_tbl ctp
where  ne.nedbaccessid=ctp.CKTCTPNeDBAccessId 
  and  ctp.ctp_type=0;

2.2.12  CIRCUIT_CTP_VIEW

CREATE OR REPLACE VIEW CIRCUIT_CTP_VIEW AS 
SELECT
        c.CTPACCESSID as CTPACCESSID,
        c.CTP_TYPE as CTP_TYPE,
        c.CKTNODEID as CKTNODEID,
        c.CKTUNIQUEID as CKTUNIQUEID,
        c.CKTCTPNODEID as CKTCTPNODEID,
        c.CKTCTPNEDBACCESSID as CKTCTPNEDBACCESSID,
        c.CKTCTPMODULETYPE as CKTCTPMODULETYPE,
        c.CKTCTPIFINDEX as CKTCTPIFINDEX,
        c.CKTCTPOBJECTTYPE as CKTCTPOBJECTTYPE,
        c.CKTCTPPHYSICALLOC as CKTCTPPHYSICALLOC,
        c.CKTCTPMODELTYPE as CKTCTPMODELTYPE,
        c.CKTCTPDROPPROT as CKTCTPDROPPROT,
        c.CKTCTPPATHPROT as CKTCTPPATHPROT,
        c.CKTCTPDROPPROTTYPE as CKTCTPDROPPROTTYPE,
        c.CKTCTPPORTNAME as CKTCTPPORTNAME,
        c.CKTCTPADDITIONALINFO as CKTCTPADDITIONALINFO,
        c.NPID as NPID,
        ckt.ROWID as MYROW 
from    circuit_ctp_tbl c,
        circuit_bs_tbl ckt
where
        c.CktNodeId = ckt.CktNodeId(+) and
        c.CktUniqueId = ckt.CktUniqueId(+);

2.2.13  circuit_node_gui_view

CREATE OR REPLACE VIEW circuit_node_gui_view AS
SELECT 
        c.CktName as Name, 
        c.CktType as Type, 
        c.CktSize as CktSize, 
        c.CktDirection as Direction,
        c.CktState as State,
        (select nesysid from ne_info_table where nedbaccessid=src.CKTCTPNeDBAccessId)  as 
SrcNodeid, 
        src.cktctpnodeid as cktsrcnodeid,
        nvl(getModulename1(src.cktctpnodeid, src.cktctpModuleType),'SYSTEM')  as 
SrcModuleType,
        src.cktctpPhysicalLoc as SrcPhysicalLoc,
        src.CktctpIfIndex as SrcInterfaceId,
        nvl(getModulename1(sec.cktctpnodeid, sec.cktctpModuleType),'SYSTEM') as 
SecSrcModuleType,
        sec.CktctpPhysicalLoc as SecSrcPhysicalLoc,
        sec.CktctpIfIndex as SecSrcInterfaceId,
        collapseddestnodename(c.CKTNODEID,c.CKTUNIQUEID) as destnodename,
        collapsedmodulename(c.CKTNODEID,c.CKTUNIQUEID)as cktdestModuleName,
        collapsedphy(c.CKTNODEID,c.CKTUNIQUEID) as DestPhysicalLoc,
        collapsedifindex(c.CKTNODEID,c.CKTUNIQUEID) as DestInterfaceId,
        c.CktIsMonitor as Ismonitor,
        src.CktctpDropProt as SrcDropProt,
        c.CktNodeId as NodeId,
        c.CktUniqueId as UniqueId,
        c.CktDescription as Description,
        c.CustomerId as CustomerId, 
        c.ServiceId as ServiceId,
        dest.cktctpnodeid as DestNodeId,
        c.CktEnhancedState,
        c.CktProtectionType,
        dest.CktctpPathProt  as DestPathProtection,
        c.cktComment as CircuitNote,
        (select nesysid from ne_info_table where nedbaccessid=sec.CKTCTPNeDBAccessId) as 
SecSrcNodeid,
        sec.cktctpnodeid as cktsecsrcnodeid,
        eqptinfoport(src.cktctpnedbaccessid,src.cktctpphysicalloc,0,src.cktctpmoduletype) 
as CktSrcPortName,
        eqptinfoport(sec.cktctpnedbaccessid,sec.cktctpphysicalloc,0,sec.cktctpmoduletype) 
as CktSecSrcPortName,
        
eqptinfoport(dest.cktctpnedbaccessid,dest.cktctpphysicalloc,0,dest.cktctpmoduletype) as 
CktDestPortName,
        (select count(*) from circuit_vlan_tbl where cktnodeid=c.cktnodeid and 
cktuniqueid=c.cktuniqueid) as NoOfVlans, 
        nvl(vcg.VCGDirection,-1) as VCGDirection,
        nvl(vcg.ParentCktNodeId,-1) as ParentCktNodeId,
        nvl(vcg.ParentCktUniqueId,-1) as ParentCktUniqueId,
        c.CktOchncChannel,
        c.CktOchncDir,
        src.CktctpModelType as SrcModelType,
        src.CktctpObjectType as SrcObjectType,
        sec.CktctpModelType as CktSecSrcModelType,
        sec.CktctpObjectType as SecSrcObjectType,
        collapsedmodeltype(c.CKTNODEID,c.CKTUNIQUEID) as DestModelType,
        collapsedobjectindex(c.CKTNODEID,c.CKTUNIQUEID) as DestObjectType,
        c.isDuplicateName,
        nvl(getPortModuleName(src.cktctpnodeid, src.cktctpModuleType),'SYSTEM')  as 
SrcPortModuleType,
        nvl(getPortModuleName(sec.cktctpnodeid, sec.cktctpModuleType),'SYSTEM') as 
SecSrcPortModuleType,
        collapsedportmodulename(c.CKTNODEID,c.CKTUNIQUEID)as cktdestPortModuleName,
        c.rowid as myrow,
        dest.cktctpPhysicalLoc as CktDestPhysicalLoc,
        nvl(getPortModuleName(dest.cktctpnodeid, dest.cktctpModuleType),'SYSTEM') as 
DestPortModuleType,
        nvl(vcg.VCATSTATE,-1) as VcatState,
        src.cktctpModuleType as CktSrcModuleType
from    circuit_bs_tbl c,
        circuit_ctp_tbl src,
        circuit_ctp_tbl sec,
        circuit_ctp_tbl dest,
        circuit_vcg_tbl vcg
where
        c.CktNodeId             = src.CktNodeId(+)  and
        c.CktUniqueId           = src.CktUniqueId(+) and
	0 = src.ctp_type(+) and
        c.CktNodeId             = sec.CktNodeId(+) and
        c.CktUniqueId           = sec.CktUniqueId(+) and
	1 = sec.ctp_type(+) and
        c.CktNodeId             = dest.CktNodeId(+) and
        c.CktUniqueId           = dest.CktUniqueId(+) and
	2 = dest.ctp_type(+) and
        c.CktNodeId             = vcg.CktNodeId(+) and
        c.CktUniqueId           = vcg.CktUniqueId(+) and
        c.cktstate             !=12; 

2.2.14  circuit_node_gui_view_ctm46

CREATE OR REPLACE VIEW circuit_node_gui_view_ctm46 AS
SELECT
        c.CktName as Name, 
        c.CktType as Type, 
        c.CktSize as CktSize, 
        c.CktDirection as Direction,
        c.CktState as State,
        (select nesysid from ne_info_table where nenodeid=c.cktsrcnodeid and 
c.cktsrcnodeid !=0 )  as SrcNodeid, 
        c.cktsrcnodeid,
        nvl(getSlotModuleName(c.cktsrcnodeid, c.CktSrcModuleType),'SYSTEM')  as 
SrcModuleType,
        c.CktSrcPhysicalLoc as SrcPhysicalLoc,
        c.CktSrcIfIndex as SrcInterfaceId,
        nvl(getSlotModuleName(c.cktsecsrcnodeid, c.CktSecSrcModuleType),'SYSTEM') as 
SecSrcModuleType,
        c.CktSecSrcPhysicalLoc as SecSrcPhysicalLoc,
        c.CktSecSrcIfIndex as SecSrcInterfaceId,
        collapseddestnodename(c.CKTNODEID,c.CKTUNIQUEID) as destnodename,
        collapsedmodulename(c.CKTNODEID,c.CKTUNIQUEID)as cktdestModuleName,
        collapsedphy(c.CKTNODEID,c.CKTUNIQUEID) as DestPhysicalLoc,
        collapsedifindex(c.CKTNODEID,c.CKTUNIQUEID) as DestInterfaceId,
        c.CktIsMonitor as Ismonitor,
        c.CktSrcDropProt as SrcDropProt,
        c.CktNodeId as NodeId,
        c.CktUniqueId as UniqueId,
        c.CktDescription as Description,
        c.CustomerId as CustomerId, 
        c.ServiceId as ServiceId, 
        dest.cktdestnodeid as DestNodeId,
        spantbl.CktSpanSrcNodeId,
        spantbl.CktSpanDestNodeId,
        spantbl.cktlinkid,
        c.CktEnhancedState,
        c.CktProtectionType,
        dest.CktDestPathProt  as DestPathProtection,
        c.cktComment as CircuitNote,
        (select nesysid from ne_info_table where nenodeid=c.cktsecsrcnodeid and 
c.cktsecsrcnodeid !=0 )  as SecSrcNodeid,
        c.cktsecsrcnodeid,
        
eqptinfoport(getNEDBACCESSID(c.CKTSRCNODEID),c.CKTSRCPHYSICALLOC,0,c.CKTSRCMODULETYPE ) as 
CktSrcPortName,
        
eqptinfoport(getNEDBACCESSID(c.CKTSECSRCNODEID),c.CKTSECSRCPHYSICALLOC,0,c.CKTSECSRCMODULE
TYPE ) as CktSecSrcPortName,
        collapsedeqptportname(c.CKTNODEID,c.CKTUNIQUEID) as CktDestPortName,
       (select count(*) from circuit_vlan_tbl where cktnodeid=c.cktnodeid and 
cktuniqueid=c.cktuniqueid) as NoOfVlans, 
        nvl(vcg.VCGDirection,-1) as VCGDirection,
        nvl(vcg.ParentCktNodeId,-1) as ParentCktNodeId,
        nvl(vcg.ParentCktUniqueId,-1) as ParentCktUniqueId,
        c.CktOchncChannel,
        c.CktOchncDir,
        c.CktSrcModelType as SrcModelType,
        c.CktSrcObjectType as SrcObjectType,
        c.CktSecSrcModelType as CktSecSrcModelType,
        c.CktSecSrcObjectType as SecSrcObjectType,
        collapsedmodeltype(c.CKTNODEID,c.CKTUNIQUEID) as DestModelType,
        collapsedobjectindex(c.CKTNODEID,c.CKTUNIQUEID) as DestObjectType,
        c.isDuplicateName,
        nvl(getPortModuleName(c.cktsrcnodeid, c.CktSrcModuleType),'SYSTEM')  as 
SrcPortModuleType,
        nvl(getPortModuleName(c.cktsecsrcnodeid, c.CktSecSrcModuleType),'SYSTEM') as 
SecSrcPortModuleType,
        collapsedportmodulename(c.CKTNODEID,c.CKTUNIQUEID)as cktdestPortModuleName,
        c.rowid as myrow,
        dest.cktdestphysicalloc as CktDestPhysicalLoc,
        nvl(getPortModuleName(dest.cktdestnodeid, dest.CktDestModuleType),'SYSTEM') as 
DestPortModuleType,
        spantbl.CktSpanSrcPhysicalLoc,
        spantbl.CktSpanDestPhysicalLoc
From
        circuit_tbl c,
        circuit_vcg_tbl vcg,
        circuit_dest_tbl dest,
        circuit_span_tbl spantbl
where
        c.CktNodeId             = dest.CktNodeId(+)  and
        c.CktUniqueId           = dest.CktUniqueId(+) and
        c.CktNodeId             = spantbl.CktNodeId(+) and
        c.CktUniqueId           = spantbl.CktUniqueId(+) and
        c.CktNodeId             = vcg.CktNodeId(+) and
        c.CktUniqueId           = vcg.CktUniqueId(+) and
        c.cktState              != 12 ;

2.2.15  circuit_node_view

CREATE OR REPLACE VIEW circuit_node_view AS
SELECT 
        c.CktName as Name, 
        c.CktType as Type, 
        c.CktSize as CktSize, 
        c.CktDirection as Direction,
        c.CktState as State,
        (select nesysid from ne_info_table where nenodeid=c.cktsrcnodeid and 
c.cktsrcnodeid !=0)  as SrcNodeid, 
        nvl(getModulename1(c.cktsrcnodeid, c.CktSrcModuleType),'SYSTEM')  as 
SrcModuleType,
        c.CktSrcPhysicalLoc as SrcPhysicalLoc,
        c.CktSrcModelType as SrcModelType,
        c.CktSrcIfIndex as SrcInterfaceId,
        c.CktSrcObjectType as SrcObjectType,
        nvl(getModulename1(c.cktsecsrcnodeid, c.CktSecSrcModuleType),'SYSTEM') as 
SecSrcModuleType,
        c.CktSecSrcPhysicalLoc as SecSrcPhysicalLoc,
        c.CktSecSrcModelType as SecSrcModelType,
        c.CktSecSrcIfIndex as SecSrcInterfaceId,
        c.CktSecSrcObjectType as SecSrcObjectType,
        (select nesysid from ne_info_table where nenodeid=dest.cktdestnodeid and 
dest.cktdestnodeid != 0) as destnodeid, 
        nvl(getModulename1(dest.cktdestnodeid, dest.CktDestModuleType),'SYSTEM') as 
DestModuleType,
        dest.CktDestPhysicalLoc as DestPhysicalLoc,
        dest.CktDestIfIndex as DestInterfaceId,
        dest.CktDestObjectType as DestObjectType,
        c.CktIsMonitor as Ismonitor,
        c.CktSrcDropProt as SrcDropProt,
        dest.CktDestDropProt as DestDropProt,
        dest.CktDestPathProt as DestPathProt,
        0  as Vlanid,
        c.CktName as vlanname,
        c.CktNodeId as NodeId,
        c.CktUniqueId as UniqueId,
        c.CktDescription as Description,
        c.CustomerId as CustomerId,
        c.ServiceId as ServiceId,
        spantbl.CktSpanSrcNodeId,
        spantbl.CktSpanDestNodeId,
        spantbl.cktlinkid,
        c.CktEnhancedState,
        c.CktProtectionType,
        c.rowid as myrow
from
        circuit_tbl c,
        circuit_dest_tbl dest,
        circuit_span_tbl spantbl
where
        c.CktNodeId             = dest.CktNodeId(+)  and
        c.CktUniqueId           = dest.CktUniqueId(+) and
        c.CktNodeId             = spantbl.CktNodeId(+) and
        c.CktUniqueId           = spantbl.CktUniqueId(+) and 
        c.cktState              != 12 ;

2.2.16  Circuit_Span_View

create or replace view Circuit_Span_View as
select 
        circuit.CktName as Name, 
        circuit.CktType as Type, 
        circuit.CktSize as CktSize, 
        ne_src.NESYSID as SrcNodeId, 
        nvl(getModuleName2( ctp_src.CKTCTPMODULETYPE, ctp_src.CKTCTPMODELTYPE ) ,'SYSTEM' 
) as SrcModuleType,
        ctp_src.CKTCTPPHYSICALLOC as SrcPhysicalLoc,
        ctp_src.CKTCTPIFINDEX as SrcInterfaceId,
        ne_dst.NESYSID as DestNodeId, 
        nvl(getModuleName2( ctp_dst.CKTCTPMODULETYPE, ctp_dst.CKTCTPMODELTYPE ) ,'SYSTEM' 
) as DestModuleType,
        ctp_dst.CKTCTPPHYSICALLOC as DestPhysicalLoc,
        ctp_dst.CKTCTPIFINDEX as InterfaceId,
        spancircuit.CKTSPANSRCSTATE,
        spancircuit.CKTSPANDESTSTATE,
        spancircuit.IsCktForwarding as Forwarding,
        spancircuit.IsCktSpanInUPSR as InUpsr,
        spancircuit.IsCktSpanActive as active,
        spancircuit.CktSpanProtOp as ProtOp,
        spancircuit.CktNodeId as NodeId,
        spancircuit.CktUniqueId as UniqueId,
        ne_src.NEDBACCESSID as NEDBAccessid,
        ne_dst.NEDBACCESSID as DestNEDBAccessid,
        spancircuit.CktLinkId as linkid,
        ctp_src.CKTCTPNODEID as SrcNENodeId,
        ctp_dst.CKTCTPNODEID as DestNENodeID,
        ctp_src.CKTCTPMODULETYPE as SrcNEModuleType,
        ctp_dst.CKTCTPMODULETYPE as DestNEModuleType,
        ctp_src.CKTCTPPORTNAME as SrcPortName,
        ctp_dst.CKTCTPPORTNAME as DestPortName,
        ctp_src.CKTCTPMODELTYPE as SrcModelType,
        ctp_src.CKTCTPOBJECTTYPE as SrcObjectType,
        ctp_dst.CKTCTPMODELTYPE as DestModelType,
        ctp_dst.CKTCTPOBJECTTYPE as DestObjectType,
		nvl(getPortModuleName2( ctp_src.CKTCTPMODULETYPE, ctp_src.CKTCTPMODELTYPE ) 
,'SYSTEM' ) as SrcPortModuleType,
		nvl(getPortModuleName2( ctp_dst.CKTCTPMODULETYPE, ctp_dst.CKTCTPMODELTYPE ) 
,'SYSTEM' ) as DestPortModuleType,		
        spancircuit.rowid as myrow
from
    CIRCUIT_BS_Tbl circuit,
    circuit_ctp_tbl ctp_src,
    circuit_ctp_tbl ctp_dst,
    circuit_span_BS_tbl spancircuit,
    ne_info_table ne_src,
    ne_info_table ne_dst
where
        ctp_src.CTPACCESSID = spancircuit.CKTSPANSRCCTPACCESSID
  and   ctp_dst.CTPACCESSID = spancircuit.CKTSPANDSTCTPACCESSID
  and   spancircuit.CktNodeId = circuit.CktNodeId
  and   spancircuit.CktUniqueId = circuit.CktUniqueId
  and   ne_src.nenodeid = ctp_src.CKTCTPNODEID
  and   ne_dst.nenodeid = ctp_dst.CKTCTPNODEID
  and	ctp_src.ctp_type = 3
  and	ctp_dst.ctp_type = 4;

2.2.17  Circuit_Span_View_ctm46

create or replace view Circuit_Span_View_ctm46 as
select 
        circuit.CktName as Name, 
        circuit.CktType as Type, 
        circuit.CktSize as CktSize, 
        neInfo1.NESysID as SrcNodeId, 
        nvl(getSlotModuleName(spancircuit.cktspansrcnodeid, 
spancircuit.CktspanSrcModuleType),'SYSTEM') as SrcModuleType,
        spancircuit.CktSpanSrcPhysicalLoc as SrcPhysicalLoc,
        spancircuit.CktSpanSrcIfIndex as SrcInterfaceId,
        neInfo2.NESysID as DestNodeId, 
        nvl(getSlotModuleName(spancircuit.cktspandestnodeid, 
spancircuit.CktspandestModuleType),'SYSTEM') as DestModuleType,
        spancircuit.CktSpanDestPhysicalLoc as DestPhysicalLoc,
        spancircuit.CktSpanDestIfIndex as InterfaceId,
        spancircuit.CktSpanSrcState as SrcState,
        spancircuit.CktSpanDestState as DestState,
        spancircuit.IsCktForwarding as Forwarding,
        spancircuit.IsCktSpanInUPSR as InUpsr,
        spancircuit.IsCktSpanActive as active,
        spancircuit.CktSpanProtOp as ProtOp,
        spancircuit.CktNodeId as NodeId,
        spancircuit.CktUniqueId as UniqueId,
        neinfo1.NEDBAccessid,
        neinfo2.NEDBAccessid as DestNEDBAccessid,
        spancircuit.CktLinkId as linkid,
        spancircuit.CktSpanSrcNodeId as SrcNENodeId,
        spancircuit.CktSpanDestNodeId as DestNENodeID,
        spancircuit.CktspanSrcModuleType as SrcNEModuleType,
        spancircuit.CktspandestModuleType as DestNEModuleType,
 
eqptinfoport(getNEDBACCESSID(spancircuit.CKTSPANSRCNODEID),spancircuit.CKTSPANSRCPHYSICALL
OC,0,spancircuit.CKTSPANSRCMODULETYPE) as SrcPortName,
 
eqptinfoport(getNEDBACCESSID(spancircuit.CKTSPANDESTNODEID),spancircuit.CKTSPANDESTPHYSICA
LLOC,0,spancircuit.CKTSPANDESTMODULETYPE) as DestPortName,
        spancircuit.CktSpanSrcModelType as SrcModelType,
        spancircuit.CktSpanSrcObjectType as SrcObjectType,
        spancircuit.CktSpanDestModelType as DestModelType,
        spancircuit.CktSpanDestObjectType as DestObjectType,
        nvl(getPortModuleName(spancircuit.cktspansrcnodeid, 
spancircuit.CktspanSrcModuleType),'SYSTEM') as SrcPortModuleType,
        nvl(getPortModuleName(spancircuit.cktspandestnodeid, 
spancircuit.CktspandestModuleType),'SYSTEM') as DestPortModuleType,
        spancircuit.rowid as myrow
from
        CIRCUIT_TBL circuit,
        NE_INFO_TABLE neInfo1,
        NE_INFO_TABLE neInfo2,
        circuit_span_tbl spancircuit
where
        spancircuit.CktNodeId = circuit.CktNodeId and
        spancircuit.CktUniqueId = circuit.CktUniqueId and
        spancircuit.CktSpanSrcNodeID = neInfo1.NENodeID and
        spancircuit.CktSpanDestNodeId = neInfo2.NENodeID;

2.2.18  Circuit_View

create or replace view Circuit_View AS
select 
        c.CktName as Name, 
        c.CktType as Type, 
        c.CktSize as CktSize, 
        c.CktDirection as Direction,
        c.CktState as State,
        (select nesysid from ne_info_table where nenodeid=c.cktsrcnodeid and 
c.cktsrcnodeid !=0)  as SrcNodeid, 
        nvl(getModulename1(c.cktsrcnodeid, c.CktSrcModuleType),'SYSTEM')  as 
SrcModuleType,
        c.CktSrcPhysicalLoc as SrcPhysicalLoc,
        c.CktSrcIfIndex as SrcInterfaceId,
        nvl(getModulename1(c.cktsecsrcnodeid, c.CktSecSrcModuleType),'SYSTEM') as 
SecSrcModuleType,
        c.CktSecSrcPhysicalLoc as SecSrcPhysicalLoc,
        c.CktSecSrcIfIndex as SecSrcInterfaceId,
        (select nesysid from ne_info_table where nenodeid=dest.cktdestnodeid and 
dest.cktdestnodeid !=0 ) as destnodeid, 
        nvl(getModulename1(dest.cktdestnodeid, dest.CktDestModuleType),'SYSTEM') as 
DestModuleType,
        dest.CktDestPhysicalLoc as DestPhysicalLoc,
        dest.CktDestIfIndex as DestInterfaceId,
        c.CktIsMonitor as Ismonitor,
        c.CktSrcDropProt as SrcDropProt,
        dest.CktDestDropProt as DestDropProt,
        dest.CktDestPathProt as DestPathProt,
        vlan.Cktvlanid  as Vlanid,
        vlan.cktvlanname  as Vlanname,
        c.CktNodeId as NodeId,
        c.CktUniqueId as UniqueId,
        c.CktDescription as Description,
        c.CustomerId as CustomerId,
        c.ServiceId as ServiceId,
        dest.CKTDESTNODEID as DESTNENODEID,
        c.CKTSRCNODEID as SRCNENODEID,
        c.CKTSECSRCNODEID as SECSRCNENODEID,
        c.CktEnhancedState,
        c.CktProtectionType,
        c.CktOchncChannel,
        c.CktOchncDir,
        c.CktSrcModelType as SrcModelType,
        c.CktSrcObjectType as SrcObjectType,
        c.CktSecSrcModelType as CktSecSrcModelType,
        c.CktSecSrcObjectType as SecSrcObjectType,
        dest.CktDestModelType as CktDestModelType,
        dest.CktDestObjectType as CktDestObjectType,
        c.rowid as myrow
from
        circuit_tbl c,
        circuit_dest_tbl dest,
        circuit_vlan_view vlan
where
        c.CktNodeId             = dest.CktNodeId(+)  and
        c.CktUniqueId           = dest.CktUniqueId(+) and
        c.CktNodeId             = vlan.CktNodeid   and
        c.CktUniqueid            = vlan.CktUniqueid;

2.2.19  circuit_vlan_view

CREATE OR REPLACE VIEW circuit_vlan_view AS
SELECT
        b.CktVlanId, 
        b.CktVlanName,
        b.CktNodeId,
        b.CktUniqueId,
        a.rowid as myrow
FROM
        circuit_vlan_tbl b ,
        circuit_bs_tbl a
WHERE
        a.CktNodeId   = b.CktNodeId   AND
        a.CktUniqueId = b.CktUniqueId
UNION
SELECT
        0,
        '',
        a.CktNodeId,
        a.CktUniqueId,
        a.rowid as myrow
FROM
        circuit_bs_tbl a
WHERE   a.rowid NOT IN
                       (  SELECT a.rowid
                          FROM   circuit_bs_tbl a,
                                 circuit_vlan_tbl b
                          WHERE  a.CktNodeId   = b.CktNodeId   AND
                                 a.CktUniqueId = b.CktUniqueId
                       ) ;

2.2.20  ckt_span_dest_mt_view

CREATE OR REPLACE VIEW ckt_span_dest_mt_view AS
SELECT DISTINCT
       cst.cktspandestnodeid as cktspandestnodeid,
       nvl(spandest.modulename,'System') as Modulename,
       cst.cktspandestphysicalloc,
       spandest.moduletype as ModuleType 
FROM
      (select distinct
              mtt.modulename   as modulename,
              mtt.moduletype   as moduletype,
              cstbl.cktspandestphysicalloc as cktspandestphysicalloc,
              cstbl.cktspandestnodeid as cktspandestnodeid
         from module_type_table mtt,
              ons15454_ne_inventory_table cni,
              circuit_span_tbl cstbl,
              ne_info_table   ne
        where mtt.moduletype= cni.equipmenttype
          and 
cni.physicalloc=round(cstbl.cktspandestphysicalloc/power(2,16))*(power(2,16))
          and ne.nenodeid = cstbl.cktspandestnodeid
          and cni.nedbaccessid=ne.nedbaccessid
          and ne.nemodeltype=mtt.modeltype
          and (mtt.modeltype=3 or mtt.modeltype=5 or mtt.modeltype=14 or mtt.modeltype=18)
      ) spandest,
      circuit_span_tbl cst
  WHERE cst.cktspandestnodeid = spandest.cktspandestnodeid(+)
    AND cst.cktspandestphysicalloc = spandest.cktspandestphysicalloc(+);

2.2.21  ckt_span_src_mt_view

CREATE OR REPLACE VIEW ckt_span_src_mt_view AS 
SELECT DISTINCT
       cst.cktspansrcnodeid as cktspansrcnodeid,
       nvl(spansrc.modulename,'System') as Modulename,
       cst.cktspansrcphysicalloc,
       spansrc.moduletype as ModuleType
FROM
      (select distinct
              mtt.modulename   as modulename,
              mtt.moduletype   as moduletype,
              cstbl.cktspansrcnodeid as cktspansrcnodeid,
              cstbl.cktspansrcphysicalloc as cktspansrcphysicalloc
         from module_type_table mtt,
              ons15454_ne_inventory_table cni,
              circuit_span_tbl cstbl,
              ne_info_table ne
        where mtt.moduletype= cni.equipmenttype
          and cni.physicalloc=round(cstbl.cktspansrcphysicalloc/power(2,16))*(power(2,16))
          and ne.nenodeid=cstbl.cktspansrcnodeid
          and cni.nedbaccessid=ne.nedbaccessid
          and ne.nemodeltype=mtt.modeltype
          and (mtt.modeltype=3 or mtt.modeltype=5 or mtt.modeltype=14 or mtt.modeltype=18)
      ) spansrc,
      circuit_span_tbl cst
  WHERE cst.cktspansrcnodeid=spansrc.cktspansrcnodeid(+)
    AND cst.cktspansrcphysicalloc=spansrc.cktspansrcphysicalloc(+) ;

2.2.22  Client_User_VIEW

create or replace view Client_User_VIEW As
select 
       username  as Username
from user_table
union
select distinct
      username  as Username
from  deleted_user_table;

2.2.23  CTM_Unknown_User_View

create or replace view CTM_Unknown_User_View as
select 
	CTMUnknownUserTable.IPAddress,  	
	CTMUnknownUserTable.FailedAttempts,  	
   CTMUnknownUserTable.LastLoginFailTime,
	decode(CTMUnknownUserTable.LockedState, 0, 'Unlocked',
                                           1, 'Locked') AS LockedState,
	CTMUnknownUserTable.ROWID AS MYROW 
FROM  
	CTM_Unknown_User_Table CTMUnknownUserTable;

2.2.24  DATA_CARD_VIEW

CREATE OR REPLACE VIEW DATA_CARD_VIEW AS	
SELECT
	B.NEID,
	B.SLOT,
	B.PORTNUM,
	B.SUBIF,
	B.BG,
	A.CIR,
	A.CIR_BURST,
	A.PIR,
	A.PIR_BURST,
	A.CCOSTRANSMIT
FROM
	INTF_SUB_INTF_VIEW B,
	QOS_VIEW A
WHERE 
	A.NEID(+) = B.NEID and A.SLOT(+) = B.SLOT and A.PORTNUM(+) = B.PORTNUM and A.BG(+) = 
B.BG;

2.2.25  domain_ne_inventory_view

create or replace view domain_ne_inventory_view as
select 
       ne.NESysID, 
       ne.NEModelType,
       ne.NEIPAddr,
       gne.NextHopIPAddr,
       ne.isNEConnected,
       ne.NEState,
       ne.NEPMEnabled,
       ne.NERobustPmEnabled,
       ne.NEVersion,
       ne.GNEID,
       ne.NESubNetworkID,
       np.NPId, 
       ne.NESnmpCommString,
       ne.NEConfigMode,
       ne.NECLLICode,
       ne.NEDescription,
       ne.NEDbaccessid,
       ne.NEDiscoveryState,
       mod.MODELTYPENAME,
       sub.SUBNETNAME,
       np.NPNAME,
       gne.GNESYSID,
       ne.rowid as myrow
 from  ne_info_table ne,
       network_partition_table np,
       subnetwork_table sub,
       model_type_table mod,
       gne_table gne
where ne.NeSubNetworkid=sub.subnetid
  and sub.npid= np.npid
  and ne.NEMODELTYPE=mod.MODELTYPE
  and ne.GNEID=gne.GNEID(+);

2.2.26  DSP_CIRCUIT_VIEW

create or replace view DSP_CIRCUIT_VIEW AS
select
        src.CKTCTPNODEID as SRCNENODEID,
        src.CktCTPPhysicalLoc as SrcPhysicalLoc,
        src.CKTCTPMODULETYPE as SRCMODULETYPE,
        dest.CKTCTPNODEID as DESTNENODEID,
        dest.CktCTPPhysicalLoc as DestPhysicalLoc,
        dest.CKTCTPMODULETYPE as DESTMODULETYPE
from
	  circuit_bs_tbl c,
        circuit_ctp_src_view src,
        circuit_ctp_drop_view dest
where
        c.CKTNODEID = src.CKTNODEID(+) and
	  c.CKTUNIQUEID = src.CKTUNIQUEID(+) and
        c.CKTNODEID = dest.CKTNODEID(+) and
		c.CKTUNIQUEID = dest.CKTUNIQUEID(+) and
        ( src.CKTCTPMODULETYPE = 6684672 or src.CKTCTPMODULETYPE = 6750208 or 
src.CKTCTPMODULETYPE = 10747904 or src.CKTCTPMODULETYPE = 14483456 or 
dest.CKTCTPMODULETYPE = 6684672 or dest.CKTCTPMODULETYPE = 6750208 or 
dest.CKTCTPMODULETYPE = 10747904 or dest.CKTCTPMODULETYPE = 14483456) and
        c.cktState             != 12; 

2.2.27  DSP_EQPT_VIEW

create or replace view DSP_EQPT_VIEW AS
select
        e.NEDBACCESSID as NEDBACCESSID,
        n.NENODEID as NENODEID,
        e.PHYSICALLOC as PHYSICALLOC,
        e.EQUIPMENTTYPE as MODULETYPE
from
        ONS15454_NE_INVENTORY_TABLE e,
        NE_INFO_TABLE n
where
        e.NEDBACCESSID = n.NEDBACCESSID(+) and
        ( e.EQUIPMENTTYPE = 102 or e.EQUIPMENTTYPE = 103 or e.EQUIPMENTTYPE = 164 or 
e.EQUIPMENTTYPE = 221) and
        ( n.NEMODELINDEX = 47 or n.NEMODELINDEX = 49 or n.NEMODELINDEX = 55 or 
n.NEMODELINDEX = 57 or n.NEMODELINDEX = 61 or n.NEMODELINDEX = 62 or n.NEMODELINDEX = 65 
or n.NEMODELINDEX = 77 or  n.NEMODELINDEX = 78 or  n.NEMODELINDEX = 75 or  n.NEMODELINDEX 
= 76 or n.NEMODELINDEX = 87 or n.NEMODELINDEX = 88 or n.NEMODELINDEX = 91 or 
n.NEMODELINDEX = 81);

2.2.28  GWCORBA_PM_MAPPING_VIEW

create or replace view GWCORBA_PM_MAPPING_VIEW AS
select
  	gwpm.MODELTYPE AS MODELTYPE,
	gwpm.LAYERRATE AS LAYERRATE,
	gwpm.OBJECTINDEX AS OBJECTINDEX,
	gwpm.LOCATION AS LOCATION,
	gwpm.DIRECTION AS DIRECTION,
	gwpm.TERMINATIONPOINT AS TERMINATIONPOINT,
	pam.IS24H AS IS24H,
	gwpm.PMVIEWNAME AS PMVIEWNAME,
	ot.METADATAINDEX AS METADATAINDEX,
	pam.PMPARAMID AS PMPARAMID,
	pam.PMNAME AS PMNAME,
	pci.TMFNAME AS TMFNAME,
	pam.ATTRINDEX AS ATTRINDEX,
	pam.VALIDITY_ATTRINDEX AS VALIDITY_ATTRINDEX,
	pci.PMTABLECOLNO AS PMTABLECOLNO
from
        GWCORBA_PM_MAPPING_TABLE gwpm,
	OBJECTTYPETABLE ot,
	PM_ATTRID_MAPPING_TABLE pam,
	PM_CERENT_INFO_TABLE pci
where
	gwpm.OBJECTINDEX = ot.OBJECTINDEX AND
	gwpm.MODELTYPE = ot.MODELTYPE AND
	gwpm.PMVIEWNAME = pam.PMVIEWNAME AND
	ot.METADATAINDEX = pam.METADATAINDEX AND
	pam.PMPARAMID = pci.PMPARAMID AND
	gwpm.LOCATION = pci.LOCATION AND
	gwpm.DIRECTION = pci.DIRECTION AND
	TMFNAME NOT LIKE ('N/A');

2.2.29  INTF_SUB_INTF_VIEW

CREATE OR REPLACE VIEW INTF_SUB_INTF_VIEW AS
SELECT DISTINCT	
	ert.NEDBACCESSID as NEID,
	getSlot(ert.RELATEDPHYSICALLOC) as SLOT, 
	getPort(ert.RELATEDPHYSICALLOC) as PORTNUM, 
	getBGFromBGObj(ert.SELFIFINDEX) as BG,
	getSubIf(ert.RELATEDIFINDEX) as SUBIF
FROM
	Eqpt_Info_Table eqpt,
	Eqpt_RelationShip_Table ert
WHERE
	eqpt.NEDBACCESSID = ert.NEDBACCESSID AND eqpt.PHYSICALLOC = ert.RELATEDPHYSICALLOC
	AND eqpt.IFINDEX = ert.RELATEDIFINDEX AND ert.SELFOBJECTINDEX  = 165
	AND (eqpt.OBJECTINDEX = 172 OR eqpt.OBJECTINDEX = 173  OR eqpt.OBJECTINDEX = 175 OR 
eqpt.OBJECTINDEX = 176);

2.2.30  Inventory_Table_View

create or replace view Inventory_Table_View as 
select 
	ni.NESysID,					
	inv.ModuleName, 	
	inv.ModulePartNum,
	inv.ModuleCLEICode, 
	inv.ModuleHWVersion, 
	inv.ModuleSWVersion, 
	inv.ModuleSerialNumber, 
	inv.ModuleDateOfManuf, 
	inv.ModuleDateOfEntry,
	inv.ModuleHoursInUse,
	ni.NEDBAccessId,
	inv.rowid as myrow
from 
	NE_INFO_TABLE ni, 
	NE_INVENTORY_TABLE inv
where 
	ni.NEDBAccessID = inv.NEDBAccessID ;

2.2.31  IOS_ACTIVE_CARDS

create or replace view IOS_ACTIVE_CARDS as
select distinct
	   a.NEDBACCESSID as NEDBACCESSID, 					
	   a.PHYSICALLOC as PHYSICALLOC, 
	   a.EQUIPMENTTYPE as MODULETYPE, 
	   a.NAME as MODULENAME,
	   b.NESYSID as NEID,
       b.NEMODELTYPE as NEMODELTYPE,
	   a.rowid as MYROW
from ONS15454_NE_INVENTORY_TABLE a, NE_INFO_TABLE  b
where EQUIPMENTTYPE in ( 102,103,164,221 ) and 
	  EQUIPMENTSTATE = 5 and
	  a.NEDBACCESSID = b.NEDBACCESSID;

2.2.32  IOS_USERS_VIEW

CREATE OR REPLACE VIEW IOS_USERS_VIEW AS
select
       c.NEDBACCESSID as NEDBACCESSID,
	   c.MODULETYPE as MODULETYPE,
       c.PHYSICALLOC as PHYSICALLOC,
	   c.IFINDEX as IFINDEX,
	   c.COL2 as USERNAME,
       c.COL5 as PASSWORD,
	   c.COL3 as PRIVILEGE,
	   a.MODULENAME as MODULENAME,
       b.NESYSID as NEID,					
       c.MODELTYPE as NEMODELTYPE,
	   c.rowid as MYROW
from EQPT_INFO_TABLE c,NE_INFO_TABLE b,MODULE_TYPE_TABLE a
where c.OBJECTINDEX = 221 and 
c.NEDBACCESSID = b.NEDBACCESSID and 
c.MODELTYPE = a.MODELTYPE and 
c.MODULETYPE = a.MODULETYPE;

2.2.33  link_utilization_view

create or replace view link_utilization_view AS
SELECT     a.FIELD1_NUM as CKTMODULETYPE,
           a.FIELD2_NUM as CKTPHYSICALLOC,
           a.FIELD3_NUM as CKTIFINDEX,
           b.CKTNAME as CKTNAME,
           b.CKTPROTECTIONTYPE as CKTPROTECTIONTYPE,
           a.CUSTOMER_ID_STR as CKTCUSTOMERID,
           a.SERVICE_ID_STR as CKTSERVICEID,
           b.CKTSIZE as CKTSIZE,
           a.field3_num as STRIPPED_IFINDEX, 
           a.NEDBACCESSID as NEDBACCESSID,
           b.CKTTYPE as CKTTYPE,
           b.CKTUSELAP as CKTUSELAP,
           b.CKTSRCIFINDEX as STRIPPED_CKTSRC_IFINDEX,
           collapsedifindex(b.CKTNODEID,b.CKTUNIQUEID)  as CKTDEST_IFINDEX,
           b.CKTUNIQUEID as CKTUNIQUEID,
           b.CKTNODEID as CKTNODEID,
           a.FIELD4_NUM as CKTOBJECTTYPE,
           collapsedobjectindex(b.CKTNODEID,b.CKTUNIQUEID) as cktDestObjectType,
           b.CKTSRCMODELTYPE as modelType,
           b.Rowid as myrow
FROM   MANAGED_ET_TAB a, CIRCUIT_TBL b
WHERE
            a.MNG_ENTITY_ID2_NUM = b.CKTUNIQUEID AND
            a.MNG_ENTITY_ID_NUM = b.CKTNODEID AND 
            ( b.CKTTYPE != 5 AND b.CKTTYPE != 6 AND b.CKTTYPE != 21 AND b.CKTTYPE != 22 );

2.2.34  LINK_UTILIZATION_VIEW

CREATE OR REPLACE VIEW LINK_UTILIZATION_VIEW ( CKTMODULETYPE, 
CKTPHYSICALLOC, CKTIFINDEX, CKTNAME, CKTPROTECTIONTYPE, 
CKTCUSTOMERID, CKTSERVICEID, CKTSIZE, STRIPPED_IFINDEX, 
NEDBACCESSID, CKTTYPE, CKTUSELAP, STRIPPED_CKTSRC_IFINDEX, 
CKTDEST_IFINDEX, CKTUNIQUEID, CKTNODEID, CKTOBJECTTYPE, 
CKTDESTOBJECTTYPE, MODELTYPE, MYROW ) AS SELECT     a.CKTCTPMODULETYPE as CKTMODULETYPE,
           a.CKTCTPPHYSICALLOC as CKTPHYSICALLOC,
           a.CKTCTPIFINDEX as CKTIFINDEX,
           b.CKTNAME as CKTNAME,
           b.CKTPROTECTIONTYPE as CKTPROTECTIONTYPE,
           b.CUSTOMERID as CKTCUSTOMERID,
           b.SERVICEID as CKTSERVICEID,
           b.CKTSIZE as CKTSIZE,
           a.CKTCTPIFINDEX as STRIPPED_IFINDEX, 
           a.CKTCTPNEDBACCESSID as NEDBACCESSID,
           b.CKTTYPE as CKTTYPE,
           b.CKTUSELAP as CKTUSELAP,
           c.CKTCTPIFINDEX as STRIPPED_CKTSRC_IFINDEX,
           collapsedifindex(b.CKTNODEID,b.CKTUNIQUEID)  as CKTDEST_IFINDEX,
           b.CKTUNIQUEID as CKTUNIQUEID,
           b.CKTNODEID as CKTNODEID,
           a.CKTCTPOBJECTTYPE as CKTOBJECTTYPE,
           collapsedobjectindex(b.CKTNODEID,b.CKTUNIQUEID) as cktDestObjectType,
           c.CKTCTPMODELTYPE as modelType,
           b.Rowid as myrow
FROM   CIRCUIT_CTP_TBL a, CIRCUIT_BS_TBL b, CIRCUIT_CTP_TBL c
WHERE
            a.CKTUNIQUEID = b.CKTUNIQUEID AND
            a.CKTNODEID = b.CKTNODEID AND
            c.CKTUNIQUEID = b.CKTUNIQUEID AND
            c.CKTNODEID = b.CKTNODEID AND
            c.CTP_TYPE = 0 AND
            ( b.CKTTYPE != 5 AND b.CKTTYPE != 6 AND b.CKTTYPE != 21 AND b.CKTTYPE != 22 );

2.2.35  link_view

create or replace view link_view as
SELECT 
        link.LinkID as LinkId,
        link.LinkSrcNode as LinkSrcNode,
        link.LinkSrcModuleType as LinkSrcModuleType,
        link.LinkSrcPhysicalLoc as LinkSrcPhysicalLoc, 
        link.LinkSrcIfIndex as LinkSrcIfIndex,
        
eqptinfoport(link.LinkSrcNode,link.LinkSrcPhysicalLoc,link.LinkSrcIfIndex,link.LinkSrcModu
leType) as LinkSrcPortName,
        link.LinkDstNode as LinkDstNode,
        link.LinkDstModuleType as LinkDstModuleType,
        link.LinkDstPhysicalLoc as LinkDstPhysicalLoc, 
        link.LinkDstIfIndex as LinkDstIfIndex,
        
eqptinfoport(link.LinkDstNode,link.LinkDstPhysicalLoc,link.LinkDstIfIndex,link.LinkDstModu
leType) as LinkDstPortName,
        link.LinkSize as LinkSize,
        link.LinkDirection as LinkDirection,
        link.LinkProvType as LinkProvType,
        link.LinkConnectionType as LinkConnectionType,
        link.LinkType as LinkType,
        link.LinkProtType as LinkProtType,
        link.LinkProtRole as LinkProtRole,
        link.LinkState as LinkState,
        link.useForRouting as useForRouting,
        link.LinkName as LinkName,
        link.LinkDescription as LinkDescription,
        link.NumCriticalAlarms as NumCriticalAlarms,
        link.NumMajorAlarms as NumMajorAlarms,
        link.NumMinorAlarms as NumMinorAlarms,
        link.NumWarningAlarms as NumWarningAlarms,
        link.LinkSrcPhyLocUnmanaged as LinkSrcPhyLocUnmanaged,
        link.LinkDestPhyLocUnmanaged as LinkDestPhyLocUnmanaged,
        link.LinkUnmanaged as LinkUnmanaged,
        neinfo1.nesysid  as SrcNesysid, 
        neinfo2.nesysid  as DstNesysid, 
        link.rowid as myrow,
        (select neSubnetworkId from ne_info_table where nedbaccessid = link.LinkSrcNode 
AND neSubnetworkId = (select neSubnetworkId from ne_info_table where nedbaccessid = 
link.LinkDstNode)) as SubnetworkId,
        link.LinkLayer as LinkLayer,
        link.LinkValid as LinkValid,
        link.CableGroupId as GroupId,
        0 as LinkDstNode2,
        0 as LinkDstModuleType2,
        d.phyloc as LinkDstPhysicalLoc2,
        d.phyloc as LinkDstIfIndex2,
        '' as LinkDstPortName2,
	0 as ycable,
        link.LinkCost as LinkCost,
        link.LinkSrcModelType as LinkSrcModelType,
        link.LinkSrcObjectType as LinkSrcObjectType,
        link.LinkDstModelType as LinkDstModelType,
        link.LinkDstObjectType as LinkDstObjectType,
        0 as LinkDstModelType2,   
        0 as LinkDstObjectType2,
        link.LinkSrlgList as LinkSrlgList,
        -1.0 as LinkUtilization
FROM    Link_table link,
        ne_info_table neinfo1,
        ne_info_table neinfo2,
        dummy_table d
WHERE
        link.LinkSrcNode = neinfo1.nedbaccessid AND
        link.LinkDstNode = neinfo2.nedbaccessid AND
	((link.LinkSrcModelType != 27 AND link.LinkSrcModelType != 26) 
         OR (link.LinkType = 14 OR link.LinkType = 15 OR link.LinkType = 16) ) AND
	link.LinkType != 11 and
        d.phyloc = 0
UNION
SELECT distinct
        link.LinkID as LinkId,
        link.LinkSrcNode as LinkSrcNode,
        link.LinkSrcModuleType as LinkSrcModuleType,
        link.LinkSrcPhysicalLoc as LinkSrcPhysicalLoc, 
        link.LinkSrcIfIndex as LinkSrcIfIndex,
        
eqptinfoport(link.LinkSrcNode,link.LinkSrcPhysicalLoc,link.LinkSrcIfIndex,link.LinkSrcModu
leType) as LinkSrcPortName, 
        link.LinkDstNode as LinkDstNode,
        link.LinkDstModuleType as LinkDstModuleType,
        link.LinkDstPhysicalLoc as LinkDstPhysicalLoc, 
        link.LinkDstIfIndex as LinkDstIfIndex,
        
eqptinfoport(link.LinkDstNode,link.LinkDstPhysicalLoc,link.LinkDstIfIndex,link.LinkDstModu
leType) as LinkDstPortName,
        link.LinkSize as LinkSize,
        link.LinkDirection as LinkDirection,
        link.LinkProvType as LinkProvType,
        link.LinkConnectionType as LinkConnectionType,
        link.LinkType as LinkType,
        link.LinkProtType as LinkProtType,
        link.LinkProtRole as LinkProtRole,
        link.LinkState as LinkState,
        link.useForRouting as useForRouting,
        link.LinkName as LinkName,
        link.LinkDescription as LinkDescription,
        link.NumCriticalAlarms+link1.NumCriticalAlarms as NumCriticalAlarms,
        link.NumMajorAlarms+link1.NumMajorAlarms as NumMajorAlarms,
        link.NumMinorAlarms+link1.NumMinorAlarms as NumMinorAlarms,
        link.NumWarningAlarms+link1.NumWarningAlarms as NumWarningAlarms,
        link.LinkSrcPhyLocUnmanaged as LinkSrcPhyLocUnmanaged,
        link.LinkDestPhyLocUnmanaged as LinkDestPhyLocUnmanaged,
        link.LinkUnmanaged as LinkUnmanaged,
        neinfo1.nesysid  as SrcNesysid, 
        neinfo2.nesysid  as DstNesysid, 
        link.rowid as myrow,
        (select neSubnetworkId from ne_info_table where nedbaccessid = link.LinkSrcNode 
AND neSubnetworkId = (select neSubnetworkId from ne_info_table where nedbaccessid = 
link.LinkDstNode)) as SubnetworkId,
        link.LinkLayer as LinkLayer,
        link.LinkValid as LinkValid,
        link.CableGroupId as GroupId,
        link1.LinkDstNode as LinkDstNode2,
        link1.LinkDstModuleType as LinkDstModuleType2,
        link1.LinkDstPhysicalLoc as LinkDstPhysicalLoc2,
        link1.LinkDstIfIndex as LinkDstIfIndex2,
        
eqptinfoport(link.LinkDstNode,link1.LinkDstPhysicalLoc,link1.LinkDstIfIndex,link1.LinkDstM
oduleType) as LinkDstPortName2,
	1 as ycable,
        link.LinkCost as LinkCost,
        link.LinkSrcModelType as LinkSrcModelType,
        link.LinkSrcObjectType as LinkSrcObjectType,
        link.LinkDstModelType as LinkDstModelType,
        link.LinkDstObjectType as LinkDstObjectType,
        link1.LinkDstModelType as LinkDstModelType2,
        link1.LinkDstObjectType as LinkDstObjectType2,
        link.LinkSrlgList as LinkSrlgList,
        -1.0 as LinkUtilization
FROM    Link_table link,
        Link_table link1,
        ne_info_table neinfo1,
        ne_info_table neinfo2
WHERE
        link.LinkSrcNode = neinfo1.nedbaccessid AND
        link.LinkDstNode = neinfo2.nedbaccessid AND
	link.cableGroupId=link1.cableGroupId and
	link.legIndex < link1.legIndex and
        link.LinkType = 11
UNION
SELECT distinct
        link.LinkID as LinkId,
        link.LinkSrcNode as LinkSrcNode,
        link.LinkSrcModuleType as LinkSrcModuleType,
        link.LinkSrcPhysicalLoc as LinkSrcPhysicalLoc, 
        link.LinkSrcIfIndex as LinkSrcIfIndex,
        
eqptinfoport(link.LinkSrcNode,link.LinkSrcPhysicalLoc,link.LinkSrcIfIndex,link.LinkSrcModu
leType) as LinkSrcPortName,
        link.LinkDstNode as LinkDstNode,
        link.LinkDstModuleType as LinkDstModuleType,
        link.LinkDstPhysicalLoc as LinkDstPhysicalLoc, 
        link.LinkDstIfIndex as LinkDstIfIndex,
        
eqptinfoport(link.LinkDstNode,link.LinkDstPhysicalLoc,link.LinkDstIfIndex,link.LinkDstModu
leType) as LinkDstPortName,
        link.LinkSize as LinkSize,
        link.LinkDirection as LinkDirection,
        link.LinkProvType as LinkProvType,
        link.LinkConnectionType as LinkConnectionType,
        link.LinkType as LinkType,
        link.LinkProtType as LinkProtType,
        link.LinkProtRole as LinkProtRole,
        link.LinkState as LinkState,
        link.useForRouting as useForRouting,
        link.LinkName as LinkName,
        link.LinkDescription as LinkDescription,
        link.NumCriticalAlarms as NumCriticalAlarms,
        link.NumMajorAlarms as NumMajorAlarms,
        link.NumMinorAlarms as NumMinorAlarms,
        link.NumWarningAlarms as NumWarningAlarms,
        link.LinkSrcPhyLocUnmanaged as LinkSrcPhyLocUnmanaged,
        link.LinkDestPhyLocUnmanaged as LinkDestPhyLocUnmanaged,
        link.LinkUnmanaged as LinkUnmanaged,
        neinfo1.nesysid  as SrcNesysid, 
        neinfo2.nesysid  as DstNesysid, 
        link.rowid as myrow,
        (select neSubnetworkId from ne_info_table where nedbaccessid = link.LinkSrcNode 
AND neSubnetworkId = (select neSubnetworkId from ne_info_table where nedbaccessid = 
link.LinkDstNode)) as SubnetworkId,
        link.LinkLayer as LinkLayer,
        link.LinkValid as LinkValid,
        link.CableGroupId as GroupId,
        0 as LinkDstNode2,
        0 as LinkDstModuleType2,
        d.phyloc as LinkDstPhysicalLoc2,
        d.phyloc as LinkDstIfIndex2,
        '' as LinkDstPortName2,
	0 as ycable,
        link.LinkCost as LinkCost,
        link.LinkSrcModelType as LinkSrcModelType,
        link.LinkSrcObjectType as LinkSrcObjectType,
        link.LinkDstModelType as LinkDstModelType,
        link.LinkDstObjectType as LinkDstObjectType,
        0 as LinkDstModelType2,   
        0 as LinkDstObjectType2,
        link.LinkSrlgList as LinkSrlgList,
        routerLinkTable.LinkUtilization as LinkUtilization
FROM    Link_table link,
        ne_info_table neinfo1,
        ne_info_table neinfo2,
	Router_Link_Table routerLinkTable,
        dummy_table d
WHERE
        link.LinkSrcNode = neinfo1.nedbaccessid AND
        link.LinkDstNode = neinfo2.nedbaccessid AND
	((link.LinkSrcModelType = 27 OR link.LinkSrcModelType = 26) 
	AND (link.LinkType != 14 OR link.LinkType != 15 OR link.LinkType != 16) ) AND
	link.LinkID = routerLinkTable.LinkId AND
	link.LinkType != 11 and
        d.phyloc = 0;

2.2.36  mcard_l2topology_map_view

CREATE OR REPLACE VIEW mcard_l2topology_map_view AS 
SELECT
      l2tct.Toponodeid as Toponodeid,
      l2tct.Topouniqueid as Topouniqueid,
      nit.NeDbAccessId as NeDbId,
      cst.CktCTPPhysicalLoc as PhysicalLoc,
      cst.CktCTPModuleType as ModuleType
FROM  circuit_ctp_src_view cst,
      L2topology_Circuits_Table l2tct,
      Ne_Info_Table nit
WHERE cst.CktNodeId    = l2tct.NodeId AND
      cst.CktUniqueId  = l2tct.UniqueId AND
      cst.CktCTPNodeId = nit.NeNodeId AND
      cst.CktCTPModuleType IN (6684672,6750208,10747904,14483456)
UNION
SELECT
      l2tct.Toponodeid as Toponodeid,
      l2tct.Topouniqueid as Topouniqueid,
      nit.NeDbAccessId as NeDbId,
      cdt.cktCTPPhysicalLoc as PhysicalLoc,
      cdt.cktCTPModuleType as ModuleType
FROM  circuit_ctp_drop_view cdt,
      L2topology_Circuits_Table l2tct,
      Ne_Info_Table nit
WHERE cdt.CktNodeId     = l2tct.NodeId AND
      cdt.CktUniqueId   = l2tct.UniqueId AND
      cdt.CktCTPNodeId = nit.NeNodeId AND
      cdt.cktCTPModuleType IN (6684672,6750208,10747904,14483456);

2.2.37  MLL_INV_VIEW

create or replace view MLL_INV_VIEW AS
select distinct
       NEDBACCESSID as NEDBACCESSID,
       LAYERRATE as LAYERRATE
from ( select 
        info.NEDBACCESSID as NEDBACCESSID,
        m.LAYERRATE as LAYERRATE
from
        MODULE_TYPE_MLL_INFO m,
        ne_info_table info,
        ONS15454_ne_inventory_table inv
where
        info.NEDBAccessID = inv.NEDBAccessID AND
        info.NEModelType  = m.ModelType AND
        inv.EquipmentType = m.ModuleType
UNION ALL
select 
        ne.NEDBACCESSID as NEDBACCESSID,
        m.LAYERRATE as LAYERRATE
from
        MODULE_TYPE_MLL_INFO m,
        ne_info_table ne,
        eqpt_info_table eit
where
        ne.NEDBACCESSID = eit.NEDBACCESSID AND
        ne.NEModelType  = m.ModelType    AND
        eit.ModuleType  = m.ModuleType   AND
        ne.NEModelType in (4,6,10)       AND
        m.ModuleType  >  2003
UNION ALL
select	
        t1.NEDBACCESSID as NEDBACCESSID,
        m.LAYERRATE as LAYERRATE
from
        MODULE_TYPE_MLL_INFO m,
        NE_INFO_TABLE t1,
        ONS15216_NE_INVENTORY_TABLE t2
where
        t1.NEDBACCESSID = t2.NEDBACCESSID AND
 	t1.NEModelType = m.MODELTYPE
UNION ALL
select 
        n.NEDBACCESSID as NEDBACCESSID,
        0 as LAYERRATE
from
        NE_INFO_TABLE n
where
        n.NEMODELTYPE in (24,33)
UNION
select distinct
        n.NEDBACCESSID as NEDBACCESSID,
        7 as LAYERRATE
from
        NE_INFO_TABLE n
where
        n.NEMODELTYPE = 24
UNION ALL
select 
        n.NEDBACCESSID as NEDBACCESSID,
        m.LAYERRATE as LAYERRATE
from
        MODULE_TYPE_MLL_INFO m,
        NE_INFO_TABLE n,
        EQPT_INFO_TABLE eqpt
where
        n.NEDBACCESSID = eqpt.NEDBACCESSID and
        m.MODELTYPE = n.NEMODELTYPE and
        m.MODULETYPE = eqpt.MODULETYPE and
        ((n.NEMODELTYPE = 9) or (n.NEMODELTYPE<14 and n.NEMODELTYPE>10))
UNION ALL
select 
        neInfo.NEDBACCESSID as NEDBACCESSID,
        mll.LAYERRATE as LAYERRATE
from
        MODULE_TYPE_MLL_INFO mll,
        NE_INFO_TABLE neInfo,
        ONS1530x_NE_INVENTORY_TABLE neInv
where
        neInfo.NEDBACCESSID = neInv.NEDBACCESSID and
        neInfo.NEModelType  = mll.ModelType and
        neInv.Type  = mll.ModuleType and
        neInfo.NEModelType in (21,22));

2.2.38  NE_Alarm_View

create or replace view NE_Alarm_View as
select 
	aat.NEDBAccessID, 
	aat.ActiveAlarmSeverity,
	aat.ModuleOrIfIndex, 
	aat.AlarmSeqNum, 
        aat.ModuleType,
        aat.PhysicalLoc,
        aat.alarmStatus,
	aat.rowid as myrow,
        aat.ModelType,
        aat.ObjectType,
        aat.StrObjInstance
from
	ACTIVE_ALARM_TABLE aat, 
	NE_INFO_TABLE nit
where
	aat.NEDBAccessID = nit.NEDBAccessID ;

2.2.39  NE_Circuit_NodeID_View

create or replace view NE_Circuit_NodeID_View as
SELECT
       a.nedbaccessid, b.cktname
  FROM ne_info_table a, circuit_bs_tbl b
 WHERE a.NENodeID = b.CktNodeId and
       b.cktstate != 12;

2.2.40  NE_Circuit_Vlan_View

create or replace view NE_Circuit_Vlan_View as
SELECT
       a.NEDBACCESSID, c.CKTVLANID
  FROM NE_INFO_TABLE a, CIRCUIT_TBL b, CIRCUIT_VLAN_TBL c
 WHERE b.CKTUNIQUEID = c.CKTUNIQUEID
   AND b.CKTNODEID = c.CKTNODEID
   AND b.CKTNODEID = a.NENODEID;

2.2.41  NE_Info_NP_VIEW

create or replace view NE_Info_NP_VIEW As
select ne.NEDBAccessID,
       ne.NESysID,
       ne.NEIPAddr,
       ne.NENSAPAddr,
       ne.NEState,
       ne.isNEConnected,
       decode(ne.GNEID,-1,'Not Applicable',
                             gne.GNESysID ) as GneName,
       ne.NEDescription,
       ne.NEConfigMode,
       ne.NESnmpCommString,
       ne.NECLLICode,
       ne.NEStateChangeTime,
       ne.NEModelType,
       ne.NEModelIndex,
       ne.NEModelStatus,
       decode(ne.nesubnetworkID,-1,'Not Applicable',
                               sub.SubnetName) as SubnetworkName,
       ne.NETimeOffset,
       ne.NELEDStatus,
       ne.NESystemTitle,
       ne.NEUserLabel,
       ne.NEVendorName,
       ne.NEVersion,
       ne.NENumActiveCriticalErrors,
       ne.NENumActiveMajorErrors,
       ne.NENumActiveMinorErrors,
       ne.NEPmEnabled,
       ne.NENodeID,
       ne.NEInventoryLastChanged,
       ne.NESubnetMask,
       ne.NEDefaultGateway,
       ne.NENumUnActiveCriticalErrors,
       ne.NENumUnActiveMajorErrors,
       ne.NENumUnActiveMinorErrors,
       ne.NENumCleared,
       ne.DisplayModelName,
       ne.GWTL1USERNAME,
       ne.GWTL1PASSWD,
       ne.ServiceID,
       ne.DeleteState,
       np.NPId,
       np.NPName
from   ne_info_table ne,
       subnetwork_table sub,
       gne_table        gne,
       network_partition_table np
Where  ne.GNEID=gne.gneid(+) AND
       ne.NESubNetworkID=sub.subnetID AND
       sub.NPId=np.NPId;

2.2.42  NE_Inventory_View

create or replace view NE_Inventory_View as
select 
	nit.NESysID,				
	ninvt.ModuleIndex,
	ninvt.ModuleName,
	ninvt.ModulePartNum, 
	ninvt.ModuleCLEICode,
	ninvt.ModuleHWVersion, 
	ninvt.ModuleSWVersion, 
	ninvt.ModuleSerialNumber,
	ninvt.ModuleDateOfManuf, 
	ninvt.ModuleDateOfEntry,
	ninvt.ModuleHoursInUse,
	nit.NEDBAccessId,
	ninvt.rowid as myrow
from
	NE_INVENTORY_TABLE ninvt, 
	NE_INFO_TABLE nit
where
	ninvt.NEDBAccessID = nit.NEDBAccessID ;

2.2.43  NE_SWIMAGE_VIEW

create or replace view NE_SWIMAGE_VIEW as
SELECT
        ne.NESysId, 
        mtt.modelTypeName AS ModelName, 
        ne.NEState, 
        sw.activeimagename, 
        sw.standbyimagename, 
        sw.defaultimagename, 
        ne.nedbaccessid,
        sw.inprogress,
        sw.physicalloc,
        mtt.modeltype,
        sw.rowid as myrow
from
        NE_SWIMAGE_TABLE sw,
        NE_INFO_TABLE ne,
        Model_Type_Table mtt
where
        sw.nedbaccessid = ne.nedbaccessid AND
        mtt.ModelType = ne.NEModelType;

2.2.44  OSS_Alarm_Fltr_AidDeny_VIEW

create or replace view OSS_Alarm_Fltr_AidDeny_VIEW as
select 
	alarmfltrtbl.AlarmFilterId,
	alarmenum.AIDString,	
	alarmfltrtbl.RowId AS myrow  
FROM  
	OSS_Alarm_Fltr_AID_Deny_Tbl alarmfltrtbl,
	OSS_AID_ENUM_TABLE alarmenum
WHERE
	alarmfltrtbl.AidId = alarmenum.AIDId;

2.2.45  OSS_Alarm_Fltr_TidDeny_VIEW

create or replace view OSS_Alarm_Fltr_TidDeny_VIEW as
select 
	neInfo.NEDBAccessId,	
	alarmfltrtbl.AlarmFilterId,	
	neInfo.NESysId,		
	alarmfltrtbl.ROWID AS MYROW 
FROM  
	OSS_Alarm_Fltr_TID_Deny_Tbl alarmfltrtbl,  
	NE_INFO_TABLE neInfo  
WHERE  
	alarmfltrtbl.NEDBAccessID = neInfo.NEDBAccessID;

2.2.46  OSS_Corba_User_View

create or replace view OSS_Corba_User_View as
select 
	corbaUserTable.OSSName,  				
	corbaUserTable.IPAddress,  	
	corbaUserTable.OSSPasswd,
	corbaUserTable.ROWID AS MYROW 
FROM  
	OSS_CORBA_USER_TABLE corbaUserTable;

2.2.47  OSS_User_View

create or replace view OSS_User_View as
select 
	userTable.OSSName,  	
	userTable.IPAddress,  	
	userTable.ListenerModeFlag,
	userTable.ActUserDenyFlag,
	userTable.DomainMgrFlag,  				
	userTable.AlarmFilterFlag,
	filterTable.FilterName,  	
	userTable.OSSPASSWD,
	userTable.ALARMFILTERID,
	userTable.ROWID AS MYROW 
FROM  
	OSS_ALARM_FILTER_TABLE filterTable,  
	OSS_USER_TABLE userTable  
WHERE  
	filterTable.AlarmFilterId = userTable.AlarmFilterId;

2.2.48  POS_PORTS_VIEW

CREATE OR REPLACE VIEW POS_PORTS_VIEW AS 
select
       c.NEDBACCESSID as NEDBACCESSID,	
       c.MODULETYPE as MODULETYPE,
       c.MODELTYPE as NEMODELTYPE,
       a.MODULENAME as MODULENAME,
       c.PHYSICALLOC as PHYSICALLOC,
       c.IFINDEX as IFINDEX,
       c.COL5 as POSSTATE,
       c.COL15 as MTUSIZE
from EQPT_INFO_TABLE c,NE_INFO_TABLE b,MODULE_TYPE_TABLE a
where c.OBJECTINDEX = 166 and
c.NEDBACCESSID = b.NEDBACCESSID and
c.MODELTYPE = a.MODELTYPE and
c.MODULETYPE = a.MODULETYPE;

2.2.49  QOSTEMPLATE_GENERAL_VIEW

CREATE OR REPLACE VIEW QOSTEMPLATE_GENERAL_VIEW AS 	
SELECT
  QOSTEMPLATEID as TID,
  QOSTEMPLATENAME as TNAME,
  QOSTEMPLATETYPE as TTYPE,
  QOSTEMPLATEDESCRIPTION as TDESC
FROM L2QOSTEMPLATE_TABLE;

2.2.50  QOS_VIEW

CREATE OR REPLACE VIEW QOS_VIEW AS 	
SELECT DISTINCT	
	eqpt.NEDBACCESSID as NEID,
	getSlot(eqpt.PHYSICALLOC) as SLOT,
	getPort(eqpt.PHYSICALLOC) as PORTNUM,
	getBGFromQoSObj(eqpt.IFINDEX) as BG, 
	eqpt.COL4 as CIR, 
	eqpt.COL5 as CIR_BURST,
	eqpt.COL17 as PIR,
	eqpt.COL18 as PIR_BURST,
	eqpt.COL11 as CCOSTRANSMIT 
FROM 
	Eqpt_Info_Table eqpt 
WHERE
	eqpt.OBJECTINDEX = 180 AND (getPolicyMapType(eqpt.IFINDEX) = 3 OR 
getPolicyMapType(eqpt.IFINDEX) = 5);

2.2.51  roll_view

CREATE OR REPLACE VIEW roll_view AS
SELECT
        (select CktName from circuit_bs_tbl where cktnodeid = r.rollfromcktnodeid and 
cktuniqueid=r.rollfromcktuniqueid) as rollFromCkt, 
        (select CktName from circuit_bs_tbl where cktnodeid = r.rolltocktnodeid and 
cktuniqueid=r.rolltocktuniqueid) as rollToCkt, 
        r.rollstate as rollState, 
        r.rollvalidsignal as rollValidSignal, 
        r.rollmode as rollMode, 
        (select nesysid from ne_info_table where nenodeid=r.rollpathnodeid and 
r.rollpathnodeid !=0 )  as PathNodeId,
        r.rollpathnodeid,
        nvl(getSlotModuleName(r.rollpathnodeid, r.rollpathmoduletype),'SYSTEM')  as 
rollPathModuleType,
        r.rollpathphysicalloc as rollPathPhySicalLoc,
        r.rollpathifindex as rollPathIfIndex,
        (select nesysid from ne_info_table where nenodeid=r.rollfromnodeid and 
r.rollfromnodeid !=0 )  as FromNodeId,
        r.rollfromnodeid,
        nvl(getSlotModuleName(r.rollfromnodeid, r.rollfrommoduletype),'SYSTEM')  as 
rollFromModuleType,
        r.rollfromphysicalloc as rollFromPhySicalLoc,
        r.rollfromifindex as rollFromIfIndex,
        (select nesysid from ne_info_table where nenodeid=r.rolltonodeid and 
r.rolltonodeid !=0 )  as ToNodeId,
        r.rolltonodeid,
        nvl(getSlotModuleName(r.rolltonodeid, r.rolltomoduletype),'SYSTEM')  as 
rollToModuleType,
        r.rollTophysicalloc as rollToPhySicalLoc,
        r.rollToifindex as rollToIfIndex,
        r.rollNodeid as nodeId,
        r.Connectionindex as connectionIndex,
        r.canBeCompleted as canBeCompleted,
        r.canBeFinished as canBeFinished,
        r.canBeCancelled as canBeCancelled,
        r.rollPathModelType as rollPathModelType,
        r.rollpathobjectindex as rollPathObjectIndex,
        r.rollFromModelType as rollFromModelType,
        r.rollfromobjectindex as rollfromobjectindex,
        r.rollToModelType as rollToModelType,
        r.rolltoobjectindex as rollToObjectindex,
        nvl(getPortModuleName(r.rollpathnodeid, r.rollpathmoduletype),'SYSTEM')  as 
rollPathPortModuleType,
        nvl(getPortModuleName(r.rollfromnodeid, r.rollfrommoduletype),'SYSTEM')  as 
rollFromPortModuleType,
        nvl(getPortModuleName(r.rolltonodeid, r.rolltomoduletype),'SYSTEM')  as 
rollToPortModuleType,
        r.rollname as rollName,
        r.canBeForced as canBeForced,
        r.rowid as myrow
From
        roll_table r;

2.2.52  Self_Monitoring_view

create or replace view Self_Monitoring_view AS
SELECT sp.DisplayName,
       sp.ModelType,
       sm.CollectionTime, 
       sm.Value,
       sm.nedbaccessid,
       ne.Nesysid as Nesysid,
       sm.rowid as MyRow
FROM   SERVER_MONITOR_TABLE sm,
       SERVER_PARAMETER_TABLE sp,
       ne_info_table ne
WHERE  sp.ParameterIndex=sm.ParameterIndex
  and  sm.nedbaccessid=ne.nedbaccessid
union
SELECT sp.DisplayName,
       sp.ModelType,
       sm.CollectionTime, 
       sm.Value,
       sm.nedbaccessid,
       pn.Nesysid as Nesysid,
       sm.rowid as MyRow
FROM   SERVER_MONITOR_TABLE sm,
       SERVER_PARAMETER_TABLE sp,
       purged_ne_table pn
WHERE  sp.ParameterIndex=sm.ParameterIndex
  and  sm.nedbaccessid=pn.nedbaccessid
union
SELECT sp.DisplayName,
       sp.ModelType,
       sm.CollectionTime, 
       sm.Value,
       sm.nedbaccessid,
       'CTM' as Nesysid,
       sm.rowid as MyRow
FROM   SERVER_MONITOR_TABLE sm,
       SERVER_PARAMETER_TABLE sp
WHERE  sp.ParameterIndex=sm.ParameterIndex
  AND  sm.nedbaccessid=0;

2.2.53  SPR_VIEW

CREATE OR REPLACE VIEW SPR_VIEW AS 
select
       c.NEDBACCESSID as NEDBACCESSID,	
       c.MODULETYPE as MODULETYPE,
       c.MODELTYPE as NEMODELTYPE,
       a.MODULENAME as MODULENAME,
       c.PHYSICALLOC as PHYSICALLOC,
       c.IFINDEX as IFINDEX,
       c.COL15 as MTUSIZE
from EQPT_INFO_TABLE c,NE_INFO_TABLE b,MODULE_TYPE_TABLE a
where c.OBJECTINDEX = 186 and
c.NEDBACCESSID = b.NEDBACCESSID and
c.MODELTYPE = a.MODELTYPE and
c.MODULETYPE = a.MODULETYPE;

2.2.54  SW_Active_Alarm_View

create or replace view SW_Active_Alarm_View as 
select distinct
	aa.ActiveAlarmSeverity, 	
	ni.NESysID,					
	if.ifName,					
	aa.ActiveAlarmTimeStamp,			
	en.EnumString, 
	aa.ActiveAlarmServEff,	
	aa.ActiveAlarmAdditionalInfo, 
	aa.NEDBAccessID, 
	aa.ModuleOrIfIndex, 
	aa.rowid as myrow
from 
	NE_INFO_TABLE ni, 
	INTERFACE_TABLE if, 
	ACTIVE_ALARM_TABLE aa,
	ALARM_EVENT_TYPE_ENUM_TABLE en
where 
	aa.NEDBAccessID = ni.NEDBAccessID AND 
	aa.ModuleOrIfIndex= if.ifStaticIndex AND 
	aa.ActiveAlarmType = en.EnumIndex ;

2.2.55  SW_User_Port_View

create or replace view SW_User_Port_View as	
select  					
	p.userid, 				
	p.nedbaccessid,	
	p.neportifindex,	
	i.ifName, 
	p.rowid as myrow 
from 
	sway_user_port_table p,
	interface_table i
where 
	p.NEPortIfIndex = i.ifstaticindex;

2.2.56  tl1_active_alarm_view

CREATE OR REPLACE VIEW tl1_active_alarm_view AS
SELECT
       ni.NESysID,
       aa.ModuleOrIfIndex,
       aa.AlarmStatus,
       aa.ActiveAlarmSeverity,
       en.TL1String,
       aa.ActiveAlarmServEff,
       TO_CHAR(aa.ActiveAlarmTimeStamp, 'MM/DD/YYYY HH24:MI:SS') AS ActiveAlarmTimeStamp,
       en.EnumString,
       eq.ModuleName, 
       aa.NEDBAccessID,
       ni.NEModelType,
       TO_CHAR(aa.PhysicalLoc) AS PhysicalLoc,
       ni.DeleteState,
       aa.ObjectType
FROM
       ne_info_table ni,
       active_alarm_table aa,
       alarm_event_type_enum_table en,
       module_type_table eq
WHERE
       aa.ActiveAlarmSeverity > 4               AND
       aa.ModuleType          = eq.ModuleType   AND
       ni.NEModelType         = eq.ModelType    AND
       aa.NEDBAccessID        = ni.NEDBAccessID AND
       aa.ActiveAlarmType     = en.EnumIndex    AND
       aa.AlarmStatus         = 0;

2.2.57  TL1_NE_View

create or replace view TL1_NE_View as
select distinct
        si.SubnetName,
        ni.NEIPAddr,
        ni.NESysID,
        ni.GNEID,
        ni.NEModelType,
        ni.NEVersion,  
        (select GNESysID from GNE_Table where GNEID=ni.GNEID) as GNESysID,
        ni.NEState,
        ni.isNEConnected,
        ni.NESubNetworkID,
        ni.NEDBAccessID,
        ni.NEModelIndex,
        ni.DeleteState 
from
        NE_INFO_TABLE      ni,
        Subnetwork_Table   si,
        GNE_Table          gi
where
        ni.NESubnetworkID = si.SubnetID AND
        ni.GNEID          = gi.GNEID(+)
UNION
select distinct
        si.SubnetName,
        ni.NEIPAddr,
        ni.NESysID,
        ni.GNEID,
        ni.NEModelType,
        ni.NEVersion,
        si.SubnetName,
        ni.NEState,
        ni.isNEConnected,
        ni.NESubNetworkID,
        ni.NEDBAccessID,
        ni.NEModelIndex,
        ni.DeleteState
from
        NE_INFO_TABLE      ni,
        Subnetwork_Table   si
where
        ni.NESubnetworkID = si.SubnetID AND
        ni.NEModelType    = 34 ;

2.2.58  TOPOLOGY_CIRCUIT_VIEW

create or replace view TOPOLOGY_CIRCUIT_VIEW as
SELECT 
    	l2topo.Topology_Name,   		 	
        c.CktName as Name,                                
        c.CktType as Type,                                
        c.CktSize as CktSize,                             
        c.CktDirection as Direction,
        c.CktState as State,
        src.nesysid as SrcNodeid, 
        src.cktnodeid as cktsrcnodeid,
        nvl(getModulename1(src.cktnodeid, src.CktCtpModuleType),'SYSTEM')  as 
SrcModuleType,
        src.CktCtpPhysicalLoc as SrcPhysicalLoc,
        src.CktCtpModelType as SrcModelType,
        src.CktCtpIfIndex as SrcInterfaceId,
        nvl(getModulename1(sec.cktnodeid, sec.CktCtpModuleType),'SYSTEM') as 
SecSrcModuleType,
        sec.CktCtpPhysicalLoc as SecSrcPhysicalLoc,
        sec.CktCtpModelType as CktSecSrcModelType,
        sec.CktCtpIfIndex as SecSrcInterfaceId,
        collapseddestnodename(c.CKTNODEID,c.CKTUNIQUEID) as destnodename,
        collapsedmodulename(c.CKTNODEID,c.CKTUNIQUEID) as cktdestModuleName,
        collapsedphy(c.CKTNODEID,c.CKTUNIQUEID) as DestPhysicalLoc,
        dest.CktCtpModelType as CktDestModelType,
        collapsedifindex(c.CKTNODEID,c.CKTUNIQUEID) as DestInterfaceId,
        c.CktIsMonitor as Ismonitor,
        src.CktCtpDropProt as SrcDropProt,
        c.CktNodeId as NodeId,
        c.CktUniqueId as UniqueId,
        c.CktDescription as Description,
        dest.cktnodeid as DestNodeId,
        span.cktlinkid,
        span.SpanSrcNodeId as CktSpanSrcNodeId,
        span.SpanDestNodeId as CktSpanDestNodeId,
        c.CktEnhancedState,
        c.CktProtectionType,
        dest.CktCtpPathProt  as DestPathProtection,
        l2topo.rowid as myrow,
	l2topo.TOPONODEID,  
	l2topo.TOPOUNIQUEID,
	eqptinfoport(src.cktctpnedbaccessid,src.cktctpphysicalloc,0,src.cktctpmoduletype) as 
CktSrcPortName,
	eqptinfoport(sec.cktctpnedbaccessid,sec.cktctpphysicalloc,0,sec.cktctpmoduletype) as 
CktSecSrcPortName,
	collapsedeqptportname(c.CKTNODEID,c.CKTUNIQUEID) as CktDestPortName,
	sec.CktNodeId as CktSecSrcNodeId,
	c.customerId as CktCusiomerId,
	c.serviceId as CktServiceId,
	c.cktComment as CktNote,
	l2topo.TopoType,					
	l2topo.TopoSize,					
	l2topo.TopoDescription as TopoDescription,
        l2topo.AlarmSeverity as TopoAlarmSeverity,
        l2topo.TopoStatus as TopoStatus,	
        l2topo.TopoProtection as TopoProtection,
        l2topo.TopoOperStatus as TopoOprStatus,
        l2topo.TOPORESYNCSTATUS as TopoResyncStatus,
	l2topo.BW_SP_Management,
	l2topo.BW_Committed,
	l2topo.BW_Best_Effort,
	l2topo.COS_COMMIT,
        l2topo.BW_Utilized,
        l2topo.BW_Available,
        l2topo.BW_AVVID_CONTROL,
        l2topo.COS_SP_MANAGEMENT,
        l2topo.COS_COMMITTED,
        l2topo.COS_AVVID_VOICEVIDEO,
        l2topo.COS_AVVID_CONTROL,
        l2topo.BW_Group1,
	l2topo.BW_Group2,
        l2topo.COS_GROUP1,
        l2topo.COS_GROUP2,
        nvl(vcg.VCGDirection,-1) as VCGDirection,
        nvl(vcg.ParentCktNodeId,-1) as ParentCktNodeId,
        nvl(vcg.ParentCktUniqueId,-1) as ParentCktUniqueId
FROM
	L2Topology_Table l2topo,
    	L2Topology_Circuits_Table l2circuits,
        circuit_bs_tbl c,
        circuit_ctp_src_view src,
        circuit_ctp_sec_view sec,
        circuit_ctp_drop_view dest,
        circuit_ctpspan_view span,
        circuit_span_view spantbl,
        circuit_vcg_tbl vcg
where
    l2topo.TopoNodeID = l2circuits.TopoNodeID(+) AND 
    l2topo.TopoUniqueId = l2circuits.TopoUniqueId(+) AND
    l2circuits.NodeId = c.CktNodeId AND
    l2circuits.UniqueId = c.CktUniqueId and
    c.CktNodeId             = src.CktNodeId(+)  and
    c.CktUniqueId           = src.CktUniqueId(+) and
    c.CktNodeId             = sec.CktNodeId(+) and
    c.CktUniqueId           = sec.CktUniqueId(+) and
    c.CktNodeId             = dest.CktNodeId(+) and
    c.CktUniqueId           = dest.CktUniqueId(+) and
    c.CktNodeId             = span.CktNodeId(+) and
    c.CktUniqueId           = span.CktUniqueId(+) and
    c.CktNodeId             = vcg.CktNodeId(+) and
    c.CktUniqueId           = vcg.CktUniqueId(+) and
    c.CktNodeId             = spantbl.NodeId(+) and
    c.CktUniqueId           = spantbl.UniqueId(+) and
    c.cktState != 12 AND
    l2topo.TopoStatus != 2;	

2.2.59  TOPOLOGY_CIRCUIT_VIEW_CTM5_0

create or replace view TOPOLOGY_CIRCUIT_VIEW_CTM5_0 as
SELECT 
    	l2topo.Topology_Name,   		 	
        c.CktName as Name,                                
        c.CktType as Type,                                
        c.CktSize as CktSize,                             
        c.CktDirection as Direction,
        c.CktState as State,
        (select nesysid from ne_info_table where nenodeid=c.cktsrcnodeid and 
c.cktsrcnodeid !=0 )  as SrcNodeid, 
        c.cktsrcnodeid,
        nvl(getModulename1(c.cktsrcnodeid, c.CktSrcModuleType),'SYSTEM')  as 
SrcModuleType,
        c.CktSrcPhysicalLoc as SrcPhysicalLoc,
        c.CktSrcModelType as SrcModelType,
        c.CktSrcIfIndex as SrcInterfaceId,
        nvl(getModulename1(c.cktsecsrcnodeid, c.CktSecSrcModuleType),'SYSTEM') as 
SecSrcModuleType,
        c.CktSecSrcPhysicalLoc as SecSrcPhysicalLoc,
        c.CktSecSrcModelType as CktSecSrcModelType,
        c.CktSecSrcIfIndex as SecSrcInterfaceId,
        c.cktDestNodename as destnodename,
        c.cktdestModuleName,
        c.CktDestPhysicalLoc as DestPhysicalLoc,
        c.CktDestModelType as CktDestModelType,
        c.CktDestIfIndex  as DestInterfaceId,
        c.CktIsMonitor as Ismonitor,
        c.CktSrcDropProt as SrcDropProt,
        c.CktNodeId as NodeId,
        c.CktUniqueId as UniqueId,
        c.CktDescription as Description,
        dest.cktdestnodeid as DestNodeId,
        spantbl.cktlinkid,
        spantbl.CktSpanSrcNodeId,
        spantbl.CktSpanDestNodeId,
        c.CktEnhancedState,
        c.CktProtectionType,
        dest.CktDestPathProt  as DestPathProtection,
        l2topo.rowid as myrow,
	l2topo.TOPONODEID,  
	l2topo.TOPOUNIQUEID,
	c.cktSrcPortName as CktSrcPortName,
	c.cktSecSrcPortName as CktSecSrcPortName,
	c.cktDestPortName as CktDestPortName,
	c.cktSecSrcNodeId as CktSecSrcNodeId,
	c.customerId as CktCusiomerId,
	c.serviceId as CktServiceId,
	c.cktComment as CktNote,
	l2topo.TopoType,				
	l2topo.TopoSize,							
	l2topo.TopoDescription as TopoDescription,
    l2topo.AlarmSeverity as TopoAlarmSeverity,
    l2topo.TopoStatus as TopoStatus,	
    l2topo.TopoProtection as TopoProtection,
    l2topo.TopoOperStatus as TopoOprStatus,	
    l2topo.TOPORESYNCSTATUS as TopoResyncStatus,
	l2topo.BW_SP_Management,
	l2topo.BW_Committed,
	l2topo.BW_Best_Effort,
	l2topo.COS_COMMIT,
        l2topo.BW_Utilized,
        l2topo.BW_Available,
        l2topo.BW_AVVID_CONTROL,
        l2topo.COS_SP_MANAGEMENT,
        l2topo.COS_COMMITTED,
        l2topo.COS_AVVID_VOICEVIDEO,
        l2topo.COS_AVVID_CONTROL,
        l2topo.BW_Group1,
	l2topo.BW_Group2,
        l2topo.COS_GROUP1,
        l2topo.COS_GROUP2
FROM
	L2Topology_Table l2topo,
    	L2Topology_Circuits_Table l2circuits,
        circuit_tbl c,
        circuit_dest_tbl dest,
        circuit_span_tbl spantbl
where
	l2topo.TopoNodeID = l2circuits.TopoNodeID(+) AND 
   	l2topo.TopoUniqueId = l2circuits.TopoUniqueId(+) AND
    	l2circuits.NodeId = c.CktNodeId AND
    	l2circuits.UniqueId = c.CktUniqueId and
        c.CktNodeId = dest.CktNodeId(+)  and
        c.CktUniqueId = dest.CktUniqueId(+) and
        c.CktNodeId = spantbl.CktNodeId(+) and
        c.CktUniqueId = spantbl.CktUniqueId(+) and
        c.cktState != 12 AND
        l2topo.TopoStatus != 2;		

2.2.60  topology_gui_view

CREATE OR REPLACE VIEW topology_gui_view AS
SELECT DISTINCT
        l2Topology.Topology_Name as Name, 
	l2Topology.TopoNodeID as TopoNodeID,
	l2Topology.TopoUniqueId as TopoUniqueID,
        l2Topology.TopoType as TopoType,        
        l2Topology.TopoSize as TopoSize,
        l2Topology.TopoDescription as Description,
        l2Topology.AlarmSeverity as Severity,
        l2Topology.TopoStatus as TopoStatus,
        l2Topology.TopoProtection as Protection,
        l2Topology.TopoOperStatus as OprStatus,
        l2Topology.TOPORESYNCSTATUS as ResyncStatus,
        l2Topology.rowId as myrow,
	c.CktType as CktType,
	l2Topology.BW_SP_Management,
	l2Topology.BW_Committed,
	l2Topology.BW_Best_Effort,
        l2Topology.BW_AVVID_CONTROL,
        l2Topology.COS_SP_MANAGEMENT,
        l2Topology.COS_COMMITTED,
        l2Topology.COS_AVVID_VOICEVIDEO,
        l2Topology.COS_AVVID_CONTROL,
        l2Topology.BW_Group1,
        l2Topology.BW_Group2,
        l2Topology.COS_GROUP1,
        l2Topology.COS_GROUP2
FROM
	L2Topology_Table l2Topology,
        L2Topology_Circuits_Table l2circuits,
        circuit_tbl c
WHERE  
        l2Topology.TopoNodeID = l2circuits.TopoNodeID AND
        l2Topology.TopoUniqueId = l2circuits.TopoUniqueId AND
        l2circuits.NodeId = c.CktNodeId AND
        l2circuits.UniqueId = c.CktUniqueId AND
	l2Topology.TopoStatus != 2;

2.2.61  trace_vlan_view

CREATE OR REPLACE VIEW trace_vlan_view AS
SELECT DISTINCT
        eit1.COL250 as VLANID,
        eit2.COL10 as BRIDGEID,
        eit2.COL13 as DESIGNATEDROOT,
        eit1.NEDBACCESSID,
        ni.NESYSID,
        eit1.physicalloc,
        ni.CONFIGSYNCSTATUS as NODEMANAGERSTATE,
        eit1.COL13 as UNTAGGED,
        eit2.COL7 as BRIDGEMAXAGE,
        eit2.COL8 as BRIDGEHELLOTIME,
        eit2.COL15 as ROOTPORT,
        eit2.COL14 as ROOTCOST,
        eit1.COL5 as STPSTATE,
        eit1.COL11 as STPENABLED,
        st.SUBNETID,
        ni.rowid as myrow
FROM
        eqpt_info_table eit1,
        eqpt_info_table eit2,
        eqpt_info_table eit3,
        ne_info_table ni,
        subnetwork_table st
WHERE
        ni.NEDBACCESSID   = eit1.NEDBACCESSID AND
        ni.NEDBACCESSID   = eit2.NEDBACCESSID(+) AND
        ni.NEDBACCESSID   = eit3.NEDBACCESSID(+) AND
        (eit1.OBJECTINDEX=105 OR eit1.OBJECTINDEX=205) AND
        11=eit2.OBJECTINDEX(+) AND
        104=eit3.OBJECTINDEX(+) AND eit3.COL12!='LINEAR_NO_SWITCH' AND
        ni.CONFIGSYNCSTATUS=3 AND
        (ni.NESTATE=1 OR ni.NESTATE=4) AND
        st.SUBNETID = ni.NESUBNETWORKID;

2.2.62  UNMANAGED_NE_INVENTORY_VIEW

create or replace view UNMANAGED_NE_INVENTORY_VIEW as
SELECT DISTINCT
    t1.NEDBACCESSID,
    t1.NEMODELINDEX,
    t1.NESYSID, 										
    t1.NEDESCRIPTION,
    t3.MODELNAME,
    t1.NECONFIGMODE,
    t1.NEVERSION,
    t2.SERIALNUMBER,
    t1.NECLLICODE,
    t1.GNEID,
    t1.NESUBNETWORKID,
    t2.rowid as NYROW
FROM
    NE_INFO_TABLE t1,
    UNMANAGED_NE_INVENTORY_TABLE t2,
    VERSION_TABLE t3
WHERE
    t1.NEDBACCESSID = t2.NEDBACCESSID
    AND
    t1.NEMODELINDEX = t3.NEMODELINDEX;

2.2.63  User_NE_View

create or replace view User_NE_View as
select
        distinct
        grouporneid  as GROUPORNEID,
        userid       as USERID,
        'AA' as MYROW
from   User_Ne_table;

2.2.64  User_View

create or replace view User_View as
select 
	umt.UserID,
	umt.TreeNodeType,
	umt.GroupOrNEID, 
	ut.UserName,
	ut.rowid as myrow
from
	USER_MAP_TABLE umt, 
	USER_TABLE ut
where
	umt.UserID = ut.UserID ;

2.2.65  VLAN_DROP_PORTS_QOS_VIEW

create or replace view VLAN_DROP_PORTS_QOS_VIEW as
SELECT DISTINCT 
  l2if_qos.MATCH_ANY,
  l2if_qos.MATCH_DSCP,
  l2if_qos.MATCH_COS,
  l2if_qos.MATCH_IP_PRECEDENCE,
  l2if_qos.MATCH_DSCP_VALUE,
  l2if_qos.MATCH_COS_VALUE,
  l2if_qos.MATCH_IP_PRECEDENCE_VALUE,
  l2if_qos.ANDOR,
  l2if_qos.CLASS_NAME,
  l2if_qos.CIR_TYPE,
  l2if_qos.MAX_RATE_KBPS,
  l2if_qos.BURST_SIZE_BPS,
  l2if_qos.CIR_COS_TYPE,
  l2if_qos.CIR_COS_VALUE,
  l2if_qos.EXCESS_ACTION,
  l2if_qos.PIR_BURST_BPS,
  l2if_qos.PIR_KBPS,
  l2if_qos.PIR_COS_TYPE,
  l2if_qos.PIR_COS_VALUE,
  l2if_qos.VIOLATE_ACTION,
  l2if_qos.VIOLATE_COS_VALUE,
  l2if_qos.BEFF_TYPE,
  l2if_qos.BEFF_RATE_KBPS,
  l2if_qos.BEFF_BURST_SIZE_BPS,
  l2if_qos.NEID,							
  l2if_qos.PORT_NUMBER,
  l2if_qos.SLOT_NUMBER,								
  l2if_qos.BRIDGE_GROUP_NUMBER,
  l2if_qos.rowId as myrow,        
  l2if_qos.PORT_SUB_INTERFACE
FROM
    L2_Interface_Table l2if,
    L2_Interface_QOSClass_Table l2if_qos
WHERE  
  l2if.NEID =  l2if_qos.NEID and
  l2if.SLOT_NUMBER =   l2if_qos.SLOT_NUMBER and
  l2if.BRIDGE_GROUP_NUMBER = l2if_qos.BRIDGE_GROUP_NUMBER and
  l2if.PORT_NUMBER = l2if_qos.PORT_NUMBER and
  l2if.PORT_SUB_INTERFACE = l2if_qos.PORT_SUB_INTERFACE;

2.2.66  VLAN_DROP_PORTS_VIEW

create or replace view VLAN_DROP_PORTS_VIEW as
SELECT DISTINCT 
    l2topo.Topology_Name,   					
    l2vlan.VLAN_Number,    					
    l2vlan.Customer_Id,
    l2vlan.Service_Id,
    l2if.NEID,									
    l2if.PORT_NUMBER,							
    l2if.SLOT_NUMBER,						
    l2if.BRIDGE_GROUP_NUMBER,
    l2if.PORT_SUB_INTERFACE,	
    l2if.INTERFACE_NAME,
    l2if.INTERFACE_TYPE,
    l2if.PORT_TYPE,
    l2if.CONNECTION_TYPE,
    l2if.PORT_STATE,
    l2if.QOSTEMPLATE_NAME,
    l2topo.TOPONODEID,
	l2topo.TOPOUNIQUEID,        
	l2if.rowId as myrow,
	l2fp.PM_STATUS,        
    neIf.NESYSID
FROM
    L2Topology_Table l2topo,
    L2_Vlan_Table l2vlan,
    L2_Interface_Table l2if,
    L2_Frontport_Table l2fp,
    Bridge_Group_Table bg,
    NE_INFO_TABLE neIf
WHERE  
    l2vlan.TopoNodeID = l2topo.TopoNodeID AND
    l2vlan.TopoUniqueId = l2topo.TopoUniqueId AND
    l2if.INTERFACE_TYPE != 166 AND
    l2if.INTERFACE_TYPE != 174 AND
    l2if.INTERFACE_TYPE != 186 AND
    l2if.INTERFACE_TYPE != 190 AND
    bg.toponodeid = l2vlan.topoNodeid AND
	bg.topouniqueid = l2vlan.topouniqueid AND
	bg.vlan_number = l2vlan.vlan_number AND
	l2if.NEID = bg.NEID AND
	l2if.Slot_Number = bg.slot_number AND
	l2fp.NEID = l2if.NEID AND
	l2fp.SLOT_NUMBER = l2if.SLOT_NUMBER AND
	l2fp.PORT_NUMBER = l2if.PORT_NUMBER AND
	l2if.BRIDGE_GROUP_NUMBER = bg.Bridge_group_number AND
    l2if.NEID = neIf.NEDBACCESSID;

2.2.67  VLAN_SERVICE_VIEW

create or replace view VLAN_SERVICE_VIEW as
SELECT DISTINCT 
    l2topo.Topology_Name,  					
    l2topo.TopoNodeID,
    l2topo.TopoUniqueId,
    l2vlan.VLAN_Number, 
    l2vlan.Customer_Id,
    l2vlan.Service_Id,						
	l2vlan.VlanStatus,
	l2topo.TopoResyncStatus,
	l2topo.TopoType,
	l2topo.TopoStatus,
	l2topo.TopoSize,
	l2vlan.rowId as myrow
FROM
    L2Topology_Table l2topo,
    L2_Vlan_Table l2vlan
WHERE  
    l2vlan.TopoNodeID = l2topo.TopoNodeID AND
    l2vlan.TopoUniqueId = l2topo.TopoUniqueId AND
    l2vlan.VlanStatus != 2;

2.3  Cisco Catalyst 6509 Views

CREATE OR REPLACE VIEW CAT65XX_inventory_view AS
SELECT
       ne.NESysId as NEID, 
       eit.PhysicalLoc as PhysicalLoc,
       eit.Col16 as ModuleName,
       eit.Col4 as Description,
       eit.Col3 as PhysicalName,
       eit.Col5 as HardwareRev,
       eit.Col6 as FirmwareRev,
       eit.Col7 as SoftwareRev,
       eit.Col8 as SerialNumber,
       eit.Col9 as MfgName,
       eit.Col10 as ModelName,
       eit.Col11 as Alias,
       eit.Col12 as AssetID,
       eit.Col13 as PartNumber,
       eit.Col14 as CleiCode,
       eit.Col1 as FRU,
       ne.NEDBAccessId as NEDBACCESSID,
       eit.rowid as myrow,
       eit.COL15 as Type,
       eit.IFINDEX as IfIndex
FROM
       ne_info_table ne,
       eqpt_info_table eit
WHERE
       ne.NEDBAccessId = eit.NEDBAccessId AND
       eit.modeltype = 28;

INSERT INTO MODULE_TYPE_TABLE ( MODULETYPE, MODULENAME, MODELTYPE )
 VALUES (0, 'System', 27);

commit;

2.4  Cisco CRS-1 (HFR) Views


Note In the CTM code, the CRS-1 is referred to as HFR.


2.4.1  HFR_BGP_PEER_PM_VIEW

CREATE OR REPLACE VIEW HFR_BGP_PEER_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        bgp.PhysicalLoc, 
        bgp.NEIfIndex, 
        bgp.BGPPeerTimeStamp, 
        bgp.NEIfPMStatus,
        bgp.inMaintenance,
        bgp.IPADDRESS,
        bgp.INPUTUPDATEMSGS,
        bgp.OUTPUTUPDATEMSGS,
        bgp.INPUTMSGS,
        bgp.OUTPUTMSGS,
        bgp.CONNESTABLISHED,
        bgp.CONNDROPPED,
        bgp.ERRORSRECEIVED,
        bgp.ERRORSSENT,
        bgp.fifteenMinThresholdMask as FifteenMinThreshold,
        bgp.IS24H,
        bgp.ModelType,
        bgp.ObjectType,
	bgp.StrObjInstance,
        bgp.rowid as myrow
FROM
        HFR_BGP_PEER_PM_Table bgp,
        ne_info_table ni,
        module_type_table en
WHERE
        bgp.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        bgp.NEDBAccessID = ni.NEDBAccessID;

2.4.2  HFR_INTERFACE_DRC_PM_VIEW

CREATE OR REPLACE VIEW HFR_INTERFACE_DRC_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        interface.PhysicalLoc, 
        interface.NEIfIndex, 
        interface.InterfaceDRCTimeStamp, 
        interface.NEIfPMStatus,
        interface.inMaintenance,
        interface.IFNAME,
        interface.INPUTDATARATE,
        interface.INPUTPACKETRATE,
        interface.OUTPUTDATARATE,
        interface.OUTPUTPACKETRATE,
        interface.INPUTPEAKRATE,
        interface.INPUTPEAKPKTS,
        interface.OUTPUTPEAKRATE,
        interface.OUTPUTPEAKPKTS,
        interface.BANDWIDTH,
        interface.fifteenMinThresholdMask as FifteenMinThreshold,
        interface.IS24H,
        interface.ModelType,
        interface.ObjectType,
	interface.StrObjInstance,
        interface.rowid as myrow
FROM
        HFR_INTERFACE_DRC_PM_Table interface,
        ne_info_table ni,
        module_type_table en
WHERE
        interface.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        interface.NEDBAccessID = ni.NEDBAccessID;

2.4.3  HFR_INTERFACE_GC_PM_VIEW

CREATE OR REPLACE VIEW HFR_INTERFACE_GC_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        interface.PhysicalLoc, 
        interface.NEIfIndex, 
        interface.InterfaceGCTimeStamp, 
        interface.NEIfPMStatus,
        interface.inMaintenance,
        interface.IFNAME,
        interface.INPACKETS,
        interface.INOCTETS,
        interface.OUTPACKETS,
        interface.OUTOCTETS,
        interface.INUCASTPACKETS,
        interface.INMULTICASTPACKETS,
        interface.INBROADCASTPACKETS,
        interface.OUTUCASTPACKETS,
        interface.OUTMULTICASTPACKETS,
        interface.OUTBROADCASTPACKETS,
        interface.OUTPUTTOTALDROPS,
        interface.INPUTTOTALDROPS,
        interface.INPUTQUEUEDDROPS,
        interface.INPUTUNKNOWNPROTO,
        interface.OUTPUTTOTALERRORS,
        interface.OUTPUTUNDERRUN,
        interface.INPUTTOTALERRORS,
        interface.INPUTCRC,
        interface.INPUTOVERRUN,
        interface.INPUTFRAME,
        interface.fifteenMinThresholdMask as FifteenMinThreshold,
        interface.IS24H,
        interface.ModelType,
        interface.ObjectType,
	interface.StrObjInstance,
        interface.rowid as myrow
FROM
        HFR_INTERFACE_GC_PM_Table interface,
        ne_info_table ni,
        module_type_table en
WHERE
        interface.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        interface.NEDBAccessID = ni.NEDBAccessID;

2.4.4  HFR_inventory_view

CREATE OR REPLACE VIEW HFR_inventory_view AS
SELECT
       ne.NESysId as NEID, 
       eit.PhysicalLoc as PhysicalLoc, 
       mtt.ModuleName as ModuleName,
       eit.Col4 as Description,
       eit.Col3 as PhysicalName,
       eit.Col5 as HardwareRev,
       eit.Col6 as FirmwareRev,
       eit.Col7 as SoftwareRev,
       eit.Col8 as SerialNumber,
       eit.Col9 as MfgName,
       eit.Col10 as ModelName,
       eit.Col11 as Alias,
       eit.Col12 as AssetID,
       eit.Col13 as PartNumber,
       eit.Col14 as CleiCode,
       eit.Col1 as FRU,
       ne.NEDBAccessId as NEDBACCESSID,
       eit.rowid as myrow,
       eit.ModuleType as Type,
       eit.IFINDEX as IfIndex,
       eit.OBJECTINDEX as ObjectIndex
FROM
       ne_info_table ne,
       eqpt_info_table eit,
       module_type_table mtt,
       objecttypetable ott
WHERE
       ne.NEDBAccessId = eit.NEDBAccessId AND
       ne.NEModelType  = mtt.ModelType    AND
       eit.ModuleType  = mtt.ModuleType   AND
       ott.objectIndex = eit.objectIndex  AND
       (eit.objectIndex > 17999 AND eit.objectIndex < 18200) AND
       ne.NEModelType = 26;

2.4.5  HFR_MPLS_INTERFACE_PM_VIEW

CREATE OR REPLACE VIEW HFR_MPLS_INTERFACE_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        node.PhysicalLoc, 
        node.NEIfIndex, 
        node.MPLSInterfaceTimeStamp,
        node.NEIfPMStatus,
        node.inMaintenance,
        node.IFNAME,
        node.FAILEDLABELLOOKUP,
        node.FRAGMENTEDPKTS,
        node.fifteenMinThresholdMask as FifteenMinThreshold,
        node.IS24H,
        node.ModelType,
        node.ObjectType,
	node.StrObjInstance,
        node.rowid as myrow
FROM
        HFR_MPLS_INTERFACE_PM_Table node,
        ne_info_table ni,
        module_type_table en
WHERE
        node.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        node.NEDBAccessID = ni.NEDBAccessID;

2.4.6  HFR_MPLS_LDP_PM_VIEW

CREATE OR REPLACE VIEW HFR_MPLS_LDP_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        node.PhysicalLoc, 
        node.NEIfIndex, 
        node.MPLSLDPTimeStamp, 
        node.NEIfPMStatus,
        node.inMaintenance,
        node.IPADDRESS,
        node.TOTALMSGSSENT,
        node.TOTALMSGSRCVD,
        node.INITMSGSSENT,
        node.INITMSGSRCVD,
        node.ADDRESSMSGSSENT,
        node.ADDRESSMSGSRCVD,
        node.ADDRESSWITHDRAWMSGSSENT,
        node.ADDRESSWITHDRAWMSGSRCVD,
        node.LABELMAPPINGMSGSSENT,
        node.LABELMAPPINGMSGSRCVD,
        node.LABELWITHDRAWMSGSSENT,
        node.LABELWITHDRAWMSGSRCVD,
        node.LABELRELEASEMSGSSENT,
        node.LABELRELEASEMSGSRCVD,
        node.NOTIFICATIONMSGSSENT,
        node.NOTIFICATIONMSGSRCVD,
        node.KEEPALIVEMSGSSENT,
        node.KEEPALIVEMSGSRCVD,
        node.fifteenMinThresholdMask as FifteenMinThreshold,
        node.IS24H,
        node.ModelType,
        node.ObjectType,
	node.StrObjInstance,
        node.rowid as myrow
FROM
        HFR_MPLS_LDP_PM_Table node,
        ne_info_table ni,
        module_type_table en
WHERE
        node.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        node.NEDBAccessID = ni.NEDBAccessID;

2.4.7  HFR_MPLS_TE_LINK_PM_VIEW

CREATE OR REPLACE VIEW HFR_MPLS_TE_LINK_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        node.PhysicalLoc, 
        node.NEIfIndex, 
        node.MPLSTELinkTimeStamp, 
        node.NEIfPMStatus,
        node.inMaintenance,
        node.IFNAME,
        node.LINKUTILIZATION,
        node.fifteenMinThresholdMask as FifteenMinThreshold,
        node.IS24H,
        node.ModelType,
        node.ObjectType,
	node.StrObjInstance,
        node.rowid as myrow
FROM
        HFR_MPLS_TE_LINK_PM_Table node,
        ne_info_table ni,
        module_type_table en
WHERE
        node.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        node.NEDBAccessID = ni.NEDBAccessID;

2.4.8  HFR_MPLS_TE_TUNNEL_PM_VIEW

CREATE OR REPLACE VIEW HFR_MPLS_TE_TUNNEL_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        node.PhysicalLoc, 
        node.NEIfIndex, 
        node.MPLSTETunnelTimeStamp, 
        node.NEIfPMStatus,
        node.inMaintenance,
        node.IFNAME,
        node.INPUTDATARATE,
        node.INPUTPACKETRATE,
        node.OUTPUTDATARATE,
        node.OUTPUTPACKETRATE,
        node.INPUTPEAKRATE,
        node.INPUTPEAKPKTS,
        node.OUTPUTPEAKRATE,
        node.OUTPUTPEAKPKTS,
        node.BANDWIDTH,
        node.fifteenMinThresholdMask as FifteenMinThreshold,
        node.IS24H,
        node.ModelType,
        node.ObjectType,
	node.StrObjInstance,
        node.rowid as myrow
FROM
        HFR_MPLS_TE_TUNNEL_PM_Table node,
        ne_info_table ni,
        module_type_table en
WHERE
        node.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        node.NEDBAccessID = ni.NEDBAccessID;

2.4.9  HFR_NODE_CPU_PM_VIEW

CREATE OR REPLACE VIEW HFR_NODE_CPU_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        node.PhysicalLoc, 
        node.NEIfIndex, 
        node.NodeCPUTimeStamp, 
        node.NEIfPMStatus,
        node.inMaintenance,
        node.NODEID,
        node.AVERAGECPUUSED,
        node.NUMPROCESSES,
        node.fifteenMinThresholdMask as FifteenMinThreshold,
        node.IS24H,
        node.ModelType,
        node.ObjectType,
	node.StrObjInstance,
        node.rowid as myrow
FROM
        HFR_NODE_CPU_PM_Table node,
        ne_info_table ni,
        module_type_table en
WHERE
        node.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        node.NEDBAccessID = ni.NEDBAccessID;

2.4.10  HFR_NODE_MEMORY_PM_VIEW

CREATE OR REPLACE VIEW HFR_NODE_MEMORY_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        node.PhysicalLoc, 
        node.NEIfIndex, 
        node.NodeMemoryTimeStamp, 
        node.NEIfPMStatus,
        node.inMaintenance,
        node.NODEID,
        node.PEAKMEMORY,
        node.APPMEMORY,
        node.fifteenMinThresholdMask as FifteenMinThreshold,
        node.IS24H,
        node.ModelType,
        node.ObjectType,
	node.StrObjInstance,
        node.rowid as myrow
FROM
        HFR_NODE_MEMORY_PM_Table node,
        ne_info_table ni,
        module_type_table en
WHERE
        node.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        node.NEDBAccessID = ni.NEDBAccessID;

2.4.11  HFR_NODE_PROCESS_PM_VIEW

CREATE OR REPLACE VIEW HFR_NODE_PROCESS_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        node.PhysicalLoc, 
        node.NEIfIndex, 
        node.NodeProcessTimeStamp, 
        node.NEIfPMStatus,
        node.inMaintenance,
        node.NODEID,
        node.PROCESSID,
        node.AVERAGECPUUSED,
        node.TOTALMEMORY,
        node.NUMTHREADS,
        node.fifteenMinThresholdMask as FifteenMinThreshold,
        node.IS24H,
        node.ModelType,
        node.ObjectType,
	node.StrObjInstance,
        node.rowid as myrow
FROM
        HFR_NODE_PROCESS_PM_Table node,
        ne_info_table ni,
        module_type_table en
WHERE
        node.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        node.NEDBAccessID = ni.NEDBAccessID;

2.4.12  HFR_OSPF_V2_PM_VIEW

CREATE OR REPLACE VIEW HFR_OSPF_V2_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        ospfv2.PhysicalLoc, 
        ospfv2.NEIfIndex, 
        ospfv2.OSPFV2TimeStamp, 
        ospfv2.NEIfPMStatus,
        ospfv2.inMaintenance,
        ospfv2.INSTANCENAME,
        ospfv2.INPACKETS,
        ospfv2.OUTPACKETS,
        ospfv2.INHELLO,
        ospfv2.OUTHELLO,
        ospfv2.INDBDS,
        ospfv2.INDBDSLSA,
        ospfv2.OUTDBDS,
        ospfv2.OUTDBDSLSA,
        ospfv2.INLSREQUESTS,
        ospfv2.INLSREQUESTSLSA,
        ospfv2.OUTLSREQUESTS,
        ospfv2.OUTLSREQUESTSLSA,
        ospfv2.INLSAUPDATES,
        ospfv2.INLSAUPDATESLSA,
        ospfv2.OUTLSAUPDATES,
        ospfv2.OUTLSAUPDATESLSA,
        ospfv2.INLSAACKS,
        ospfv2.INLSAACKSLSA,
        ospfv2.OUTLSAACKS,        
        ospfv2.OUTLSAACKSLSA,
        ospfv2.CHECKSUMERRS,
        ospfv2.fifteenMinThresholdMask as FifteenMinThreshold,
        ospfv2.IS24H,
        ospfv2.ModelType,
        ospfv2.ObjectType,
	       ospfv2.StrObjInstance,
        ospfv2.rowid as myrow
FROM
        HFR_OSPF_V2_PM_Table ospfv2,
        ne_info_table ni,
        module_type_table en
WHERE
        ospfv2.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        ospfv2.NEDBAccessID = ni.NEDBAccessID;

2.4.13  HFR_OSPF_V3_PM_VIEW

CREATE OR REPLACE VIEW HFR_OSPF_V3_PM_VIEW AS
SELECT
        ni.NESysID, 
        ni.NEDbaccessid,
        en.ModuleName, 
        en.ModuleType,
        ospfv3.PhysicalLoc, 
        ospfv3.NEIfIndex, 
        ospfv3.OSPFV3TimeStamp, 
        ospfv3.NEIfPMStatus,
        ospfv3.inMaintenance,
        ospfv3.INSTANCENAME,
        ospfv3.INPACKETS,
        ospfv3.OUTPACKETS,
        ospfv3.INHELLO,
        ospfv3.OUTHELLO,
        ospfv3.INDBDS,
        ospfv3.INDBDSLSA,
        ospfv3.OUTDBDS,
        ospfv3.OUTDBDSLSA,
        ospfv3.INLSREQUESTS,
        ospfv3.INLSREQUESTSLSA,
        ospfv3.OUTLSREQUESTS,
        ospfv3.OUTLSREQUESTSLSA,
        ospfv3.INLSAUPDATES,
        ospfv3.INLSAUPDATESLSA,
        ospfv3.OUTLSAUPDATES,
        ospfv3.OUTLSAUPDATESLSA,
        ospfv3.INLSAACKS,
        ospfv3.INLSAACKSLSA,
        ospfv3.OUTLSAACKS,        
        ospfv3.OUTLSAACKSLSA,
        ospfv3.CHECKSUMERRS,
        ospfv3.fifteenMinThresholdMask as FifteenMinThreshold,
        ospfv3.IS24H,
        ospfv3.ModelType,
        ospfv3.ObjectType,
	       ospfv3.StrObjInstance,
        ospfv3.rowid as myrow
FROM
        HFR_OSPF_V3_PM_Table ospfv3,
        ne_info_table ni,
        module_type_table en
WHERE
        ospfv3.ModuleType   = en.ModuleType   AND
        ni.NEModelType   = en.ModelType    AND
        ospfv3.NEDBAccessID = ni.NEDBAccessID;

2.5  Cisco MGX Media Gateway Views

2.5.1  access_node

create or replace view access_node 
(node_id,obj_id,type,subtype,ipaddress,p_ipaddress,p_slot,p_port,r_slot,r_port,device_id)
AS SELECT
    to_number(eit.COL1) as node_id ,
    to_number(eit.COL1) as obj_id ,
    to_number(eit.COL1) as type ,
    to_number(eit.COL1) as subtype ,
    to_number(eit.COL1) as ipaddress ,
    to_number(eit.COL1) as p_ipaddress ,
    to_number(eit.COL1) as p_slot ,
    to_number(eit.COL1) as p_port ,
    to_number(eit.COL1) as r_slot ,
    to_number(eit.COL1) as r_port ,
    to_number(eit.COL1) as device_id
FROM
    eqpt_info_table eit
WHERE
    eit.NEDBACCESSID = 10000;

2.5.2  bis_object

create or replace view bis_object 
(obj_id,name,type,subtype,node_id,ipaddress,p_node_id,p_ipaddress,p_bay,p_line,p_slot,p_po
rt,p_logicalport,f_slot,f_port,status,active,model) AS SELECT
    to_number(eit.COL1) as obj_id ,
    eit.COL1 as name ,
    to_number(eit.COL1) as type ,
    to_number(eit.COL1) as subtype ,
    to_number(eit.COL1) as node_id ,
    to_number(eit.COL1) as ipaddress ,
    to_number(eit.COL1) as p_node_id ,
    to_number(eit.COL1) as p_ipaddress ,
    to_number(eit.COL1) as p_bay ,
    to_number(eit.COL1) as p_line ,
    to_number(eit.COL1) as p_slot ,
    to_number(eit.COL1) as p_port ,
    to_number(eit.COL1) as p_logicalport ,
    to_number(eit.COL1) as f_slot ,
    to_number(eit.COL1) as f_port ,
    to_number(eit.COL1) as status ,
    to_number(eit.COL1) as active ,
    to_number(eit.COL1) as model 
FROM
    eqpt_info_table eit
WHERE
    eit.NEDBACCESSID = 10000;

2.5.3  card

CREATE OR REPLACE VIEW card AS
SELECT
       -1 as obj_id,                                           
       eit.NEDBACCESSID as node_id, 
       9999 as network_id,                          
       -1 as node_type,
       to_number(eit.COL1) as shelf, 
       to_number(eit.COL2) as slot, 
       to_number(eit.COL3) as fc_type,
       eit.Col4 as fc_dscrp,
       eit.Col5 as fc_serial_num,
       eit.Col6 as fc_hw_rev,
       eit.Col7 as fc_fw_rev,
       to_number(eit.Col8)  as fc_reset_reason,
       -1 as fc_fab_num,
       to_number(eit.Col9) as fc_state,
       -1 as mib_version,
       to_number(eit.COL10) as bc_type,
       eit.Col11 as bc_dscrp,
       eit.Col12 as bc_serial_num,
       eit.Col13 as bc_hw_rev,
       '' as bc_fw_rev,
       to_number(eit.Col14) as bc_state,
       to_number(eit.COL15) as sec_bc_type,
       eit.Col16 as sec_bc_dscrp,
       eit.Col17 as sec_bc_serial_num,
       eit.Col18 as sec_bc_hw_rev,
       '' as sec_bc_fw_rev,
       to_number(eit.Col19) as sec_bc_state,
       -1 as rate_up,
       -1 as rate_dn,
       -1 as fast_dn,
       -1 as measure_time,
       -1 as qir_timeout,
       -1 as chan_allowed,
       -1 as rate_ctrl_allowed,
       -1 as clk_conn_type,
       -1 as curr_clk_src,
       -1 as pri_clk_src,
       -1 as sec_clk_src,
       -1 as clk_impedence,
       to_number(eit.Col20) as out_of_sync,
       -1 as bnm_ln_format,
       -1 as aps_info,
       to_number(eit.Col35) as ml_chan_stat,
       to_number(eit.Col21) as logical_slot,
       -1 as egr_qos_feature,
       to_number(eit.Col22) as sct_id,
       to_number(eit.Col23) as sct_version,
       -1 as clk_err_reason,
       -1 as fc_admin_status,
       eit.ifindex as ent_phy_idx,
       to_number(eit.Col24) as bc_ent_phy_idx,
       to_number(eit.Col25) as sec_bc_ent_phy_idx,
       to_number(eit.Col26) as transaction_id,
       to_number(eit.Col27) as cac_mode,
       to_number(eit.Col28) as max_ima_grp,
       to_number(eit.Col29) as configured_ima_grp,
       to_number(eit.Col30) as min_grp_tx_ima_id,
       to_number(eit.Col31) as max_grp_tx_ima_id,
       to_number(eit.Col32) as ima_ver_fallback_enable,
       to_number(eit.Col33) as ima_restart_enable,
       to_number(eit.Col34) as ima_ent_phy_idx,
       -1 as reserved
FROM
       ne_info_table ne,
       eqpt_info_table eit,
       module_type_table mtt
WHERE
       ne.NEDBAccessId = eit.NEDBAccessId AND
       ne.NEModelType  = mtt.ModelType    AND
       eit.ModuleType  = mtt.ModuleType   AND
       mtt.ModuleType  > 20002            AND
       mtt.ModuleType  < 20030;

2.5.4  line

CREATE OR REPLACE VIEW line AS
SELECT
       eit.NEDBACCESSID as node_id, 
       to_number(eit.COL5) as obj_id, 
       9999 as network_id,                          
       to_number(eit.COL1) as shelf,               
       to_number(eit.COL2) as slot,                
       to_number(eit.COL4) as line,                
       to_number(eit.COL6) as line_type,                
       to_number(eit.COL7) as connector,                
       to_number(eit.COL8) as enable,                
       to_number(eit.COL9) as subtype,                
       to_number(eit.COL10) as coding,                
       to_number(eit.COL17) as length,                
       to_number(eit.COL11) as clock_src,                
       to_number(eit.COL12) as loopback,                
       to_number(eit.COL24) as line_bitmap,                
       -1 as oof_criteria,
       -1 as aisc_check,
       -1 as tx_timing_marker,
       -1 as tx_payload_type,
       '' as commentc,
       -1 as red_severity,
       -1 as rai_severity,
       to_number(eit.COL23) as stat_severity,                
       to_number(eit.COL18) as alarm_state,                
       to_number(eit.COL19) as stat_alarm_state,                
       to_number(eit.COL16) as agg_state,                
       -1 as rate,
       -1 as hcs_masking,
       -1 as payload_scramble,
       -1 as frame_scramble,
       -1 as section_state,
       -1 as section_stat_sev,
       -1 as section_stat_state,
       -1 as line_state,
       -1 as line_stat_sev,
       -1 as line_stat_state,
       -1 as path_state,
       -1 as path_stat_sev,
       -1 as path_stat_state,
       -1 as atm_ln_format,
       -1 as aps_flag,
       eit.COL13 as name,                
       -1 as chan_assignment,
       to_number(eit.COL3) as bay,                
       eit.ifindex as if_index,
       to_number(eit.COL14) as parent_if_index,                
       -1 as lpbk_code,
       -1 as invert_clock,
       -1 as subrate_enable,
       -1 as dsu_select,
       -1 as ln_intf_type,
       -1 as clk_freq_threshold,
       -1 as serl_ln_rate,
       -1 as serl_ln_rate_var,
       -1 as sonet_rdiv_type,
       -1 as sonet_rdip_type,
       -1 as sonet_trib_type,
       -1 as sonet_trib_map,
       -1 as sonet_trib_frm,
       -1 as sonet_sig_trnsp,
       -1 as sonet_trib_grp,
       to_number(eit.COL20) as sendcode,                
       to_number(eit.COL15) as channel_bitmap,                
       to_number(eit.COL25) as  sig_tx_mode,                
       -1 as st_chg_trap_en,
       to_number(eit.COL21) as  lpbk_status,                
       to_number(eit.COL22) as  channelize,                
       to_number(eit.COL26) as  signal_mode,                
       to_number(eit.COL27) as  trk_cond_en,                
       -1 as reserved
FROM
       ne_info_table ne,
       eqpt_info_table eit,
       module_type_table mtt
WHERE
       ne.NEDBAccessId = eit.NEDBAccessId AND
       ne.NEModelType  = mtt.ModelType    AND
       eit.ModuleType  = mtt.ModuleType   AND
       mtt.ModuleType  = 20051            
UNION ALL
SELECT
       eit.NEDBACCESSID as node_id, 
       to_number(eit.COL5) as obj_id, 
       9999 as network_id,                          
       to_number(eit.COL1) as shelf,               
       to_number(eit.COL2) as slot,                
       to_number(eit.COL4) as line,                
       to_number(eit.COL6) as line_type,                
       to_number(eit.COL7) as connector,                
       to_number(eit.COL8) as enable,                
       to_number(eit.COL9) as subtype,                
       to_number(eit.COL10) as coding,                
       to_number(eit.COL17) as length,                
       to_number(eit.COL11) as clock_src,                
       to_number(eit.COL12) as loopback,                
       -1 as line_bitmap,                
       to_number(eit.COL24) as oof_criteria,
       to_number(eit.COL25) as aisc_check,
       -1 as tx_timing_marker,
       -1 as tx_payload_type,
       '' as commentc,
       -1 as red_severity,
       to_number(eit.COL26) as rai_severity,
       to_number(eit.COL23) as stat_severity,                
       to_number(eit.COL18) as alarm_state,                
       to_number(eit.COL19) as stat_alarm_state,                
       to_number(eit.COL16) as agg_state,                
       to_number(eit.COL27) as rate,
       -1 as hcs_masking,
       -1 as payload_scramble,
       to_number(eit.COL28) as frame_scramble,
       -1 as section_state,
       -1 as section_stat_sev,
       -1 as section_stat_state,
       -1 as line_state,
       -1 as line_stat_sev,
       -1 as line_stat_state,
       -1 as path_state,
       -1 as path_stat_sev,
       -1 as path_stat_state,
       -1 as atm_ln_format,
       -1 as aps_flag,
       eit.COL13 as name,                
       -1 as chan_assignment,
       to_number(eit.COL3) as bay,                
       eit.ifindex as if_index,
       to_number(eit.COL14) as parent_if_index,                
       -1 as lpbk_code,
       -1 as invert_clock,
       to_number(eit.COL29) as subrate_enable,
       to_number(eit.COL30) as dsu_select,
       -1 as ln_intf_type,
       -1 as clk_freq_threshold,
       -1 as serl_ln_rate,
       -1 as serl_ln_rate_var,
       -1 as sonet_rdiv_type,
       -1 as sonet_rdip_type,
       -1 as sonet_trib_type,
       -1 as sonet_trib_map,
       -1 as sonet_trib_frm,
       -1 as sonet_sig_trnsp,
       -1 as sonet_trib_grp,
       to_number(eit.COL20) as sendcode,                
       to_number(eit.COL15) as channel_bitmap,                
       -1 as  sig_tx_mode,                
       -1 as st_chg_trap_en,
       to_number(eit.COL21) as  lpbk_status,                
       to_number(eit.COL22) as  channelize,                
       -1 as  signal_mode,                
       -1 as  trk_cond_en,                
       -1 as reserved
FROM
       ne_info_table ne,
       eqpt_info_table eit,
       module_type_table mtt
WHERE
       ne.NEDBAccessId = eit.NEDBAccessId AND
       ne.NEModelType  = mtt.ModelType    AND
       eit.ModuleType  = mtt.ModuleType   AND
       mtt.ModuleType  = 20052            
UNION ALL
SELECT
       eit.NEDBACCESSID as node_id, 
       to_number(eit.COL5) as obj_id, 
       9999 as network_id,                          
       to_number(eit.COL1) as shelf,               
       to_number(eit.COL2) as slot,                
       to_number(eit.COL4) as line,                
       to_number(eit.COL6) as line_type,                
       to_number(eit.COL7) as connector,                
       to_number(eit.COL8) as enable,                
       to_number(eit.COL9) as subtype,                
       to_number(eit.COL10) as coding,                
       -1 as length,                
       to_number(eit.COL11) as clock_src,                
       to_number(eit.COL12) as loopback,                
       -1 as line_bitmap,                
       -1 as oof_criteria,
       -1 as aisc_check,
       -1 as tx_timing_marker,
       to_number(eit.COL17) as tx_payload_type,
       '' as commentc,
       -1 as red_severity,
       -1 as rai_severity,
       -1 as stat_severity,                
       to_number(eit.COL34) as alarm_state,                
       -1 as stat_alarm_state,                
       to_number(eit.COL16) as agg_state,                
       -1 as rate,
       -1 as hcs_masking,
       -1 as payload_scramble,
       -1 as frame_scramble,
       to_number(eit.COL18) as section_state,
       to_number(eit.COL19) as section_stat_sev,
       to_number(eit.COL20) as section_stat_state,
       to_number(eit.COL21) as line_state,
       to_number(eit.COL22) as line_stat_sev,
       to_number(eit.COL23) as line_stat_state,
       to_number(eit.COL24) as path_state,
       to_number(eit.COL25) as path_stat_sev,
       to_number(eit.COL26) as path_stat_state,
       -1 as atm_ln_format,
       -1 as aps_flag,
       eit.COL13 as name,                
       -1 as chan_assignment,
       to_number(eit.COL3) as bay,                
       eit.ifindex as if_index,
       to_number(eit.COL14) as parent_if_index,                
       -1 as lpbk_code,
       -1 as invert_clock,
       -1 as subrate_enable,
       -1 as dsu_select,
       -1 as ln_intf_type,
       -1 as clk_freq_threshold,
       -1 as serl_ln_rate,
       -1 as serl_ln_rate_var,
       to_number(eit.COL27) as sonet_rdiv_type,
       to_number(eit.COL28) as sonet_rdip_type,
       to_number(eit.COL29) as sonet_trib_type,
       to_number(eit.COL30) as sonet_trib_map,
       to_number(eit.COL31) as sonet_trib_frm,
       to_number(eit.COL32) as sonet_sig_trnsp,
       to_number(eit.COL33) as sonet_trib_grp,
       to_number(eit.COL20) as sendcode,                
       to_number(eit.COL15) as channel_bitmap,                
       -1 as  sig_tx_mode,                
       -1 as st_chg_trap_en,
       -1 as  lpbk_status,                
       -1 as  channelize,                
       -1 as  signal_mode,                
       -1 as  trk_cond_en,                
       -1 as reserved
FROM
       ne_info_table ne,
       eqpt_info_table eit,
       module_type_table mtt
WHERE
       ne.NEDBAccessId = eit.NEDBAccessId AND
       ne.NEModelType  = mtt.ModelType    AND
       eit.ModuleType  = mtt.ModuleType   AND
       mtt.ModuleType  > 20052            AND           
       mtt.ModuleType  < 20058;

2.5.5  MGX8880_inventory_view

CREATE OR REPLACE VIEW MGX8880_inventory_view AS
SELECT
       ne.NESysId, 
       eit.PhysicalLoc as PhysicalLoc,                          
       mtt.ModuleName as ModuleName,
       eit.Col4 as ModuleDescription,
       eit.Col5 as FcSerialNum,
       eit.Col6 as FcHwRev,
       eit.Col7 as FcSwRev,
       to_number(eit.Col8)  as FcResetReason,
       to_number(eit.Col9) as ModuleState,
       eit.Col11 as BcName,
       eit.Col12 as BcSerialNum,
       eit.Col13 as BcHwRev,
       to_number(eit.Col14) as BcState,
       eit.Col16 as SecBcName,
       eit.Col17 as SecBcSerialNum,
       eit.Col18 as SecBcHwRev,
       to_number(eit.Col19) as SecBcState,
       to_number(eit.Col20) as SyncMode,
       to_number(eit.Col21) as LogicalSlot,
       to_number(eit.Col22) as SctId,
       to_number(eit.Col23) as SctVersion,
       -1 as UnitNum,
       -1 as GroupNum,
       ne.NEDBAccessId,
       eit.IFINDEX, 
       mtt.ModuleType, 
       eit.rowid as myrow
FROM
       ne_info_table ne,
       eqpt_info_table eit,
       module_type_table mtt
WHERE
       ne.NEDBAccessId = eit.NEDBAccessId AND
       ne.NEModelType  = mtt.ModelType    AND
       eit.ModuleType  = mtt.ModuleType   AND
       mtt.ModuleType  > 20002            AND
       mtt.ModuleType  < 20030
UNION ALL
SELECT
       ne.NESysId,                                              
       eit.PhysicalLoc as PhysicalLoc,                          
       mtt.ModuleName as ModuleName,
       '' as ModuleDescription,
       'N/A' as FcSerialNum,
       'N/A' as FcHwRev,
       'N/A' as FcSwRev,
       0  as FcResetReason,
       to_number(eit.Col6) as ModuleState,
       'N/A' as BcName,
       'N/A' as BcSerialNum,
       'N/A' as BcHwRev,
       0 as BcState,
       'N/A' as SecBcName,
       'N/A' as SecBcSerialNum,
       'N/A' as SecBcHwRev,
       0 as SecBcState,
       0 as SyncMode,
       0 as LogicalSlot,
       0 as SctId,
       0 as SctVersion,
       to_number(eit.Col4) as UnitNum,
       to_number(eit.Col5) as GroupNum,
       ne.NEDBAccessId,
       eit.IFINDEX,
       mtt.ModuleType,
       eit.rowid as myrow
FROM
       ne_info_table ne,
       eqpt_info_table eit,
       module_type_table mtt
WHERE
       ne.NEDBAccessId = eit.NEDBAccessId AND
       ne.NEModelType  = mtt.ModelType    AND
       eit.ModuleType  = mtt.ModuleType   AND
       mtt.ModuleType  > 20029            AND
       mtt.ModuleType  < 20038            AND
       eit.Col2 is null
UNION ALL
SELECT
       ne.NESysId,                                              
       eit.PhysicalLoc as PhysicalLoc,                          
       mtt.ModuleName as ModuleName,
       eit.Col3 as ModuleDescription,
       'N/A' as FcSerialNum,
       'N/A' as FcHwRev,
       'N/A' as FcSwRev,
       0  as FcResetReason,
       to_number(eit.Col7) as ModuleState,
       'N/A' as BcName,
       'N/A' as BcSerialNum,
       'N/A' as BcHwRev,
       0 as BcState,
       'N/A' as SecBcName,
       'N/A' as SecBcSerialNum,
       'N/A' as SecBcHwRev,
       0 as SecBcState,
       0 as SyncMode,
       0 as LogicalSlot,
       0 as SctId,
       0 as SctVersion,
       to_number(eit.Col9) as UnitNum,
       0 as GroupNum,
       ne.NEDBAccessId,
       eit.IFINDEX,
       mtt.ModuleType,
       eit.rowid as myrow
FROM
       ne_info_table ne,
       eqpt_info_table eit,
       module_type_table mtt
WHERE
       ne.NEDBAccessId = eit.NEDBAccessId AND
       ne.NEModelType  = mtt.ModelType    AND
       eit.ModuleType  = mtt.ModuleType   AND
       mtt.ModuleType  = 20038            AND
       eit.Col2 is not null;

2.5.6  node

CREATE OR REPLACE VIEW node AS
SELECT
       ne.NEDBAccessId as node_id, 
       ne.NESubNetworkID as netw_id,
       mgxne.NeName as node_name,
       -1 as ipx_netw_id,
       -1 as ipx_node_id,
       ne.NEIPAddr as net_ip_address,
       mgxne.LanIpAddress as lan_ip_address,
       -1 as nw_ip_address,
       mgxne.MgxModelNum as model,
       'B' as submodel, 
       -1 as alarm_state,
       -1 as filtered_alarm,
       -1 as gateway,
       1 as active,
       mgxne.Platform as platform,
       4 as subtype,
       ne.NEVersion as release,
       -1 as fs_inc_rate,
       -1 as fs_dec_rate,
       -1 as fs_fdec_rate,
       -1 as rst_timeout,
       ne.ConfigSyncStatus as sync_mode, 
       getMgx88xxMgmtState(ne.isNEConnected) as mgmt_state,
       -1 as manager,
       -1 as protocol,
       mgxne.NodePrefix as node_prefix,
       mgxne.PnniNodeId as pnni_node_id,
       -1 as connroute_mode,