Example: Using a Java Program to Edit the E-Mail Sender Display Name Configuration Setting

Introducing the Oracle BI Systems Management API 22-19 host = args[0]; port = Integer.parseIntargs[1]; username = args[2]; password = args[3]; oracleInstanceName = args[4]; newNumBIServers = Integer.parseIntargs[5]; } 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.getAttributebiDomainMBeanName, BIInstances; biInstanceMBeanName = biInstanceMBeanNames[0]; there should only be one System.out.printlnFound BI Instance MBean: + biInstanceMBeanName; oracleInstanceMBeanNames = ObjectName[]mbs.getAttributebiDomainMBeanName, OracleInstances; for ObjectName oracleInstanceMBeanName : oracleInstanceMBeanNames { System.out.printlnFound Oracle Instance MBean: + oracleInstanceMBeanName; } } private void displayStatus throws Exception { String status = Stringmbs.getAttributebiInstanceMBeanName, ServiceStatus; System.out.printlnStatus is: + status; } private void lock throws Exception { System.out.printlnLocking domain ...; Object[] args = new Object[]{}; String[] sig = new String[]{}; mbs.invokebiDomainMBeanName, lock, args, sig; System.out.printlnLocked domain OK; } private void commit throws Exception { System.out.printlnCommitting changes ...; Object[] args = new Object[]{}; String[] sig = new String[]{}; mbs.invokebiDomainMBeanName, commit, args, sig; System.out.printlnCommitted changes OK; } private ObjectName findMatchingOracleInstanceMBean throws Exception { for ObjectName oracleInstanceMBeanName : oracleInstanceMBeanNames { String oracleInstanceId = Stringmbs.getAttributeoracleInstanceMBeanName, Id; 22-20 System Administrators Guide for Oracle Business Intelligence Enterprise Edition if oracleInstanceId.equalsoracleInstanceName { return oracleInstanceMBeanName; } } throw new RuntimeExceptionCannot find oracle instance: + oracleInstanceName; } private void scaleOutObjectName oracleInstanceMBeanName throws Exception { ObjectName[] biInstanceDeploymentMBeanNames = ObjectName[]mbs.getAttributeoracleInstanceMBeanName, BIInstanceDeployments; ObjectName biInstanceDeploymentMBeanName = biInstanceDeploymentMBeanNames[0]; there should only be one System.out.printlnFound BI Instance Deployment MBean: + biInstanceDeploymentMBeanName; int numBIServers = Integermbs.getAttributebiInstanceDeploymentMBeanName, NumBIServers; System.out.printlnFound Num BI Servers: + numBIServers; System.out.printlnSetting Num BI Servers to: + newNumBIServers; mbs.setAttributebiInstanceDeploymentMBeanName, new AttributeNumBIServers, newNumBIServers; } 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; } public static void mainString[] args throws Exception { MBeanAPIExample4ScaleOut example = new MBeanAPIExample4ScaleOutargs; example.connect; example.displayStatus; ObjectName oiMBeanName = example.findMatchingOracleInstanceMBean; example.lock; example.scaleOutoiMBeanName; example.commit; example.stopAll; example.startAll; example.displayStatus; } } 2. Navigate to the \wlserver\server\lib folder and run the Java program, providing the class name and any arguments required. 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.