Friday, April 2, 2010

Installing Oracle Weblogic Server cluster (2 nodes) on Linux RHEL 5

Here is brief description how to install Oracle WebLogic Servers as cluster under Linux RHEL 5 assuming that there are 2 nodes in.

NODE1:

While installing WebLogic:

1) Create domain (say WLDM)
2) In optional configuration check as the following:

 Select Optional Configuration:
------------------------------

1|Administration Server [x]
2|Managed Servers, Clusters and Machines [x]
3|RDBMS Security Store [ ]



3) Do necessary settings for Admin Console
4) DO necessary settings for each Managed server. Please note that you need to set up settings for the second node Managed server as well before it will be installed.

 

Configure Managed Servers:
--------------------------

Add or delete configuration information for Managed Servers. A typical production environment has one or more Managed Servers. Each Managed Server is an
instance of WebLogic Server used to host enterprise applications.

| Name* | Listen address* | Listen port | SSL listen port | SSL enabled |
_|__________|_________________|_____________|_________________|_____________|
1| MS1 | 10.10.10.133 | 7003 | 7503 | true |
2->| MS2 | 10.10.10.134 | 7003 | 7503 | true |



5) Configure Cluster.


 
Configure Clusters:
-------------------

Add or delete configuration information for clusters. A cluster consists of multiple server instances working together to provide increased scalability
and reliability.

| Name* | Cluster messaging mode | Multicast address | Multicast port | Cluster address |
_|___________|________________________|___________________|________________|_________________|
1->| WLCL | unicast | N/A | N/A | |




6) Assign Managed Servers to Clusters:

 

Assign Servers to Clusters:
---------------------------

Assign Managed Servers to a cluster in the domain.

Cluster
|_____WLCL [1]
|_____MS1
|_____MS2




7) Configure machines and assign machines to Managed servers. Please note there are two types of machines differed by non-Unix/Unix. You need to fill the only type for each of the node otherwise you will get duplication by machines.

8) Finish installing process by exact installing Domain right after all the setting commited.

 **** Domain Created Successfully! ****


NODE2:

Start installing Weblogic as you did in node1

1) Create domain the same as we pointed in node1
2) In optional configureation check as follows:

 

Select Optional Configuration:
------------------------------

1|Administration Server [ ]
2|Managed Servers, Clusters and Machines [x]
3|RDBMS Security Store [ ]


3) Do necessary setting for exact MS2 Managed server that we did in node1:

 

Configure Managed Servers:
--------------------------

Add or delete configuration information for Managed Servers. A typical production environment has one or more Managed Servers. Each Managed Server is an
instance of WebLogic Server used to host enterprise applications.

| Name* | Listen address* | Listen port | SSL listen port | SSL enabled |
_|__________|_____________________|_____________|_________________|_____________|
1->| MS2 | 10.10.10.134 | 7003 | 7503 | true |



4) Skip cluster and machine configureation settings
5) Finish installing process by exact installing Domain right after all the setting commited.

 **** Domain Created Successfully! ****



Now you can start node1 Admin Console and Managed server with Managed server at node2. Please note that Admin Console required to be start first once it controls the cluster.

Monday, March 22, 2010

Oracle BI Publisher + Digital signature (Digital ID)

Oracle BI Publisher has an feature related to digital signature in PDF documents.

Here is some requirements to do in order to use the feature:

1. You need up and running Oracle BI Scheduler. In order to run scheduler you need to create specific schema manually and deploy the database objects via Oracle BI Publisher.

2. It's required to add Oracle Security Developer Tools JARs to your application server (particullary, JARs which usually goes, for instance, with Oracle Client. Without JARs you're not able to use digital signature which cause stuck of scheduler job in Running state.

