Example: Using WLST to Scale Out to Servers

Introducing the Oracle BI Systems Management API 22-21 For example: java JavaClassName host port username password oracleInstanceName newNumBIServers 3. 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 oracleInstanceName newNumBIServers For example: java -classpath MW_HOMEwls_10.3serverlibwjmxclient.jar com.oracle.bi.example.MBeanAPIExample4ScaleOut localhost 7001 user1 password1 instance1 3 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 Found Oracle Instance MBean: oracle.biee.admin:oracleInstance=instance1,type=BIDomain.OracleInstance,group=S ervice Status is: PARTIALLY_STARTED Locking domain ... Locked domain OK Found BI Instance Deployment MBean: oracle.biee.admin:oracleInstance=instance1,type=BIDomain.OracleInstance.BIInsta nceDeployment,biInstance=coreapplication,group=Service Found Num BI Servers: 1 Setting Num BI Servers to: 3 Committing changes ... Committed changes OK Stopping instance ... Stopped instance OK Starting instance ... Started instance OK Status is: FULLY_STARTED

22.3.5 Capturing Metrics Using the Oracle BI Systems Management API

In addition to the Metrics Browser in Fusion Middleware Control, you can view metrics for Oracle Business Intelligence using the Dynamic Monitoring Service DMS and WLST commands. This section describes how to use these methods.

22.3.5.1 Using the Dynamic Monitoring Service for Metrics

You can use the Dynamic Monitoring Service DMS to view metrics for Oracle Business Intelligence. Access the service using the following URL: http:host:7001dms Using the Metrics Tables list in the left pane, select Non-J2EE Metrics to view the list of metrics for Oracle Business Intelligence. This is the same list that you see in the Metrics Browser of Fusion Middleware Control. 22-22 System Administrators Guide for Oracle Business Intelligence Enterprise Edition You can use the Dynamic Monitoring Service to quickly obtain a snapshot of metrics. You can use the URL for a given metric as the source for a web query in a Microsoft Excel spreadsheet that you combine with a macro that automatically copies values to an archive sheet and refreshes the query on a loop for a given period. Suppose that you want to use the Dynamic Monitoring Service to see the details of the metric table called Oracle_BI_General. When you click the Oracle_BI_General link in the Metrics Tables list, the table is displayed on the right side. This metric table consists of several monitored values, such as Active_Execute_Requests and Total_ Sessions. You can use the information from the tables that are displayed in this Metrics Browser as part of WLST commands. For information on accessing DMS metrics using WLST commands, see the chapter on DMS custom WLST commands in Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

22.3.5.2 Using WLTS Commands for Metrics

You can use WLST commands to capture metrics for Oracle Business Intelligence. To use WLST commands for metrics: 1. Navigate to the MW_HOMEORACLE_HOMEcommonbin directory. 2. Run the WLST utility. 3. Connect to the Oracle BI system using the connect command, as shown in the following example: connectuser,password,t3:host:7001

4. Verify that you are in online mode by viewing the following prompt:

