4 Using wsadmin to Configure Oracle Fusion Middleware

The wsadmin tool is a command-line utility that you can use in interactive mode to configure IBM WebSphere cells. You can also use wsadmin commands in Jython scripts to automate cell management.

This chapter provides various examples of how to use wsadmin commands to perform configuration tasks. It contains the following sections:

Note:

In the examples in this chapter, any output shown for a wsadmin command is displayed only if the command is executed in interactive mode. Output is not displayed when wsadmin scripts are executed.

For information about Oracle-specific wsadmin commands, see Chapter 5, "wsadmin Command Reference." For additional information about wsadmin, see "Using the Oracle Fusion Middleware wsadmin Commands" in Oracle Fusion Middleware Third-Party Application Server Guide.

4.1 Prerequisite Environment Setup

Before you can use wsadmin to configure Oracle Fusion Middleware products in a cell, you must use the IBM WebSphere manageprofiles.sh command (UNIX) or manageprofiles.cmd command (Windows) to set up the initial Deployment Manager profile and the empty custom profile that are needed for configuration. The following sections describe how to do this in an IBM WebSphere ND environment and an IBM WebSphere AS environment.

Note:

You do not have to perform the steps in this section if you have already used the Configuration Wizard to create the initial Deployment Manager profile and custom profile.

4.1.1 Environment Setup for IBM WebSphere ND

Before you can use wsadmin to configure your Oracle Fusion Middleware products in an IBM WebSphere ND environment, you must first create a management profile with a serverType of DEPLOYMENT_MANAGER. You must also federate (add) an empty custom profile to the Deployment Manager.

The following script uses IBM WebSphere commands to:

  • Create the Deployment Manager profile and Deployment Manager on the local machine

  • Set the Administrator user name and password for the Deployment Manager

  • Create an empty custom profile

  • Start the Deployment Manager (required to federate the custom node)

  • Federate the custom node to the local machine

  • Shut down the custom node

  • Shut down the Deployment Manager

Note:

The commands used to set up the environment in a Windows operating system are the same as in a UNIX operating system, except that all paths use back slash (\) instead of forward slash (/), and all command names have a .cmd extension instead of a .sh extension.

The script assumes that the $WAS_HOME environment variable has been defined as the IBM WebSphere home directory:

## Create the Deployment Manager profile and Deployment Manager, and define
## the Administrator user name and password. serverType must be
## DEPLOYMENT_MANAGER.
${WAS_HOME}/bin/manageprofiles.sh -create -templatePath ${WAS_HOME}
/profileTemplates/management -serverType DEPLOYMENT_MANAGER
-enableAdminSecurity true -adminUserName yourAdminUserName -adminPassword yourAdminPassword
 
## Create an empty custom profile. The default custom profile name is Customnn,
## where nn is the next available value in the sequence, starting with 01.
## When you are creating the first custom profile in the cell, the profile name 
## is typically Custom01. 
${WAS_HOME}/bin/manageprofiles.sh -create -templatePath ${WAS_HOME}/profileTemplates/managed
 
## Start the Deployment Manager and federate the custom node on the same machine.
## The startManager.sh command must be issued from the Deployment Manager profile
## directory, Dmgr01. The DepMgrSOAPPort can be determined by opening the file
## $WAS_HOME/profiles/Dmgr01/logs/AboutThisProfile.txt.
${WAS_HOME}/profiles/Dmgr01/bin/startManager.sh
${WAS_HOME}/bin/addNode.sh localhost DepMgrSAOPPort -user yourAdminUserName -password yourAdminPassword -profileName CustomProfileName
 
## Stop the custom node and Deployment Manager.
${WAS_HOME}/profiles/CustomProfileName/bin/stopNode.sh -user yourAdminUserName -password yourAdminPassword
${WAS_HOME}/profiles/Dmgr01/bin/stopManager.sh -user yourAdminUserName -password yourAdminPassword

4.1.2 Environment Setup for IBM WebSphere AS

