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)) |
Create the Multi Data Source
<jdbc-connection-pool-params>
<test-frequency-seconds>5</test-frequency-seconds>
</jdbc-connection-pool-params>
<jdbc-data-source-params>
<jndi-name>jdbc/racDS</jndi-name>
<algorithm-type>Load-Balancing</algorithm-type>
<data-source-list>Node1DS,Node2DS</data-source-list>
- 1250 - ORA-00911: invalid character
- 1251 - SQL command not properly ended
- 1252 - linq to sql 的实体如何序列
- 1253 - LINQ并发问题
- 1254 - System.NullReferenceException: 未将对象引用设置到对象的实例
- 1255 - Linq ToList出错
- 1256 - The null value cannot be assigned to a member with type System.Int32 which is a non-nullable value type
- 1257 - 错误6无法将类型
- 1258 - SubmitChanges
- 1259 - System.ObjectDisposedException: 无法访问已释放的对象。
- 1260 - ORA-01747: 无效的用户.表.列
- 1261 - 服务器未启动和运行
- 1262 - java.lang.reflect.invocationtargetexception
- 1263 - insert抛出异常
- 1264 - Error verifying method
- 1265 - org.springframework.jdbc.UncategorizedSQLException: Hibernate operation
- 1266 - Exception抛出
- 1267 - 找不到类异常
- 1268 - java的异常处理如何能用它写错误日志
- 1269 - 死循环