Spanning tree query for extending existing lan

Hi Guys,
I've got a network setup where I need to add a new set of switches have some new vlans that are independant to the existing environment but i have some of the existing vlans propogate accross.
My current setup is:
and my new design is this:
The 5505-02 is there so that i can easily manage acl's so that only some users can access the new vlans such as 200. And in the future put in idfw to manage this via AD groups.
My concern is regarding spanning tree. The current set up the 3750-01 , 2960-01, sf300-01 and sf300-02 are all set to default pvst where the 3750-01 is the root bridge for all existing vlans
With having the vlan 101 and 102 being propagated across to the new environment what is the best way of tackling STP for this? could I manually set the root primary and the priority to be lowest for these two vlans as the 3750-01? And then the same for the new 200 and 201 as the new 3750-02?
Or would setting a different mode be best i.e mst?
thanks
Rich

Rich
Are you proposing to use the same IP subnet for vlans 101 and 102 on the new switches ?
If so unless the ASA 5505-02 is in transparent mode then you will not be able to extend vlans 101 and 102 across to the new switches ie. if it is in routed mode that is a L3 hop and you generally can't extend a L2 vlan across a L3 hop. There are technologies that allow you to do this but i dont think any of them are supported on the 3750 switches.
If you are making the ASA 5505-02 transparent then it would need to be transparent for a trunk link and i don;t know whether this is possible. You may want to ask in the firewalling forums.
So before worrying about STP can you clarify what you are going to be doing with ASA 5505-02 and that whether or not you are proposing to use the same IP subnet for those vlans on the new switches ?
One last question. Any particular reason why you are using a square topology as opposed to simply using multiple uplinks from each 2960 to the 3750 stack ?
Jon