Before you can use wsadmin to configure your Oracle Fusion Middleware products in an IBM WebSphere AS environment, you must first create an Application Server profile. To do so, enter the following commands. This command assumes that the $WAS_HOME environment variable has been defined as the WebSphere home directory.

  • UNIX:

    ## Create the Application Server profile and define the Administrator user 
    ## name and password.
    ${WAS_HOME}/bin/manageprofiles.sh -create -templatePath 
    ${WAS_HOME}/profileTemplates/default -enableAdminSecurity true
    -adminUserName yourAdminUserName -adminPassword yourAdminPassword
    
  • Windows:

    WAS_HOME\bin\manageprofiles.cmd -create -templatePath 
    WAS_HOME\profileTemplates\default -enableAdminSecurity true
    -adminUserName yourAdminUserName -adminPassword yourAdminPassword
    

    In these commands, WAS_HOME represents the IBM WebSphere home directory.

4.1.3 Prerequisites for DB2 Databases

If you are using a DB2 database, you must perform the steps in this section prior to using wsadmin to configure FMW products.

Note:

As an alternative to these steps, you can use the IBM WebSphere Administrator Console to set the DB2_JCC_DRIVER_PATH variable to the DB2 driver directory path.
  1. On the Deployment Manager machine, run wsadmin, specifying the Deployment Manager profile. For example, to run wsadmin for the Dmgr01 profile on a UNIX operating system, enter the following command:

    $MW_HOME/oracle_common/common/bin/wsadmin.sh -profileName Dmgr01

    Note:

    Before performing Step 2, do not execute the OracleMWConfig.startConfig() command to start a configuration session. The following command should be executed outside of a configuration session.
  2. Enter the following command at the wsadmin> prompt:

    AdminTask.setVariable('[-variableName DB2_JCC_DRIVER_PATH -variableValue Db2DriverDirectory -scope Cell=cellName, Node=nodeName]')

    In this command, Db2DriverDirectory is the full path to the directory in which the DB2 drivers are located on the Deployment Manager node, cellName is the name of the cell, and nodeName is the name of the Deployment Manager node.

    Note:

    Ensure that the DB2 JAR files db2jcc4.jar and db2jcc_license_cu.jar are stored in the Db2DriverDirectory.
  3. For each Application Server node in the cell, enter the following command at the wsadmin> prompt:

    AdminTask.setVariable('[-variableName DB2_JCC_DRIVER_PATH -variableValue Db2DriverDirectory -scope Cell=cellName, Node=nodeName]')

    In this command, Db2DriverDirectory is the full path to the directory in which the DB2 drivers are located on the Application Server node, cellName is the name of the cell, and nodeName is the name of the Application Server node.

    Note:

    Ensure that the DB2 JAR files db2jcc4.jar and db2jcc_license_cu.jar are stored in the Db2DriverDirectory on the specified Application Server node.
  4. Enter the following command to save your changes:

    AdminConfig.save()

  5. Enter exit to exit from the wsadmin session.

Whenever you add a new Application Server node to the cell, repeat this procedure, skipping Step 2.

Note:

When configuring data sources for DB2, make sure that you set the DatabaseType attribute to DB2.

4.2 Starting and Ending a Configuration Session

To start a wsadmin configuration session, run the wsadmin command either in interactive mode or scripting mode as described in "Starting the Oracle Fusion Middleware Wsadmin Command-Line Shell and Connecting to the Deployment Manager" in Oracle Fusion Middleware Third-Party Application Server Guide.

Whether executing wsadmin commands from the command line or from within a script, you must use the following command to start a new configuration session. This command loads the cell configuration for the Deployment Manager to which you connected.

OracleMWConfig.startConfig()

After completing the configuration, use the following command to save your configuration changes and end the configuration session:

OracleMWConfig.endConfig()

Caution:

If you do not use the endConfig() command to end your configuration session, any changes you made during the session will not be saved.

To exit the wsadmin utility after completing a configuration session, enter exit.

4.3 Adding an Oracle Fusion Middleware Product to a Cell

Example 4-1 demonstrates how to add an Oracle Fusion Middleware product to a cell. To add a product, you select the appropriate product template JAR file. The template JAR files that are used to configure your products in a cell are included with your product installation in the ORACLE_COMMON_HOME/common/templates/was directory.

Example 4-1 Adding a Product to a Cell

# Get the location of the ORACLE_COMMON_HOME directory.
commonHome = java.lang.System.getProperty("COMMON_COMPONENTS_HOME")
 