3. Create manually or use existing PFX (Personal Information Exchange) file with private and public key ((here is good explanation how to create PFX file manually: http://blogs.msdn.com/maximelamure/archive/2007/01/24/create-your-own-pfx-file-for-clickonce.aspx) and upload it as Digital ID in Oracle BI Publisher Admin Console. Give appropriate rights to user groups which are allowed to sign documents.

4. Create report in BI Publisher by uploading template with signature area. You can also manually add signature area in BI Publisher in report configure page.


5. Create a job to generate the report in BI Publisher Scheduler.

6. Once report succcessfully cooked you could download PDF with your digital ID.

Tuesday, March 2, 2010

Balancing and proxying. Apache 2.2 + mod_proxy_balancer + Clustered Oracle WebLogic Managed servers

Recently i was working around the task aimed to realize simple loadbalancing between to clustered Oracle WebLogic servers and proxing facilities to pass external request to our intranet for specific Oracle BI application (analytics). In the front-end tier I've used Apache 2.2 with mod_proxy_balancer module on Linux RHLE 5. Additionally WebLogic servers were in intranet whereis web server looking to external network. So below the setting that i've added into Apache's httpd.conf web server side to make external access possible with loadbalancing by requests.

Assume that we have servers like below:

Level 1: Internet - Apache 2.2 HTTP server + mod_proxy_balancer (www.mydomain.com)
Level 2: Intranet - Oracle WebLogic Managed server 1 (clustered) (intradomain1.com - 10.10.10.133)
Level 2: Intranet - Oracle WebLogic Managed server 2 (clustered) (intradomain2.com - 10.10.10.134)


httpd.conf:

....

  
#Switching off facilities of forwarding proxy server
ProxyRequests Off

#Actual balancing settings with two members of balancer group. Balancer is accessed by balancer://lb link.
#ProxySet lbmethod sets balancer load-balance method as byrequest to perform weighted request counting.
#loadfactor is normalized weighted load applied to the worker. I set it to 50/50 to equal balancing between nodes.
#route is a value appended to session id. Usually used with inside balancers, for instance, when we need to used predefined requests direction using subsequent balancers.

<Proxy>
BalancerMember http://10.10.10.133:7003 loadfactor=50 route=r1
BalancerMember http://10.10.10.134:7003 loadfactor=50 route=r2
ProxySet lbmethod=byrequest
</Proxy>

#Allow everyone to access any proxied content
<Proxy *>
Order deny,allow
Allow from all
</Proxy>

#Every request to http://www.mydomain.com/analytics goes through Apache balancer to pass into intranet Weblogic application servers.
ProxyPass /analytics balancer://lb/analytics/

#Reverse intranet servers requests back
ProxyPassReverse / balancer://lb/analytics/
ProxyPassReverse / http://10.10.10.133/analytics/
ProxyPassReverse / http://10.10.10.134/analytics/

#Set location accessable by http://www.mydomain.com/lbm to see actual balancing state.
<Location>
SetHandler balancer-manager
</Location>



ProxyPass directive allows remote servers to be mapped into the space of the local server; the local server does not act as a proxy in the conventional sense, but appears to be a mirror of the remote server. The local server is often called a reverse proxy or gateway. The path is the name of a local virtual path; url is a partial URL for the remote server and cannot include a query string.

ProxyPassReverse
directive lets Apache adjust the URL in the Location, Content-Location and URI headers on HTTP redirect responses. This is essential when Apache is used as a reverse proxy (or gateway) to avoid by-passing the reverse proxy because of HTTP redirects on the backend servers which stay behind the reverse proxy.

Only the HTTP response headers specifically mentioned above will be rewritten. Apache will not rewrite other response headers, nor will it rewrite URL references inside HTML pages. This means that if the proxied content contains absolute URL references, they will by-pass the proxy. A third-party module that will look inside the HTML and rewrite URL references is Nick Kew's mod_proxy_html
.

For details please check documentation:
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html


Please note with setting i've mentioned if there is no session's replication between application servers you could have a problems with application access or its work. The one of the other possible solution is to use session ID as identifier of the backend node e.g preventing of switching nodes in the same session (it's called sticky session). I'm going to describe in future posts how to make replication and how to use session ID to identify required destination.

Tuesday, February 24, 2009

DBAs script bunches

http://www.shutdownabort.com/

Tuesday, February 3, 2009

/*+ PRECOMPUTE_SUBQUERY */

Here is some interesting findings:

Multipart cursor subexecution and PRECOMPUTE_SUBQUERY hint

Some explanation at OTN: precompute_subquery hint

Monday, February 2, 2009

Here is simple example of common mistake:

SQL> drop table t
2 /

Table dropped
SQL> create table t
2 as
3 select level as num from dual connect by level <= 100
4 /

Table created

SQL> begin
2
3 savepoint a;
4
5 execute immediate 'truncate table t';
6
7 insert into t
8 select level+100 from dual connect by level <= 100;
9
10 raise_application_error( -20000,'Fake exception');
11
12 exception
13 when others then
14 rollback to a;
15 raise;
16 end;
17 /

begin

savepoint a;

execute immediate 'truncate table t';

insert into t
select level+100 from dual connect by level <= 100;

raise_application_error( -20000,'Fake exception');

exception
when others then
rollback to a;
raise;
end;

ORA-01086: savepoint 'A' never established
ORA-06512: at line 15
ORA-20000: Fake exception


The cause of rollback failure is that rollback to savepoint A operation could be completed after commitment by DDL statement.

Thursday, January 29, 2009

bind peeking and execution plan...

It's gone long time since i've posted my first blog message but this year i'm going to be more active here :)

The first post of this year intends to share nice articles about bind peeking and execution plans:

1. Karen Morton's blog introduced the article - "Dynamic" WHERE clauses that aren't
2. The Great
Jonathan Lewis blog - Conditional SQL (2)
3. The article by Alex Fatkulin - Stabilize Oracle 10G’s Bind Peeking Behaviour by Cutting Histograms