weblogic rac10g 配置ha

wmlm發表於2009-12-15

How-To Configure and Use Oracle Real Application Clusters (RAC) with Oracle WebLogic Server 10.3

http://www.oracle.com/technology/products/weblogic/howto/rac/index.html

[@more@]

How-To Configure and Use Oracle Real Application Clusters (RAC) with Oracle WebLogic Server 10.3

要點

伺服器端tnsnames.ora

HASERVICE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = apemrac1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = apemrac2-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = MYHASERVICE.apemrac.au.oracle.com)
)
)

test.sh

#!/bin/sh
count=0
while [ $count -lt 5 ] # Set up a loop control
do # Begin the loop
count=`expr $count + 1` # Increment the counter
sqlplus -s juser/juser@HASERVICE @test.sql
done

test.sql

col "Instance" format a20
col "Host" format a20
col "Service Name" format a20
select sys_context('userenv', 'instance_name') "Instance",
sys_context('userenv', 'server_host') "Host",
sys_context('userenv', 'service_name') "Service Name"
from dual

/
exit;

Creating the required Data Sources

Create Data Source #1 for first Node
Here let’s connect to the first instance in our RAC node that will be "orcl1" with an URL as following example.

jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = apemrac1-vip)(PORT = 1521))

(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = MYHASERVICE.apemrac.au.oracle.com)

(INSTANCE_NAME = orcl1)))

Create data Source #2 for second Node
Repeat the steps above but this time select the second node in the RAC cluster. This data source will be called "Node2DS" and once again be targeted to the managed server "lemon"

jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = apemrac2-vip)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.apemrac.au.oracle.com)
(INSTANCE_NAME = orcl2)))

Create the Multi Data Source

5


jdbc/racDS
Load-Balancing
Node1DS,Node2DS

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271063/viewspace-1029704/,如需轉載,請註明出處,否則將追究法律責任。

相關文章