# Start Oracle Fusion Middleware product configuration. 
OracleMWConfig.startConfig()
 
# Specify the path to the templates being applied to the cell.
# In this example, the SOA Management template is selected. To specify another
# template, enter the appropriate template name. You can include multiple
# OracleMWConfig.selectTemplate() commands to select multiple templates.
OracleMWConfig.selectTemplate(commonHome + '/common/templates/was/oracle.soa.mgmt_template_11.1.1.jar')
 
# Load all the templates that are selected in the current configuration session.
OracleMWConfig.loadTemplates()
 
# Apply all newly loaded templates and save the changes to the cell.
OracleMWConfig.endConfig()

4.4 Adding a New Server to a Cell

Example 4-2 demonstrates how to add a new server to a cell. It also demonstrates how to configure and validate the end points on the new server.

Example 4-2 Adding a New Server to a Cell

# Create a new server.
atts = []
atts.append(['Name','Myserver'])
atts.append(['NodeName','TEST01Node01'])
atts.append(['DevelopmentMode','true'])
newServer = OracleMWConfig.create('Server',atts)
 
# List the attributes and types supported for the server type.
newServer.show()

[ar-] Name [Myserver]
[ar-] NodeName [TEST01Node01]
[arw] DevelopmentMode [true]
[trw] ListenerAddress
 
# Create the listener address
listenerAddress = newServer.create('ListenerAddress',None)
 
# List the attributes and types supported for the listener address type.
listenerAddress.show()
>>>>> Output:
[trw] AdminListenerAddress
[trw] AdminSSLListenerAddress
[trw] HttpListenerAddress
[trw] HttpsListenerAddress
[trw] SoapListenerAddress
[trw] SibListenerAddress
[trw] SibSSLListenerAddress
[trw] BootstrapListenerAddress
 
# Create and set ports and hosts for the end points.
atts = []
atts.append(['Host','localhost'])
atts.append(['Port','9000'])
endpoint = listenerAddress.create('HttpListenerAddress',atts)
 
atts = []
atts.append(['Host','localhost'])
atts.append(['Port','9001'])
endpoint = listenerAddress.create('AdminListenerAddress',atts)
 
# Validate the ports (check for port conflicts).
OracleMWConfig.validateConfig('InternalPortConflict')
OracleMWConfig.validateConfig('ExternalPortConflict')

4.5 Configuring Host and Port Settings for End Points

The examples in this section show two methods that you can use to configure the end points on a server.

Example 4-3 demonstrates how to use basic configuration commands to:

  • List all available servers

  • Display the available listener ports for a server

  • Display the current setting for a specific end point

  • Change both the host and port for that end point

Example 4-3 Configuring Host and Port Settings for End Points

# List all available servers.
servers  = OracleMWConfig.getChildren('Server')
 
# Print all servers.
print servers
>>>>output:
[Server(dmgr), Server(OracleAdminServer), Server(nodeagent), Server(soa_server1), 
Server(test), Server(Myserver)]
 
# Find a server by using name and scope.
adminServer = OracleMWConfig.getChildByName('Server','OracleAdminServer')
 
# Find the listener addresses.
listenerAddress = adminServer.getChildren('ListenerAddress')
 
# Print the listener addresses.
print listenerAddress[0].show()
>>>>output:
[trw] AdminListenerAddress
[trw] AdminSSLListenerAddress
[trw] HttpListenerAddress
[trw] HttpsListenerAddress
[trw] SoapListenerAddress
[trw] SibListenerAddress
[trw] SibSSLListenerAddress
[trw] BootstrapListenerAddress
 
# Find a specific end point.
adminListenerAddress = listenerAddress[0].getChildren('AdminListenerAddress')
 
# Print existing end point details.
print adminListenerAddress[0].show()
>>>>output:
[arw] Host [*]
[arw] Port [9001]
[arw] Enable [true]
 
# Update the host and port for the above end point, and do the same procedure for 
# other end points.
adminListenerAddress[0].setValue('Host','localhost')
adminListenerAddress[0].setValue('Port','8000')
 
# Print the updated end point details.
print adminListenerAddress[0].show()
>>>>output:
[arw] Host [localhost]
[arw] Port [8000]
[arw] Enable [true]

