How to kill a Query In Shared Connection Pool

Is it possible to kill just a single "long running query" (and in this case after 5 seconds) when the connection is through a connection pool?
Environment is Exadata, about a 1500 Users making search query and may do a query for "THE%"
Is there a profile setting?
Regards

This sounds like a perfect case for the Resource Manager, with which Exadata is very closely integrated.  Here is an example,
http://www.orafaq.com/forum/mv/msg/121801/333625/0/#msg_333625

Similar Messages

  • Query about multiple connection pools under one database

    Hi,
    I have s query about connection pool, now we have a requirement,
    we have two schemas in one db, some data store in one schema, some in another schema,
    all tables are the same, but data is different, we want to retrive all data under two schemas,
    so we need two connection pools under one database,
    I have set two system DSN, and each connection pool was mapping to one DSN,
    but after I importing tables into RPD, when I view data, there is a dialog let me select connection pool. so If this, when we drag columns in answer, it will definitely get wrong.
    so how to realize this function about multiple connection pools under one database and we can get data normally.

    Hi,
    Try this step
    1)Better to create two different DSN for the same database with different user id and password
    2)now create multiple connection pool in the same database in u r RPD physical layer .
    also refer this link : for imporving performance
    http://obiee101.blogspot.com/2009/01/obiee-multiple-connection-pools.html
    http://gerardnico.com/wiki/dat/obiee/connection_pool
    Thanks
    Deva

  • How to kill a query?

    I moved from TOAD to SQL Developer and am not an experienced programmer.
    When a query gets away from me that I want to kill, I hit the red X button. SQL Developer will hang. Sometimes I will actually have to stop and restart the Oracle service to kill the query.
    How do I kill a query immediately?

    This is probably due to the nature of your query rather than an sqldev bug, so the database won't let you cancel and sqldev just hangs there until it completes anyway.
    You shouldn't have any trouble canceling a normal select. If you do, get back with DB/sqldev version and a reproducible script.
    Also, it would be great if you can compare the same statement with TOAD. If it can be canceled there, it should be possible in sqldev too.
    Last, you can always kill the whole session through sqldev's Monitor Sessions tool (in a second instance since the first one is blocked by your statement), the Enterprise Manager or the OS' KILL command.
    Regards,
    K.

  • Shared Connection Pool via Singleton

    I have just started to learn Java (more jsp & servlets) and have been going through "Core Servlets and Java Server Pages" and in there is stuff on connection pooling. The author provides a good a connection pool servlet that can be shared, but as I'm new and don't fully understand how everything works (got a basic idea).
    How do i go about making the following code accessiable via a singleton class?
    ConnectionPool Class
    package sco;
    import java.sql.*;
    import java.util.*;
    /** A class for preallocating, recycling, and managing
    *  JDBC connections.
    *  <P>
    *  Taken from Core Servlets and JavaServer Pages
    *  from Prentice Hall and Sun Microsystems Press,
    *  http://www.coreservlets.com/.
    *  &copy; 2000 Marty Hall; may be freely used or adapted.
    public class ConnectionPool implements Runnable {
      private String driver, url, username, password;
      private int maxConnections;
      private boolean waitIfBusy;
      private Vector availableConnections, busyConnections;
      private boolean connectionPending = false;
      public ConnectionPool(String driver, String url,
                            String username, String password,
                            int initialConnections,
                            int maxConnections,
                            boolean waitIfBusy)
          throws SQLException {
        this.driver = driver;
        this.url = url;
        this.username = username;
        this.password = password;
        this.maxConnections = maxConnections;
        this.waitIfBusy = waitIfBusy;
        if (initialConnections > maxConnections) {
          initialConnections = maxConnections;
        availableConnections = new Vector(initialConnections);
        busyConnections = new Vector();
        for(int i=0; i<initialConnections; i++) {
          availableConnections.addElement(makeNewConnection());
      public synchronized Connection getConnection()
          throws SQLException {
        if (!availableConnections.isEmpty()) {
          Connection existingConnection =
            (Connection)availableConnections.lastElement();
          int lastIndex = availableConnections.size() - 1;
          availableConnections.removeElementAt(lastIndex);
          // If connection on available list is closed (e.g.,
          // it timed out), then remove it from available list
          // and repeat the process of obtaining a connection.
          // Also wake up threads that were waiting for a
          // connection because maxConnection limit was reached.
          if (existingConnection.isClosed()) {
            notifyAll(); // Freed up a spot for anybody waiting
            return(getConnection());
          } else {
            busyConnections.addElement(existingConnection);
            return(existingConnection);
        } else {
          // Three possible cases:
          // 1) You haven't reached maxConnections limit. So
          //    establish one in the background if there isn't
          //    already one pending, then wait for
          //    the next available connection (whether or not
          //    it was the newly established one).
          // 2) You reached maxConnections limit and waitIfBusy
          //    flag is false. Throw SQLException in such a case.
          // 3) You reached maxConnections limit and waitIfBusy
          //    flag is true. Then do the same thing as in second
          //    part of step 1: wait for next available connection.
          if ((totalConnections() < maxConnections) &&
              !connectionPending) {
            makeBackgroundConnection();
          } else if (!waitIfBusy) {
            throw new SQLException("Connection limit reached");
          // Wait for either a new connection to be established
          // (if you called makeBackgroundConnection) or for
          // an existing connection to be freed up.
          try {
            wait();
          } catch(InterruptedException ie) {}
          // Someone freed up a connection, so try again.
          return(getConnection());
      // You can't just make a new connection in the foreground
      // when none are available, since this can take several
      // seconds with a slow network connection. Instead,
      // start a thread that establishes a new connection,
      // then wait. You get woken up either when the new connection
      // is established or if someone finishes with an existing
      // connection.
      private void makeBackgroundConnection() {
        connectionPending = true;
        try {
          Thread connectThread = new Thread(this);
          connectThread.start();
        } catch(OutOfMemoryError oome) {
          // Give up on new connection
      public void run() {
        try {
          Connection connection = makeNewConnection();
          synchronized(this) {
            availableConnections.addElement(connection);
            connectionPending = false;
            notifyAll();
        } catch(Exception e) { // SQLException or OutOfMemory
          // Give up on new connection and wait for existing one
          // to free up.
      // This explicitly makes a new connection. Called in
      // the foreground when initializing the ConnectionPool,
      // and called in the background when running.
      private Connection makeNewConnection()
          throws SQLException {
        try {
          // Load database driver if not already loaded
          Class.forName(driver);
          // Establish network connection to database
          Connection connection =
            DriverManager.getConnection(url, username, password);
          return(connection);
        } catch(ClassNotFoundException cnfe) {
          // Simplify try/catch blocks of people using this by
          // throwing only one exception type.
          throw new SQLException("Can't find class for driver: " +
                                 driver);
      public synchronized void free(Connection connection) {
        busyConnections.removeElement(connection);
        availableConnections.addElement(connection);
        // Wake up threads that are waiting for a connection
        notifyAll();
      public synchronized int totalConnections() {
        return(availableConnections.size() +
               busyConnections.size());
      /** Close all the connections. Use with caution:
       *  be sure no connections are in use before
       *  calling. Note that you are not <I>required</I> to
       *  call this when done with a ConnectionPool, since
       *  connections are guaranteed to be closed when
       *  garbage collected. But this method gives more control
       *  regarding when the connections are closed.
      public synchronized void closeAllConnections() {
        closeConnections(availableConnections);
        availableConnections = new Vector();
        closeConnections(busyConnections);
        busyConnections = new Vector();
      private void closeConnections(Vector connections) {
        try {
          for(int i=0; i<connections.size(); i++) {
            Connection connection =
              (Connection)connections.elementAt(i);
            if (!connection.isClosed()) {
              connection.close();
        } catch(SQLException sqle) {
          // Ignore errors; garbage collect anyhow
      public synchronized String toString() {
        String info =
          "ConnectionPool(" + url + "," + username + ")\n" +
          ", available=" + availableConnections.size() + "\n" +
          ", busy=" + busyConnections.size() + "\n" +
          ", max=" + maxConnections;
        return(info);
    ScoPool Class (singleton to access the connection pool)
    package sco;
    public class ScoPool extends ConnectionPool {
      private ScoPool pool = null;
      private ScoPool() {
        super(); // Call parent constructor
      public static synchronized ScoPool getInstance() {
        if(pool == null) {
          pool = new ScoPool();
        return(pool);
    }Please help a newbie.

    Figured it out.
    package sco;
    import java.sql.SQLException;
    public class ScoPool extends ConnectionPool {
      private static ScoPool pool;
      private ScoPool(String driver, String url, String username, String password,
                      int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException {
        super(driver, url, username, password, initialConnections, maxConnections, waitIfBusy); // Call parent constructor
      public static synchronized ScoPool getInstance() {
        if(pool == null) {
          String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
          String url = "jdbc:microsoft:sqlserver://MIM-W0432:1433;DatabaseName=sco";
          String username = "sco_user";
          String password = "123";
          int initCon = 5;
          int maxCon = 10;
          boolean waitIfBusy = true;
          try {
            pool = new ScoPool(driver, url, username, password, initCon, maxCon, waitIfBusy);
          catch(SQLException sqle) {
        return pool;
    }

  • How to catch exception when have max connection pool

    hi,
    i have define in oracle user that i could have max 10 sessions at the same time.
    I have jdbc datasource & connection pool defined at glassfish server(JSF application).
    now, if in application is too many queries to the database then i have error: nullpointer exception - becouse when i try to do:
    con = Database.createConnection(); - it generates nullpointer exception becouse there isn't free connection pool
    i try to catch exception like this:
    public List getrep_dws_wnioski_wstrzymane_graph() {     int i = 0;     try {     con = Database.createConnection();     ps =    (Statement) con.createStatement();     rs = ps.executeQuery("select data, klasa, ile_dni_wstrzymana, ile_wnioskow from stg1230.dwsww_wstrzymane_dws8 order by data, klasa, ile_dni_wstrzymana, ile_wnioskow");     while(rs.next()){       rep_dws_wnioski_wstrzymane_graph.add(i,new get_rep_dws_wnioski_wstrzymane_graph(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4)));       i++;     }     } catch (NamingException e) {         e.printStackTrace();     } catch (SQLException e) {         e.printStackTrace();     } catch (NullPointerException e) {         e.printStackTrace();         throw new NoConnectionException();  // catch null 1     } finally {     try {         con.close();     } catch (SQLException e) {         e.printStackTrace();     } catch (NullPointerException e) {         e.printStackTrace();         throw new NoConnectionException();  // catch null 2     }     } return rep_dws_wnioski_wstrzymane_graph; }
    but at line:
    con.close();
    i have nullpointerexception
    and
    at line
    throw new NoConnectionException(); // catch null 2
    i have: caused by exception.NoConnectionException
    what's wrong with my exception class? how to resolve it?
    public class NoConnectionException extends RuntimeException{     public NoConnectionException(String msg, Throwable cause){       super(msg, cause);     }     public NoConnectionException(){       super();     } }
    at web.xml i have defined:
    <error-page>         <exception-type>exception.NoConnectionException</exception-type>         <location>/NoConnectionExceptionPage.jsp</location>     </error-page>

    thanks,
    i did it and i have error:
    java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit
    at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
    at logic.Database.createConnection(Database.java:37): conn = ds.getConnection();
    public class Database {
         public static Connection createConnection() throws NamingException,
                    SQLException {
                Connection conn = null;
                try{
                    Context ctx = new InitialContext();
              if (ctx == null) {
                   throw new NamingException("No initial context");
              DataSource ds = (DataSource) ctx.lookup("jdbc/OracleReports");
              if (ds == null) {
                   throw new NamingException("No data source");
              conn = ds.getConnection();  // here's exception when max connections to database
              if (conn == null) {
                   throw new SQLException("No database connection");
                } catch (NamingException e) {
                    e.printStackTrace();
                    throw new NoConnectionException(); 
             } catch (SQLException e) {
                 e.printStackTrace();
                    throw new NoConnectionException(); 
                catch (NullPointerException e) {
                 e.printStackTrace();
                    throw new NoConnectionException();  // obsluga bledy na wypadek jesli braknie wolnych polaczen do bazy
            return conn;
    }and at my ealier code i have error:
    at logic.GetDataOracle.getrep_dws_wnioski_wstrzymane_graph(GetDataOracle.java:192)
    at line: con = Database.createConnection();
    in code:
    public List getrep_dws_wnioski_wstrzymane_graph() {
        int i = 0;
        try {
        con = Database.createConnection();
        ps =    (Statement) con.createStatement();
        rs = ps.executeQuery("select data, klasa, ile_dni_wstrzymana, ile_wnioskow from stg1230.dwsww_wstrzymane_dws8 order by data, klasa, ile_dni_wstrzymana, ile_wnioskow");
        while(rs.next()){
          rep_dws_wnioski_wstrzymane_graph.add(i,new get_rep_dws_wnioski_wstrzymane_graph(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4)));
          i++;
        } catch (NamingException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (NullPointerException e) {
            e.printStackTrace();
            throw new NoConnectionException();
        } finally {
        try {
            if(con != null)
            con.close();
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (NullPointerException e) {
            e.printStackTrace();
            throw new NoConnectionException(); 
    return rep_dws_wnioski_wstrzymane_graph;
    }so what's wrong?
    i have limit max sessions 10 at oracle so i set at my connection pool 5 connections as max. But when i get max 5 sesssins and try to execute next query then i can't catch exception..

  • How to access database from applet using connection pooling.

    Hi,
    I am using tomcat 4.1, JRE 1.4.2_10, MySQL 5.0, and IE 6.0. I can access the database using connection pooling from JSP without problems. But, if I try to acess from the applet, I get the following exception (related to JNDI.):
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.lookup(Unknown Source)
    I know what this acception means, but I don't know how to fix it. I set up connection pooling in my Tomcat 4.1 that talks to MySQL 5.0. As I said, when I access from jsp, JNDI works. But, applet complains. Please help. In my applet, the following code accesses the database:
    ArrayList toolTipData =
          access.getToolTipData (projectName,interfac);This is the snipet of my Access class:
    public ArrayList getToolTipData (String projectName, String interfac) {
        System.out.println("In getToolTipData");
        ArrayList toolTipData = new ArrayList();
       try{
        Context ctx = new InitialContext();
        if(ctx == null )
            throw new Exception("No Context");
        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/interfacesDB");
        if (ds != null) {
          Connection conn = ds.getConnection();
          if(conn != null)  {
              Statement s = conn.createStatement();
              //For some reason paramtized queries don't work, so I am forced
              //to this in slighly less eficient way.
              ResultSet rst = s.executeQuery("select * from interfaces");
              while (rst.next()) {
                 if (rst.getString("Project_Name").equals(projectName) &&
                     rst.getString("Interface").equals(interfac)) {
                   System.out.println("getToolTipData: ITG #" + rst.getString("ITG"));
                   toolTipData.add("ITG #: " + rst.getString("ITG"));
                   toolTipData.add("SPNE Prime Name: " +
                                   rst.getString("SPNE_Prime_Name"));
                   toolTipData.add("PD Prime Name: " +
                                   rst.getString("PD_Prime_Name"));
                   toolTipData.add("IT Prime Name: " +
                                   rst.getString("IT_Prime_Name"));
                   toolTipData.add("MLC Priority: " +
                                   rst.getString("MLC_Priority"));
                   toolTipData.add("Gary's Prime: " + rst.getString("Garys_Prime"));
                   toolTipData.add("QA Prime: " + rst.getString("QA_Prime"));
                   toolTipData.add("Brief Description: " +
                                   rst.getString("Brief_Description"));
                   toolTipData.add("Project_Status: " +
                                   rst.getString("Project_Status"));
              conn.close();
      }catch(Exception e) {
        e.printStackTrace();
      return toolTipData;
    ....

    The jsp runs on the server, whereas the applet runs on the client so
    you must package with your applet any jndi implementation specific classes
    and
    Properties props = new Properties();
    props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
    props.setProperty("java.naming.provider.url", "url:1099");
    Context ctx = new InitialContext(props);
    Object ref = ctx.lookup("...");

  • How to Retrieve Server Name for creating connection pool during startup!

    Hi All,
    I am going thru the edocs documentation of weblogic for creating the connection pool and the datasource dynamically. The URL I referred to was as under
    http://edocs.bea.com/wls/docs81/jdbc/programming.html
    There is a sample given in the above-mentioned URL. The Server MBean is created by passing the server name.
    The code below mentioned was have placed in my dblib.java
    svrAdminMBean = (ServerMBean)adminMBeanHome.getAdminMBean("myserver", "Server");
    I am creating the connection pool from the servlet by invoking the dblib.java
    I cannot hard-code the server name in the dblib.java since the same code was shared across multiple servlets.
    Each Servlet will create its own connection pool during application server startup.
    Is there a way to retrieve the server name in which the dblib.java is invoked.
    Any pointers to info source will be REALLY appreciated.
    Many Thanks in Advance,
    C R Baradwaj

    You can get it from the Java system property weblogic.Name, i.e. System.getProperty("weblogic.Name");
    Cheers
    Feargal

  • Sharing connection pooling  ?

    Is there a way to checkin the connection back to the pool and still have an access to the resultset in order to reuse the connection for other queries ?

    gnosis,
    You asked:
    Is there a way to checkin the connection back to the pool and still have
    access to the resultset in order to reuse the connection for other queries ?
    A single "Connection" object can be used to create (theoretically) an infinite number of "Statement" objects where each "Statement" has an associated "ResultSet".
    In other words, you don't need to release the "Connection" object in order to use it to perform a second query.
    You are asking the classic wrong question.
    Instead of asking, "How do I implement my proposed solution?", you should ask, "What is the best solution to my problem?"
    Your problem is that you want to have two (or more) "ResultSet"s opened simultaneously and you think the only way to do that is to release the "Connection", hence your question.
    A better question would be: "Can I have two 'ResultSet' objects opened simultaneously, using the same 'Connection'?"
    Now, why do you think you need two "ResultSet" objects opened simultaneously?
    Good Luck,
    Avi.

  • How to compile connection pool sample java code

    I recently bought David Knox's "Effective Oracle Database 10g Security by Design", and have been working through his examples with client identifiers and how to leverage database security with anonymous connection pools.
    The database side of things I totally understand and have set up, but I now want to compile/run the java code examples, but don't know what is required to compile this.
    I'm running Oracle 10.2.0.4 (64-bit) Enterprise Edition on a Linux (RHEL 5) PC. Java version is 1.6.0_20. Relevant .bash_profile environment variables are as follows:
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
    When I try to compile, I get:
    oracle:DB10204$ java FastConnect.java
    Exception in thread "main" java.lang.NoClassDefFoundError: FastConnect/java
    Caused by: java.lang.ClassNotFoundException: FastConnect.java
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    Could not find the main class: FastConnect.java. Program will exit.
    The java source code of one of the examples is below. Is someone able to point me in the right direction as to how I get this to compile? Do I just have a syntax and/or environment configuration modification to do, or is there more to it than that to get this example working? Any help much appreciated.
    oracle:DB10204$   cat FastConnect.java
    package OSBD;
    import java.sql.*;
    import oracle.jdbc.pool.OracleDataSource;
    public class FastConnect
      public static void main(String[] args)
        long connectTime=0, connectionStart=0, connectionStop=0;
        long connectTime2=0, connectionStart2=0, connectionStop2=0;
        ConnMgr cm = new ConnMgr();
        // time first connection. This connection initializes pool.
        connectionStart = System.currentTimeMillis();
        Connection conn = cm.getConnection("SCOTT");
        connectionStop = System.currentTimeMillis();
        String query = "select ename, job, sal from person_view";
        try {
          // show security by querying from View
          Statement stmt = conn.createStatement();
          ResultSet rset = stmt.executeQuery(query);
          while (rset.next()) {
            System.out.println("Name:   " + rset.getString(1));
            System.out.println("Job:    " + rset.getString(2));
            System.out.println("Salary: " + rset.getString(3));
          stmt.close();
          rset.close();
          // close the connection which resets the database session
          cm.closeConnection(conn);
          // time subsequent connection as different user
          connectionStart2 = System.currentTimeMillis();
          conn = cm.getConnection("KING");
          connectionStop2 = System.currentTimeMillis();
          // ensure database can distinguish this new user
          stmt = conn.createStatement();
          rset = stmt.executeQuery(query);
          while (rset.next()) {
            System.out.println("Name:   " + rset.getString(1));
            System.out.println("Job:    " + rset.getString(2));
            System.out.println("Salary: " + rset.getString(3));
          stmt.close();
          rset.close();
          cm.closeConnection(conn);
        } catch (Exception e)    { System.out.println(e.toString()); }
        // print timing results
        connectTime = (connectionStop - connectionStart);
        System.out.println("Connection time for Pool: " + connectTime + " ms.");
        connectTime2 = (connectionStop2 - connectionStart2);
        System.out.println("Subsequent connection time: " +
                            connectTime2 + " ms.");
    }Code download is at: http://www.mhprofessional.com/getpage.php?c=oraclepress_downloads.php&cat=4222
    I'm looking at Chapter 6.

    stuartu wrote:
    When I try to compile, I get:
    oracle:DB10204$  java FastConnect.java
    Exception in thread "main" java.lang.NoClassDefFoundError: FastConnect/java
    Caused by: java.lang.ClassNotFoundException: FastConnect.java
    I will try to explain what is happening here.
    You are launching java telling it to run a class named 'java' in a package named 'FastConnect'
    and java says it cannot find that class.
    What you intended to do:
    $ # make the directory structure match the package structure
    $ mkdir OSBD
    $ # move the source file in the directory structure so it matches the package structure
    $ mv FastConnect.java OSBD/
    $ # compile OSBD/FastConnect.java to OSBD/FastConnect.class
    $ javac OSBD/FastConnect.java
    $ # launch java using the OSBD/FastConnect class
    $ java -cp . OSBD.FastConnectNote that the package 'OSBD' does not follow the recommended naming conventions
    you might consider changing that to 'osbd'.

  • Saving Screen Sharing Connections

    Ok, this is driving me crazy. How do you save a Screen Sharing connection so that you do not have to enter the IP address every time. I am referring to accessing a computer remotely over the Internet done through port 5900. I have the screen sharing set up and working fine, and I even have one of these shortcuts made a year ago, but for the life of me I can't remember how I did it again.
    I think may be it was a trick using TextEdit? I know you can do this for ssh connections, but I can't remember the syntax for doing it for screen sharing. If I remember correctly you can type the right syntax followed by the IP address in TextEdit. Then you highlight the text and drag it to the desktop which results in a .inetloc file. After that you can simply doubleclick on the file and it will automatically launch the Screen Share.app and go to the right IP.

    Open Safari
    Type in "vnc://your.ip.address" in the address bar (I use Bonjour so it's "vnc://computername.local")
    Drag the blue globe in the address bar onto your desktop
    Source: http://www.mail-archive.com/[email protected]/msg46630.html

  • How to monitor connection pools using wlsd

    Hi
    i need to monitor connectionpools , i dont know that much about wlsd, how can we configure wlsd to monitor connection pools.
    Cheers
    Raghu

    U can use a Simple Java Code for that: http://jaysensharma.wordpress.com/2010/02/19/jdbcconnectionpool-parameters-using-jmx/
    In the above program you need to just change the following 4-lines:
    int port = 7001; // AdminServer Port
    String hostname = “localhost”; // AdminSewrver HostName
    h.put(Context.SECURITY_PRINCIPAL, “weblogic”); // AdminUserName
    h.put(Context.SECURITY_CREDENTIALS, “weblogic”); // Admin Paassword...
    ====================================
    Using WLST if you want to do it then you need to edit the following Script a Bit : http://jaysensharma.wordpress.com/2010/03/23/testing-datasource-status-using-wlst/

  • How to get ManagedBean for C3P0 connection pool.

    Hi there,
    How to get ManagedBean(C3P0PooledDataSourceMBean) for C3P0 connection pool, as the object name is getting constructed during run time.
    Thanks,
    Sid

    Hi there,
    How to get ManagedBean(C3P0PooledDataSourceMBean) for C3P0 connection pool, as the object name is getting constructed during run time.
    Thanks,
    Sid

  • Connection Pooling in OCCI Vs Multi-Threading.

    Hi,
    I am working on an application in which I am using OCCI( Oracle C++ Call Interface)  and multi-threading concepts.
    My application is having different clients( Ex: Client-A, Client-B) and I am offering a set of operations( functions that trigger the Stored Procedures of DataBase ) which are common to all the clients.Each Client can send asynchronous requests of any number.So, is there any chance of using single connection( not connection pooling) to the Data Base for all the clients to manage their requests ?
    Note: Multi-threaded requests are also allowed from each client.
    How can I co-relate multithreading and Connection Pooling in OCCI?
    Can I you multi-threading without Connection Pooling? If so how?
    Will the connection pooling is needed if there is no multi threading concept in my application?
    Please help me on this. Very urgent.
    Thanks in Advance..:)

    Connections are resources that the application uses and a fewer connections can be used by multiple threads if the threads are not always busy with the database activity only, and are doing other work too. This sharing (pooling) can be implemented by the application or the application can leverage the connection pooling features offered by OCI/OCCI (recommended).
    Be aware of connections vs sessions and sharing them (refer to :
    OCI Programming Advanced Topics
    OCCIConnectionPool is to pool connections and OCCIStatelessConnectionPool is to pool sessions. Please see the differences in the above link and apply as appropriate.

  • Multiple Connection Pools in OBIEE 10g

    Hi Experts,
    My question is as follows:
    Let's say in the RPD I create 2 connection pools in 1 database schema. I understand that that 1 connection pool should be dedicated for repository & session variables, and 1 connection pool dedicated to physical queries on the table.
    How does OBIEE know which connection pool to use for the physical tables? I haven't been able to find anything in the RPD that tells a table which connection pool to use when running a query in answers.
    Example:
    Connection Pool A (used to generate session variables)
    Connection Pool B (in 'theory' used for physical tables)
    What is stopping answers from using Connection Pool A? What is forcing answers to use connection pool B?
    An answer in OBIEE 10g is fine.
    Thanks!
    John

    When a connection pool is named in an initialization query then that connection pool is always used even if the user is explicitly denied permission to use the connection pool.
    This means that a connection pool used for initialization which does not have permissions for any user or user group can occur in any order in the connection pool list. But if it has permissions for a specific user or user group then it must be placed after any general query connection pools for the same user or group to ensure that it is not used for general purpose queries.
    Refer: http://everythingoracle.com/obieecnpl.htm
    Please mark if helps.
    Thanks,
    -A.Y

  • Response time & dump-allowed & disable connection pooling

    3 Questions:
    Question 1:
    Where do I find status report when I set "dump-allowed" to yes? Where does it get "dumped"? I've looked in servlet log files, such as:
    1. C:\Program Files\New Atlanta\ServletExec ISAPI\Servlet Logs\Servlet.Log
    C:\WINNT\SYSTEM32\LogFiles\W3SVC1\exyymmdd.log
    in a NewAtlanta ServletExec 4.1 for IIS/PWS 5.1 scenario AND
    2. C:\oracle\ora81\Apache\Jserv\logs\Jserv.log
    C:\oracle\ora81\Apache\Apache\logs\access_log
    in a Apache 1.3.12 with JServ 1.1 scenario (the versions that come with Oracle 8.1.7 on W2K).
    but cannot find any connection pool dump information in any of the above log files.
    Is there documentation on "dump-allowed" other than the short blurb in the XSQLConfig.xml file?
    Question 2:
    Does setting the following connection pool elements, initial & increment, in the XSQLConfig.xml file
    <initial>1</initial>
    <increment>1</increment>
    to 1 & 1 respectively, actually DISABLE connection pooling?
    When I set the timing-info element to "yes", I see about 2 to 4 second response time to any of the Insurance demos at the outset. This is probably normal to establish the first connection and to process the SQL statement. However after 60 seconds, which is the setting for the timeout-seconds element, I again see about 2 to 4 second response time. I expect a response time under 1 second because not only should the SQL statement be cached since it had previously been parsed, the initial connection should still be live.
    Thus it seems that an initial setting of 1 does not do what it's suppose to do, and that is maintain a connection pool of 1.
    I thought I had read in the XML forum that:
    <initial>1</initial>
    <increment>0</increment>
    does disable connection pooling. Not sure how and why. What does disabling connection pooling really mean anyway?
    BTW I'm using XDK 9.2.0.1.
    Question 3:
    The real reason behind questions 1 & 2. How do I track response times from end to end?
    I know about setting timing-info element to "yes" in the XSQLConfig.xml file.
    <timing-info>
    <page>yes</page>
    <action>yes</action>
    </timing-info>
    However if I want to know where a hold up is, timing-info is not enough.
    How do I turn on sql trace for the session affiliated each JDBC connection. I know about setting time_statistics= true in the init.ora file, but how do I alter session set sql_trace=true for an XSQL query action?
    I think I answered this question. See following amended claim1.xsql file for the Insurance example:
    Claim1.xsql:
    <?xml version="1.0"?>
    <page connection="demo" xmlns:xsql="urn:oracle-xsql">
    <xsql:dml><![CDATA[
    ALTER SESSION SET SQL_TRACE = true
    ]]></xsql:dml>
    <xsql:query><![CDATA[
    select value(c) as Claim from insurance_claim_view c
    where c.claimpolicy.primaryinsured.lastname = 'Astoria'
    ]]></xsql:query>
    <xsql:dml><![CDATA[
    ALTER SESSION SET SQL_TRACE = false
    ]]></xsql:dml>
    </page>
    The result of which is:
    <?xml version="1.0" ?>
    - <page xsql-timing="3485">
    <!-- 260 -->
    <xsql-status action="xsql:dml" rows="0" />
    <!-- 3195 -->
    - <ROWSET>
    - <ROW num="1">
    - <CLAIM>
    <CLAIMID>77804</CLAIMID>
    <FILED>1/1/1999 0:0:0</FILED>
    </CLAIM>
    </ROW>
    - <ROW num="2">
    - <CLAIM>
    <CLAIMID>12345</CLAIMID>
    <FILED>3/11/1998 0:0:0</FILED>
    </CLAIM>
    </ROW>
    </ROWSET>
    <!-- 10 -->
    <xsql-status action="xsql:dml" rows="0" />
    </page>
    and in the database trace file:
    select value(c) as Claim
    from insurance_claim_view c
    where c.claimpolicy.primaryinsured.lastname = 'Astoria'
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.08 0 0 0 0
    Execute 1 0.00 0.07 0 0 0 0
    Fetch 1 0.00 0.21 0 11 12 2
    total 3 0.00 0.36 0 11 12 2
    Do I use the elapsed time to understand the time spent in the db? Do I consider the other SQL statements in the trace file that seem to deal with the page request? If so, then there is an overall timed total provided.
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call count cpu elapsed disk query current rows
    Parse 14 0.00 0.20 0 0 0 0
    Execute 15 0.04 1.07 0 14 0 6
    Fetch 7 0.00 0.38 0 210 12 21
    total 36 0.04 1.65 0 224 12 27
    Misses in library cache during parse: 0
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call count cpu elapsed disk query current rows
    Parse 2 0.00 0.16 0 0 0 0
    Execute 7 0.00 0.04 0 0 0 0
    Fetch 7 0.04 0.25 0 56 0 7
    total 16 0.04 0.45 0 56 0 7
    Misses in library cache during parse: 0
    So do I use overall elapsed time in db affiliated with the Claim SQL statement, which is 2.1 seconds? Is the 3.5 seconds in the XSQL timing an elapsed time, and does it include time spent (2.1 seconds) in the database?
    I guess you can see where this is going. What I really need is a recommended plan to analyze response time problems.
    Has anyone come across this respose time problem, and how did you attack the problem? Did you use timing-info and cross check with database timed statistics using tkprof? What database statistics did you use?
    How does one analyze response time even further. For example how does one track time within the web server? How does one track time within the servlet engine?
    Ideas anyone?
    Steve.
    The section of the XSQLConfig.xml file to which I refer:
    <!--
    |
    | Set the parameters controlling database connection pools.
    |
    | When used, each named connection defined can have a pool of
    | connection instances to share among requests. These values
    | control the initial number of connection instances in the pool,
    | the number that will be added/incremented when under-load the
    | pool must be grown, and the number of seconds that must
    | transpire without activity before a connection instance will be
    | dropped out of the pool to shrink it back towards its initial
    | number.
    |
    | If the "dump-allowed" element has the value "yes"
    | then a browser-based status report that dumps the
    | current state of the connection pools is enabled.
    |
    | <connection-pool>
    | <initial>2</initial>
    | <increment>1</increment>
    | <timeout-seconds>60</timeout-seconds>
    | <dump-allowed>no</dump-allowed>
    | </connection-pool>
    |
    +-->                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    [list=1]
    [*]Where do I find status report when I set "dump-allowed" to yes?
    The report is returned in the browser.
    [*]Does setting the following connection pool elements, initial=1 & increment=1 actually DISABLE connection pooling?
    No. This tells the pool to start a one connection, and to grow by one connection whenever the pool finds all current connections in-use in the pool.
    When I set the timing-info element to "yes", I see about 2 to 4 second response time to any of the Insurance demos at the outset.
    Initial = 1 means that the pool will start with 1 connection. It also means the pool will never shrink to below 1 connection.
    I thought I had read in the XML forum that initial=1, increment=0 disables connection pooling.
    Setting increment=0 forces the pool never to grow, but if you have more than one user this is not a desireable situation to be in. It will cause potential delays for users contending for the one connection available.
    [*]How do I track response times from end to end?
    <timing-info> is the only XSQL pages specific timing info available. You saw how to use <xsql:dml> to turn on tracing. Once you have the trace output, the analysis is a database profiling task.
    [list]
    You can experiment with the fetch-size parameter to see if increasing the number of records fetched at a time will improve your throughput.

Maybe you are looking for

  • No signal from audigy 2zs line out j

    Hey there....due to a virus, I recently had to format my dri've and reinstall XP and all my apps including software for my Audigy 2 ZS soundcard. Before the format I had my sound and video card connect to my TV to extend my PC display and audio to my

  • How do i find a PDF sent to me

    how do i find a PDF sent to my e-mail address it doesn' t load when i open it

  • IMac 27" resolution issue

    So I got my new baby almost a month ago, and immediately had an issue with its (otherwise superb) resolution, which made everything so SMALL on the screen... With all due respect to Apple, I don't see no reason to cause damage to my eyesight, especia

  • An Unknown Exception Occurred !

    When I view report, I got this error on my report. Can anybody help me on this? thanks

  • Compile error in adjacency matrix

    Hello, I'm getting a strange compile error in my fileStream constructor also I'm having trouble accessing nodes. Any advice is much much appreciated and will be rewarded as such cheers mport java.io.*; import java.util.*; class AdjMatrix      private