wls:bifoundation_domainserverConfig You can now interactively use the DMS custom WLST commands. For example, to list all the metric tables that start with Oracle_BI, enter the following command: wls:bifoundation_domainserverConfig displayMetricTablesOracle_BI This command generates a long list of data for each of the Oracle BI metric tables. So it is more useful to focus on a given metric table, such as Oracle_BI_General. The following command displays output such as that shown in this sample. wls:bifoundation_domainserverConfig displayMetricTablesOracle_BI_General ----------------- Oracle_BI_General ----------------- Active_Execute_Requests.value: 0 Active_Fetch_Requests.value: 0 Active_File_Handles.value: 1 Active_Initblock_Executions.value: 0 Active_Logins.value: 0 Active_Prepare_Requests.value: 0 Avg._Failed_Logins_Elapsed_Time.value: 0 Avg._Initblock_Executions_Elapsed_Time.value: 0 Avg._Succeeded_Logins_Elapsed_Time.value: 0 Avg._query_elapsed_time.value: 0 Busy_File_Handles.value: 0 File_Handle_Waiters.value: 0 Introducing the Oracle BI Systems Management API 22-23 Free_File_Handles.value: 502 Host: oracle-bc5ac6af Max._Initblock_Execution_Elapsed_Time.value: 0 Max_File_Handles.value: 503 Name: Oracle BI General New_Execute_Requests.value: 19 New_Fetch_Requests.value: 32 New_Initblock_Executions.value: 0 New_Logins.value: 7 New_Prepare_Requests.value: 19 New_Requests.value: 187 OBPERF_.value: 7 Oracle_BI_Applications: Oracle BI Server Parent: Oracle BI Server Process: Oracle BI Server:4004:instance1coreapplication_obis1 Queriessec.value: 0 ServerName: instance1coreapplication_obis1 Succeeded_Initblock_Execution_Ratio_as_.value: 0 Succeeded_Logins_Ratio_as_.value: 7 Total_sessions.value: 0 Using the scripting capability of WLST, you can embed DMS commands into a Jython script to store the required metric values in a file. The following is an example of such a script. Script to dump timestamp in milliseconds for a single Oracle BI metric to a file from java.util import Date from java.text import SimpleDateFormat Modify to connect to your server connectbiadmin,welcome1,t3:localhost:7001 This is the number of times to sample the metric sample_length = 100 This is where you define what metric table and metric to dump to file metric_table = Oracle_BI_General metric_of_interest = Avg._query_elapsed_time.value Some metrics have non-text characters in the name. Provide a reference here so it dumps to file without error in file name output_file_metric_ref = Avg_Qry_Elapse This section defines the output file name with unique time start_time = strSimpleDateFormatdd-MMM-yyyy_HH-mm-ss.formatDate output_filename = start_time + _ + output_file_metric_ref + _dump.txt Open the file and write summary of metric to be dumped file = openoutput_filename,w print file, Start Metric Dump of: + strmetric_table + : + strmetric_ of_interest + at + strSimpleDateFormatdd-MMM-yyyy HH-mm-ss.formatDate The following section forms a loop according to the sample length defined earlier. The displayMetricTables command returns the metric table in the form of a JMX composite data array. The code following this command access the metric data from this array. In this case, a particular metric of 22-24 System Administrators Guide for Oracle Business Intelligence Enterprise Edition interest is tested for and only the value of that metric is output to file. counter = 0 while counter = sample_length: results = displayMetricTablesmetric_table for table in results: name = table.getTable rows = table.getRows rowCollection = rows.values iter = rowCollection.iterator while iter.hasNext: row = iter.next rowType = row.getCompositeType keys = rowType.keySet keyIter = keys.iterator while keyIter.hasNext: columnName = keyIter.next value = row.getcolumnName if columnName == metric_of_interest: print file, strSimpleDateFormatdd-MMM-yyyy HH-mm-ss-SSS.formatDate + , + strvalue counter = counter + 1 file.close disconnect Certain Oracle BI metric tables, such as Oracle_BI_Thread_Pool, are in effect two-dimensional. With the Oracle_BI_Thread_Pool table, you can query the metric values for various Names, such as Server or Usage_Tracking. To export the required metric value to a file in this case, you must modify the logic that was used in looping in the previous example script to handle the two dimensions. The following example script provides one way to handle this case. Script to dump timestamp in milliseconds and a single Oracle BI metric to a file for metrics with multiple sections from java.util import Date from java.text import SimpleDateFormat Modify to connect to your server connectbiadmin,welcome1,t3:localhost:7001 This is the number of times to sample the metric sample_length = 100 This is where you define what metric table, category, and metric to dump to file metric_table = Oracle_BI_Thread_Pool category_of_interest = Server metric_of_interest = Avg._Requestsec.value Some metrics have non-text characters - provide a reference here so it dumps to file without error output_file_metric_ref = Avg_Req_Sec This section defines the output file name with unique time start_time = strSimpleDateFormatdd-MMM-yyyy_HH-mm-ss.formatDate output_filename = start_time + _ + output_file_metric_ref + _dump.txt Open the file and write summary of metric to be dumped file = openoutput_filename,w Introducing the Oracle BI Systems Management API 22-25 print file, Start Metric Dump of: + strmetric_table + : + strmetric_ of_interest + for Category: + strcategory_of_interest + at + strSimpleDateFormatdd-MMM-yyyy HH-mm-ss.formatDate counter = 0 while counter = sample_length: results = displayMetricTablesmetric_table for table in results: name = table.getTable rows = table.getRows rowCollection = rows.values iter = rowCollection.iterator while iter.hasNext: row = iter.next if row.containsValuecategory_of_interest: rowType = row.getCompositeType keys = rowType.keySet keyIter = keys.iterator while keyIter.hasNext: columnName = keyIter.next value = row.getcolumnName if columnName == metric_of_interest: print file, strSimpleDateFormatdd-MMM-yyyy HH-mm-ss-SSS.formatDate + , + strvalue counter = counter + 1 file.close disconnect

22.4 Descriptions of JMX Admin MBeans and Methods for the Oracle BI Systems Management API

This section lists the JMX Admin MBeans of the Oracle BI Systems Management API that you use to perform system administration tasks using WLST scripts and Java programs. Your code must reference Admin MBeans and their attributes and methods. This section lists the Admin MBeans. The JavaDoc pages describe the attributes and methods that are available for each Admin MBean. For example, display the JavaDoc files in a Web browser and click the Admin MBean EmailConfigurationMBean. You see all related attributes and methods, and you can then use the correct attribute and method names in WLST scripts or Java programs. See the JavaDoc file that is located in the following directory: ORACLE_HOMEdocjavadocbifoundationjmxapiindex.html Table 22–1 lists the JMX Admin MBeans for the Oracle BI Systems Management API. Table 22–1 Oracle BI Systems Management API JMX Admin MBeans Admin MBean Description AvailabilityConfigurationMBean Provides an MBean interface for configuring several options that affect process availability for Oracle Business Intelligence. BIComponentMBean Defines an MBean interface for a component of a BI domain. BIDomainMBean Defines an MBean interface for managing a BI domain.