Example 4-4 demonstrates how to use basic configuration commands and configuration utility commands to:

  • List all available servers

  • Find the node name for a specific server

  • List the attributes and end points for a specific server and node name

  • Get the current host name and port for a specific listener address for a specific server and node name

  • Set the host name and port for a specific listener address for a specific server and node name

Example 4-4 Configuring End Points by Using Utility Commands

# List all available servers.
servers  = OracleMWConfig.getChildren('Server')
 
# Print all servers.
print servers
>>>>output:
[Server(dmgr), Server(OracleAdminServer), Server(nodeagent), Server(soa_server1)
, Server(test), Server(Myserver)]
 
# Find a server by using name and scope.
adminServer = OracleMWConfig.getChildByName('Server','OracleAdminServer')
 
# Find the node for a server.
print adminServer.getValue('NodeName')
>>>>output:
TEST01Node01
 
# List the attributes for a server name and node name.
print OracleMWConfigUtilities.showServer('OracleAdminServer','TEST01Node01')
>>>>output:
[ar-] Name [OracleAdminServer]
[ar-] NodeName [myeole-lapNode04]
[arw] DevelopmentMode [false]
[trw] ListenerAddress
 
# List the end points for a server name and node name.
print OracleMWConfigUtilities.showEndPointsUsingObject('OracleAdminServer','TEST01Node01')
>>>>output:
[trw] AdminListenerAddress
[trw] AdminSSLListenerAddress
[trw] HttpListenerAddress
[trw] HttpsListenerAddress
[trw] SoapListenerAddress
[trw] SibListenerAddress
[trw] SibSSLListenerAddress
[trw] BootstrapListenerAddress
 
# List the host and port of an end point for a specified server name and node 
# name.
host = OracleMWConfigUtilities.getEndPointHostUsingName('OracleAdminServer','TEST01Node01','AdminListenerAddress')
port = OracleMWConfigUtilities.getEndPointPortUsingName('OracleAdminServer','TEST01Node01','AdminListenerAddress')
print host
print port
 
# Set the host and port of an end point for a specified server name and node 
# name.
host = OracleMWConfigUtilities.setEndPointHostUsingName('OracleAdminServer','TEST01Node01','HttpListenerAddress','localhost')
port = OracleMWConfigUtilities.setEndPointPortUsingName('OracleAdminServer','TEST01Node01','HttpListenerAddress','9001')

4.6 Creating Servers, Clusters, and Cluster Members

Example 4-5 demonstrates how to:

  • Create a new server

  • Create a cluster and use the previously created server as the primary cluster member

  • Add a new server (cluster member) to the cluster

The new cluster member automatically inherits its attributes from the primary cluster member. For more information about clusters, see Section 1.5, "Creating Clusters and Cloning Application Servers."

Example 4-5 Creating Servers, Clusters, and Cluster Members

# Create a new server. Note that embedded spaces are not allowed in server names.
#
newServerName1 = 'MyServer1'
node = 'TEST01Node01'
atts = []
atts.append(['Name', newServerName1])
atts.append(['NodeName', node])
atts.append(['DevelopmentMode', 'false'])
newServer = OracleMWConfig.create('Server',atts)
Server: MyServer1 successfully created
 
# Create a new cluster.
newClusterName = 'MyCluster'
atts = []
atts.append(['Name', newClusterName])
atts.append(['EnableHA', 'true'])
atts.append(['FirstClusterMember', newServerName1])
newCluster = OracleMWConfig.create('ServerCluster', atts)
ServerCluster: MyCluster successfully created
 
# Create a new server (a new cluster member).
newServerName2 = 'MyServer2'
atts = []
atts.append(['Name', newServerName2])
atts.append(['NodeName', node])
atts.append(['ClusterName', newClusterName])
atts.append(['DevelopmentMode', 'false'])
newServer1 = OracleMWConfig.create('ClusterMember', atts)
ClusterMember: MyServer2 successfully created

# Clone a server
serverName = 'MyServer1'
server_to_clone = OracleMWConfig.getChildByName('Server',serverName)
atts = []
atts.append(['Name','MyServer1c'])
atts.append(['NodeName','TEST01Node01'])
OracleMWConfig.clone(server_to_clone,atts)
Server : MyServer1 successfully cloned as MyServer1c
Server(MyServer1c)

