• IBM Consulting

    DBA Consulting can help you with IBM BI and Web related work. Also IBM Linux is our portfolio.

  • Oracle Consulting

    For Oracle related consulting and Database work and support and Migration call DBA Consulting.

  • Novell/RedHat Consulting

    For all Novell Suse Linux and SAP on Suse Linux questions releated to OS and BI solutions. And offcourse also for the great RedHat products like RedHat Enterprise Server and JBoss middelware and BI on RedHat.

  • Microsoft Consulting

    For Microsoft Server 2012 onwards, Microsoft Client Windows 7 and higher, Microsoft Cloud Services (Azure,Office 365, etc.) related consulting services.

  • Citrix Consulting

    Citrix VDI in a box, Desktop Vertualizations and Citrix Netscaler security.

  • Web Development

    Web Development (Static Websites, CMS Websites (Drupal 7/8, WordPress, Joomla, Responsive Websites and Adaptive Websites).

12 December 2009

PHP Connection Pooling



Oracle Data Provider for .NET / ODP.NET

Type:    .NET Framework Class Library
Usage:  Oracle.DataAccess.Client.OracleConnection
Using TNS
Data Source=TORCL;User Id=myUsername;Password=myPassword;
 
Using integrated security
Data Source=TORCL;Integrated Security=SSPI;
 
Using ODP.NET without tnsnames.ora
Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;
 
Using the Easy Connect Naming Method (aka EZ Connect)
The easy connect naming method enables clients to connect to a database without any configuration.
Data Source=username/password@//myserver:1521/my.service.com;
Port 1521 is used if no port number is specified in the connection string.

Make sure that EZCONNECT is enabled in the sqlnet.ora file. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

'//' in data source is optional and is there to enable URL style hostname values
Easy Connect Naming Method to connect to an Instance
This one does not specify a service or a port.
Data Source=username/password@myserver//instancename;
 
Easy Connect Naming Method to connect to a dedicated server instance
This one does not specify a service or a port.
Data Source=username/password@myserver/myservice:dedicated/instancename;
Other server options: SHARED, POOLED (to use instead of DEDICATED). Dedicated is the default.
Specifying Pooling parameters
By default, connection pooling is enabled. This one controls the pooling mechanisms. The connection pooling service creates connection pools by using the ConnectionString property to uniquely identify a pool.
Data Source=myOracle;User Id=myUsername;Password=myPassword;Min Pool Size=10;Connection Lifetime=120;Connection Timeout=60;Incr Pool Size=5;Decr Pool Size=2;
The first connection opened creates the connection pool. The service initially creates the number of connections defined by the Min Pool Size parameter.

The Incr Pool Size attribute defines the number of new connections to be created by the connection pooling service when more connections are needed.

When a connection is closed, the connection pooling service determines whether the connection lifetime has exceeded the value of the Connection Lifetime attribute. If so, the connection is closed; otherwise, the connection goes back to the connection pool.

The connection pooling service closes unused connections every 3 minutes. The Decr Pool Size attribute specifies the maximum number of connections that can be closed every 3 minutes.
Restricting Pool size
Use this one if you want to restrict the size of the pool.
Data Source=myOracle;User Id=myUsername;Password=myPassword;Max Pool Size=40;Connection Timeout=60;
The Max Pool Size attribute sets the maximum number of connections for the connection pool. If a new connection is requested, but no connections are available and the limit for Max Pool Size has been reached the connection pooling service waits for the time defined by the Connection Timeout attribute. If the Connection Timeout time has been reached, and there are still no connections available in the pool, the connection pooling service raises an exception indicating that the request has timed-out.
Disable Pooling
Data Source=myOracle;User Id=myUsername;Password=myPassword;Pooling=False;
 
Using Windows user authentication
Oracle can open a connection using Windows user login credentials to authenticate database users.
Data Source=myOracle;User Id=/;
If the Password attribute is provided, it is ignored.

Operating System Authentication is not supported in a .NET stored procedure.
Privileged Connections
Oracle allows database administrators to connect to Oracle Database with either SYSDBA or SYSOPER privileges.
Data Source=myOracle;User Id=myUsername;Password=myPassword;DBA Privilege=SYSDBA;
SYSOPER is also valid for the DBA Privilege attribute.
Runtime Connection Load Balancing
Optimizes connection pooling for RAC database by balancing work requests across RAC instances.
Data Source=myOracle;User Id=myUsername;Password=myPassword;Load Balancing=True;
This feature can only be used against a RAC database and only if pooling is enabled (default).

.NET Framework Data Provider for Oracle

Database Resident Connection Pooling (DRCP) Oracle Database 11g

Database Resident Connection Pooling (DRCP)

Oracle Database 11g

(Technical White paper)


Introduction

Web tier and mid-tier applications typically have many threads of execution, which take turns using RDBMS resources. Currently, multi-threaded applications can share connections to the database efficiently, allowing great mid-tier scalability. Starting with Oracle 11g, application developers and administrators and DBAs can use Database Resident Connection Pooling to achieve such scalability by sharing connections among multi-process as well as multi-threaded applications that can span across mid-tier systems.
A connection resource for an Oracle Database is the database server process, the session and their associated memory. To minimize the database resources and to provide enduser concurrency at the same time, applications generally implement various resource pooling solutions. Oracle has provided connection-pooling solutions in all the data access drivers like OCI, OCCI, JDBC, ODP.NET etc. These take advantage of the ability of multiple threads in one application process to share resources.
However, there are many mid-tier deployments, which are process oriented or in which sharing of resources amongst threads is insufficient. These deployments fall into two
major classes:
1. Single threaded applications such as most PHP applications
2. Multi-threaded applications which often hold many idle connections, e.g. in
redundant processes, due to spikes in usage, and could benefit from sharing across processes or even across systems.

These applications tend to hold the database connections persistently while serving multiple user requests, to avoid connection creation and termination overheads when done on the fly. The mid-tier processes are typically configured to address the concurrency of end user requests, which is much higher than the concurrency of backend database accesses. If all the mid-tier processes use persistent connections to the database, the mid-tier scalability gets restricted due to database resource constraints.
Oracle Shared Server model partly addresses this issue, by pooling the Oracle server processes on the database side that can be shared by multiple connections. But the session resources are not shared. This model is useful where the clients need to hold the sessions for longer periods (for long running transactions etc.) with fewer clients actually doing the database activity at any point of time. However, in scenarios where the sessions are required for short database activity and the database activity across multiple requests does
not depend on the session state, applications can achieve much higher scalability by using the Database Resident Connection Pooling.



Database Resident Connection Pooling (DRCP)


The Database Resident Connection Pooling, a new feature of Oracle Database 11g by design is targeted at addressing the scalability requirements in such environments that require support for tens of thousands of connections. DRCP pools database server processes and sessions (the combination is known as a pooled server), which are shared across connections from multiple application processes from the same host or from different hosts. A Connection Broker process manages the pooled servers in the database instance. Clients are persistently connected and authenticated to the Broker. Clients request the Broker to provide pooled servers when they need to perform some database
activity, use them, and then release them back for reuse by other clients.
When the pooled servers are in use, they are equivalent to dedicated servers. Upon a request from the client on the persistent channel, the broker picks the appropriate pooled server and hands-off the client to that pooled server. The client directly communicates with the pooled server for all its database activity. The pooled server is handed back to the broker when the client releases it.







Using Database Resident Connection Pool


Database Tier Enabling and Configuring the pool: DRCP comes with an easy-to-use database administrative API. Every database instance of 11g has a default pool.
The pool can be configured and administered by the DBA using the PLSQL package DBMS_CONNECTION_POOL.

SQL>execute dbms_connection_pool.configure_pool(null, minsize=>10,
maxsize=>100, inactivity_timeout=>300, max_think_time=>600, …);

The above is an optional step and can be used if the default settings have to be changed.
The pool needs to be started before the clients can request for connections. The command below brings up the Broker, which registers itself with the database listener.

SQL> execute dbms_connection_pool.start_pool;

Once enabled this way, the pool automatically restarts when the instance restarts, unless explicitly stopped by use of the dbms_connection_pool.stop_pool command.
Application Tier Routing client connections to DRCP: Currently DRCP interface is available for OCI and OCCI clients using TCP/IP protocol and simple database authentication (userid/password based). The clients must specify the server type as POOLED via the connect string as shown below:

myhost.dom.com:1521/sales:POOLED
OR
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp) (HOST=myhost.dom.com)
(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=sales)
(SERVER=POOLED)))