Similar Messages

  • View spanning tree configuraton for all the switches in ciscoworks

    Hi All,
    Is there any way I can see spanning tree configuration for all the switches we have on our networks in Ciscoworks.
    Waiting for your kind reply.
    Thanks in advance
    samir

    This can be done from within Campus Manager's Topology Services.  Open up the LAN Edge View map, and you should seesome switch clouds on the map.  If you drill into one of the clouds, you should see a Spanning Tree option in the right-hand tree.  If you expand this, you can visualize the spanning tree for MISTP or even for each VLAN.

  • Spanning-Tree config for a looped cable LAN

    Hi,
    Hopoing someone could help clarify if the below config could work,  or if it is just a no no.
    I am dealing with 2 DC's operating with a stretcheld LAN configuration using plain dot1q. 
    We have a 1GB LAN link between the 2 of them and an older 100MB LAN link.
    Can this configuration work:
    DC1-CORE-1 - 1GB LAN Link - DC2-CORE-1
    DC1-CORE-1 - 1GB - DC1-CORE-2
    DC1-CORE2 - 100MB LAN Link - DC2-CORE2
    DC2-CORE1 - 1GB - DC2-CORE2
    It truly is a looped LAN configuration but we want to the 100MB to just act as a secondary path in the event a 1GB goes down.
    Let me know your thoughts.
    Thanks

    David
    I'm sure you haven't so please don't take offence but the ports don't have portfast on them do they ?
    Also, have you changed any port costs or have you left them at the default ?
    STP should block on one of the 100Mbps ports. Which one depends on which switch is the root bridge for the vlans.
    Are these trunk links or access port links. If trunks can you confirm the native vlan is the same on both ends of the trunk ? Even if they are not it should not cause a loop as STP shoul shut one of the ports down but worth checking.
    What was the sequence of events ie. the minute you brought the interfaces up did it crash the network or was it up and running for a while ?
    Which version of STP are you running ?
    I appreciate it is difficult with it disconnected but to the best of your knowledge is the 100Mbps link working properly in terms of bidirectional traffic ?
    It's difficult to be more precise because as you say any STP outputs now wouid not be that helpful.
    Jon

  • How to query for extended ASCII characters in column value

    Hi All
    Sorry if this has been answered before. I tried searching but none of them seems to work for me.
    I am trying to search for inverted ? in my column.
    I am using the following query
    select *
    from table_name
    where regexp_like (description , '¿' )

    Did you try:
    like '%¿%'
    create table table_name (description varchar2(100))
    insert into table_name values ('jh¿¿gagd')
    insert into table_name values ('jhga345gd')
    insert into table_name values ('j1231232hgagd¿')
    select *
    from table_name
    where regexp_like (description , '¿' )
    DESCRIPTION
    jh¿¿gagd
    j1231232hgagd¿
    select * from table_name
    where description like '%¿%'
    DESCRIPTION
    jh¿¿gagd
    j1231232hgagd¿Edited by: user130038 on Sep 8, 2011 12:29 PM

  • Mono spanning-tree and PVST

    Refering to these two links
    http://www.cisco.com/en/US/tech/tk389/tk390/technologies_tech_note09186a0080094665.shtml
    http://www.experts-exchange.com/Hardware/Routers/Q_21349385.html
    IEEE 802.1Q defines a single instance of spanning tree running on the native VLAN for all the VLANs in the network which is called Mono Spanning Tree (MST). This lacks the flexibility and load balancing capability of PVST available with ISL. However, PVST+ offers the capability to retain multiple Spanning Tree topologies with 802.1Q trunking.
    IEEE 802.1Q defines a single instance of spanning tree running on the native VLAN for all the VLANs in the network which is called Mono Spanning Tree (MST). This lacks the flexibility and load balancing capability of PVST available with ISL. However, PVST+ offers the capability to retain multiple Spanning Tree topologies with 802.1Q trunking.
    http://networking.ringofsaturn.com/Certifications/BCMSN.php
    Per-VLAN Spanning Tree (PVST) ? A Cisco proprietary method of connecting through 802.1Q VLAN trunks, the switches maintain one instance of the spanning tree for each VLAN allowed on the trunk, versus non-Cisco 802.1Q switches which maintain one instance for ALL VLANs. This is the default STP used on ISL trunks.
    http://www.informit.com/content/images/1587051427/samplechapter/1587051427content.pdf
    The 802.1Q standard defines one unique Spanning Tree instance to be used by all VLANs in the network. STP runs on the Native VLAN so that it can communicate with both 802.1Q and non-802.1Q compatible switches. This single instance of STP is often referred to as 802.1Q Mono Spanning Tree or Common Spanning Tree (CST). A single spanning tree
    lacks flexibility in how the links are used in the network topology. Cisco implements a protocol known as Per-VLAN Spanning Tree Plus (PVST+) that is compatible with 802.1Q CST but allows a separate spanning tree to be constructed for each VLAN. There is only one active path for each spanning tree; however, in a Cisco network, the active path can be
    I could not get exactly what these Terminology (PVST, instance, PVST+, MST, etc) trying to achieve ?
    Any URL and online resource help me to do some extar reading to clarify these terminology

    Hi,
    The URLs that you have provided all explains the same technical details in different fashion.
    I will summarise them here for better clarity.
    There are two separate technologies that needs clarity.
    1) Method of Trunking many vlans across a link
    2) Spanning tree
    Now for point 1, we have the IEEE standard 802.1q, which mentions how multiple vlans can be carried across a link. As per this standard a 4 byte tag will be inserted in the ethernet packet, ( inserted between the Destination mac address field and the ethertype field)
    This tag will contain the vlan identifier info and some other details ( available in the urls that you have highlighted)
    Cisco has a proprietary technology called ISL which effectively does the same job in a different fashion but can only be used in cisco devices.
    Now for point 2, again we have IEEE standards like 802.1d ( common/mono spanning tree), 802.1w/RSTP ( Rapid spanning tree) and 802.1s/MSTP.
    In 802.1d, there will be only one spanning tree process/instance running for the whole network, irrespective of how many vlans are involved in the network. Hence the whole network is treated as one common domain by the STP protocol.
    So, there can be only one root bridge in the network and other bridges will intelligently block the redundant links, we wont have much control to effectively utilise the redundant links.
    IEEE 802.1w/RSTP also works in the same fashion, but the convergence time is very fast in this protocol.
    Here also there is only one spanning tree instance involved.
    In both the above STP protocols, there is only one instance/process of the protocol running in the network, which is common for all vlans. Hence these protocols consume only very less CPU utilisation.
    In 802.1s/ MSTP ( multiple spanning tree), extends the 802.1w Rapid Spanning Tree Protocol (RSTP) to have multiple STP instances. In this protocol, we can group the desired vlans in to one Instance of the protocol.
    Say for example, lets assume a typical campus network with multiple access switches, 2 distribution/core switches.
    Access switches having dual connectivity to the distribution/core switches.
    In this topology if we deploy 802.1d or 802.1w, the redundant links from the access switches to the distribution/core switches will be blocked. Only one uplink from the access switch to the distribution layer will be working at any point.
    In this network, only one distribution/core switch will be root bridge for the entire network.
    But if we deploy 802.1s for this network, we can design it as follows.
    We can split the vlans in to two groups,
    Group1 => vlan 1 to 50
    Group2 => vlan 51 to 100
    We can create two instance of MSTP protocol with the following mappings
    Instance 1 => for Group 1, with one distribution/core switch as the root bridge
    Instance 2 => for Group 2, with another distribution switch as the root bridge
    --Continued

  • IDSM2 spanning tree

    Hi,
    what is a default value of spanning tree cost for data port on IDSM2 module?
    If we put command
    intrusion-detection module 4 data-port 1 spanning-tree cost 1
    what is changed?

    Each link between spanning tree switches has a "cost" associated with the bandwidth of that link. This allows switchs to caculate the lowest "cost" (highest bandwidth) path to the root switch. Here's a table of the STP cost for each bandwidth:
    http://en.wikipedia.org/wiki/Spanning_tree_protocol
    I think that I shall never see
    A graph as lovely as a tree.
    A tree which must be sure to span.
    So packets can reach every LAN.
    First the root must be selected.
    By ID, it is elected.
    Least cost paths from Root are traced.
    In the tree these paths are placed.
    A mesh is made by folks like me.
    Then bridges find a spanning tree.
    - Radia Perlman

  • 2960X 15.0(2)EX5 Stack Bug? Master Switch Ports link in Orange, no spanning Tree

    Is anyone aware of a bug in version 15.0(2)EX5 for 2960X Switches that would cause a switch in the master role to stop linking in new ports in green (and passing traffic).  I have 2 2960X-48FPD-L Switches in a stack and whichever switch I designate master will only link new connections in orange and not pass traffic.  All ports linked in show up/up and can be seen in a show cdp neighbor but won't pass any other traffic. 
    If I unplug the Stacking cables both switches become masters and ports linked in green on the previous member switch stay green, but after it switches to master any new connections plugged in only link in orange. 
    If I switch priorities and reboot the problem switches to the new master switch and the problem goes away on the member switch.
    Also, a switch in the master role does not show any spanning tree instances for ports in the orange link state. 
    Has anyone seen this issue and do you know of a solution? 
    Jim

    A quick update for those with this same problem.
    1.  15.2(3)E turned out to be very unstable causing my switch stack to randomly lockup/reboot one of the switches about once a week.
    2.  I downgraded back to 15.0(2)EX5 but found a workaround.  It turns out the switch stack with the 15.0 versions does not like the switchport voice vlan command on any of the interfaces on the master switch.  I simply removed the voice vlan configuration on the interfaces and all the switch ports linked in just fine.  I would prefer to run the phones on a voice vlan, but it still works without, just the PC's and phones are on the same vlan. 
    Jim

  • About Spanning tree problem

    I am a newbie for cisco switch.
    I need a failover solution for both switch and AP Bridge link on both side.
    I have 2 of location (Location A and Location B)
    Location A
    There has 3 set of cisco 2960 switch.
    switch C is active switch
    switch A is redundancy switch , it will be active when primary Wi-FI Link and switch C is failure.
    Location B
    There has 3 set of cisco 2960 switch
    switch D is active switch
    switch B is redundancy switch ,it will be active when primary Wi-Fi Link and switch D is failure.
    I would like to use spanning tree protocol for this case.
    As show my diagram, Can it achive failover for both switch and AP bridge link if I use this network design
    Please help to comment
    Thanks
    John

    Hi John,
    This is achievable. The best way to do this is, If you can control the client switches,
    make the Client switch at location A, the root primary for the STP domain.
    On the Client switch at location B, make the STP cost high on the port towards the Switch B.
    Assuming all other STP settings are on default values,  this should block the link between LocationB client switch and Switch B. So all your traffic will take the path through switchC-SwitchD.
    If the Wifi Bridge fails (AP3-AP4), the blocked link will start forwarding (make sure you are using rapid spanning tree for fast transition)
    Now the most important thing in this design is to make sure that the Wifi bridges pass STP BPDU traffic, if they don't, this will not work.
    Even if one of the switches fails on the active path, the backup path would still kick in.. 
    Let me know how you go with this..
    please rate helpful posts.. :)

  • Spanning tree in VPC

    Hi All,
    I have a topology like two vpc peer connected to down catalyst switch 3750 with VPC 51. My left switch is primary in VPC and other is secondary.
    So acc. to Theory only primary switch would generate BPDU not secondary switch. But if down catalyst or Secondary switch will be root switch in Spanning tree.
    Will primary switch still generate the BPDU's? 

    Hi Garg,
    In VPC environment , In simple term regardless of the Spanning-tree root, VPC primay always generate BPDU and seconday device only rely that bpdu and never generate itself.
    For vPC ports only the vPC primary switch runs the STP topology for those vPC ports. In other words, Spanning Tree Protocol for vPCs is controlled by the vPC primary peer device, and only this device generates then sends out Bridge Protocol Data Units (BPDUs) on Spanning Tree Protocol designated ports. This happens irrespectively of where the designated Spanning Tree Protocol root is located. STP on the secondary vPC switch must be enabled but it doesn’t dictate vPC member port state. vPC secondary peer device proxies any received Spanning Tree Protocol BPDU messages from access switches toward the primary vPC peer device . Both vPC member ports on both peer devices always share the same STP port state (FWD state in a steady network).
    HTH
    Regards,
    VS.Suresh.
    *Plz rate the usefull posts *

  • VLAN spanning-tree root and VLAN L3 SVI

    I have a traditional core/access switches connected, Catalyst 4506 with 802.1Q uplink trunks to two core 6504-E switches. Spanning-tree roots for VLAN's were on core switch with the active HSRP/SVI. Shutdown HSRP/SVI on the cores and moved the SVI to the L3 access switches, but we left the spanning-tree root on the cores... Is this causing the clients/ports in the VLAN on the access switches to do a double/triple hop over the uplink for ingress/egress?  Gig1/1 is the trunkport/uplink to the core, wanted to move L3 functions to the access switch to reduce spanning VLANs across the core network.              
    Current configuration : 253 bytes
    interface Vlan196
    description Tower I - 8th Floor VLAN
    ip address 10.200.196.1 255.255.255.0
    ip access-group 115 in
    ip helper-address 164.103.160.150
    ip helper-address 172.20.135.201
    no ip redirects
    no ip unreachables
    ip pim sparse-mode
    end
    I0504506A8#sh spann          
    I0504506A8#sh spanning-tree vlan 196
    VLAN0196
      Spanning tree enabled protocol ieee
      Root ID    Priority    196
                 Address     6400.f1ee.c140
                 Cost        4
                 Port        1 (GigabitEthernet1/1)
                 Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
      Bridge ID  Priority    49348  (priority 49152 sys-id-ext 196)
                 Address     0015.f960.9ac0
                 Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
                 Aging Time 300
    Interface        Role Sts Cost      Prio.Nbr Type
    Gi1/1            Root FWD 4         128.1    P2p
    Gi1/2            Altn BLK 4         128.2    P2p

    Hi Tojackson, I guess this depends on how stuff is interconnecting. It's obvious gi1/1 is forwarding and gi1/2 is blocking. So from the furthest access switch, what path must it take to reach gi1/1? That is the number of hops involved for normal traffic.
    Now, if you're concerned about a specific VLAN and you need gi1/2 forwarding to reduce travel time for other traffic, you may employ RPVST to have that specific VLAN and cost to go to gi1/2.
    In some part of the network I support we have a pair of Cisco 7606 which feeds in to a 4507R and off the 4507R we have a ring of 2955 with even 10-12 L2 switches on the ring. The consequence of multiple layer 2 hops is not of much concern and our spanning tree stops with the 4507 since we're not concerned about broadcast storm on the routed interfaces on the 7600.
    -Tom
    Please mark answered for helpful posts

  • Sg-300 - 3750 stack with SPANNING-TREE root problem.

    Morning. I think ive configured a few hundred switches, maybe a thousand in my time, but never have a faced such horribleness that is the SG-300. After this week, I think ill refuse to touch them.
    Got 2 voice vlans and running a few vrf's on a 3750 stack. but this discussion is about layer 2.
    2 x 3750 stacked
    1 x voice switch sg-300 company A voice vlan 18 - Po1 up to 3750 distributed etherchannel Po1 (LACP active both sides) 2 ports in channel
    1 x voice switch sg-300 company B voice vlan 19 - Po1 up to 3750 distributed etherchannel Po2 (LACP active both sides) 2 ports in channel
    Allowed vlans on both sides (command on Port-channel) are data A, Voice A, Mgt A to switch A
    Allowed vlans on both sides (command on Port-channel) are data B, Voice B, Mgt B to switch B
    It seems that these switches are limited to one voice vlan....
    and that spanning tree BPDU's are ignored (or not recevied- havnt released the shark yet).  let me explain.
    originally when using "smart port" the switch with the lowest mac address, whatever Voice vlan was configured would take over the other switche's voice vlan, argh what a nightmare.
    I gave up on the GUI as its far to complcated and have Almost got this working.
    I am now using auto voice vlan, but have disabled smart macro. I hope that disabling smart macro stop other switches from learning the switch with the lowest mac address's voice vlan.  So far so good - in the LAB. No where was it documented in the cli guide how do disable this stupid feature.
    DHCP is working from scope on core, can mange the switches etc etc, access vlan voice vlan all good (after a monster battle).
    Now I have an issue with spanning tree.
    spanning tree priority for vlans 1-4094 on the 3750 is 4096.
    spanning tree priority for vlans 1-4094 on the SG-300's is 6xxxx.
    ALL switches think that they are the root. (well the "logical" 3 of them) The 3750's for all vlans, and the SG-300 for the one instance as it doesnt support per vlan.  (I am not interested in trying MST here..this is not a datacentre)
    On the 3750's Ive tried ieee, pvst, rpvst, while matching the non per-vlan equivalent on the SG series.
    What is the difference between a General port and Trunk Port on a SG-300 specific to spanning tree, native vlans (when you can just configure an untagged vlan anyway!!) and what is the relevance to the way the bpdu's are carried?
    And why the need for a PVID, when you can tell a port what is tagged and what isnt.
    Does the trunk need Vlan1 to be explicitly allowed, and untagged? Does the Po trunk need to be a general port with PVID configured? in vlan 1?
    I need to sort this, as cannot put an access switch into production that thinks it is the root of the tree.  I wish I had a 2960.... a 3500XL..anything
    Does anyone have CLI commands that can help here?

    F.Y.I for catylyst heroes - here is the equivalent config for SG-300 - Vlan1 is required on the allowed list on the catylyst side (3xxx/4xxx/6xxx)
    In this example:
    VLANS - Voice on 188, data on 57, management on 56.
    conf t
    hostname XXX-VOICE-SWXX
    no passwords complexity enable
    username xxxx priv 15 password XXXXX
    enable password xxxxxx
    ip ssh server
    ip telnet server
    crypto key generate rsa
    macro auto disabled
    voice vlan state auto-enabled !(otherwise one switch controls your voice vlan….)
    vlan 56,57,188
    voice vlan id 188
    int vlan 56
    ip address 10.230.56.12 255.255.255.0
    int vlan1
    no ip add dhcp
    ip default-gateway 10.230.56.1
    interface range GE1 - 2
    switchport mode trunk
    channel-group 1 mode auto
    int range fa1 - 24
    switchport mode trunk
    switchport trunk allowed vlan add 188
    switchport trunk native vlan 57
    qos advanced
    qos advanced ports-trusted
    exit
    int Po1
    switchport trunk allowed vlan add 56,57,188
    switchport trunk native vlan 1
    do sh interfaces switchport po1
    !CATYLYST SIDE
    !Must Explicitly allow VLan1, this is not normal for catalysts - or spanning tree will not work ! Even though it’s the native vlan on both sides.
    interface Port-channel1
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 1,56,57,189
    switchport mode trunk

  • Are VTP Advertisements Sent over Spanning Tree Blocked Links?

    In a Virtual Terminal Protocol (VTP) domain there are 6506 switches, 4912G units and many 35xx units. There are more than 64 VLANs in use, so there are no redundant links due to the 35xx restriction of 64 spanning trees.
    Should this be split into three VTP domains to make sure there are no more than 64 VLANs on any 35xx? In this scenario, some of the switches would be connected to one neighbour in the same domain but to other neighbours in other domains. How can we ensure that the first link is not spanning tree blocked for VTP to work?

    First, VTP is passed on VLAN 1 and
    can be sent and received through blocked
    ports.
    Second, spantree topology and VTP are totally independent. So, spantree would still block
    or forward normally on a link regardless of whether
    the switches on each side are in different VTP
    domains.

  • Why did we really need this "spanning-tree extend system-id" command?

    Folks,
    On the Spanning tree protocol I understood how does this spanning-tree extend system-id command work.
    But I have not understood why it is in place? or why do we really need it?
    Regards,
    Nikhil Kulkarni.

    Hi Nikhil,
    The STP and RSTP standard specifications mandate that each switch running STP/RSTP must have a unique Bridge ID (BID). Because Cisco runs STP or RSTP in each VLAN separately (called PVST and RPVST or PVRST), in each VLAN, the switch behaves like a standalone (albeit virtual) switch and thus, each STP/RSTP instance is required to have a unique BID to comply with the standard. Simply, having X VLANs means having X separate STP/RSTP instances and X unique BIDs.
    The question now is how to make sure the BIDs of STP/RSTP instances run on the same switch in different VLANs are truly unique. Older switches actually had a large reserve of MAC addresses. As new VLANs were created, these switches allocated a new MAC address for each new STP/RSTP instance in a new VLAN (recall that the BID originally consisted of the priority and the MAC address), making the BIDs unique.
    However, the consumption of MAC addresses this way was simply too large and ineffective. At the same time, having 65536 different values for priority in the BID was largely useless. So IEEE came with the idea of Extended System ID in which they reused a part of the priority field for a unique instance identifier. In Cisco's implementation, this field is populated with the VLAN number the STP/RSTP instance runs in. This easily and effectively makes the BID unique - even with the same priority for all VLANs on a single switch, and a single switch MAC address, multiple STP/RSTP instances running on this same switch with the same priority have different BIDs thanks to different VLAN numbers embedded into the BID.
    Some switch platforms actually allowed you to deactivate the Extended System ID and revert to the older style of assigning unique MAC addresses to individual STP/RSTP instance BIDs. That is why the command spanning-tree extend system-id exists in the first place. However, removing this command is only possible on those switching platforms which are equipped with 1024 MAC addresses for their disposal. Most new switching platforms have only 64 MAC addresses for their internal use, and while the spanning-tree extend system-id command is present in their configuration, you can not remove it. It is simply there to inform you that the Extended System ID is being used but you can not really deactivate it.
    Read more here:
    http://www.cisco.com/en/US/docs/switches/lan/catalyst6500/ios/12.2SXF/native/configuration/guide/spantree.html#wp1096536
    Best regards,
    Peter

  • Query for spesific children in a tree structure

    Hi,
    My data is organized in a tree structure.
    I need a sql statement that returns a parent that
    have a set of children corresponding to some demands.
    I provide a very simplified description of my data, but it covers my problem.
    Can anyone please help me write a select statement that gives me all featureids
    that have a GID attribute with children GNR=123 AND BNR=456?
    Regards
    gv
    create table attributetype( id number, name varchar2(8), parentid number );
    insert into attributetype( id, name ) values ( 1, 'GIDLIST' );
    insert into attributetype( id, name, parentid ) values ( 2, 'GID', 1 );
    insert into attributetype( id, name, parentid ) values( 3, 'GNR', 2 );
    insert into attributetype( id, name, parentid ) values ( 4, 'BNR', 2 );
    create table attribute( featureid number, id number, parentid number, atttypeid number, intvalue number );
    --attributes for feature1
    insert into attribute( featureid, id, parentid, atttypeid ) values( 1, 1, 0, 1 );
    insert into attribute( featureid, id, parentid, atttypeid ) values( 1, 2, 1, 2 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 3, 2, 3, 123 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 4, 2, 4, 456 );
    insert into attribute( featureid, id, parentid, atttypeid ) values( 1, 5, 1, 2 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 6, 5, 3, 12 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 1, 7, 5, 4, 456 );
    --attributes for feature 2
    insert into attribute( featureid, id, parentid, atttypeid ) values( 2, 8, 0, 1 );
    insert into attribute( featureid, id, parentid, atttypeid ) values( 2, 9, 8, 2 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 10, 9, 3, 678 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 11, 9, 4, 456 );
    insert into attribute( featureid, id, parentid, atttypeid ) values( 2, 12, 8, 2 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 13, 12, 3, 876 );
    insert into attribute( featureid, id, parentid, atttypeid, intvalue ) values( 2, 14, 12, 4, 456 );
    commit;
    column name format a15
    select a.featureid featureid, lpad(' ', (level - 1) * 2) || b.name name, a.id attid, a.parentid parentid, a.intvalue
    from attribute a, attributetype b
    where a.atttypeid=b.id
    connect by prior a.id=a.parentid
    start with a.parentid=0;
    FEATUREID NAME ATTID PARENTID INTVALUE
    1 GIDLIST 1 0
    1 GID 2 1
    1 GNR 3 2 123
    1 BNR 4 2 456
    1 GID 5 1
    1 GNR 6 5 12
    1 BNR 7 5 456
    2 GIDLIST 8 0
    2 GID 12 8
    2 GNR 13 12 876
    2 BNR 14 12 456
    2 GID 9 8
    2 GNR 10 9 678
    2 BNR 11 9 456

    Hi,
    Thanks for providing the CREATE TABLE and INSERT statements; that helps a lot.
    You want featureids that meet three criteria:
    (1) there is a GID attribute
    (2) the GID attribute has a GNR child with intvalue=123
    (3) the GID attribute has a BNR child with intvalue=456
    Since you're looking for immediate children, not distant descendants, it's easiest to do this with a non-hierarrchical query that finds one of these criteria, and does EXISTS sub-queries to test for the other two.
    For example:
    WITH aat AS
    ( -- Begin aat: join of attribute and attributetype
         SELECT     a.featureid
         ,     a.id
         ,     a.parentid
         ,     a.intvalue
         ,     t.name
         FROM     attribute     a
         JOIN     attributetype     t     ON     a.atttypeid     = t.id
    ) -- End aat: join of attribute and attributetype
    SELECT DISTINCT     featureid
    FROM     aat     m     -- m for main
    WHERE     name     = 'GID'
    AND     EXISTS     (     -- Begin EXISTS sub-query for GNR=123
              SELECT     NULL
              FROM     aat
              WHERE     parentid     = m.id
              AND     name          = 'GNR'
              AND     intvalue     = 123
              )     -- End EXISTS sub-query for GNR=123
    AND     EXISTS     (     -- Begin EXISTS sub-query for BNR=456
              SELECT     NULL
              FROM     aat
              WHERE     parentid     = m.id
              AND     name          = 'BNR'
              AND     intvalue     = 456
              )     -- End EXISTS sub-query for BNR=456
    ;Alternatively, you could do a three-way self join, and skip the EXISTS sub-queries.
    If you were looking for GNR and BNR descendants, any number of levels below the same GID node, it's easy to modify the query above. Just re-write the EXISTS sub-queries to CONNECT BY queries that "START WITH parentid = m.id".
    It looks like this application will have a lot of use for a view like aat, above. If you don't already have a permanent view like that, you should create one.

  • How to model query for -- existing and unchanged values

    Hello BW Experts,
    I have material and material group as navigational time-dependent attributes. I have a requirement to show the existing and unchanged values for the material and material group in the time frame 2003 to 2006 . how to create a query for this.
    Suggestions appreciated.
    Thanks,
    BWer

    HI ,
    I think u need to add two more date fields as the attributes  to the master data and then use them and give restriction in the query with the Keydate to see data which has unchanged from One range to another . As key Date applies to only the system defined to and from dates present in the Master Data .
    In query give Keydate as 31.dec.2006 and then give restriction for user defined dates sa follows :
    User From : 01.01.1000 - 31.12.2002.
    User To : 01.01.2007 -- 31.12.9999 .
    Regards,
    Vijay.
    Message was edited by: vijay Kumar
    Message was edited by: vijay Kumar
    Message was edited by: vijay Kumar

Maybe you are looking for