4.7 Setting File Store Shared Directories for a Cluster

Example 4-6 demonstrates how to:

  • Display a list of the available service buses

  • Set the file store shared directories for a service bus.

As described in the example comments, there are two ways you can do this.

Example 4-6 Setting File Store Shared Directories

# 
buses = OracleMWConfig.getChildren('SIBus')
busNm = buses[0].getValue('Name')
 
# Set the file store directories.
# Use this command or individual commands below to set file store directories.
# OracleMWConfigUtilities.setFileStoreDirectory('LogDirectory', 'Mycluster',
# busNm, '${USER_INSTALL_ROOT}/log')
 
OracleMWConfigUtilities.setLogDirectory(newClusterName, busNm, '${USER_INSTALL_ROOT}/log')
OracleMWConfigUtilities.setPermanentStoreDirectory(newClusterName, busNm, '${USER_INSTALL_ROOT}/permStore')
OracleMWConfigUtilities.setTemporaryStoreDirectory(newClusterName, busNm, '${USER_INSTALL_ROOT}/tempStore')

4.8 Creating and Deleting a Data Source

Example 4-7 demonstrates how to create a new Oracle JDBC data source. You can use the same script to create a DB2 data source by specifying 'DB2' as the DatabaseType.

Example 4-7 Creating a New Data Source

atts = []
atts.append(['Name','myNewDatasource'])
atts.append(['Username','websphere'])
atts.append(['Password','welcome1'])
atts.append(['DatabaseType', 'Oracle'])
# NOTE: Use 'DB2' as the DatabaseType for DB2 data sources.
atts.append(['DatabaseName', 'orcl'])
atts.append(['ServerName', 'example.host.com'])
atts.append(['PortNumber', '1521'])
atts.append(['IsXa', 'true'])
atts.append(['JndiName', 'myJNDI'])
atts.append(['Server', 'soa_server1'])
 
newDS = OracleMWConfigUtilities.createDatasource(atts)
print newDS.show()
>>>>> Output:
[ar-] Name [myNewDatasource]
[ar-] Type [Normal]
[arw] Username [websphere]
[a-w] Password [********]
[arw] DatabaseName [orcl]
[arw] ServerName [example.host.com]
[arw] PortNumber [1521]
[ar-] URL [jdbc:oracle:thin:@example.host.com:1521/orcl]
[arw] DatabaseType [Oracle]
[arw] DriverType [4]
[arw] IsXa [true]
[arw] IsOracleInstanceType [false]
[arw] IsRac [false]
[ar-] DriverClass [oracle.jdbc.xa.client.OracleXADataSource]

Example 4-8 demonstrates how to delete a data source.

Example 4-8 Deleting a Data Source

dbWrapper = OracleMWConfig.getChildByName('JDBC', 'myNewDatasource')
OracleMWConfig.delete(dbWrapper)

4.9 Changing a Data Source to an Oracle RAC Data Source

The examples in this section show two methods that you can use to change a standard data source to an Oracle RAC data source.

Example 4-9 demonstrates how to convert a standard data source to an Oracle RAC data source using the convertJdbcNormalDatasourceToRAC command, and then how to display the data source configuration.

Example 4-9 Converting a Data Source to an Oracle RAC Data Source

hostPortList = ['hostExampleRac1.oracle.com:1521','hostExampleRac2.oracle.com:1234','hostExampleRac3.oracle.com:4567']
OracleMWConfigUtilities.convertJdbcNormalDatasourceToRAC('TestNormalDatasource', 'myRACService', hostPortList)
print OracleMWConfigUtilities.showJdbc('TestNormalDatasource')

[ar-] Name [TestNormalDatasource]
[ar-] Type [Normal]
[arw] Username [wlsqa]
[arw] Password [*****]
[arw] DatabaseName [lnrac1]
[arw] ServerName [hostExampleRac1.oracle.com:hostExampleRac2.oracle.com:hostExampleRac3.oracle.com]
[arw] PortNumber [1521:1234:4567]
[ar-] URL [jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(
HOST=hostExampleRac1.oracle.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=hostExa
mpleRac2.oracle.com)(PORT=1234))(ADDRESS=(PROTOCOL=TCP)(HOST=hostExampleRac3.ora
cle.com)(PORT=4567))(FAILOVER=ON)(LOAD_BALANCE=ON))(CONNECT_DATA=(SERVER=DEDICAT
ED)(SERVICE_NAME=myRACService)))]
[arw] DatabaseType [Oracle]
[arw] DriverType [4]
[arw] IsXa [true]
[arw] IsOracleInstanceType [false]
[arw] IsRac [true]
[ar-] DriverClass [oracle.jdbc.xa.client.OracleXADataSource]