Sharing the pooled servers: DRCP guarantees that the pooled servers are never shared across different users. However, DRCP allows for sharing the pooled servers across different instances of the same application. In addition, even for the same user, DRCP maintains a logical grouping of the pooled servers, based on the “connection classes” chosen by the applications. A connection class is a logical name supplied by a client while requesting for a pooled server. It indicates that the client is willing to reuse a pooled server, which was used by other clients using the same logical name.
For example, applications in AP suite may be willing to share the pooled servers among themselves but not among HR suite of applications. Differences in state that the applications leave in the sessions, or some session-specific attributes like language settings etc. may be the factors that influence this decision. Clients can request a brand new session if they cannot reuse a session from the pool.

OCI Clients using DRC

1. Use OCISessionPoolCreate() to create an OCI Session Pool with the DRCP
connect string. This maintains connection persistency with the Broker.
2. Use OCISessionGet() and OCISessionRelease() from that OCISessionPool
which acquire and release pooled servers.
3. Specify a connection class value as an attribute on the auth handle passed to
OCISessionGet call, before making the call.
4. If no connection class is specified, the OCISessionPool’s name is implicitly used as the connection class by all the requests using that OCISessionPool, resulting in sharing only within a session pool, becoming equivalent to a plain client-side session pooling application.

OCCI Clients using DRCP

