21-4 System Administrators Guide for Oracle Business Intelligence Enterprise Edition
ResourceVirtualPath Specifies the virtual path used for the primary
resource files for Presentation Services, as specified by the ResourcePhysicalPath
element. These resource files and customer-defined resource files must be
served from the same Web server.
For generating relative URLs, the virtual path defaults to res, if the resource folder is present
under the same virtual directory as the Oracle BI Presentation Services DLL files.
For generating absolute URLs, the value of the AbsoluteCommandURLPrefix element is used
as the default. The value must be a fully qualified virtual
path of this form: VirtualPath
If you omit the leading slash, then one is added.
res
Table 21–1 Cont. Elements for URL Generation and Resource File Location
Element Description
Default Value
Part VII
Part VII
Automating Management of Oracle Business Intelligence
This part explains how to use the Oracle BI Systems Management API. It includes the following chapter:
■
Chapter 22, Introducing the Oracle BI Systems Management API
22
Introducing the Oracle BI Systems Management API 22-1
22
Introducing the Oracle BI Systems Management API
This chapter describes the Oracle BI Systems Management Application Programming Interface API and includes the following topics:
■
Section 22.1, What Is the Oracle BI Systems Management API?
■
Section 22.2, Accessing Oracle BI Systems Management API Methods
■
Section 22.3, Using the Oracle BI Systems Management API to Manage and Configure Oracle Business Intelligence
■
Section 22.4, Descriptions of JMX Admin MBeans and Methods for the Oracle BI Systems Management API
22.1 What Is the Oracle BI Systems Management API?
The Oracle BI Systems Management API is a programming interface that provides access to Oracle Business Intelligence JMX Admin MBeans, enabling a developer to
programmatically perform system administration tasks for Oracle Business Intelligence. The system administration tasks that can be performed using the Oracle
BI Systems Management API are also available using Fusion Middleware Control.
The Oracle BI Systems Management API centralizes the management of system configuration by automatically propagating changes to all of the files that require
updates in multiple locations.
Alternative methods for modifying system configuration settings for Oracle Business Intelligence are available. For information, see
Section 3.1, Configuring Oracle Business Intelligence.
The Oracle BI Systems Management API and its Java methods are described in a JavaDoc file that is located in the following directory:
ORACLE_HOMEdocjavadocbifoundationjmxapiindex.html
Note: You cannot display the Log Viewer or Performance Metrics
using the Oracle BI Systems Management API.
22-2 System Administrators Guide for Oracle Business Intelligence Enterprise Edition
22.2 Accessing Oracle BI Systems Management API Methods
This section describes the following ways to access Oracle BI Systems Management API methods:
■
Using an Oracle WebLogic Server Scripting Tool WLST command interactive mode
You can use the command line to enter a command and view the response at a command-line prompt. This method is useful for learning the tool, prototyping
command syntax, and verifying configuration options before building a script. Using WLST interactively is particularly useful for getting immediate feedback
after making a critical configuration change. The WLST scripting shell maintains a persistent connection with an instance of WebLogic Server.
■
Using a WLST command in a script Script mode You can use a script to invoke a sequence of WLST commands without requiring
your input, much like a shell script. Scripts contain WLST commands in a text file with a .py file extension, such as filename.py. You use script files with the Jython
commands for running scripts. The Jython scripting language is used because it is freely available and compatible with the Java platform.
■
Using a Java program You can use a Java program to contact the JMX server directly.
For information about the Oracle BI Systems Management API methods, see Section 22.4, Descriptions of JMX Admin MBeans and Methods for the Oracle BI
Systems Management API.
22.3 Using the Oracle BI Systems Management API to Manage and Configure Oracle Business Intelligence
This section describes using the Oracle BI Systems Management API to manage and configure Oracle Business Intelligence, and contains the following topics:
■
Section 22.3.1, Displaying Oracle Business Intelligence Status Using the Oracle BI Systems Management API
■
Section 22.3.2, Starting and Stopping Oracle Business Intelligence Using the Oracle BI Systems Management API
■
Section 22.3.3, Updating Configuration Settings Using the Oracle BI Systems Management API
■
Section 22.3.4, Scaling Out for High Availability and Performance Using the Oracle BI Systems Management API
■
Section 22.3.5, Capturing Metrics Using the Oracle BI Systems Management API
22.3.1 Displaying Oracle Business Intelligence Status Using the Oracle BI Systems Management API
You can use the Oracle BI Systems Management API to display the status of Oracle Business Intelligence using either WLST commands or a Java program as described in
the following sections:
Introducing the Oracle BI Systems Management API 22-3
■
Section 22.3.1.1, Example: Using WLST Commands in a Script to Display the Status of Oracle Business Intelligence
■
Section 22.3.1.2, Example: Using a Java Program to Display the Status of Oracle Business Intelligence
22.3.1.1 Example: Using WLST Commands in a Script to Display the Status of Oracle Business Intelligence
This example connects a user to Oracle Business Intelligence and displays the service status.
To use WLST commands in a script to display the status of Oracle Business Intelligence:
1.
Open a text editor and create a WLST script similar to the following example: Example to demonstrate connecting to a BIEE domain using WLST
This scripts expects the following arguments: 1. wls.host
localhost 2. wls.port
7001 3. wls.user
user1 4. wls.password
password1 ===================================================================
import sys import os
Check the arguments to this script are as expected. argv[0] is script name.
argLen = lensys.argv if argLen -1 = 4:
print ERROR: got , argLen -1, args. print USAGE: wlst.cmd wls_connect.py WLS_HOST WLS_PORT WLS_USER WLS_
PASSWORD print eg: wlst.cmd wls_connect.py localhost 7001 user1 password1
exit WLS_HOST = sys.argv[1]
WLS_PORT = sys.argv[2] WLS_USER = sys.argv[3]
WLS_PW = sys.argv[4] print Connecting to + WLS_HOST+ : + WLS_PORT + as user: + WLS_USER +
... Connect to WLS
connectWLS_USER, WLS_PW, WLS_HOST+ : + WLS_PORT; print Connecting to Domain ...
domainCustom cd oracle.biee.admin
print Connecting to BIDomain MBean ... cd oracle.biee.admin:type=BIDomain,group=Service
biinstances = getBIInstances biinstance = biinstances[0]
print Connecting to BIInstance MBean ...
22-4 System Administrators Guide for Oracle Business Intelligence Enterprise Edition
cd .. cd biinstance.toString
servicestatus=getServiceStatus print BIInstance MBean; ServiceStatus: + servicestatus
exit
2.
Save the script.
3.
Navigate to the folder \MW_HOME\wlserver_10.3\common\bin and run the script, entering any arguments required.
For example, you might enter the following at the command line: .wlst.sh wlst_connect.py localhost 7001 user1 password1
UNIX wlst wlst_connect.cmd localhost 7001 user1 password1 Windows
The command window and log file, displays prompts and messages, for example:
Initializing WebLogic Scripting Tool WLST ... Welcome to WebLogic Server Administration Scripting Shell
Type help for help on available commands Connecting to localhost:7001 as user: user1 ...
Connecting to t3:localhost:7001 with userid password1 ... Successfully connected to Administration Server AdminServer that belongs to
domain bifoundation_domain. Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, use the SSL port or Admin port instead.
Connecting to Domain ... Location changed to domain custom tree.
This is a writable tree with No root. For more help, use helpdomainCustom
Connecting to BIDomain MBean ... Connecting to BIInstance MBean ...
BIInstance MBean; ServiceStatus: FULLY_STARTED Exiting WebLogic Scripting Tool.
For more information about using WLST commands, see Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.
22.3.1.2 Example: Using a Java Program to Display the Status of Oracle Business Intelligence
This example connects to Oracle Business Intelligence and displays the current status. The Java program in this example also contains additional methods commented out
which you can use to start and stop Oracle Business Intelligence. For more information, see
Section 22.3.2.2, Example: Using a Java Program to Stop and Start Oracle Business Intelligence.
Introducing the Oracle BI Systems Management API 22-5
To use a Java program with the Systems management API to display the status of Oracle Business Intelligence:
1.
Open a Java editor and compile a Java program similar to the following example: package com.oracle.bi.example;
import java.util.Hashtable; import javax.management.MBeanServerConnection;
import javax.management.ObjectName; import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL;
import javax.naming.Context;
Example class showing how to connect to the Oracle BIEE AdminMBeans JMX Interface.
br This example is intentionally succinct for clarity, so for example,
it does not do any exception handling. Any production code should include robust error handling.
Note that you need codewljmxclient.jarcode and codewlclient.jarcode on the classpath.
public class MBeanAPIExample1 {
private String host; private int port;
private String username; private String password;
private MBeanServerConnection mbs = null; private ObjectName biDomainMBeanName;
private ObjectName biInstanceMBeanName;
private MBeanAPIExample1String[] args { if args.length 4 {
System.out.printlnUsage: MBeanAPIExample1 host port username password;
throw new IllegalArgumentExceptionNot enough arguments; }
host = args[0]; port = Integer.parseIntargs[1];
username = args[2]; password = args[3];
}
private void connect throws Exception { String jmxUrl = service:jmx:t3: + host + : + port +
jndiweblogic.management.mbeanservers.domainruntime; System.out.printlnConnecting using URL: + jmxUrl + ...;
HashtableString,String h = new HashtableString,String; h.putContext.SECURITY_PRINCIPAL, username;
h.putContext.SECURITY_CREDENTIALS, password; h.putJMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
weblogic.management.remote; JMXConnector jmxConnector = JMXConnectorFactory.connectnew
JMXServiceURLjmxUrl, h; mbs = jmxConnector.getMBeanServerConnection;
System.out.printlnConnected OK;
biDomainMBeanName = new ObjectNameoracle.biee.admin:type=BIDomain,group=Service;
ObjectName[]biInstanceMBeanNames=ObjectName[]mbs.getAttribute
22-6 System Administrators Guide for Oracle Business Intelligence Enterprise Edition
biDomainMBeanName, BIInstances; biInstanceMBeanName = biInstanceMBeanNames[0];
there should only be one System.out.printlnFound BI Instance MBean: +
biInstanceMBeanName;
} private void displayStatus throws Exception {
String status = Stringmbs.getAttributebiInstanceMBeanName, ServiceStatus;
System.out.printlnStatus is: + status; }
private void stopAll throws Exception { System.out.printlnStopping instance ...;
Object[] args = new Object[]{}; String[] sig = new String[]{};
mbs.invokebiInstanceMBeanName, stop, args, sig; System.out.printlnStopped instance OK;
} private void startAll throws Exception {
System.out.printlnStarting instance ...; Object[] args = new Object[]{};
String[] sig = new String[]{}; mbs.invokebiInstanceMBeanName, start, args, sig;
System.out.printlnStarted instance OK; }
param args public static void mainString[] args throws Exception {
MBeanAPIExample1 example = new MBeanAPIExample1args; example.connect;
example.displayStatus; example.stopAll;
example.startAll; }
}
2.
Navigate to the \wlserver\server\lib folder and run the Java program, providing the class path, class name and any arguments required.
java -classpath JavaClassName host port username password For example:
java -classpath MW_HOMEwls_10.3serverlibwjmxclient.jar com.oracle.bi.example.MBeanAPIExample1 localhost 7001 user1 password1
The command window and log file displays prompts and messages, for example: Connecting using URL:
service:jmx:t3:localhost:7001jndiweblogic.management.mbeanservers.domainrun time
... Connected OK
Found BI Instance MBean: oracle.biee.admin:type=BIDomain.BIInstance,biInstance=coreapplication,group=Ser
vice
Status is: FULLY_STARTED
Introducing the Oracle BI Systems Management API 22-7
22.3.2 Starting and Stopping Oracle Business Intelligence Using the Oracle BI Systems Management API
You can use the Oracle BI Systems Management API start and stop Oracle Business Intelligence using either WLST commands or a Java program as described in the
following sections:
■
Section 22.3.2.1, Example: Using WLST Commands to Stop and Start Oracle Business Intelligence
■
Section 22.3.2.2, Example: Using a Java Program to Stop and Start Oracle Business Intelligence
22.3.2.1 Example: Using WLST Commands to Stop and Start Oracle Business Intelligence
This example stops and starts the Oracle Business Intelligence instance, and displays the status during each stage of the process.
To use WLST commands to stop and start Oracle Business Intelligence: 1.
Open a text editor and create a WLST script similar to the following: Example to demonstrate connecting to a BIEE domain using WLST and stopping
and restarting the instance This scripts expects the following arguments:
1. wls.host localhost 2. wls.port 7001
3. wls.user user1 4. wls.password password1
=================================================================== import sys
import os Check the arguments to this script are as expected.
argv[0] is script name. argLen = lensys.argv
if argLen -1 = 4: print ERROR: got , argLen -1, args.
print USAGE: wlst_stop_start.cmd wls_stop_start_obi.py WLS_HOST WLS_PORT WLS_USER WLS_PASSWORD
print eg: wlst_stop_start.cmd wls_stop_start_obi.py localhost 7001 user1 password1
exit WLS_HOST = sys.argv[1]
WLS_PORT = sys.argv[2] WLS_USER = sys.argv[3]
WLS_PW = sys.argv[4] print Connecting to + WLS_HOST+ : + WLS_PORT + as user: + WLS_USER +
... Connect to WLS
connectWLS_USER, WLS_PW, WLS_HOST+ : + WLS_PORT; print Connecting to Domain ...
domainCustom cd oracle.biee.admin
print Connecting to BIDomain MBean ... cd oracle.biee.admin:type=BIDomain,group=Service
biinstances = getBIInstances biinstance = biinstances[0]
print Connecting to BIInstance MBean ...
22-8 System Administrators Guide for Oracle Business Intelligence Enterprise Edition
cd .. cd biinstance.toString
servicestatus=getServiceStatus print BIInstance MBean; ServiceStatus: + servicestatus
print Calling stop ... objs = jarray.array[], java.lang.Object
strs = jarray.array[], java.lang.String invokestop, objs, strs
servicestatus=getServiceStatus print BIInstance MBean; ServiceStatus: + servicestatus
print Calling start ... objs = jarray.array[], java.lang.Object
strs = jarray.array[], java.lang.String invokestart, objs, strs
servicestatus=getServiceStatus print BIInstance MBean; ServiceStatus: + servicestatus
exit
2.
Save the script.
3.
Navigate to the folder \MW_HOME\wlserver_10.3\common\bin and run the script, entering any arguments required.
For example, you might enter the following at the command line: .wlst.sh wlst_stop_start_obi.py localhost 7001 user1
password1 UNIX wlst wlst_wlst_stop_start_obi.cmd localhost 7001 user1
password1 Windows The command window and log file, displays prompts and messages, for
example: Initializing WebLogic Scripting Tool WLST ...
Welcome to WebLogic Server Administration Scripting Shell Type help for help on available commands
Connecting to localhost:7001 as user: user1 ... Connecting to t3:localhost:7001 with userid password1 ...
Successfully connected to Administration Server AdminServer that belongs to domain bifoundation_domain.
Warning: An insecure protocol was used to connect to the server. To ensure on-the-wire security, use the SSL port or
Admin port instead. Connecting to Domain ...
Location changed to domain custom tree. This is a writable tree with No root.
For more help, use helpdomainCustom Connecting to BIDomain MBean ...
Connecting to BIInstance MBean ... BIInstance MBean; ServiceStatus: FULLY_STARTED
Calling stop ... BIInstance MBean; ServiceStatus: STOPPED
Calling start ... BIInstance MBean; ServiceStatus: FULLY_STARTED