Host后面的别名可以在/etc/hosts里面配置!
以下是Oracle官方相关文档:
3.2 Using Oracle RAC Databases for Oracle Identity Manager
This section explains how to deploy Oracle Real Application Clusters (Oracle RAC) databases for Oracle Identity Manager and contains the following sections:
Installing Oracle Identity Manager for Oracle RAC
Oracle RAC Net Services
JDBC and Oracle RAC
Configuring JBoss Application Server for Oracle RAC
3.2.1 Installing Oracle Identity Manager for Oracle RAC
Oracle RAC is a cluster database with a shared cache architecture that provides highly scalable and available database solutions. Oracle RAC consists of multiple database instances on different computers. These database instances act in tandem to provide database solutions.
Note:
The Oracle Identity Manager Installer program does not provide support for Oracle RAC. To deploy Oracle Identity Manager for Oracle RAC, you must install Oracle Identity Manager on a single database instance in Oracle RAC and then change the application server settings, specifically the connection pool parameters, to use the Oracle RAC JDBC connection string.
To install Oracle Identity Manager for Oracle RAC:
Ensure that Oracle RAC is properly set up and configured with the Oracle Identity Manager schema owner.
Start the Oracle Identity Manager Installer.
On the Database Parameters page of the installer, enter the host name, port number, and database name of a single database instance in Oracle RAC.
Complete the Oracle Identity Manager installation by performing the steps in the installer.
Configure your application server for Oracle RAC by referring to Configuring JBoss Application Server for Oracle RAC.
3.2.2 Oracle RAC Net Services
The net services name entry for an Oracle RAC database differs from that of a conventional database. The following is an example of the net services name entry for an Oracle RAC database:
racdb= (DESCRIPTION= (LOAD_BALANCE=off) (FAILOVER=on) (ADDRESS_LIST= (ADDRESS=(protocol=tcp)(host=node1-vip)(port=1521)) (ADDRESS=(protocol=tcp)(host=node2-vip)(port=1521))) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=racdb)))
Table 3-2 lists and describes the parameters in a net services name entry for an Oracle RAC database.
Table 3-2 Parameters for Oracle RAC Database Net Services Name Entries
ParameterDescription
LOAD_BALANCE
Specifies whether client load balancing is enabled (on) or disabled (off). The default setting is on.
FAILOVER
Specifies whether failover is enabled (on) or disabled (off). The default setting is on.
ADDRESS_LIST
Specifies the list of all the nodes in Oracle RAC, including their host names and the ports at which they listen.
3.2.3 JDBC and Oracle RAC
JDBC client applications using the Thin driver to connect to an Oracle RAC database must use the Oracle RAC net services name as a part of the JDBC URL. The entire Oracle RAC net services name is concatenated and the entire string is used in the JDBC URL so that the client application can connect to Oracle RAC.
The following sample code shows how a JDBC URL is used to connect to an Oracle RAC database:
//String url = "jdbc:oracle:thin:@dbhost:1521:dbservice"String racUrl ="jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=off)(FAILOVER=on)(ADDRESS_LIST=(ADDRESS=(protocol=tcp)(host=node1-vip)(port=1521))(ADDRESS=(protocol=tcp)(host=node2-vip)(port=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=racdb)))"; String strUser = "username"; String strPW = "password"; // load Oracle driver Class.forName("oracle.jdbc.driver.OracleDriver"); // create the connection con = DriverManager.getConnection(strURL, strUser, strPW);
The subsequent sections about configuring application servers for Oracle RAC databases explain how to modify connection pools to use a similar JDBC URL so the application server can communicate with Oracle RAC.
3.2.4 Configuring JBoss Application Server for Oracle RAC
This section explains how to configure JBoss Application Server (nonclustered or clustered) for Oracle RAC by ensuring that the data sources and connection pools are configured to use the Oracle RAC JDBC connection string.
See Also:
For information about avoiding split branches of a distributed transaction between Oracle Identity Manager and RAC, see Best Practices for Using XA with RAC document. You can find this document by searching the Oracle Technology Network at
http://www.oracle.com/technology/index.html
To configure nonclustered or clustered JBoss Application Server for Oracle RAC:
Get the RAC net services name from the tnsnames.ora file.
Construct the RAC JDBC URL. See "JDBC and Oracle RAC" for instructions.
Open the OIM_HOME
/xellerate/config/xlconfig.xml
file.
Locate the <DirectDB> section and replace the value of the <url>...</url> tag with the Oracle RAC JDBC URL. For example, the new tag can be similar to the following:
<url>jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=off)(FAILOVER=on)(ADDRESS_LIST=(ADDRESS=(protocol=tcp)(host=node1-vip)(port=1521))(ADDRESS=(protocol=tcp)(host=node2-vip)(port=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=racdb)))</url>Save and close the OIM_HOME
/xellerate/config/xlconfig.xml
file.
If you are configuring a nonclustered JBoss Application Server environment, open the JBOSS_HOME
/server/default/deploy/xell-ds.xml
file.
If you are configuring a clustered JBoss Application Server environment, open the JBOSS_HOME
/server/all/farm/xell-ds.xml
file for each node in the cluster.
These files contain entries with the XA and non-XA datasources.
Locate the <datasources>.<local-tx-datasource>.<connection-url> entry.
Change the value of this entry to the JDBC URL described in step 4.
Locate the <datasources>.<xa-datasource>.<xa-datasource-property name="URL"> entry.
Change the value of this entry to the JDBC URL described in step 4.
Save and close the file.
Restart JBoss Application Server. For JBoss clusters, restart all nodes in the cluster.