Voice & Data VLAN Implementation

Hello,
We have recently purchased an asterisk based IP PBX, it is hosted in-house which uses Grandstream IP GXP1405 Phones.  We have configured and installed. we are able to receive calls and dial out.  Unfortunately our infrastructure was not up to par with the PBX.  We purchased an SG300 20 port switch, with two RV320 VPN Dual Wan Routers.  We have a total of 4 offices.  this is the current setup:
HQ 1 - Asterisk Based IP PBX, RV320 VPN router, & SG300
HQ2 - RV320 VPN Router
Office 1 - Simple Linksys Router
Office 2 - Simple Linksys Router
We have established connectivity using the Tunnels incorporated onto the RV320 Routers, so we are able to connect to the HQ locations.
However since the RV320 has dual WAN setup's, we have now have 2 Internet Connections independent from each other.  Our goal is to perform the following: 
WAN 1 = to be used for Data Traffic
WAN 2 = to be used for Voice Traffic
We would like to do this by separating the VLAN's and directing the traffic from one VLAN to a specific WAN using the equipment above.
We are having issues establishing the voice VLAN and redirecting the traffic once created.
Any help would be appreciated it.
Thanks,

Hi Soiser,
My name is Mehdi from Cisco Technical Support, 
For the Voice & Data VLAN Implementation we can manage to do it with different way :
First example hard coding the voice vlan
1. we can have the switch Layer 2
2. Configure on the switch Vlan Data and Vlan voice (in this example will have Vlan 1 Data and 100 is Voice vlan) --> under Vlan management --> Create Vlan
3. Configure the port from where the switch is connected to the Router and change it to Trunk port and add vlan voice (until here we made the data traffic as untagged traffic and voice traffic as tagged) by going under Vlan managemnent --> Port Vlan Membership --> select port 20 --> click on join vlan --> by default you have 1UP in the right so now select vlan 100 and select Tagged and move it to the right
4. And the same trunk port with both vlan for all the port on the switch where you have voice and data
5. here we done with the switch
Second Using Auto-voice Vlan implementation 
1. We Can have the switch also layer 2
2. we need to configure the AUTO-Voice Vlan under vlan management--Voice Vlan --> Properties by changing the voice vlan 100 and we have two option to choose
       Dynamic Voice VLAN: Enable Auto Voice VLAN OR  Enable Telephony OUI :  the difference is when you have Cisco Phone enable                                 auto-voice vlan and the phone will take all the informations like (Vlan ,..) via CDP protocol
       if you have 3rd part Phone select Enable Telephony OUI and configure the first 3 bits of the MAC address of the phones by going under voice                 vlan -->Telephony OUI --> add 3 bits of the MAC address of the phone but not for all the phones is by model remember first 3 bits of mac
            address is the model of the device!
 Auto Voice VLAN Activation: select "Immediate"
3. and enable telephony OUI interface  
-------> We didn't configure voice vlan the switch will assign voice vlan to the phones when they connect to the switch by CDP or Telephony OUI
Now going to the router :
- By default RV320 Has Vlan ID 100 with subnet 192.168.3.1 so we can change only the ip address of vlan interface or if you deleted by some reason we will need to create a voice vlan by going to Setup-->Network--> multiple Subnet Table --> Create the Vlan interface in my example i will put 10.10.10.1 and mask 255.255.255.0
- Just to check if you going to port management --> Vlan Membership you will see vlan 1 is untagged and vlan voice is tagged this also in our switch !! you can connect the switch from any port of the router since all of them are the same
- if you wantr to change and coding only port 4 for example as trunk and remove other port the voice vlan you can 
---> Now should work the voice vlan and data vlan 
But we have two WAN and you want to bind the WAN 1 to Data and Wan 2 to Voice
we need to configure Protocol Binding
under System management --> Dual WAN --> Protocol Binding 
there we can choose all traffic , source IP (voice network 10.10.10.1 - 10.10.10.254) , destination 1.0.0.1 to 223.255.255.254, and select WAN 2
and another rule but the source will be the data network and select WAN 1
This is it just example and how the Voice vlan work and how to use Protocol binding if you have two WAN 
Please if you have the switch on L3 by some reason and you have SVI configured in the switch , please call the Cisco Technical Support Center we will be happy to help you to accomplish your need with layer 3 switch is almost the same few change and we need more information's from your topology that's why by phone is better !! :)
Please rate the post or mark as answered to help other Cisco Customers
Have a nice day
Regards
Mehdi