1. Use Environment::createStatelessConnectionPool() to create an OCCI
Stateless Connection Pool with the DRCP connect string. This maintains
connection persistency with the Broker.
2. Use getConnection(…”APPCC”…) and releaseConnection() from that
StatelessConnectionPool which acquire and release pooled servers.
PHP Clients using DRCP

Oracle plans to work closely with the open source community on enhancing the PHPOCI8 driver to leverage DRCP. This will enable PHP applications to maintain persistent connections with the database with minimal resource constraints.

Tuning DRCP 

Depending on the available hardware resources and concurrency requirements, the pool can be configured for its size. The minsize ensures the pool comes up with and always keeps a certain minimum number of servers. The maxsize puts a cap on the total number of pooled servers. The client requests wait if all the pooled servers are busy and the pool is at its maxsize, till one becomes free.
The inactivity_timeout setting helps the pool to terminate idle pooled servers,
optimizing the resources. To avoid pooled servers permanently being locked up by bad clients or dead clients, max_think_time can be set on the pool. The parameters num_cbrok and maxconn_cbrok can be used to distribute the persistent connections from the clients across multiple brokers. This may particularly be needed in cases where the Operating System limits the maximum number of connections per process.
DBA views are available to monitor the performance of DRCP. The DBA can check the number of busy and free servers, number of hits and misses in the pool against the total number of requests from clients etc. The DRCP configuration parameters can be altered dynamically any time, using bms_connection_pool.alter_param method or dbms_connection_pool.configure_pool method.


DRCP Scalability

DRCP boosts the scalability of the database and the mid-tier, as the persistent
connections to the database are held at minimal cost. The real database connection resources are only used by the active connections, and the scaling of that usage can be explicitly controlled by setting the pool size.
How much of an advantage can this provide?- As each inactive client connection has a very small memory requirement, DRCP can support many times the number of client connections (compared to dedicated and shared servers), when each client connection holds the database session for a short time. In one of our test scenarios on a 2GB system, DRCP was able to support 10 times the number of connections compared to shared servers, and 20 times the number of connections compared to dedicated servers.
Performance measurements were done with a sample OCI client against the Database Resident Connection Pool and the results are shown below. The clients were standalone OCI application processes concurrently requesting for pooled servers and performing query executions and DML operations. The workload chosen was a mix of a READONLY transaction and a READWRITE transaction in the ratio of 3:1. The READONLY transaction included a “get connection” operation, execution of five SELECT statements and a “release connection”. The READWRITE transaction, on the other hand, had the same operations but also included an UPDATE statement. The clients used 15sec think time between requests.
The database instance with DRCP was hosted on a 4 CPU Intel Xeon MP 2.80GHz machine with 2GB RAM, running 32bit Red Hat Enterprise Linux Version 4. The pool was up with one Connection Broker and 100 pooled servers. Oracle 11g Beta5 was used for the client and database software. The CPU and memory utilizations were captured using vmstat command and the throughput was captured using Oracle AWR reporting.
The OS file descriptor limit was set at 20000.
The throughput had scaled linearly as the number of incoming connections grew and the memory required for the connections was minimal, again proportionate to the number of connections.



Summary

The Database Resident Connection Pool is an ideal solution for efficiently handling a large number (in the order of tens of thousands) of connections to Oracle database from clients distributed over multiple processes on multiple hosts.
For more information, please see the following Oracle guides:
• Database Concepts
• Database Administrator’s Guide
• Oracle Call Interface Programmer’s Guide
• Oracle C++ Call Interface Programmer’s Guide
• PL/SQL Packages and Types Reference
• Database Reference