Example 4-10 demonstrates how to change a standard data source to an Oracle RAC data source using setValue commands, and then how to display the data source configuration.

Example 4-10 Changing a Data Source to an Oracle RAC Data Source Using setValue()

testDS = OracleMWConfig.getChildByName('JDBC', 'TestNormalDatasource')
testDS.setValue('DatabaseName', 'lnrac1')
testDS.setValue('Username', 'websphere')
testDS.setValue('Password', 'welcome1')
testDS.setValue('IsXa', 'false')
testDS.setValue('IsRac', 'true')
testDS.setValue('RacService', 'exampleRacService')
testDS.setValue('ServerName', 'hostRac1.oracle.com:hostRac2:hostRac3.oracle.com')
testDS.setValue('PortNumber', '1521:1521:1521')
url_testDS = testDS.getValue('URL')
driverClass = testDS.getValue('DriverClass')
# Show testDS object's configuration settings:
print testDS.show()
>>>>> Output:
[ar-] Name [TestNormalDatasource]
[ar-] Type [Normal]
[arw] Username [websphere]
[a-w] Password [********]
[arw] DatabaseName [lnrac1]
[arw] ServerName [hostRac1.oracle.com:hostRac2:hostRac3.oracle.com]
[arw] PortNumber [1521:1521:1521]
[ar-] URL [jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(
HOST=hostRac1.oracle.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=hostRac2)(PORT
=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=hostRac3.oracle.com)(PORT=1521))(FAILOVER=ON
)(LOAD_BALANCE=ON))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=exampleRacServi
ce)))]
 
[arw] DatabaseType [Oracle]
[arw] DriverType [4]
[arw] IsXa [false]
[arw] IsOracleInstanceType [false]
[arw] IsRac [true]
[ar-] DriverClass [oracle.jdbc.pool.OracleConnectionPoolDataSource]

4.10 Changing an Oracle RAC Data Source to a Data Source

Example 4-11 demonstrates how to convert an Oracle RAC data source to a standard data source and then how to display the resulting configuration of the data source.

Example 4-11 Changing an Oracle RAC Data Source to a Data Source