Similar Messages

  • Configure Voice and Data VLAN in CISCO SF 300 8P

    I have a couple of Cisco SF 300 8P and 24 P Switches. I have voice and Data VLAN configured as :
    Data VLAN : Default 145.17.59.0/24
    Voice VLAN : VLAN 20 172.22.20.0/24
    I have different DHCP servers as for Data VLAN we have physical server which is configured for 145.17.59.* IP Scope and Voice VLAN DHCP Server is configured in Gateway router with option 150.
    This configuation works fine with other cisco swiches like 2960 and 3750 etc except CISCO SF 300 8P and 24P. I was trying to configure both voice and Data VLAN in these CISCO Switches so that CISCO phone (Model 6941) shold get IP from Voice VLAN and PC should get IP from Data VLAN DHCP Server. I have tried several techniques like LLDP, Port to VLAN Config etc.
    Can anyone please guide me/help on this.
    Regards,
    A K.M.Sayeed

    Hi A.K.M., with Cisco phones you should be able to simply set auto voice VLAN to be VLAN20. 
    voice vlan id 20
    You should ensure CDP and/or LLDP are enabled as well. I would check this in web GUI. DHCP for the phones can come from the switch, a DHCP server on a VLAN20 access port or you can use dhcp helper to redirect DHCP to server elsewhere.
    If you prefer or have issues with CDP or LLDP you can also program ports as trunks and add tagged VLAN 20 to them.  In this scenario you need to insure inter-vlan routing is working and that phones download config file with corrrect VLAN config.
    These switches do not run ios so they are similar but different than catalyst switches you referred to.
    -- please remember to rate helpful posts --

  • Passing voice and data Vlans on Cisco SG200-08P help

    Hello All,
    I'm struggling with a configuration issue on the Cisco SG200-08P.
    We are using the Cisco SG200-08P on a mobile cart that will go from class room to class room that will have computer and cisco Voip phone plugged into it. The issue is that each of our closets are in differnt VLANS ( 1 voice and 1 data....lets say data vlan 20 and voice vlan 2025 for conversation) and that we route to each closet.
    It would be great if I could just create a generic data and voice vlan to dynamically pick up what the upstream switch has however, it seems that I've been unsuccessful in doing so.
    So far I can pass the data Vlan no probablem. The upstream switch port is set to access port and a switch port access voice vlan (these are 3750x switches)
    If the above is not possible I guess I will take what I can get. Should I just create data vlan 20 and voice vlan2025 on the Cisco SG200-08P and make a trunk port on the Cisco SG200-08P and a trunk on the 3750x? Is there an option on the Cisco SG200-08P to tag voice traffic?
    I'm also concerned with VTP and I did not see an area in the Cisco SG200-08P to set that as a client and transparent mode.
    Thanks for any help,
    Dan

    On a Catalyst switch, when a port is defined as a trunk without a vlan specified on the port, all vlan pass through the port. On a small business switch it is nearly the opposite. You must specify the vlans on the links. Additionally, ingress filter discards anything not associated to the port.
    802.1q specifies there must be an untagged vlan which is the native vlan (of course you can make exceptions, tagging the default vlan..).
    One thing I did in the past with a 2960, I made an LLDP network policy and it basically "provisioned" the downstream switch connecting link and voice vlan. That may be another idea for you.
    Here's a link that may be useful-
    https://supportforums.cisco.com/message/3811376
    Here is the 2960 config I used to feed a SB switch voice info
    Switch#show run
    Building configuration...
    Current configuration : 2206 bytes
    ! Last configuration change at 00:41:16 UTC Mon Mar 1 1993
    version 12.2
    no service pad
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    hostname Switch
    boot-start-marker
    boot-end-marker
    no aaa new-model
    system mtu routing 1500
    vtp mode transparent
    network-policy profile 1
    voice vlan 100 cos 4
    spanning-tree mode pvst
    spanning-tree extend system-id
    vlan internal allocation policy ascending
    vlan 2
    name test
    vlan 100
    lldp run
    interface FastEthernet0/1
    network-policy 1
    spanning-tree portfast
    interface FastEthernet0/2
    interface FastEthernet0/3
    interface FastEthernet0/4
    interface FastEthernet0/5
    interface FastEthernet0/6
    interface FastEthernet0/7
    interface FastEthernet0/8
    interface FastEthernet0/9
    interface FastEthernet0/10
    interface FastEthernet0/11
    interface FastEthernet0/12
    interface FastEthernet0/13
    interface FastEthernet0/14
    interface FastEthernet0/15
    interface FastEthernet0/16
    interface FastEthernet0/17
    interface FastEthernet0/18
    interface FastEthernet0/19
    interface FastEthernet0/20
    interface FastEthernet0/21
    interface FastEthernet0/22
    interface FastEthernet0/23
    interface FastEthernet0/24
    interface FastEthernet0/25
    interface FastEthernet0/26
    interface FastEthernet0/27
    interface FastEthernet0/28
    interface FastEthernet0/29
    interface FastEthernet0/30
    interface FastEthernet0/31
    interface FastEthernet0/32
    interface FastEthernet0/33
    interface FastEthernet0/34
    interface FastEthernet0/35
    interface FastEthernet0/36
    interface FastEthernet0/37
    interface FastEthernet0/38
    interface FastEthernet0/39
    interface FastEthernet0/40
    interface FastEthernet0/41
    interface FastEthernet0/42
    interface FastEthernet0/43
    interface FastEthernet0/44
    interface FastEthernet0/45
    interface FastEthernet0/46
    interface FastEthernet0/47
    interface FastEthernet0/48
    interface GigabitEthernet0/1
    switchport mode trunk
    interface GigabitEthernet0/2
    interface Vlan1
    no ip address
    interface Vlan100
    no ip address
    ip http server
    ip http secure-server
    logging esm config
    line con 0
    line vty 5 15
    end
    Switch#
    -Tom
    Please mark answered for helpful posts

  • Voice VLAN vs Data VLAN

    Hi,
    I have a call manager connected to switch with three VLANS configured, one voice vlan and two data vlan,
    int f0/1-2
    switchport mode access
    switchport access VLAN 200
    int f0/3-23
    switchport mode access
    switchport access VLAN 300
    switchport voice VLAN 100
    intf0/24
    switchport mode trunk
    switchport trunk encapsulation dot1q
    int g0/0.100
    encapsulation dot1q 100
    ip address 172.100.1.1 255.255.255.0
    int g0/0.200
    encapsulation dot1q 100
    ip address 172.200.1.1 255.255.255.0
    int g0/0.300
    encapsulation dot1q 100
    ip address 172.300.1.1 255.255.255.0
    I am able to access the call manager if I assign it an IP under data VLAN range, but if I assign IP under voice VLAN( 172.100.1.0/24 ) i am not able to access the call manager, If i assign an IP address to the call manager under voice VLAN I am not able to ping even the default gateway 172.100.1.1
    What may be the issue.
    Regards,
    Shaggy

    Hi,
         try this.
    int g0/0.100
    encapsulation dot1q 100
    ip address 172.100.1.1 255.255.255.0
    int g0/0.200
    encapsulation dot1q 200
    ip address 172.200.1.1 255.255.255.0
    int g0/0.300
    encapsulation dot1q 300
    ip address 172.300.1.1 255.255.255.0
    hth
    Muammer

  • Voice and Data Vlan Routing for CUPC and IP Phones ?

    The IP Phones are in 10.1.1.0/24 network (Voice Vlan 10) , Desktop Computers are installed with CUPC 8.5 and they are in 11.2.2.0/24 network (DATA VLAN 20) , Unfied Communication Applications like CUCM , Cisco Unified Presence Server, Contact Center Express are in 172.16.10.0/24 network(Vlan 30). When using Clients like Cisco Unified Personal Communicator, How the Communication between  CUPC(DATA Vlan)and IP Phones(VOICE Vlan) is possible?.How network should be configured or designed ? If i make intervlan routing it creates Security problems.what is the best practiced network Configs for these kind of Scenario ? Even if i prefer to configure Intervlan routing, Which all TCP/UDP ports are to be allowed / blocked between VLANS ??

    Hi Mohammed,
    Hosts on separate vlans communicate with each other through routing, as they are not in the same broadcast domain. Some of the systems you mention use a wide range of ports and, depending on system and installed version, documentation is generally available.
    e.g
    http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/port/8_5_1/portlist851.html
    or
    http://www.cisco.com/en/US/docs/voice_ip_comm/cupc/8_5/english/release/notes/cupc85.html#wp39407
    Be also aware that RTP communication uses extended ranges of ephemeral ports.

  • Change data vlan

    How to change data vlan for PC connected behind ip phone. I've tried with switchport trunk native vlan XXX but it didn't work, here is present config
    interface FastEthernet0/12
    switchport mode dynamic desirable
    switchport voice vlan 10
    mls qos trust device cisco-phone
    mls qos trust cos
    auto qos voip cisco-phone
    wrr-queue bandwidth 20 1 80 1
    wrr-queue min-reserve 1 5
    wrr-queue min-reserve 2 6
    wrr-queue min-reserve 3 7
    wrr-queue min-reserve 4 8
    wrr-queue cos-map 1 0 1 2 4
    wrr-queue cos-map 3 3 6 7
    wrr-queue cos-map 4 5
    priority-queue out
    spanning-tree portfast
    end

    All you need is "switchport accss vlan

  • Query on Vocie and Data VLan on same Swithc port

    Hi All,
    This is query regarding allowing both Vocie and data Vlans on a single switch port. I knew tehre are different ways to configure and acheive this, but not sure how techncially they are different from each other>
    Way 1:
    interface FastEthernet1/5
    description *** IP Phone/Data Port ***
    switchport trunk native vlan 10
    switchport mode trunk
    switchport voice vlan 16
    no logging event link-status
    no snmp trap link-status
    mls qos trust cos
    spanning-tree portfast
    sh int trunk
    Port      Mode         Encapsulation  Status        Native vlan
    Fa1/5     on           802.1q         trunking      10
    Fa1/7     on           802.1q         trunking      10
    Fa1/12    on           802.1q         trunking      10
    Fa1/13    on           802.1q         trunking      10
    Fa1/14    on           802.1q         trunking      10
    Port      Vlans allowed on trunk
    Fa1/5     1-1005
    Fa1/7     1-1005
    Fa1/12    1-1005
    Fa1/13    1-1005
    Fa1/14    1-1005
    Port      Vlans allowed and active in management domain
    Fa1/5     1,10,16
    Fa1/7     1,10,16
    Fa1/12    1,10,16
    Fa1/13    1,10,16
    Fa1/14    1,10,16
    Port      Vlans in spanning tree forwarding state and not pruned
    Port      Vlans in spanning tree forwarding state and not pruned
    Fa1/5     1,10,16
    Fa1/7     1,10,16
    Fa1/12    1,10,16
    Fa1/13    1,10,16
    Fa1/14    1,10,16
    sh vlan-switch
    VLAN Name                             Status    Ports
    1    default                          active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                                                    Fa1/4, Fa1/6, Fa1/8, Fa1/9
                                                    Fa1/10, Fa1/11, Fa1/15
    10  DVLAN                            active
    16  VVLAN                            active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                                                    Fa1/4, Fa1/6, Fa1/8, Fa1/9
                                                    Fa1/10, Fa1/11, Fa1/15
    In the above config, the port Fa 1/5 which is currnetly up and running( this port is ocnencted with IP phoen and a PC)  is not shown in sh vlan-switch output as assigned to vlan 10 or vlan 16. Not sure it is becuase the output was taken from ISR rotuer with NM 16-ESW module .
    sh int fa 1/5 switchp
    Name: Fa1/5
    Switchport: Enabled
    Administrative Mode: trunk
    Operational Mode: trunk
    Administrative Trunking Encapsulation: dot1q
    Operational Trunking Encapsulation: dot1q
    Negotiation of Trunking: Disabled
    Access Mode VLAN: 0 ((Inactive))
    Trunking Native Mode VLAN: 10 (DVLAN)
    Trunking VLANs Enabled: ALL
    Trunking VLANs Active: 1,10,16
    Priority for untagged frames: 0
    Override vlan tag priority: FALSE
    Voice VLAN: 16
    Appliance trust: none
    In above ocnfig, the port is configured as trunk and hence it can carry multiple vlan traffic on swithcport. As IP phones will have inbuilt switch which runs DTP by default and CDP to reciognize the conencted devcies.  I am not sure how this config works as even it's configured as trunk the DTP negotiation is disabled and how phone switch can differentiate the voice frames and data frames. Please explain in loigcal as it's known that as we have confgiured vlan 10 as native and vocie vlan 16 as trunk it carries the voice traffic.
    Way 2:
    interface FastEthernet1/2
    description *** IP Phone/Data Port ***
    switchport access vlan 10
    switchport mode access
    switchport voice vlan 16
    no logging event link-status
    no snmp trap link-status
    mls qos trust cos
    spanning-tree portfast
    In the above config, even the port is access it's carrying multiple vlan traffic despite of being trunk port. Not sure how the trunk will be formed even DTP neogotiation is off. Isi t because of voice vlan command and if so what it deos exactly.  Please can anyone elaborate in detail. Sorry, if my post is big and confusing
    sh int fa 1/2 switchport
    Name: Fa1/2
    Switchport: Enabled
    Administrative Mode: static access
    Operational Mode: static access
    Administrative Trunking Encapsulation: negotiate
    Operational Trunking Encapsulation: native
    Negotiation of Trunking: Off

    Switch - Phone - PC
    1. First question:
         # int f0/1
         # switchport mode access
         # spanning-tree portfast
         # switchport access vlan 50
         # switchport voice vlan 10
    This is the ideal way to configure and in all latest IOS Switches and in latest ISR routers, we do this as the command "switch port voice vlan" command  says to switch port that it carries the voice traffic as tagged and PC as untagged.
    As we all know the default switch port of a switch will be either Dynamic auto or Dynamic Desirable which means DTP is on and in turn it means negotiation of trunking is ON. This is as per my understanding.
    The Sub-Questions for 1st Question are below:
    1  Does the trunk negotiation happen between Access Switch switch port and Mini 3 Port Switch within the IP Phone. If mini switch in IP PHone negotiates to form  trunk based on DTP then what’s the default switch port mode of mini switch in the IP Phone.
    2. As in above config we are no where mentioning the port to be trunk. But it’s still allowing multiple vlan’s traffic to carry on access port. The switchport mode is access when you do “ sh int fa 0/1 swithcport.”.  Is it the swithcport voice vlan command does the magic?
    2. Second Question:
         # int f0/1
         # switchport trunk encapsulation dot1q
         # switchport trunk native vlan 10     (data VLAN)
         # switchport mode trunk
         # swichport voice vlan 15
    The Sub-Questions for 2nd Question are below:
    When do we use this configuration.? In my set-up the above config is seen on 2811 ISR routers with NM-16ESW modules.  Can’t we configure the data vlan a switch port access vlan 10 , instead of trunk native vlan.

  • CONFIGURE VOICE DATA ACCESS PORT SW SF500-48

    Hi Everybody,
    I have a SW SF500 small business and i need configure one port how access for Voice and data VLan. I need help with any configuration that can apply por this requirement. I attach the design that i hope to work
    Thanks in advance

    Here is a link to a detailed document on configuring auto voice vlan:
    http://sbkb.cisco.com/CiscoSB/ukp.aspx?vw=1&docid=14906e97e0c24e14836144529c214b87_Voice_VLAN_Properties_on_Sx500_Series_Managed_Switches.xml&pid=2&respid=0&snid=4&dispid=0&cpage=search
    Here is a link to the admin guide(p252):
    http://www.cisco.com/en/US/docs/switches/lan/csbms/Sx500/administration_guide/500_Series_Admin_Guide.pdf

  • How to configure SGE2000P with CISCO 7900 phones and data VLAN

    Hello all
    I am having problem setting up SGE2000P switches to work with my default data VLAN and additional voice VLAN. I am configuring it to pick IP address for phones from voice VLAN which is working fine but when I connect a PC on phone port it is also picking up an IP from Voice VLAN while default VLAN is data with different scope of IP.
    Is there any good discussion or documents out there to help me resolve this issue before I pack these switches and purchase ESW 500 series. I have ESW 500 at another client and they are working fine out of the box but this guy is giving me hard time.
    Any suggestions help will be appreciated
    Mo

    HI Muhammed,
    I suggest you contact the Small Business Support Center for some help:
    http://www.cisco.com/en/US/support/tsd_cisco_small_business_support_center_contacts.html
    Regards,
    Cindy Toy
    Cisco Small Business Community Manager
    for Cisco Small Business Products
    www.cisco.com/go/smallbizsupport
    twitter: CiscoSBsupport

  • How to do sorting/filtering on custom java data source implementation

    Hi,
    I have an entity driven view object whose data should be retrieved and populated using custom java data source implementation. I've done the same as said in document. I understand that Query mode should be the default one (i.e. database tables) and createRowFromResultSet will be called as many times as it needs based on the no. of data retrieved from service, provided we should write the logic for hasNextForCollection(). Implementation sample code is given below.
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) {      
    Iterator datumItr = retrieveDataFromService(qc, params);
    setUserDataForCollection(qc, datumItr);
    hasNextForCollection(qc);
    super.executeQueryForCollection(qc, params, noUserParams);
    protected boolean hasNextForCollection(Object qc) {
    Iterator datumItr = (Iterator) getUserDataForCollection(qc);
    if (datumItr != null && datumItr.hasNext()){
    return true;
    setCallService(false);
    setFetchCompleteForCollection(qc, true);
    return false;
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet) {
    Iterator datumItr = (Iterator) getUserDataForCollection(qc);
    Object datumObj = datumItr.next();
    ViewRowImpl r = createNewRowForCollection(qc);
    return r;
    Everything is working fine include table sorting/filtering. Then i noticed that everytime when user perform sorting/filtering, executeQueryForCollection is called, which in turn calls my service. It is a performance issue. I want to avoid. So i did some modification in the implementation in such a way that, service call will happen only if the callService flag is set to true, followed by executeQuery(). Code is given below.
    private boolean callService = false;
    public void setCallService(boolean callService){
    this.callService = callService;
    public boolean isCallService(){
    return callService;
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams){
    if (callService)
    Iterator datumItr = retrieveDataFromService(qc, params);
    setUserDataForCollection(qc, datumItr);
    hasNextForCollection(qc);
    super.executeQueryForCollection(qc, params, noUserParams);
    Issue i have:
    When user attempts to use table sort/filter, since i skipped the service call and set null as userDataCollection, createRowFromResultSet is not called and data which i retrieved and populated to view object is totally got vanished!!. I've already retrived data and created row from result set. Why it should get vanished? Don't know why.
    Tried solution:
    I came to know that query mode should be set to Scan_Entity_Cache for filtering and Scan_View_Rows for sorting. I din't disturb the implementation (i.e. skipping service call) but overrided the executeQuery and did like the following code.
    @Override
    public void executeQuery(){
    setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
    super.executeQuery();
    By doing this, i could able to do table filtering but when i try to use table sorting or programmatic sorting, sorting is not at all applied.
    I changed the code like beolw*
    @Override
    public void executeQuery(){
    setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
    super.executeQuery();
    Now sorting is working fine but filtering is not working in an expected way because Scan_View_rows will do further filtering of view rows.
    Question:
    I don't know how to achieve both filtering and sorting as well as skipping of service call too.
    Can anyone help on this?? Thanks in advance.
    Raguraman

    Hi,
    I have an entity driven view object whose data should be retrieved and populated using custom java data source implementation. I've done the same as said in document. I understand that Query mode should be the default one (i.e. database tables) and createRowFromResultSet will be called as many times as it needs based on the no. of data retrieved from service, provided we should write the logic for hasNextForCollection(). Implementation sample code is given below.
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) {
      Iterator datumItr = retrieveDataFromService(qc, params);
      setUserDataForCollection(qc, datumItr);
      hasNextForCollection(qc);
      super.executeQueryForCollection(qc, params, noUserParams);
    protected boolean hasNextForCollection(Object qc) {
      Iterator datumItr = (Iterator) getUserDataForCollection(qc);
      if (datumItr != null && datumItr.hasNext()){
        return true;
      setFetchCompleteForCollection(qc, true);
      return false;
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet) {
      Iterator datumItr = (Iterator) getUserDataForCollection(qc);
      Object datumObj = datumItr.next();
      ViewRowImpl r = createNewRowForCollection(qc);
      return r;
    }Everything is working fine include table sorting/filtering. Then i noticed that everytime when user perform sorting/filtering, executeQueryForCollection is called, which in turn calls my service. It is a performance issue. I want to avoid. So i did some modification in the implementation in such a way that, service call will happen only if the callService flag is set to true, followed by executeQuery(). Code is given below.
    private boolean callService = false;
    public void setCallService(boolean callService){
      this.callService = callService;
    public boolean isCallService(){
      return callService;
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams){
      if (callService) {
        Iterator datumItr = retrieveDataFromService(qc, params);
        setUserDataForCollection(qc, datumItr);
      hasNextForCollection(qc);
      super.executeQueryForCollection(qc, params, noUserParams);
    }Issue i have:
    When user attempts to use table sort/filter, since i skipped the service call and storing of userDataCollection, createRowFromResultSet is not called and data which i retrieved and populated to view object is totally got vanished!!. I've already retrived data and created row from result set. Why it should get vanished? Don't know why.
    Tried solution:
    I came to know that query mode should be set to Scan_Entity_Cache for filtering and Scan_View_Rows for sorting. I din't disturb the implementation (i.e. skipping service call) but overrided the executeQuery and did like the following code.
    @Override
    public void executeQuery(){
      setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
      super.executeQuery();
    }By doing this, i could able to do table filtering but when i try to use table sorting or programmatic sorting, sorting is not at all getting applied.
    I changed the code like below one (i.e. changed to ViewObject.QUERY_MODE_SCAN_VIEW_ROWS instead of ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS)
    @Override
    public void executeQuery(){
      setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
      super.executeQuery();
    }Now sorting is working fine but filtering is not working in an expected way because Scan_View_rows will do further filtering of view rows.
    If i OR'ed the Query Mode as given below, i am getting duplicate rows. (vewObject.QUERY_MODE_SCAN_ENTITY_ROWS | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS) Question:
    I don't know how to achieve both filtering and sorting as well as skipping of service call too.
    Can anyone help on this?? Thanks in advance.
    Raguraman
    Edited by: Raguraman on Apr 12, 2011 6:53 AM

  • Data Cartridge Implementation - PGA Memory Problem

    Hi,
    I have modified the Data Cartridge implementation explained in the article at http://www.oracle-developer.net/display.php?id=422.
    More precisely I have modified it to create not only the type returned, but also the select statement.
    The problem I have, is that the PGA memory through the execution of my package always increases, and when it ends the execution the PGA doesn't get released.
    I'm wondering if i'm missing something on the ODCITableClose.
    Object spec:
    create or replace type t_conf_obj as object
      atype anytype, --<-- transient record type
      static function ODCITableDescribe(rtype                  out anytype,
                                        p_cz_conf_categoria in     number,
                                        p_id_profilo        in     number   default null,
                                        p_cz_conf_livello   in     number   default null,
                                        p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                       ) return number,
      static function ODCITablePrepare(sctx                   out t_conf_obj,
                                       tf_info             in     sys.ODCITabFuncInfo,
                                       p_cz_conf_categoria in     number,
                                       p_id_profilo        in     number   default null,
                                       p_cz_conf_livello   in     number   default null,
                                       p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                      ) return number,
      static function ODCITableStart(sctx                in out t_conf_obj,
                                     p_cz_conf_categoria in     number,
                                     p_id_profilo        in     number   default null,
                                     p_cz_conf_livello   in     number   default null,
                                     p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                    ) return number,
      member function ODCITableFetch(self  in out t_conf_obj,
                                     nrows in     number,
                                     rws      out anydataset
                                    ) return number,
      member function ODCITableClose(self in t_conf_obj
                                    ) return number
    );Object Body
    create or replace type body t_conf_obj as
      static function ODCITableDescribe(rtype                  out anytype,
                                        p_cz_conf_categoria in     number,
                                        p_id_profilo        in     number   default null,
                                        p_cz_conf_livello   in     number   default null,
                                        p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                       ) return number
      is
        r_sql   pck_conf_calcolo.rt_dynamic_sql;
        v_rtype anytype;
        stmt    dbms_sql.varchar2a;
      begin
          HERE I CREATE MY SELECT STATEMENT
        if p_cz_conf_livello is null and p_id_profilo is null then
          stmt := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria
        elsif p_cz_conf_livello is not null then
          stmt (1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
                                                           p_id_profilo,
                                                           p_cz_conf_livello,
                                                           p_dt_rif
        else
          stmt (1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
                                                           p_id_profilo
        end if;
        || parse the sql and describe its format and structure.
        r_sql.cursor := dbms_sql.open_cursor;
        dbms_sql.parse(r_sql.cursor, stmt, stmt.first, stmt.last, false, dbms_sql.native);
        dbms_sql.describe_columns2(r_sql.cursor,
                                   r_sql.column_cnt,
                                   r_sql.description);
        dbms_sql.close_cursor(r_sql.cursor);
        || create the anytype record structure from this sql structure.
        anytype.begincreate(dbms_types.typecode_object, v_rtype);
        for i in 1 .. r_sql.column_cnt loop
          v_rtype.addattr(r_sql.description(i).col_name,
                          case
                          --<>--
                            when r_sql.description(i).col_type in (1, 96, 11, 208) then
                             dbms_types.typecode_varchar2
                          --<>--
                            when r_sql.description(i).col_type = 2 then
                             dbms_types.typecode_number
                            when r_sql.description(i).col_type in (112) then
                             dbms_types.typecode_clob
                          --<>--
                            when r_sql.description(i).col_type = 12 then
                             dbms_types.typecode_date
                          --<>--
                            when r_sql.description(i).col_type = 23 then
                             dbms_types.typecode_raw
                          --<>--
                            when r_sql.description(i).col_type = 180 then
                             dbms_types.typecode_timestamp
                          --<>--
                            when r_sql.description(i).col_type = 181 then
                             dbms_types.typecode_timestamp_tz
                          --<>--
                            when r_sql.description(i).col_type = 182 then
                             dbms_types.typecode_interval_ym
                          --<>--
                            when r_sql.description(i).col_type = 183 then
                             dbms_types.typecode_interval_ds
                          --<>--
                            when r_sql.description(i).col_type = 231 then
                             dbms_types.typecode_timestamp_ltz
                          --<>--
                          end,
                          r_sql.description(i).col_precision,
                          r_sql.description(i).col_scale,
                          r_sql.description(i).col_max_len,
                          r_sql.description(i).col_charsetid,
                          r_sql.description(i).col_charsetform);
        end loop;
        v_rtype.endcreate;
        || now we can use this transient record structure to create a table type
        || of the same. this will create a set of types on the database for use
        || by the pipelined function...
        anytype.begincreate(dbms_types.typecode_table, rtype);
        rtype.setinfo(null,
                      null,
                      null,
                      null,
                      null,
                      v_rtype,
                      dbms_types.typecode_object,
                      0);
        rtype.endcreate();
        return odciconst.success;
      exception when others then
        -- indicate that an error has occured somewhere.
        return odciconst.error;
      end odcitabledescribe;
      static function ODCITablePrepare(sctx                   out t_conf_obj,
                                       tf_info             in     sys.ODCITabFuncInfo,
                                       p_cz_conf_categoria in     number,
                                       p_id_profilo        in     number   default null,
                                       p_cz_conf_livello   in     number   default null,
                                       p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                      ) return number
      is
        r_meta pck_conf_calcolo.rt_anytype_metadata;
      begin
        || we prepare the dataset that our pipelined function will return by
        || describing the anytype that contains the transient record structure...
        r_meta.typecode := tf_info.rettype.getattreleminfo(1,
                                                           r_meta.precision,
                                                           r_meta.scale,
                                                           r_meta.length,
                                                           r_meta.csid,
                                                           r_meta.csfrm,
                                                           r_meta.type,
                                                           r_meta.name);
        || using this, we initialise the scan context for use in this and
        || subsequent executions of the same dynamic sql cursor...
        sctx := t_conf_obj(r_meta.type);
        return odciconst.success;
      end;
      static function ODCITableStart(sctx                in out t_conf_obj,
                                     p_cz_conf_categoria in     number,
                                     p_id_profilo        in     number   default null,
                                     p_cz_conf_livello   in     number   default null,
                                     p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                    ) return number
      is
        r_meta pck_conf_calcolo.rt_anytype_metadata;
        stmt    dbms_sql.varchar2a;
      begin
          HERE I CREATE MY SELECT STATEMENT
        if p_cz_conf_livello is null and p_id_profilo is null then
          stmt := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria
        elsif p_cz_conf_livello is not null then
          stmt(1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
                                                           p_id_profilo,
                                                           p_cz_conf_livello,
                                                           p_dt_rif
        else
          stmt(1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
                                                          p_id_profilo
        end if;
        || we now describe the cursor again and use this and the described
        || anytype structure to define and execute the sql statement...
        pck_conf_calcolo.r_sql.cursor := dbms_sql.open_cursor;
        dbms_sql.parse(pck_conf_calcolo.r_sql.cursor, stmt, stmt.first, stmt.last, false, dbms_sql.native);
        dbms_sql.describe_columns2(pck_conf_calcolo.r_sql.cursor,
                                   pck_conf_calcolo.r_sql.column_cnt,
                                   pck_conf_calcolo.r_sql.description);
        for i in 1 .. pck_conf_calcolo.r_sql.column_cnt loop
          || get the anytype attribute at this position...
          r_meta.typecode := sctx.atype.getattreleminfo(i,
                                                        r_meta.precision,
                                                        r_meta.scale,
                                                        r_meta.length,
                                                        r_meta.csid,
                                                        r_meta.csfrm,
                                                        r_meta.type,
                                                        r_meta.name);
          case r_meta.typecode
          --<>--
            when dbms_types.typecode_varchar2 then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor, i, '', 32767);
              --<>--
            when dbms_types.typecode_number then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as number));
              --<>--
            when dbms_types.typecode_date then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as date));
              --<>--
            when dbms_types.typecode_raw then
              dbms_sql.define_column_raw(pck_conf_calcolo.r_sql.cursor,
                                         i,
                                         cast(null as raw),
                                         r_meta.length);
              --<>--
            when dbms_types.typecode_timestamp then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as timestamp));
              --<>--
            when dbms_types.typecode_timestamp_tz then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as timestamp with time zone));
              --<>--
            when dbms_types.typecode_timestamp_ltz then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as timestamp with local time zone));
              --<>--
            when dbms_types.typecode_interval_ym then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as interval year to month));
              --<>--
            when dbms_types.typecode_interval_ds then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as interval day to second));
              --<>--
            when dbms_types.typecode_clob then
              --<>--
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as clob));
              --<>--
          end case;
        end loop;
        || the cursor is prepared according to the structure of the type we wish
        || to fetch it into. we can now execute it and we are done for this method...
        pck_conf_calcolo.r_sql.execute := dbms_sql.execute(pck_conf_calcolo.r_sql.cursor);
        return odciconst.success;
      end;
      member function ODCITableFetch(self  in out t_conf_obj,
                                     nrows in     number,
                                     rws      out anydataset
                                    ) return number
      is
        type rt_fetch_attributes is record(
          v2_column    varchar2(32767),
          num_column   number,
          date_column  date,
          clob_column  clob,
          raw_column   raw(32767),
          raw_error    number,
          raw_length   integer,
          ids_column   interval day to second,
          iym_column   interval year to month,
          ts_column    timestamp,
          tstz_column  timestamp with time zone,
          tsltz_column timestamp with local time zone,
          cvl_offset   integer := 0,
          cvl_length   integer);
        r_fetch rt_fetch_attributes;
        r_meta  pck_conf_calcolo.rt_anytype_metadata;
      begin
        rws := null;
        if dbms_sql.fetch_rows(pck_conf_calcolo.r_sql.cursor) > 0 then
          || first we describe our current anytype instance (self.a) to determine
          || the number and types of the attributes...
          r_meta.typecode := self.atype.getinfo(r_meta.precision,
                                                r_meta.scale,
                                                r_meta.length,
                                                r_meta.csid,
                                                r_meta.csfrm,
                                                r_meta.schema,
                                                r_meta.name,
                                                r_meta.version,
                                                r_meta.attr_cnt);
          || we can now begin to piece together our returning dataset. we create an
          || instance of anydataset and then fetch the attributes off the dbms_sql
          || cursor using the metadata from the anytype. longs are converted to clobs...
          anydataset.begincreate(dbms_types.typecode_object, self.atype, rws);
          rws.addinstance();
          rws.piecewise();
          for i in 1 .. pck_conf_calcolo.r_sql.column_cnt loop
            r_meta.typecode := self.atype.getattreleminfo(i,
                                                          r_meta.precision,
                                                          r_meta.scale,
                                                          r_meta.length,
                                                          r_meta.csid,
                                                          r_meta.csfrm,
                                                          r_meta.attr_type,
                                                          r_meta.attr_name);
            case r_meta.typecode
            --<>--
              when dbms_types.typecode_varchar2 then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.v2_column);
                rws.setvarchar2(r_fetch.v2_column);
                --<>--
              when dbms_types.typecode_number then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.num_column);
                rws.setnumber(r_fetch.num_column);
                --<>--
              when dbms_types.typecode_date then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.date_column);
                rws.setdate(r_fetch.date_column);
                --<>--
              when dbms_types.typecode_raw then
                dbms_sql.column_value_raw(pck_conf_calcolo.r_sql.cursor,
                                          i,
                                          r_fetch.raw_column,
                                          r_fetch.raw_error,
                                          r_fetch.raw_length);
                rws.setraw(r_fetch.raw_column);
                --<>--
              when dbms_types.typecode_interval_ds then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.ids_column);
                rws.setintervalds(r_fetch.ids_column);
                --<>--
              when dbms_types.typecode_interval_ym then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.iym_column);
                rws.setintervalym(r_fetch.iym_column);
                --<>--
              when dbms_types.typecode_timestamp then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.ts_column);
                rws.settimestamp(r_fetch.ts_column);
                --<>--
              when dbms_types.typecode_timestamp_tz then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.tstz_column);
                rws.settimestamptz(r_fetch.tstz_column);
                --<>--
              when dbms_types.typecode_timestamp_ltz then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.tsltz_column);
                rws.settimestampltz(r_fetch.tsltz_column);
                --<>--
              when dbms_types.typecode_clob then
                --<>--
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.clob_column);
                rws.setclob(r_fetch.clob_column);
                --<>--
            end case;
          end loop;
          || our anydataset instance is complete. we end our create session...
          rws.endcreate();
        end if;
        return odciconst.success;
      end;
      member function ODCITableClose(self in t_conf_obj
                                    ) return number
      is
      begin
        dbms_sql.close_cursor(pck_conf_calcolo.r_sql.cursor);
        pck_conf_calcolo.r_sql := null;
        return odciconst.success;
      end;
    end;We have an Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 running on Windows 2003 sp2.
    Thanks in advance.
    Riccardo.

    I'm getting confused with so much answers!!!

  • Data Provider implementation '/IWFND/OM_MGW_NOTIF_0001_UC' '01' 'DEFAULT' does not exist

    Hi all,
    We are trying to implement HR renewal.After installation we got the landing page for ESS and MSS. But when trying to expand chips I am getting below error message
    'Data Provider implementation '/IWFND/OM_MGW_NOTIF_0001_UC' '01' 'DEFAULT' does not exist' in the /iwfnd/error_log  transaction.
    The chips are are still blank.What could be the issue? Any one has an idea?
    Regards,
    Jay

    Hello,
    Are you using a Gateway Hub deployment? Check the setting in the "Assign SAP system Aliases to ODATA Services", and see if the services catalog service to the hub server which has LOCAL as alias and checked the default value.
    If so deactivate Default System fiag then test again.
    You can check this in SPRO:
    Regards,
    David

  • Data warehouse implementation misconceptions

    In their book "Mastering the SAP Business Information Warehouse" the authors identify 5 common misconceptions of data warehouse implementations as:
    1) Data warehouse implementations are IT projects
    2) "Quick-win" iterative implementations will lead to a successful data warehouse
    3) Business content is a proper solution to accommodate all BI demands
    4) Governance can be introduced later
    5) Operations is not so important
    I'd like those of you who have experience in data warehouse implementation to rank these five misconceptions in terms of their importance.  You may just rank them by their numbers, for example, 5,1,3, 2,4.
    Please also indicate:
    1) your job title
    2) the number of years of experience you have in data warehousing
    3) the number of years of experience you have in SAP BW/BI
    Thank you!

    Hi Mark,
    I guess your questions below are very weird. Can I know what is your purpose ?
    Please also indicate:
    1) your job title
    2) the number of years of experience you have in data warehousing
    3) the number of years of experience you have in SAP BW/BI

  • Voice/Data T1/E1 Crossover back-to-back Cable DIY or Buy?

    Hi All,
    I am trying to build a Voice lab and it's starting to cost a fortune for the kit.
    I have seen a T1/E1 cross over cable on the link below and I need two of these from my set up
    http://www.ebay.co.uk/itm/UTP-Voice-data-T1-E1-Cross-Crossover-back-to-back-Cable-Cisco-Voice-CCIE-CCVP-/230771200798#ht_1364wt_1231
    Could anyone advise if this is a special type of UTP cable or is this standard Ethernet cable with RJ45 connectors just with a different pinout configuration?
    If it's just the order of the wires in the cable I have a reel of UTP and a crimping tool I can use to make my own
    Your help is appreciated as always
    Cheers,
    David

    T1/E1 cross over cable is very easy. You should make yours and dont waste your money buying ready made..
    The pin out you need is this..
    1----------->4
    2----------->5
    4----------->1
    5----------->2
    The images below shows you the pin out configuration
    https://www.google.co.uk/search?q=t1/e1+crossover+cable&tbm=isch&tbo=u&source=univ&sa=X&ei=EnRqUrmdK8GW0AWKsIGYDw&ved=0CD0QsAQ&biw=1600&bih=799
    Please rate all useful posts
    "opportunity is a haughty goddess who waste no time with those who are unprepared"

  • ChaRM : Update decision date and implementation date in Change request doc.

    Hi,
    I've created change request document from support message document.Then change document was created when i authorize the change request document.
    When  Change request document is created, decision date and implementation date is empty.
    1.How can i configure the decision date to be automatically capture when change manager have authorize the change request?
    2.How can i configure implementation date to be automatically capture when change document have been confirmed?
    regards,
    Biah

    Hi,
    Go to the transaction code MASS  and enter the OBJECT  TYPE as BUS2032 and enter
    It will lead you to the next screen where you can find the  Table and Field TABS
    Select the  SALES ORDER HEADER DATA  and choose the fields data and choose the fields PRICING DATE and BILLING DATE  and execute
    In the subsequent screen you can see the selection screen where you can enter all the Sales documents for which you want to change
    Key in all the documents and execute
    Now change the date as per your requirement and check the effect
    regards,
    santosh

Maybe you are looking for