11 December 2009

SOA Development and Architecture

To learn more on SOA Architecture and learn to develop contect rich Web Application look at the following link:

http://www.oracle.com/technology/tech/soa/index.html

10 December 2009

Oracle Fusion Middleware 11g Forum

Oracle Fusion Middleware 11g Forum
The Foundation for Innovation
The Oracle Fusion Middleware 11g Forum is coming to a city near you. Don't miss this exclusive event for IT executives and managers, exploring the latest release of the #1 middleware application infrastructure family to help you to achieve IT efficiency, extend and enhance investments in CRM, ERP and other applications and provide a more agile, cost-effective foundation for innovation.
Join application infrastructure thought leaders and your peers for a range of executive keynotes and technical sessions providing strategies and patterns for making your business and business applications more agile and efficient, enabling greater business insight and improved decision-making. Learn from customer case studies, demonstrations, and discussions, the relevance of Oracle Fusion Middleware 11g to you.
For more information visit the new Oracle Fusion Middleware 11g Launch Cente


Oracle SOA Governance

WHY ORACLE?

END-TO-END SOA GOVERNANCE

Oracle's SOA Governance solution eases the transition of an organization to service-oriented architecture (SOA) by providing a means to reduce risk, maintain business alignment, and show the business value of SOA investments. Oracle's end-to-end SOA governance solution automates essential SOA governance processes, regardless of the status or progress of your SOA transformation. Whether just embarking on an SOA program, or expanding from project or pilot to broader deployment, the Oracle SOA Governance solution guides you along the path to measurable SOA success. The Oracle SOA Governance solution is Oracle Fusion Middleware's strategic approach to governing SOA. Learn more about the role of Oracle SOA Governance in Oracle's middleware strategy.
  • Oracle is a leader in Forrester's SOA Lifecycle Management Wave, via acquisition of BEA
  • Comprehensive support for governing the entire SOA ecosystem
  • Extensive automation of the SOA lifecycle
  • Oracle provides a practical approach to SOA Governance to ensure your success
  • Out-of-the-box support for capturing and measuring your SOA investment


JANUARY 22, 2007

Oracle sows the seeds for SOA

Enriched suite yields a crop of enhancements

An SOA (service oriented architecture) has the appealing allure for reducing costs and improving your company's agility. But, before digging up your existing IT roots, you'll need assurances there's a fortified and fertile ecosystem waiting to support you in those supposedly greener pastures.
[ See also: InfoWorld Technology of the Year Awards Application and Middleware winners ]
What's exciting about the new Oracle SOA Suite 10g Release 3 is the comprehensive scope and breadth of its well-integrated component set that's geared to provide just such an environment.
SOA Suite packs an Oracle ESB (Enterprise Service Bus) for message routing, enrichment, and transformation with good adapters available for plugging into most any existing transport or ERP system in use. And, the Oracle BPEL Process Manager provides an orchestration engine based on native BPEL (Business Process Execution Language) with tools to easily string together complex business flows, human workflow, and exception management.
Topping the stack are the OWSM (Oracle Web Services Manager) -- locking down services with sturdy security and policy management -- and an easy-to-use rules facility, Oracle Business Rules Engine, for processing business logic and authoring customizable rule sets.
Oracle further enriches the suite with its Oracle BAM (Business Activity Monitoring) application, showing good analytics, proactive monitoring, and insight into process optimization with strong dashboard drill-down features.


Click for larger view. 
At the start, I was somewhat apprehensive of the comprehensiveness of the suite: The sheer number of components conjured nightmares from days of monolithic vendor lock-in.

But, fear not. Although Oracle SOA Suite does run Oracle's application server, a number of additional app servers are gearing up for certification. And, the BAM, OWSM, and BPEL PM apps can all be used to manage third-party infrastructure, as well. Oracle includes Oracle JDeveloper for its IDE, but Eclipse will also do the job nicely.
There remains some room for improvement, certainly. The BAM module is currently Windows-only, and globalization/localization across the platform needs improvement. The BPEL Designer for orchestrating services, though great for developers, lacks analyst appeal and would be enhanced by efforts to round out autonomous access for the business-focused. And, the multiple Enterprise Manager interfaces required to administer the suite belies an otherwise well-integrated composition.
Test Center Scorecard
30%20%15%15%10%10%
Oracle SOA Suite 10g Release 3998899
8.7
VERY GOOD