State database replicas with no slices available

Hi
I want to mirror a boot disk on Solaris 9 Sparc. All slices have file systems on them. Do I need to reformat the disk to make slices available or is there another way? I read some where about reclaiming space from swap but I'm not sure how this creates another slice unless they meant to take the space from swap and add it to a free slice if there wasn't enough space on the free slice.

Well, you can share a slice with a replica and a metadevice. But maintenance of that is really annoying.
If you must, you could do this:
#1 disable swap
#2 put a replica (or replicas) on the swap slice
#3 Create a metadevice on the same slice
#4 Create a mirror metadevice pointing at the one in #3 (if you want)
#5 Enable swap on the mirror metadevice.
You lose some flexibility with this arrangement, but it is functional.
It doesn't have to be swap, but that's the only slice that you can easily shrink/dice whatever on most machines.
Darren

Similar Messages

  • State database replicas

    Hello all,
    sorry if I'm posting this on the wrong group, please let me know if there's a better suited group for this.
    I have a solaris 9 server with 3 disks:
    the 1st one holds the OS in several slices
    the other 2 make up a mirror drive i created using the management console.
    I created 3 database replicas, one on each disk, the master was on c1t0d0s5 (OS Disk, unused slice) and the other 2 on c1t1d0s0 (disk part of mirror) and c1t2d0s0 (disk part of mirror).
    I just created a fs on c1t0d0s5 using newfs and started copying some files there when the system crashed, when it came back up i noticed the database replica there was damaged so i deleted it and created a new one and stopped using this slice altogether!
    My questions:
    - In case of a disk failure on the OS disk, is it possible to replace it, reinstall solaris and then "plug" back the array using the database replicas from the other 2 disks?
    - Shouldn't the kernel itself protect the db replicas so that they don't get damaged when using the slice??
    - Is it possible to create another database replica on the slice holding the / filesystem without damaging it??
    Thanks in advance,
    Billy

    Well ...
    There are storage forums here:
    http://forum.sun.com/index.jspa
    ... and there is a storage forum here:
    http://supportforum.sun.com/hardware/
    You may need to be prepared to describe your hardware and software with some more specifics, such as brand/model/version, etc., and have excepts from logs available, should they be requested.

  • SVM state database replica Master flag not set for any replica

    Hi guys,
    Recently i have done root mirroring. After creating svm volumes, i ran the metadb command to create state database replicas on the replaced disk. I created only one replica that time. I tried creating additional replicas but it said like replica already exist on the slice. So i deleted the replica on the slice. Thn i created 3 replicas again & ran metadb. Output of metadb command is below. I found there is not master flag not set for any replica. I like to know whether it would create any issue or it is fine.
    flags first blk block count
    a u 16 8192 /dev/dsk/c1t0d0s7
    a u 8208 8192 /dev/dsk/c1t0d0s7
    a u 16400 8192 /dev/dsk/c1t0d0s7
    a p luo 16 8192 /dev/dsk/c1t1d0s7
    a p luo 8208 8192 /dev/dsk/c1t1d0s7
    a p luo 16400 8192 /dev/dsk/c1t1d0s7

    That shouldn't be any problem, i think the metadb's are just read at boot, and at boot one of the replicas will be choosen as the master, and will then get the m-flag.
    I suspect that you deleted the replica which was used as the master during the last boot, which is why none of your replicas have the m-flag at the moment, which is not a problem as it will be choosing a new replica during the next boot.
    .7/M.

  • DiskSuite: finding disk slices with state database replica(s) on them

    I am trying to find the disk slices that that the mdb state db replicas on them... or, put another way... trying to understand the entries in mddb.cf.
    Running Sol 9. disksuite configureation is limited to concat of two disk slices for user data (I think).
    Note: (stuft in "<"/">" is my psuedo code, not what is actually in the file).
    (abbreviated) output from metastat(1M):
    d10: concat/stribp
    stripe 0:
    c1t2d0s6
    c1t3d0s6
    c1t2d0 yes id1,sd@w<very long number1>
    c1t3d0 yes id1,sd@w<very long number2>
    and from metastat -p:
    d10 1 2 c1t2d0s6 c1t3d0s6 - 64b
    From analysis of prtvtoc(1M)'s output, it looks like there may be 2 or 3 state db replicas located at c1t2d0s4, c1t3d0s4, and possably c1t0d0s1, which consist of 31779, 31779, and 10660410 sectors respectively and do not seem to be otherwise used (not mounted, etc).
    My /etc/lvm/mddb.cf looks like this:
    sd 20 16 id1,sd@w<very long number1>/e <chksum>
    sd 20 8208 id1,sd@w<very long number1>/e <chksum>
    sd 28 16 id1,sd@w<very long number2>/e <chksum>
    sd 28 8208 id1,sd@w<very long number2>/e <chksum>
    entries in /etc/lvm/md.cf are consistent with the above. Interestingly, there is no "set md" entry in /etc/system.
    Will someone please tell me what the secret is to decodeing the entries in mddb.cf such that they point to a disk slice? Thanks.

    Grandpaferret wrote:
    I am trying to find the disk slices that that the mdb state db replicas on them... or, put another way... trying to understand the entries in mddb.cf.
    Running Sol 9. disksuite configureation is limited to concat of two disk slices for user data (I think).I think you've answered your original question, but I wanted to ask about your statement above. There's no such limitation that I'm aware of. Are you trying to do something and it's not letting you?
    Darren

  • Creting a database replica with no data

    Hi :
    I have a database DB1, I want to create another database DB2 having all the tables of DB1 but with NO data. All tables should be blank.
    I have around 80 tables in DB1, can you please suggest me a way do this.
    Thanks..

    Hi Umesh98,
    According to your description, you have 80 tables in DB1, and you want to copy all these tables to a new created database DB2 without any data, right?
    So we can generate a single script containing all tables in the database DB1 first, then we can simply copy this script and execute it on the target database DB2 to copy all these tables to DB2 without any data.
    As I have tested on my local environment, please follow steps below to copy all these tables from DB1 to DB2:
    Right click the database DB1 in SSMS Object Explorer, choose Tasks, and then click Generate Script.
    Click Next and select Tables on the Choose Objects page.
    Click Next and set Scripting Options according to your needs. Then click next until you finish the task.
    Open and copy the generated script and execute it on the target database DB2.
    If you have any question, please feel free to let me know.
    Regards,
    Jerry Li

  • slice overlaps with device in metadevice state database

    bash-3.00# metadb
    bash-3.00# newfs /dev/rdsk/c0t1d0s7
    newfs: construct a new file system /dev/rdsk/c0t1d0s7: (y/n)? y
    Warning: 784 sector(s) in last cylinder unallocated
    /dev/rdsk/c0t1d0s7: 103664 sectors in 17 cylinders of 48 tracks, 128 sectors
    50.6MB in 2 cyl groups (13 c/g, 39.00MB/g, 18624 i/g)
    super-block backups (for fsck -F ufs -o b=#) at:
    32, 80032,
    bash-3.00# metadb -ac3 /dev/dsk/c0t1d0s7
    bash-3.00# metadb
    flags first blk block count
    a u 16 8192 /dev/dsk/c0t1d0s7
    a u 8208 8192 /dev/dsk/c0t1d0s7
    a u 16400 8192 /dev/dsk/c0t1d0s7
    bash-3.00# metainit d20 1 1 /dev/dsk/c0t1d0s0
    metainit: unknown: c0t1d0s0: overlaps with device in metadevice state database
    bash-3.00# metainit -f d20 1 1 /dev/dsk/c0t1d0s0
    metainit: unknown: c0t1d0s0: overlaps with device in metadevice state database
    bash-3.00#
    I get the same result using raw devices.
    The root device is on slice 6 ; this slice being an LU Boot Environment.
    I'm stuck now.Any ideas?
    I'll eliminate the non allocated sectors and try again.
    Edited by: plasmichive on Nov 11, 2009 3:11 AM

    Sorry folks. I had failed to check the placing of slice 7... which I had assumed would be placed in the highest cylinder numbers... however, I used a "custom install" facility, which had placed them somewhere else... I failed to notice when I repartitioned the disk.
    The filesystem which I "newfs"ed a little chunk out of was blank anyway.
    Off to try to bite a chunk out of an operational filesystem now.... idle hands...
    Edited by: plasmichive on Nov 11, 2009 3:35 AM

  • Metainit error - overlaps with device in metadevice state database

    I have successfully mirrored 3 of 4 partitions on a new install but am having trouble with the last one. It is the swap partition. There are the usual steps I follow:
    SWAP (slice 1):
    1. metainit -f d11 1 1 c0t0d0s1
    2. metainit d12 1 1 c0t8d0s1
    3. metainit d10 -m d11
    4. edit the /etc/vfstab
    5. reboot
    6. metattach d10 d12
    After step #1, I get the following error:
    metainit: tpssol2: c0t0d0s1: overlaps with device in metadevice state database
    I check metastat and all the config files and don't see anything wrong.

    What platform is this? SPARC or X86 and OS version. This normally happens after a rebuild and you get 2 disk devices with the same ID.
    #iostat -Ei
    This will display your disks and IDs. If the match, you will need to do the following (this should applies for physical and virtual servers, but I have only tested it on VMware) in this example c1t0d0 and c1t1d0(secondary) are the disks with matching IDs.
    #iostat -Ei
    this shows 2 disks with the same ID
    #cfgadm -al|grep c1t
    c1::dsk/c1t0d0 disk connected configured unknown
    c1::dsk/c1t1d0 disk connected configured unknown
    #cfgadm -c unconfigure c1::dsk/c1t1d0
    #cfgadm -al|grep c1t
    c1::dsk/c1t0d0 disk connected configured unknown
    c1::dsk/c1t1d0 disk connected unconfigured unknown
    #iostat -Ei
    this shows now only one disk
    from within VMWare manager remove the secondary disk and add it back again!
    #cfgadm -c configure c1::dsk/c1t1d0
    #cfgadm -al|grep c1t
    c1::dsk/c1t0d0 disk connected configured unknown
    c1::dsk/c1t1d0 disk connected configured unknown
    #iostat -Ei
    this now showed a new disk with a unique disk ID.
    #fdisk /dev/rdsk/c1t1d0p0
    Y to the prompt to create Solaris 100% prompt
    #prtvtoc /dev/rdsk/c1t0d0s2|fmthard -s - /dev/rdsk/c1t1d0s2
    #metadb -af -c4 c1t0d0s7 c1t1d0s7
    Success! You can now setup your mirroring.
    Edited by: readlee on Sep 17, 2008 7:06 AM

  • How to install SSAS Cluster instance with Always On availability group(Standalone database instance) in same windows cluster servers

    We have requirement like to Install the SSAS as Cluster instance where SQL Server Database engine was installed with Always On availability group.Please help me to how configure it
    Currently we have following configuration in Current steup.
    Node1 and Node2 are in windows cluster
    Node1 has SQL Server Database engine Instance1 as Standalone
    Node2 has SQL Server Database engine Instance2 as Standalone
    Instance1 and Instance2 configured for Always On availability group with Listener.
    Now we have to steup SSAS instance with High availibilty. I know we have only option is to install cluster SSAS instance.
    Can some one provide information below.
    1. How to steup Cluster SSAS instance in this servers.
    2. Is this will have any dependancy on exisiting Listner name.
    3. Is this affects the availiblity groups, if SSAS instance failed over to another node.
    Thanks in Advance
    Sriram

    You will need to have SSAS installed as a clustered instance with shared storage. Refer to the whitepaper from this MSDN article
    How To Cluster SQL Server Analysis Services
    Availability Group is in it's own Role/Resource Group. When you create the clustered SSAS, it will create its own Role/Resource Group. This means that it will require its own virtual network name and virtual IP address and will not affect the existing Availability
    Group. You can also have it on the existing Availability Group if you want to. However, you need to decide if you want SSAS to failover with the Availability Group or not. Your design choices will depend on that decision.
    Edwin Sarmiento SQL Server MVP | Microsoft Certified Master
    Blog |
    Twitter | LinkedIn
    SQL Server High Availability and Disaster Recover Deep Dive Course

  • State databases for shared storage

    When adding a disk to a disk-set (Solaris Volume Manager), it automatically adds a state DB to slice 7 and then of course to the next disk added.
    Sun Cluster recommends 3 state databases on each disk of an internal. Is there a recommendation for the shared disks. I know one is added automatically, should it have more?

    No, you don't need to an any normally. SVM will automatically balance the replicas across the disks added to the set. The only time you might want to mess with this default allocation is if you want to create a preferenced site. In the case where you have two sites and an even number of disk arrays located across these sites, i.e. nodeA & arrayA in siteA, nodeB & arrayB in siteB, you might want to make site A preferred.
    SVM works on the principle of requiring a majority of replicas to allow a diskset to be imported read/write. Mediators help if you have a system failure then at some point later an array failure by allowing the internally held mediator to go 'golden'. However, if you have an instantaneous site failure, then the array and the server are loss simultaneously. The mediator on the remaining site does not go golden. Thus any diskset previously held by the failed site cannot be brought in read-write because there are only 50% of the replicas available (on say arrayB). You can manually delete some 'dead' replicas and get the set imported, but that's not very highly available. Alternatively, you an add an additional replica to siteB's arrayat configuration time and this would give it the majority it needed. However, if site B failed, you are in the same situation! The best option is to have a 3rd site with some of the storage on.
    Why does it work this way? Because if you were in the middle of a change to the configuration at the point of failure you might get the wrong info about the disk arrangement on a set switchover and possibly corrupt data. Data corruption is highly undesirable, so SVM protects you by forcing a manual intervention to resolve the issue.
    Don't know if that helps?
    Regards,
    Tim
    ---

  • Please help: deploy Bean with "No resource available" error for M:N relationship

    Hi all,
    I wonder any one comes across with deploying beans with M:N relationship with
    "No resource available".
    I defined the relationship in ejb-jar.xml and dbms in the
    weblogic-cmp-rdbms-jar.xml, but when I deployed the beans I got
    the following error
    ------ Error message-----
    weblogic.common.ResourceException: No resources available at weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.
    java:568) at weblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.
    java:400) at weblogic.common.internal.ResourceAllocator.reserveNoWait(ResourceAllo
    cator.java:368) at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.j
    ava:166) at weblogic.jdbc.common.internal.ConnectionPool.reserveNoWait(Connection
    Pool.java:127) at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiData
    Source.java:194) at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
    ce.java:219) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSP
    ersistenceManager.java:317) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.createDefaultDBMSTab
    le(RDBMSPersistenceManager.java:1149) at weblogic.ejb20.utils.TableVerifier.verifyTableExistsAndCreateMaybe(Ta
    bleVerifier.java:428) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.verifyTablesExist(RD
    Unable to deploy EJB: CustomerBean from \ejb:
    Errors encountered ''The Container-Managed Persistence Entity EJB failed while
    creating its SQL Type Map. The error was: Invalid object name 'localcustomer_localsubscription'.
    Severity 16, State 1, Procedure 'IVM_SERVER null', Line 1', 'Error encountered
    while attempting to create Default DBMS Table: 'localcustomer_localsubscription'.
    Error Text: 'weblogic.common.ResourceException: No resource s available'.''
    ---------------End error ----------------------
    ---------------my ejb-jar.xml
    <ejb-jar>
    - <enterprise-beans>
    - <entity>
    <ejb-name>AddressBean</ejb-name>
    <local-home>customer.LocalAddressHome</local-home>
    <local>customer.LocalAddress</local>
    <ejb-class>customer.AddressBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    - <cmp-field>
    <field-name>addressID</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>street</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>city</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>zip</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>state</field-name>
    </cmp-field>
    <primkey-field>addressID</primkey-field>
    </entity>
    - <entity>
    <ejb-name>CustomerBean</ejb-name>
    <local-home>customer.LocalCustomerHome</local-home>
    <local>customer.LocalCustomer</local>
    <ejb-class>customer.CustomerBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <abstract-schema-name>CustomerBean</abstract-schema-name>
    - <cmp-field>
    <field-name>customerID</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>firstName</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>lastName</field-name>
    </cmp-field>
    <primkey-field>customerID</primkey-field>
    - <query>
    - <query-method>
    <method-name>findByLastName</method-name>
    - <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    - <ejb-ql>
    - <![CDATA[ SELECT OBJECT(o) FROM CustomerBean AS o
      ]]>
    </ejb-ql>
    </query>
    - <query>
    - <query-method>
    <method-name>findByFirstName</method-name>
    - <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    - <ejb-ql>
    - <![CDATA[ SELECT OBJECT(o) FROM CustomerBean AS o
      ]]>
    </ejb-ql>
    </query>
    </entity>
    - <entity>
    <ejb-name>SubscriptionBean</ejb-name>
    <local-home>customer.LocalSubscriptionHome</local-home>
    <local>customer.LocalSubscription</local>
    <ejb-class>customer.SubscriptionBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <abstract-schema-name>SubscriptionBean</abstract-schema-name>
    - <cmp-field>
    <field-name>type</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>title</field-name>
    </cmp-field>
    <primkey-field>title</primkey-field>
    - <query>
    - <query-method>
    <method-name>findAllSubscriptions</method-name>
    <method-params />
    </query-method>
    - <ejb-ql>
    - <![CDATA[ SELECT OBJECT(o) FROM SubscriptionBean AS o
      ]]>
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    - <relationships>
    - <ejb-relation>
    <ejb-relation-name>LocalCustomer-LocalAddress</ejb-relation-name>
    - <ejb-relationship-role>
    <ejb-relationship-role-name>LocalCustomer-Has-LocalAddresss</ejb-relationship-role-name>
    <multiplicity>one</multiplicity>
    - <relationship-role-source>
    <ejb-name>CustomerBean</ejb-name>
    </relationship-role-source>
    - <cmr-field>
    <cmr-field-name>addresses</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    - <ejb-relationship-role>
    <ejb-relationship-role-name>LocalAddress-Has-LocalCustomer</ejb-relationship-role-name>
    <multiplicity>many</multiplicity>
    - <relationship-role-source>
    <ejb-name>AddressBean</ejb-name>
    </relationship-role-source>
    - <cmr-field>
    <cmr-field-name>customer</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    - <ejb-relation>
    <ejb-relation-name>LocalCustomer-LocalSubscription</ejb-relation-name>
    - <ejb-relationship-role>
    <ejb-relationship-role-name>LocalCustomers-Have-LocalSubscriptions</ejb-relationship-role-name>
    <multiplicity>many</multiplicity>
    - <relationship-role-source>
    <ejb-name>CustomerBean</ejb-name>
    </relationship-role-source>
    - <cmr-field>
    <cmr-field-name>subscriptions</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    - <ejb-relationship-role>
    <ejb-relationship-role-name>LocalSubscriptions-Have-LocalCustomers</ejb-relationship-role-name>
    <multiplicity>many</multiplicity>
    - <relationship-role-source>
    <ejb-name>SubscriptionBean</ejb-name>
    </relationship-role-source>
    - <cmr-field>
    <cmr-field-name>customers</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    </relationships>
    - <assembly-descriptor>
    - <container-transaction>
    - <method>
    <ejb-name>AddressBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    - <container-transaction>
    - <method>
    <ejb-name>CustomerBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    - <container-transaction>
    - <method>
    <ejb-name>SubscriptionBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ------------------End of ejb-jar.xml---------------
    Please help
    Thanks in advance
    Mike

    Hi Gaurav,
    Other applications used the same the datasource, which I used for this application,
    are running fine.
    I think there is some bug in the wlserver 6.1 to create the join table. I think
    it is the time I should ask the bea wlserver 6.1.
    Mike
    "Gaurav Khanna" <[email protected]> wrote:
    This implies that there are no database connections available. You need
    to
    check if you can log into your database instance. By default there are
    30
    connections specified for an instance in Oracle. FYI.
    "Mike" <[email protected]> wrote in message
    news:[email protected]...
    Hi all,
    I wonder any one comes across with deploying beans with M:Nrelationship with
    "No resource available".
    I defined the relationship in ejb-jar.xml and dbms in the
    weblogic-cmp-rdbms-jar.xml, but when I deployed the beans I got
    the following error
    ------ Error message-----
    weblogic.common.ResourceException: No resources available atweblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.
    java:568) atweblogic.common.internal.ResourceAllocator.reserve(ResourceAllocator.
    java:400) atweblogic.common.internal.ResourceAllocator.reserveNoWait(ResourceAllo
    cator.java:368) atweblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.j
    ava:166) atweblogic.jdbc.common.internal.ConnectionPool.reserveNoWait(Connection
    Pool.java:127) atweblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiData
    Source.java:194) atweblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
    ce.java:219) atweblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSP
    ersistenceManager.java:317) atweblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.createDefaultDBMSTab
    le(RDBMSPersistenceManager.java:1149) atweblogic.ejb20.utils.TableVerifier.verifyTableExistsAndCreateMaybe(Ta
    bleVerifier.java:428) atweblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.verifyTablesExist(RD
    Unable to deploy EJB: CustomerBean from \ejb:
    Errors encountered ''The Container-Managed Persistence Entity EJB failedwhile
    creating its SQL Type Map. The error was: Invalid object name'localcustomer_localsubscription'.
    Severity 16, State 1, Procedure 'IVM_SERVER null', Line 1', 'Errorencountered
    while attempting to create Default DBMS Table:'localcustomer_localsubscription'.
    Error Text: 'weblogic.common.ResourceException: No resource savailable'.''
    ---------------End error ----------------------
    ---------------my ejb-jar.xml
    <ejb-jar>
    - <enterprise-beans>
    - <entity>
    <ejb-name>AddressBean</ejb-name>
    <local-home>customer.LocalAddressHome</local-home>
    <local>customer.LocalAddress</local>
    <ejb-class>customer.AddressBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    - <cmp-field>
    <field-name>addressID</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>street</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>city</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>zip</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>state</field-name>
    </cmp-field>
    <primkey-field>addressID</primkey-field>
    </entity>
    - <entity>
    <ejb-name>CustomerBean</ejb-name>
    <local-home>customer.LocalCustomerHome</local-home>
    <local>customer.LocalCustomer</local>
    <ejb-class>customer.CustomerBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <abstract-schema-name>CustomerBean</abstract-schema-name>
    - <cmp-field>
    <field-name>customerID</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>firstName</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>lastName</field-name>
    </cmp-field>
    <primkey-field>customerID</primkey-field>
    - <query>
    - <query-method>
    <method-name>findByLastName</method-name>
    - <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    - <ejb-ql>
    - <![CDATA[ SELECT OBJECT(o) FROM CustomerBean AS o
    ]]>
    </ejb-ql>
    </query>
    - <query>
    - <query-method>
    <method-name>findByFirstName</method-name>
    - <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    - <ejb-ql>
    - <![CDATA[ SELECT OBJECT(o) FROM CustomerBean AS o
    ]]>
    </ejb-ql>
    </query>
    </entity>
    - <entity>
    <ejb-name>SubscriptionBean</ejb-name>
    <local-home>customer.LocalSubscriptionHome</local-home>
    <local>customer.LocalSubscription</local>
    <ejb-class>customer.SubscriptionBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <abstract-schema-name>SubscriptionBean</abstract-schema-name>
    - <cmp-field>
    <field-name>type</field-name>
    </cmp-field>
    - <cmp-field>
    <field-name>title</field-name>
    </cmp-field>
    <primkey-field>title</primkey-field>
    - <query>
    - <query-method>
    <method-name>findAllSubscriptions</method-name>
    <method-params />
    </query-method>
    - <ejb-ql>
    - <![CDATA[ SELECT OBJECT(o) FROM SubscriptionBean AS o
    ]]>
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    - <relationships>
    - <ejb-relation>
    <ejb-relation-name>LocalCustomer-LocalAddress</ejb-relation-name>
    - <ejb-relationship-role>
    <ejb-relationship-role-name>LocalCustomer-Has-LocalAddresss</ejb-relationshi
    p-role-name>
    <multiplicity>one</multiplicity>
    - <relationship-role-source>
    <ejb-name>CustomerBean</ejb-name>
    </relationship-role-source>
    - <cmr-field>
    <cmr-field-name>addresses</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    - <ejb-relationship-role>
    <ejb-relationship-role-name>LocalAddress-Has-LocalCustomer</ejb-relationship
    -role-name>
    <multiplicity>many</multiplicity>
    - <relationship-role-source>
    <ejb-name>AddressBean</ejb-name>
    </relationship-role-source>
    - <cmr-field>
    <cmr-field-name>customer</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    - <ejb-relation>
    <ejb-relation-name>LocalCustomer-LocalSubscription</ejb-relation-name>
    - <ejb-relationship-role>
    <ejb-relationship-role-name>LocalCustomers-Have-LocalSubscriptions</ejb-rela
    tionship-role-name>
    <multiplicity>many</multiplicity>
    - <relationship-role-source>
    <ejb-name>CustomerBean</ejb-name>
    </relationship-role-source>
    - <cmr-field>
    <cmr-field-name>subscriptions</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    - <ejb-relationship-role>
    <ejb-relationship-role-name>LocalSubscriptions-Have-LocalCustomers</ejb-rela
    tionship-role-name>
    <multiplicity>many</multiplicity>
    - <relationship-role-source>
    <ejb-name>SubscriptionBean</ejb-name>
    </relationship-role-source>
    - <cmr-field>
    <cmr-field-name>customers</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    </relationships>
    - <assembly-descriptor>
    - <container-transaction>
    - <method>
    <ejb-name>AddressBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    - <container-transaction>
    - <method>
    <ejb-name>CustomerBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    - <container-transaction>
    - <method>
    <ejb-name>SubscriptionBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ------------------End of ejb-jar.xml---------------
    Please help
    Thanks in advance
    Mike

  • Database Error: RSR0009: Resource not available for pool. Wait-time expired

    i am occassionally receiving the following error during database connections in my servlet:
    Database Error: RSR0009: Resource not available for pool [webAdvisorTestPool]. Wait-time expired
    i understand that this is a result of a connection leak from improper closure of my Connection object, but i thought that i was properly closing my connection.
    i can get the error if i do the following steps:
    1) access my login page and enter login credentials.
    2) submit the login which then hits the Authentication servlet.
    3) Authentication servlet authenticates and takes me to home page.
    4) hit the back button to get back to the login page.
    5) repeat this process until i hit the Max Pool Size (from web server).
    6) then i get the error message
    here are some details:
    i have an Authentication servlet; here is the pertinent code from that servlet:
    try {     // retrieve the user and add the User object to the session     DAO dao = new DAO();     Person authenticUser = dao.getPerson(userID, password);     session.setAttribute("validUser", authenticUser);     redirectPage = mapping.findForward("success"); }
    i also have a DAO object that handles all of my DB transactions (and you can see from my code above that the Authentication servlet is using that object); here is the pertinant code from that servlet:
    public DAO() {     datasource = "java:comp/env/jdbc/webAdvisorTest"; } public Person getPerson(String userID, String password)     throws ObjectNotFoundException {     // JDBC variables     DataSource ds = null;     Connection conn = null;     PreparedStatement stmt = null;     ResultSet results = null;     // User variables     Person validUser = null;     try     {         // Retrieve the DataSource from JNDI         InitialContext ctx = new InitialContext();         // if this statement fails, NamingException is thrown         ds = (DataSource)ctx.lookup(datasource);         // get DB connection and perform SQL operations         conn = ds.getConnection();         // User variables         String validUserID = null;         String validFName = null;         String validLName = null;         String validEmail = null;         // get DB connection and perform SQL operations         conn = ds.getConnection();         stmt = conn.prepareStatement(PERSON_QUERY);         stmt.setString(1, userID);         stmt.setString(2, password);         results = stmt.executeQuery();         // iterate through the results         if (results.next())         {             validUserID = results.getString("id");             validFName = results.getString("first_name");             validLName = results.getString("last_name");             validUser = new Person(validUserID, validFName, validLName);         }     }     // handle SQL errors     catch(SQLException e)     {         e.printStackTrace(System.err);         throw new RuntimeException("Database Error: " + e.getMessage());     }     // handle JNDI errors     catch(NamingException e)     {         throw new RuntimeException("JNDI Error: " + e.getMessage());     }     // clean up resources     finally     {         doClosure(results, stmt, conn);     }     // if the user was not found, throw ObjectNotFoundException     if(validUser == null)     {         throw new ObjectNotFoundException();     }     return validUser; } protected void doClosure(ResultSet results, PreparedStatement stmt,     Connection conn) {     if (results != null)     {         try { results.close(); }         catch (SQLException e) { e.printStackTrace(System.err); }     }     if (stmt != null)     {         try { stmt.close(); }         catch (SQLException e) { e.printStackTrace(System.err); }     }     if (conn != null)     {         try         {             System.out.println("R18Resources.conn before close: " + conn);             conn.close();             System.out.println("R18Resources.conn after close: " + conn);             System.out.println("R18Resources.conn is closed? " +                 conn.isClosed());         }         catch (SQLException e)         {             System.out.println("R18Resource conn close error: " +                 e.getMessage());         }     } }
    as you can see, i've added some print statements in my connection closure block. based on my output log, each connection is being properly closed and i am not encountering any errors during that closing block.
    any ideas???
    Message was edited by:
    millerand

    Please try the following code in your doClosure method. Replace your code with the following code.
    public void doClosure(ResultSet pResultSet, Statement pStmt, Connection pConn) throws Exception {
    try {
                   if (pResultSet != null) {
                        pResultSet.close();
                        pResultSet = null;
              } catch (SQLException se) {
              logger.error( se );
              } finally {
                   try {
                        if (pStmt != null) {
                             pStmt.close();
                             pStmt = null;
                   } catch (SQLException se) {
                   logger.error(se);
                   } finally {
                        try {
                             if (pConn != null) {
                                  pConn.close();
                                  pConn = null;
                        } catch (SQLException se) {
                        logger.error(se);
    And let me know if you still face this issue. What is the application server you are using?

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • How can I use a mySQL database schema with numeric auto increment primary key instead of GUID?

    Hello!
    I'm using the TestStand "MySQL Insert (NI)" database schema with GUID as primary key. So everything works fine.
    But I prever using numeric values as primary key, because the database is in conjunction with another database which uses numeric values as primary key.
    Is this possible?
    Has anyone an idea how I can modify the "Generic Recordset (NI)" for use with MySQL?
    Thanks!
    Configuration:
    Microsoft Windows XP
    TestStand 3.1
    MySQL 4.1.12a
    MySQL ODBC 3.51 Driver
    Brosig

    Adam -
    The TestStand Database Logging feature does not allow you to run a separate SQL command after executing the command for a statement(table), so I do not think that you can use an auto incrementing column for the tables. There is just no way to get it back in a generic way. One option that I tried is something similar to the Oracle schema where you call a store procedure to return a sequence ID for each record that you want to add.
    So you would have to create the following sequence table in MySQL:
    CREATE TABLE sequence (id INT NOT NULL);
    INSERT INTO sequence VALUES (0);
    Then create a stored procedure as shown below that will increment the sequence value and return it in a recordset:
    CREATE PROCEDURE `getseqid`()
    BEGIN
            UPDATE sequence SET id=LAST_INSERT_ID(id+1);
            SELECT LAST_INSERT_ID();
    END
    Then update the MySQL tables to use INT primary and foreign key values, so the TestStand MySQL SQL file to create all tables would have text like this:
    CREATE TABLE UUT_RESULT
     ID    INT  PRIMARY KEY,
    ~
    CREATE TABLE STEP_RESULT
     ID    INT  PRIMARY KEY,
     UUT_RESULT   INT  NOT NULL,
    ~
    Then update the schema primary and foreign key columns in the TestStand Database Options dialog box to be INT to match the table. For the primary key columns, you will have to set the Primary Key Type to "Get Value from Recordset" and set the Primary Key Command Text to "call getseqid()". This will call the stored procedure to determine the next value to use as the ID value.
    Hope this helps...
    Scott Richardson
    National Instruments

  • CCX7.0 Database Integration with Oracle 10g through ODBC

    Good Day…
    We are up to integrate CCX7.0 with Oracle 10g, CCX7.0 documents show the way to integrate the CCX7.0 with SQL server, but mention nothing about Oracle 10g, anyway...
    I tried to check the ODBC options, there were many options, I tried to select any Oracle related choice, just to find out Oracle should supply the driver for it. In the forums, people say it’s an Oracle Client, but what will this client do? Am I going to connect though it to the oracle database server or is it going to query the database to my CCX server? What am I going to use in this case, user DSN or system DSN?
    If there any tips or recommendations I will be grateful, as it is my first database integration.
    Thanks
    AT

    Hi Aaron
    Thanks Aaron for the information, and yes you are right, I am not a database person.
    I have here some questions, sorry if some of them sounds silly
    1)       Is there a certain Oracle Client version? or and Oracle Client will work for me?
    2)       Do you recommend system DSN on user DSN?
    3)       “…. available to any device on the system” as you said in your reply, what do you mean by "device" and "system"? Sorry, but this will help to clear the picture to me
    4)       What will this Oracle Client exactly do? Is it going to build an SQL table on my CCX server that query the information from the Oracle Server?
    5)       My customer has already implemented database integration with IPCC3.5, how can I check the current configuration of the Oracle Client, and what things else should I check before proceeding with the integration?
    The reason I want to understand this because there is a lot of database integration is requested from us, the CCX scripts can be used to query data from SQL tables, I read a lot about this –waiting for the implementation phase- the lucky me, the first integration I faces is with Oracle.
    Anyway, who said learning is easy.
    Thanks Aaron for your time, waiting your answers.
    AT

  • Populate non database items with lov

    Hi,
    Let's say that I have one database block with 2 columns ID and NAME.
    Only ID it is a not displayed database column, and NAME it is a displayed text item with an lov which retrieve data for both columns.
    How can I do, to populate the non database item NAME after querying the block, without using POST-QUERY trigger and select into statement.
    Thanks.

    Hi Gabriel
    How can I do, to populate the non database item NAME after querying the block, without using POST-QUERY trigger and select into statement.u can't do that but with using POST-QUERY trigger and select into statement.
    This Trigger fires the action of populating the non-db item block Level after executing query...
    Regards,
    Amatu Allah

Maybe you are looking for

  • Safari 5.1.7 can't connect itself to facebook ? certificate is invalid

    I'm gonna be as simple as possible I use safari 5.1.7 on windows, and suddenly, I can't connect to facebook with my Safari. it say the certificate is invalide, while all others navigators, google chrome, opera, firefox and Maxthon can connect to face

  • HELP: License for Adobe Bridge!

    Hi, I am trying to find information on Adobe Bridge's license. I am wondering if you can purchase this as a stand-alone for use as a DAM. Many of our non-creative departments require access to our assets so need a central management console everyone

  • Final Cut Studio crashing upon opening whenever external drives are active

    Hello folks, I've gotten some great advice on this forum for a while now, through reading other posts. But now I'm hoping I can get some directly tailored advice, as I'm floundering a bit. Thanks in advance for your time, as I've tried to be as thoro

  • How to convert all Word file Hyperlinks?

    Hi, I am having some problems related to hyperlinks. I am using Word 2003 SP3 to create 'index_file.doc'. In this file, there are lots of hyperlinks (20 to 30 pages full of them) that are redirected towards PDF files that are in 2 folders ('folder1'

  • Error message not displaying when stock is zero

    Hi friends pls guide me how to solve , when ther is zero stock in the system for the particular item is not showing any error message , instead it is creating the delivery doc without any error message . pls tel me where would be the problem ..... aw