OracleMWConfigUtilities.convertJdbcRACToNormalDatasource('TestNormalDatasource', 'MS SQL Server', 'false', 'myhost.com', '1234')
print OracleMWConfigUtilities.showJdbc('TestNormalDatasource')
>>>>> Output:
[ar-] Name [TestNormalDatasource]
[ar-] Type [Normal]
[arw] Username [wlsqa]
[arw] Password [*****]
[arw] DatabaseName [lnrac1]
[arw] ServerName [myhost.com]
[arw] PortNumber [1234]
[ar-] URL [jdbc:sqlserver://myhost.com:1234]
[arw] DatabaseType [MS SQL Server]
[arw] DriverType [4]
[arw] IsXa [false]
[arw] IsOracleInstanceType [false]
[arw] IsRac [false]
[ar-] DriverClass [com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource]

4.11 Configuring a Component Schema

This section demonstrates two methods that you can use to configure a component schema, validate it, and display its configuration.

Example 4-12 demonstrates how to use utility commands to configure the values for a component schema. The OracleMWConfigUtilities.validateJdbc() command verifies that all required parameters for component schema configuration were specified.

Example 4-12 Configuring a Component Schema By Using Utility Commands

OracleMWConfigUtilities.setJdbcDriverVendor('SOA Infrastructure', 'Oracle')
OracleMWConfigUtilities.setJdbcIsOracleInstanceType('SOA Infrastructure', 'true')
OracleMWConfigUtilities.setJdbcUsername('SOA Infrastructure', 'websphere')
OracleMWConfigUtilities.setJdbcPassword('SOA Infrastructure', 'welcome1')
OracleMWConfigUtilities.setJdbcDatabaseName('SOA Infrastructure', 'orcl')
OracleMWConfigUtilities.setJdbcServerName('SOA Infrastructure', 'dbhost.example.com')
OracleMWConfigUtilities.setJdbcPortNumber('SOA Infrastructure', '12345')
OracleMWConfigUtilities.validateJdbc('SOA Infrastructure')
url_soaSchemaComp = OracleMWConfigUtilities.getJdbcURL('SOA Infrastructure')
print OracleMWConfigUtilities.showJdbc('SOA Infrastructure')
>>>>> Output:
[ar-] Name [SOA Infrastructure]
[ar-] Type [Schema]
[arw] SchemaOwner [websphere]
[arw] SchemaPassword [********]
[arw] DatabaseName [orcl]
[arw] ServerName [dbhost.example.com]
[arw] PortNumber [12345]
[ar-] URL [jdbc:oracle:thin:@dbhost.example.com:12345:orcl]
[arw] DatabaseType [Oracle]
[arw] DriverType [4]
[arw] IsOracleInstanceType [true]
[arw] IsRac [false]
[ar-] DriverClass [oracle.jdbc.pool.OracleConnectionPoolDataSource]

Example 4-13 demonstrates how to use setValue commands to configure a component schema. The soaSchemaComp.validate() call is a standard Oracle configuration API.

Example 4-13 Configuring a Component Schema Using setValue()

soaSchemaComp = OracleMWConfig.getChildByName('JDBC', 'SOA Infrastructure')
soaSchemaComp.setValue('DatabaseType', 'Oracle')
# Use 'DB2' as the DatabaseType for DB2 data sources
soaSchemaComp.setValue('IsOracleInstanceType', 'true')
soaSchemaComp.setValue('SchemaOwner', 'websphere')
soaSchemaComp.setValue('SchemaPassword', 'welcome1')
soaSchemaComp.setValue('DatabaseName', 'orcl')
soaSchemaComp.setValue('ServerName', 'dbhost.example.com')
soaSchemaComp.setValue('PortNumber', '1521')
soaSchemaComp.validate()
url_soaSchemaComp=soaSchemaComp.getValue('URL')
# Show soaSchemaComp's configuration settings.
print soaSchemaComp.show()
>>>>> Output:
[ar-] Name [SOA Infrastructure]
[ar-] Type [Schema]
[arw] SchemaOwner [websphere]
[a-w] SchemaPassword [********]
[arw] DatabaseName [orcl]
[arw] ServerName [dbhost.example.com]
[arw] PortNumber [1521]
[ar-] URL [jdbc:oracle:thin:@dbhost.example.com:1521:orcl]
 
[arw] DatabaseType [Oracle]
[arw] DriverType [4]
[arw] IsOracleInstanceType [true]
[arw] IsRac [false]
[ar-] DriverClass [oracle.jdbc.pool.OracleConnectionPoolDataSource]

4.12 Federating Remote Nodes to a Cell

This section describes the steps that you must perform in either a UNIX or Windows environment to add a remote node to a cell. After adding the remote node, you can use wsadmin commands interactively or a wsadmin script to perform optional configuration tasks on the remote node.

Prior to adding the node, you must set up the environment on the Deployment Manager machine as described in Section 4.1.1, "Environment Setup for IBM WebSphere ND."

UNIX

To add a remote node to an existing cell:

  1. On the Deployment Manager machine, enter the following wsadmin command to use a Jython script containing the appropriate OracleMWConfig and OracleMWConfigUtilities commands to apply product templates to the cell and perform other optional configuration (such as adding servers and clusters):

    ORACLE_HOME/common/bin/wsadmin.sh -f script_name

    Replace ORACLE_HOME with the directory in which you installed your Oracle products and replace script_name with the full path and file name of your Jython script.

  2. On the Deployment Manager machine, enter the following command to start the Deployment Manager:

    ${WAS_HOME}/profiles/profile_name/bin/startManager.sh

    Replace profile_name with the name of the Deployment Manager profile (for example, Dmgr01).

  3. View the following file to determine the Deployment Manager host name and SOAP port number. You need this information to connect to the Deployment Manager from the remote node:

    WAS_HOME/profiles/profile_name/AboutThisProfile.txt

    Replace WAS_HOME with the IBM WebSphere home directory and replace profile_name with the name of the Deployment Manager profile.

After completing these steps, perform the following steps on the remote machine:

  1. Enter the following command to create an empty custom profile:

    ${WAS_HOME}/bin/manageprofiles.sh -create -templatePath ${WAS_HOME}/profileTemplates/managed

    Note:

    Before executing the addNode.sh command in the next step, if you have already applied the Oracle JRF for WebSphere template to the cell, you must shut down and restart the Deployment Manager from the Deployment Manager machine, using stopManager.sh and startManager.sh.
  2. Enter the following wsadmin command to federate (add) the remote node to the cell:

    ${WAS_HOME}/bin/addNode.sh depMgrHost SOAPport -user adminUserName -password adminPassword

    Replace depMgrHost with the host name of the Deployment Manager machine, replace SOAPport with the SOAP port in the Deployment Manager AboutThisProfile.txt file, and replace adminUserName and adminPassword with the username and password you configured for the Deployment Manager.

  3. Enter the following wsadmin command to use a Jython script containing the appropriate OracleMWConfig and OracleMWConfigUtilities commands to apply additional product templates (if needed) to the cell and perform other optional configuration (such as adding servers, clusters, and cluster members):

    ORACLE_HOME/common/bin/wsadmin.sh -connType SOAP -host hostName -port SOAPport -user adminUserName -password adminPassword -f script_name

    Replace hostName with the Deployment Manager host name and replace SOAPport with the SOAP port in the Deployment Manager AboutThisProfile.txt file.

Windows

To add a remote node in to an existing cell:

  1. On the Deployment Manager machine, enter the following wsadmin command to use a Jython script containing the appropriate OracleMWConfig and OracleMWConfigUtilities commands to apply product templates to the cell and perform other optional configuration (such as adding servers and clusters):

    ORACLE_HOME\oracle_common_home\common\bin\wsadmin.cmd -f script_name

    Replace ORACLE_HOME with the directory in which you installed your Oracle products and replace script_name with the full path of your Jython script.

  2. On the Deployment Manager machine, enter the following command to start the Deployment Manager:

    WAS_HOME\profiles\profile_name\bin\startManager.cmd

    In this directory path, WAS_HOME is the IBM WebSphere home directory and profile_name the name of the Deployment Manager profile (for example, Dmgr01).

  3. View the following file to determine the Deployment Manager host name and SOAP port number. You need this information to connect to the Deployment Manager from the remote node:

    WAS_HOME\profiles\profile_name\AboutThisProfile.txt

    Replace profile_name with the name of the Deployment Manager profile.

After completing these steps, perform the following steps on the remote machine:

  1. Enter the following command to create an empty custom profile:

    WAS_HOME\bin\manageprofiles.cmd -create -templatePath WAS_HOME\profileTemplates\managed

    Note:

    Before executing the addNode.cmd command in the next step, if you have already applied the Oracle JRF for WebSphere template to the cell, you must shut down and restart the Deployment Manager, using stopManager.cmd and startManager.cmd.
  2. Enter the following wsadmin command to federate (add) the remote node to the cell:

    WAS_HOME\bin\addNode.cmd depMgrHost SOAPport -user adminUserName -password adminPassword

    Replace depMgrHost with the host name of the Deployment Manager machine, replace SOAPport with the SOAP port in the Deployment Manager AboutThisProfile.txt file, and replace adminUserName and adminPassword with the Administrator user name and password that you defined for the Deployment Manager when setting up the environment.

  3. Enter the following wsadmin command to use a Jython script containing the appropriate OracleMWConfig and OracleMWConfigUtilities commands to apply additional product templates (if needed) to the cell and perform other optional configuration (such as adding servers, clusters, and cluster members):

    ORACLE_HOME\common\bin\wsadmin.cmd -connType SOAP -host hostName -port SOAPport -user adminUserName -password adminPassword -f script_name

    Replace hostName with the Deployment Manager host name, replace SOAPport with the SOAP port in the Deployment Manager AboutThisProfile.txt file, replace adminUserName and adminPassword with the Administrator user name and password that you defined for the Deployment Manager when setting up the environment, and replace script_name with the full path of your Jython script.