ヘッダーをスキップ
Oracle® Fusion Middleware Oracle Business Intelligence Enterprise Editionシステム管理者ガイド
11g リリース1(11.1.1)
B63029-03
  目次へ移動
目次
索引へ移動
索引

前
 
次
 

22 Oracle BI Systems Management APIの概要

この章では、Oracle BI Systems Managementアプリケーション・プログラミング・インタフェース(API)について説明します。

この章の内容は次のとおりです。

22.1 Oracle BI Systems Management APIとは

Oracle BI Systems Management APIは、Oracle Business Intelligence JMX管理MBeanへのアクセスを可能にし、開発者がOracle Business Intelligenceのシステム管理タスクをプログラムによって実行できるようにするプログラミング・インタフェースです。Oracle BI Systems Management APIを使用して実行できるシステム管理タスクは、Fusion Middleware Controlを使用して実行することも可能です。

Oracle BI Systems Management APIはシステム構成の管理を一元化し、複数の場所に分散した、更新を必要とするすべてのファイルに変更を自動的に伝播します。

Oracle Business Intelligenceの構成設定の変更方法は他にもあります。詳細は、第3.1項「Oracle Business Intelligenceの構成」を参照してください。

Oracle BI Systems Management APIとそのJavaメソッドについては、JavaDocファイルに記載されています。このファイルは次のディレクトリにあります。

ORACLE_HOME/doc/javadoc/bifoundation/jmxapi/index.html


注意:

ログ・ビューアとパフォーマンス・メトリックは、いずれもOracle BI Systems Management APIを使用して表示することはできません。


22.2 Oracle BI Systems Management APIのメソッドへのアクセス

この項では、Oracle BI Systems Management APIのメソッドにアクセスするための次の方法について説明します。

Oracle BI Systems Management APIのメソッドの詳細は、第22.4項「Oracle BI Systems Management APIのJMX管理MBeanおよびメソッドの説明」を参照してください。

22.3 Oracle BI Systems Management APIを使用したOracle Business Intelligenceの管理と構成

この項では、Oracle BI Systems Management APIを使用したOracle Business Intelligenceの管理と構成について説明します。内容は次のとおりです。

第22.3.1項 Oracle BI Systems Management APIを使用したOracle Business Intelligenceのステータスの表示

Oracle BI Systems Management APIを使用して、Oracle Business Intelligenceのステータスを表示できます。この場合、WLSTコマンドを使用する方法と、Javaプログラムを使用する方法があります。それぞれの方法について次の各項で説明します。

22.3.1.1 例: スクリプトでWLSTコマンドを使用して、Oracle Business Intelligenceのステータスを表示する

この例では、ユーザーがOracle Business Intelligenceに接続してサービスのステータスを表示します。

スクリプトでWLSTコマンドを使用して、Oracle Business Intelligenceのステータスを表示するには:

  1. テキスト・エディタを開いて、次に示す例のようなWLSTスクリプトを作成します。

    # 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 = len(sys.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
    connect(WLS_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 = get('BIInstances')
    biinstance = biinstances[0]
     
    print 'Connecting to BIInstance MBean ...'
    cd ('..')
    cd (biinstance.toString())
     
    servicestatus=get('ServiceStatus')
    print 'BIInstance MBean; ServiceStatus: ' + servicestatus
     
    exit()
    
  2. スクリプトを保存します。

  3. \MW_HOME\wlserver_10.3\common\binフォルダに移動し、必要な引数を入力してスクリプトを実行します。

    たとえば、コマンドラインで次のように入力します。

    ./wlst.sh wlst_connect.py localhost 7001 user1 password1 (UNIX)

    wlst wlst_connect.cmd localhost 7001 user1 password1 (Windows)

    コマンド・ウィンドウ(およびログ・ファイル)に、次のようなプロンプトとメッセージが表示されます。

    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 help(domainCustom)
     
    Connecting to BIDomain MBean ...
    Connecting to BIInstance MBean ...
    BIInstance MBean; ServiceStatus: FULLY_STARTED
     
     
    Exiting WebLogic Scripting Tool.
    

WLSTコマンドの使用の詳細は、『Oracle Fusion Middleware WebLogic Scripting Tool コマンド リファレンス』を参照してください。

22.3.1.2 例: Javaプログラムを使用して、Oracle Business Intelligenceのステータスを表示する

この例では、Oracle Business Intelligenceに接続し、現在のステータスを表示します。この例のJavaプログラムは、この他にOracle Business Intelligenceの起動と停止のメソッドも含まれています(コメント・アウトされています)。詳細は、第22.3.2.2項「例: Javaプログラムを使用して、Oracle Business Intelligenceを停止および起動する」を参照してください。

Systems Management APIとともにJavaプログラムを使用して、Oracle Business Intelligenceのステータスを表示するには:

  1. Javaエディタを開き、次に示す例のようなJavaプログラムをコンパイルします。

    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 <code>wljmxclient.jar</code> and <code>wlclient.jar</code> 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 MBeanAPIExample1(String[] args) {
             if (args.length < 4) {
                System.out.println("Usage: MBeanAPIExample1 host port
    username password"); throw new IllegalArgumentException("Not enough arguments"); } host = args[0]; port = Integer.parseInt(args[1]); username = args[2]; password = args[3]; } private void connect() throws Exception { String jmxUrl = "service:jmx:t3://" + host + ":" + port +
    "/jndi/weblogic.management.mbeanservers.domainruntime"; System.out.println("Connecting using URL: " + jmxUrl + " ..."); Hashtable<String,String> h = new Hashtable<String,String>(); h.put(Context.SECURITY_PRINCIPAL, username); h.put(Context.SECURITY_CREDENTIALS, password); h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
    "weblogic.management.remote"); JMXConnector jmxConnector = JMXConnectorFactory.connect(new
    JMXServiceURL(jmxUrl), h); mbs = jmxConnector.getMBeanServerConnection(); System.out.println("Connected OK"); biDomainMBeanName = new
    ObjectName("oracle.biee.admin:type=BIDomain,group=Service"); ObjectName[]biInstanceMBeanNames=(ObjectName[])mbs.getAttribute
    (biDomainMBeanName, "BIInstances"); biInstanceMBeanName = biInstanceMBeanNames[0];
    // there should only be one System.out.println("Found BI Instance MBean: " +
    biInstanceMBeanName); } private void displayStatus() throws Exception { String status = (String)mbs.getAttribute(biInstanceMBeanName,
    "ServiceStatus"); System.out.println("Status is: " + status); } private void stopAll() throws Exception { System.out.println("Stopping instance ..."); Object[] args = new Object[]{}; String[] sig = new String[]{}; mbs.invoke(biInstanceMBeanName, "stop", args, sig); System.out.println("Stopped instance OK"); } private void startAll() throws Exception { System.out.println("Starting instance ..."); Object[] args = new Object[]{}; String[] sig = new String[]{}; mbs.invoke(biInstanceMBeanName, "start", args, sig); System.out.println("Started instance OK"); } /** * @param args */ public static void main(String[] args) throws Exception { MBeanAPIExample1 example = new MBeanAPIExample1(args); example.connect(); example.displayStatus(); // example.stopAll(); // example.startAll(); } }
  2. \<wlserver>\server\libフォルダに移動し、クラス・パス、クラス名および必要な引数を指定してJavaプログラムを実行します。

    java -classpath <JavaClassName> <host> <port> <username> <password>

    例:

    java -classpath <MW_HOME>wls_10.3/server/lib/wjmxclient.jar com.oracle.bi.example.MBeanAPIExample1 localhost 7001 user1 password1

    コマンド・ウィンドウ(およびログ・ファイル)に、次のようなプロンプトとメッセージが表示されます。

    Connecting using URL: service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.domainruntime
    ...
    Connected OK
    Found BI Instance MBean:
    oracle.biee.admin:type=BIDomain.BIInstance,biInstance=coreapplication,group=Service
    
    Status is: FULLY_STARTED
    

22.3.2 Oracle BI Systems Management APIを使用したOracle Business Intelligenceの起動と停止

Oracle BI Systems Management APIを使用して、Oracle Business Intelligenceを起動および停止できます。この場合、WLSTコマンドを使用する方法と、Javaプログラムを使用する方法があります。それぞれの方法について次の各項で説明します。

22.3.2.1 例: WLSTコマンドを使用して、Oracle Business Intelligenceを停止および起動する

この例では、Oracle Business Intelligenceを停止および起動し、プロセスの各段階のステータスを表示します。

WLSTコマンドを使用して、Oracle Business Intelligenceを停止および起動するには:

  1. テキスト・エディタを開いて、次に示す例のようなWLSTスクリプトを作成します。

    # 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 = len(sys.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
    connect(WLS_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 = get('BIInstances')
    biinstance = biinstances[0]
    print 'Connecting to BIInstance MBean ...'
    cd ('..')
    cd (biinstance.toString())
    servicestatus=get('ServiceStatus')
    print 'BIInstance MBean; ServiceStatus: ' + servicestatus
    print 'Calling stop ...'
    objs = jarray.array([], java.lang.Object)
    strs = jarray.array([], java.lang.String)
    invoke('stop', objs, strs)
    servicestatus=get('ServiceStatus')
    print 'BIInstance MBean; ServiceStatus: ' + servicestatus
    print 'Calling start ...'
    objs = jarray.array([], java.lang.Object)
    strs = jarray.array([], java.lang.String)
    invoke('start', objs, strs)
    servicestatus=get('ServiceStatus')
    print 'BIInstance MBean; ServiceStatus: ' + servicestatus
    exit()
    
  2. スクリプトを保存します。

  3. \MW_HOME\wlserver_10.3\common\binフォルダに移動し、必要な引数を入力してスクリプトを実行します。

    たとえば、コマンドラインで次のように入力します。

    ./wlst.sh wlst_stop_start_obi.py localhost 7001 user1 password1 (UNIX)

    wlst wlst_wlst_stop_start_obi.cmd localhost 7001 user1 password1 (Windows)

    コマンド・ウィンドウ(およびログ・ファイル)に、次のようなプロンプトとメッセージが表示されます。

    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 help(domainCustom)
     
    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 
    
    Exiting WebLogic Scripting Tool.
    

22.3.2.2 例: Javaプログラムを使用して、Oracle Business Intelligenceを停止および起動する

第22.3.1.2項「例: Javaプログラムを使用して、Oracle Business Intelligenceのステータスを表示する」の例を参照し、次に示すように、mainメソッド内の実行するメソッド(example.stopAll();またはexample.startAll();)の先頭にあるコメント(/)を削除します。

       /**
        * @param args
        */
       public static void main(String[] args) throws Exception {
            MBeanAPIExample1 example = new MBeanAPIExample1(args);
            example.connect();
            example.displayStatus();
/**         example.stopAll();
*/
/**         example.startAll();
*/
       }

22.3.3 Oracle BI Systems Management APIを使用した構成設定の更新

Oracle BI Systems Management APIを使用して、Oracle Business Intelligenceの構成設定を変更できます。この場合、次のようにWLSTコマンドを使用する方法と、Javaプログラムを使用する方法があります。

この項の例をコピーし、MBeanの詳細を他のMBeanの詳細に置き換えることによって、Oracle Business Intelligenceの各種構成設定(ログ・ファイルの設定やセキュリティ設定など)を更新できます。詳細は、第22.4項「Oracle BI Systems Management APIのJMX管理MBeanおよびメソッドの説明」を参照してください。

22.3.3.1 例: WLSTを使用して、電子メール送信者の表示名の構成設定を編集する

この例では、Oracle Business Intelligenceに接続してシステム・ロックを起動し、電子メール送信者の表示名の構成設定値を更新した後、システム・ロックを解除します。

WLSTを使用して、電子メール送信者の構成設定を更新するには:

  1. テキスト・エディタを開き、次のようなWLSTコマンドを入力します。

    # Example to demonstrate connecting to a BIEE domain using WLST,
    # and changing a simple configuration setting
    #
    # This script expects the following arguments:
    #
    # 1. wls.host (localhost)
    # 2. wls.port (7001)
    # 3. wls.user  (user1)
    # 4. wls.password  (password1)
    # 5. new email displayname
    # ===================================================================
     
    import sys
    import os
     
    # Check the arguments to this script are as expected.
    # argv[0] is script name.
    argLen = len(sys.argv)
    if argLen -1 != 5:
        print "ERROR: got ", argLen -1, " args."
        print "USAGE: wlst.cmd wls_connect.py WLS_HOST WLS_PORT WLS_USER WLS_PASSWORD EmailDisplayName"
        print "   eg: wlst.cmd wls_connect.py localhost 7001 user1 password1 FredBloggs" 
        exit()
     
    WLS_HOST = sys.argv[1]
    WLS_PORT = sys.argv[2]
    WLS_USER = sys.argv[3]
    WLS_PW = sys.argv[4]
    newDisplayName = sys.argv[5]
     
    print 'Connecting to '+ WLS_HOST+ ':' + WLS_PORT + ' as user: ' + WLS_USER + ' ...'
     
    # Connect to WLS
    connect(WLS_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')
    #bidomain=cmo
     
    print 'Calling lock ...'
    objs = jarray.array([], java.lang.Object)
    strs = jarray.array([], java.lang.String)
    invoke('lock', objs, strs)
     
    biinstances = get('BIInstances')
    biinstance = biinstances[0]
     
    print 'Connecting to BIInstance MBean ...'
    cd ('..')
    cd (biinstance.toString())
     
    servicestatus=get('ServiceStatus')
    print 'BIInstance MBean; ServiceStatus: ' + servicestatus
     
    biemailbean = get('EmailConfiguration')
    print 'Connecting to BIInstance Email MBean ...'
    cd ('..')
    cd (biemailbean.toString())
     
    oldDisplayName=get('SenderDisplayName')
    print 'Existing email displayname is: ' + oldDisplayName
    print 'Changing email displayname to: ' + newDisplayName + ' ...'
    set('SenderDisplayName', newDisplayName)
     
    print 'Calling commit ...'
    cd ('..')
    cd ('oracle.biee.admin:type=BIDomain,group=Service')
    objs = jarray.array([], java.lang.Object)
    strs = jarray.array([], java.lang.String)
    invoke('commit', objs, strs)
     
    print 'Committed OK'
     
    exit()
    
  2. スクリプトを保存します。

  3. \MW_HOME\wlserver_10.3\common\binフォルダに移動し、必要な引数を入力してスクリプトを実行します。

    たとえば、コマンドラインで次のように入力します。

    ./wlst.sh wlst_email_disp_name_obi.py localhost 7001 user1 password1 (UNIX)

    wlst wlst_wlst_email_disp_name_obi.cmd localhost 7001 user1 password1 (Windows)

    コマンド・ウィンドウ(およびログ・ファイル)に、次のようなプロンプトとメッセージが表示されます。

    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 help(domainCustom)
     
    Connecting to BIDomain MBean ...
    Connecting to BIInstance MBean ...
    BIInstance MBean; ServiceStatus: FULLY_STARTED
    Connecting to BIInstance Email MBean ...
    Existing email displayname is: Oracle Business Intelligence
    Changing email displayname to: FredBloggs ...
    Calling commit ...
    Committed OK
    
    Exiting WebLogic Scripting Tool.
    

22.3.3.2 例: Javaプログラムを使用して、電子メール送信者の表示名の構成設定を編集する

Javaプログラムを使用して、電子メール送信者の表示名の構成設定を編集するには:

  1. Javaエディタを開き、次に示す例のようなJavaプログラムをコンパイルします。

    package com.oracle.bi.example;
    import java.util.Hashtable;
    import javax.management.Attribute;
    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 and change a simple configuration setting..
     * <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 <code>wljmxclient.jar</code> and <code>wlclient.jar</code> on the classpath.
     */
    public class MBeanAPIExample3Edit {
           private String host;
           private int port;
           private String username;
           private String password;
           private String newDisplayName;
           private MBeanServerConnection mbs = null;
           private ObjectName biDomainMBeanName;
           private ObjectName biInstanceMBeanName;
           private ObjectName biEmailMBeanName;
           private MBeanAPIExample3Edit(String[] args) {
                   if (args.length < 5) {
                     System.out.println("Usage: MBeanAPIExample3Edit host port username password newDisplayName");
                    throw new IllegalArgumentException("Not enough arguments");
                 }
                 host = args[0];
                 port = Integer.parseInt(args[1]);
                 username = args[2];
                 password = args[3];
                 newDisplayName = args[4];
           }
           private void connect() throws Exception {
                 String jmxUrl = "service:jmx:t3://" + host + ":" + port +
    "/jndi/weblogic.management.mbeanservers.domainruntime"; System.out.println("Connecting using URL: " + jmxUrl + " ..."); Hashtable<String,String> h = new Hashtable<String,String>(); h.put(Context.SECURITY_PRINCIPAL, username); h.put(Context.SECURITY_CREDENTIALS, password); h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
    "weblogic.management.remote"); JMXConnector jmxConnector = JMXConnectorFactory.connect(new
    JMXServiceURL(jmxUrl), h); mbs = jmxConnector.getMBeanServerConnection(); System.out.println("Connected OK"); biDomainMBeanName = new
    ObjectName("oracle.biee.admin:type=BIDomain,group=Service"); ObjectName[]biInstanceMBeanNames=(ObjectName[])mbs.getAttribute
    (biDomainMBeanName, "BIInstances"); biInstanceMBeanName = biInstanceMBeanNames[0];
    // there should only be one System.out.println("Found BI Instance MBean: " +
    biInstanceMBeanName); } private void lock() throws Exception{ System.out.println("Locking domain ..."); Object[] args = new Object[]{}; String[] sig = new String[]{}; mbs.invoke(biDomainMBeanName, "lock", args, sig); System.out.println("Locked domain OK"); } private void commit() throws Exception{ System.out.println("Committing changes ..."); Object[] args = new Object[]{}; String[] sig = new String[]{}; mbs.invoke(biDomainMBeanName, "commit", args, sig); System.out.println("Committed changes OK"); } private void getEmailBean() throws Exception{ System.out.println("Getting Email MBean ..."); biEmailMBeanName = (ObjectName)mbs.getAttribute(biInstanceMBeanName, "EmailConfiguration"); System.out.println("Found BI Email MBean: " + biEmailMBeanName); } private void updateEmailDisplayName() throws Exception { String oldDisplayName = (String)mbs.getAttribute(biEmailMBeanName, "SenderDisplayName"); System.out.println("Existing email displayname is: " + oldDisplayName); System.out.println("Changing email displayname to: " + newDisplayName); mbs.setAttribute(biEmailMBeanName, new Attribute("SenderDisplayName", newDisplayName)); } /** * @param args */ public static void main(String[] args) throws Exception { MBeanAPIExample3Edit example = new MBeanAPIExample3Edit(args); example.connect(); example.getEmailBean(); example.lock(); example.updateEmailDisplayName(); example.commit(); } }
  2. \<wlserver>\server\libフォルダに移動し、クラス・パス、クラス名および必要な引数を指定してJavaプログラムを実行します。

    java -classpath <JavaClassName> <host> <port> <username> <password> <SenderDisplayName>

    例:

    java -classpath <MW_HOME>wls_10.3/server/lib/wjmxclient.jar com.oracle.bi.example.MBeanAPIExample3Edit localhost 7001 user1 password1 FredBloggs

    スペースを含む場合は、"Fred Bloggs"のように引用符を使用します。

    コマンド・ウィンドウ(およびログ・ファイル)に、次のようなプロンプトとメッセージが表示されます。

    Connecting using URL: service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.domainruntime ...
    Connected OK
    Found BI Instance MBean:
    oracle.biee.admin:type=BIDomain.BIInstance,biInstance=coreapplication,group=Service
    Getting Email MBean ...
    Found BI Email MBean: oracle.biee.admin:type=BIDomain.BIInstance.EmailConfiguration,biInstance=coreapplication,group=Service
    Locking domain ...
    Locked domain OK
    Existing email displayname is: Oracle Business Intelligence
    Changing email displayname to: FredBloggs
    Committing changes ...
    Committed changes OK
    
    

22.3.4 Oracle BI Systems Management APIを使用した高可用性とパフォーマンスのスケールアウト

高可用性とパフォーマンスの向上を図るために、Oracle BI Systems Management APIを使用して追加のホスト・コンピュータへのスケールアウトを実行できます。エンタープライズ・インストールを使用して新しいホスト・コンピュータにOracle Business Intelligenceをインストールし、その後次の例に示す手順と同様の方法でスケールアウトを実行します。

22.3.4.1 例: WLSTを使用して、サーバーのスケールアウトを実行する

この例では、ユーザーがOracle Business Intelligenceに接続してサーバーのスケールアウトを実行します。

スクリプトでWLSTコマンドを使用して、サーバーのスケールアウトを実行するには:

  1. テキスト・エディタを開いて、次に示す例のようなWLSTスクリプトを作成します。

    # Example to demonstrate connecting to a BIEE domain using WLST
    #  and do some scale-out operations.
    #
    # This scripts expects the following arguments:
    #
    # 1. wls.host (localhost)
    # 2. wls.port (7001)
    # 3. wls.user  (user1)
    # 4. wls.password  (password1)
    # 5. oracle instance name# 6. new count of bi servers
    # ===================================================================
     
    import sys
    import os
     
    # Check the arguments to this script are as expected.
    # argv[0] is script name.
    argLen = len(sys.argv)
    if argLen -1 != 6:
        print "ERROR: got ", argLen -1, " args."
        print "USAGE: wlst.cmd wls_connect.py WLS_HOST WLS_PORT WLS_USER WLS_PASSWORD"  OracleInstance numBIServers
        print "   eg: wlst.cmd wls_connect.py localhost 7001 user1 password1  instance2 2" 
        exit()
     
    WLS_HOST = sys.argv[1]
    WLS_PORT = sys.argv[2]
    WLS_USER = sys.argv[3]
    WLS_PW = sys.argv[4]
    oracleInstanceName = sys.argv[5]
    # convert string to int which is needed later
    newNumBIServers = int(sys.argv[6])
    
    
    print 'Connecting to '+ WLS_HOST+ ':' + WLS_PORT + ' as user: ' + WLS_USER + ' ...'
     
    # Connect to WLS
    connect(WLS_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 = get('BIInstances')
    biinstance = biinstances[0]
    
    oracleinstances = get('OracleInstances')
     
    print 'Connecting to BIInstance MBean ...'
    cd ('..')
    print 'About to cd to: ' + biinstance.toString()
    cd (biinstance.toString())
     
    servicestatus=get('ServiceStatus')
    print 'BIInstance MBean; ServiceStatus: ' + servicestatus
    
    print 'Looping through OracleInstances looking for: ' + oracleInstanceName
    matching = false
    for oi in oracleinstances:
        cd('..')
        print 'About to cd to: ' + oi.toString()    
        cd ( oi.toString() )
        id = get('Id')
        print 'Found instance with id: ' + id
        if id == oracleInstanceName:
            matching = oi
            break
            
    if matching :
        print 'Found matching OracleInstance...'
    else :
        print 'Failed to find target OracleInstance with name: ' + oracleInstanceName
        exit()
        
    deployments = get('BIInstanceDeployments')
    # Should only ever be one of these
    deployment = deployments[0]
    print 'Acquired BIInstanceDeployment : ' + deployment.toString()
    cd('..')
    cd ('oracle.biee.admin:type=BIDomain,group=Service')
    
    print 'Calling lock ...'
    objs = jarray.array([], java.lang.Object)
    strs = jarray.array([], java.lang.String)
    invoke('lock', objs, strs)
    
    cd('..')
    cd(deployment.toString())
    numBIServers = get('numBIServers')
    print 'Current number of BI Servers is:', numBIServers
    print 'About to set number of BI Servers to:', newNumBIServers
    set('numBIServers', newNumBIServers )
    
    print 'Successfully set number of BI Servers to', newNumBIServers
    print 'Calling commit ...'
    cd ('..')
    cd ('oracle.biee.admin:type=BIDomain,group=Service')
    objs = jarray.array([], java.lang.Object)
    strs = jarray.array([], java.lang.String)
    invoke('commit', objs, strs)
    
    print 'Committed OK'
    
    print 'Connecting to BIInstance MBean ...'
    cd ('..')
    cd (biinstance.toString())
    
    servicestatus=get('ServiceStatus')
    print 'BIInstance MBean; ServiceStatus: ' + servicestatus
    
    print 'Calling stop ...'
    objs = jarray.array([], java.lang.Object)
    strs = jarray.array([], java.lang.String)
    invoke('stop', objs, strs)
    
    servicestatus=get('ServiceStatus')
    print 'BIInstance MBean; ServiceStatus: ' + servicestatus
    
    print 'Calling start ...'
    objs = jarray.array([], java.lang.Object)
    strs = jarray.array([], java.lang.String)
    invoke('start', objs, strs)
    
    servicestatus=get('ServiceStatus')
    print 'BIInstance MBean; ServiceStatus: ' + servicestatus
    
    
    exit()
    
  2. スクリプトを保存します。

  3. \MW_HOME\wlserver_10.3\common\binフォルダに移動し、必要な引数を入力してスクリプトを実行します。

    たとえば、コマンドラインで次のように入力します。

    ./wlst.sh wlst_scaleout_obi.py localhost 7001 user1 password1 (UNIX)

    wlst wlst_wlst_scaleout_obi.cmd localhost 7001 user1 password1 (Windows)

    コマンド・ウィンドウ(およびログ・ファイル)に、次のようなプロンプトとメッセージが表示されます。

    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 help(domainCustom)
     
    Connecting to BIDomain MBean ...
    Connecting to BIInstance MBean ...
    About to cd to: oracle.biee.admin:type=BIDomain.BIInstance,biInstance=coreapplication,group=Service
    BIInstance MBean; ServiceStatus: FULLY_STARTED
    Looping through OracleInstances looking for: instance1
    About to cd to: oracle.biee.admin:oracleInstance=instance1,type=BIDomain.OracleInstance,group=Service
    Found instance with id: instance1
    Found matching OracleInstance...
    Acquired BIInstanceDeployment : oracle.biee.admin:oracleInstance=instance1,type=BIDomain.OracleInstance.BIInstanceDeployment,biInstance=coreapplication,group=Service
    Calling lock ...
    Current number of BI Servers is: 1
    About to set number of BI Servers to: 6
    Successfully set number of BI Servers to 6
    Calling commit ...
    Committed OK
    Connecting to BIInstance MBean ...
    BIInstance MBean; ServiceStatus: PARTIALLY_STARTED
    Calling stop ...
    BIInstance MBean; ServiceStatus: PARTIALLY_STARTED
    Calling start ...
    BIInstance MBean; ServiceStatus: FULLY_STARTED
    
    Exiting WebLogic Scripting Tool.
    

WLSTコマンドの使用の詳細は、『Oracle Fusion Middleware WebLogic Scripting Tool コマンド リファレンス』を参照してください。

22.3.4.2 例: Javaプログラムを使用して、サーバーのスケールアウトを実行する

Javaプログラムを使用して、サーバーのスケールアウトを実行するには:

  1. Javaエディタを開き、次に示す例のようなJavaプログラムをコンパイルします。

    package com.oracle.bi.example;
     
    import java.util.Hashtable;
     
    import javax.management.Attribute;
    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,
     * and do some scale-out operations.
     * <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.
     * <br/>
     * Note that you need <code>wljmxclient.jar</code> and <code>wlclient.jar</code> on the classpath.
     */
    public class MBeanAPIExample4ScaleOut {
           private String host;
           private int port;
           private String username;
           private String password;
           private String oracleInstanceName;
           private int newNumBIServers;
    
          private MBeanServerConnection mbs = null;
          private ObjectName biDomainMBeanName;
          private ObjectName biInstanceMBeanName;
          private ObjectName[] oracleInstanceMBeanNames; 
          private MBeanAPIExample4ScaleOut(String[] args) {
                 if (args.length < 6) {
                   System.out.println("Usage: MBeanAPIExample1Connect host port username password oracleInstanceName NumBIServers");
                   throw new IllegalArgumentException("Not enough arguments");
                       }
                       host = args[0];
                       port = Integer.parseInt(args[1]);
                       username = args[2];
                       password = args[3];
                       oracleInstanceName = args[4];
                       newNumBIServers = Integer.parseInt(args[5]);
           }
         private void connect() throws Exception {
                  String jmxUrl = "service:jmx:t3://" + host + ":" + port + "/jndi/weblogic.management.mbeanservers.domainruntime";
                  System.out.println("Connecting using URL: " + jmxUrl + " ...");
                  Hashtable<String,String> h = new Hashtable<String,String>();
                  h.put(Context.SECURITY_PRINCIPAL,   username);
                  h.put(Context.SECURITY_CREDENTIALS, password);
                  h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
                  JMXConnector jmxConnector = JMXConnectorFactory.connect(new JMXServiceURL(jmxUrl), h);
                  mbs = jmxConnector.getMBeanServerConnection();
                  System.out.println("Connected OK");
     
                  biDomainMBeanName = new ObjectName("oracle.biee.admin:type=BIDomain,group=Service");
                  ObjectName[] biInstanceMBeanNames = (ObjectName[])mbs.getAttribute(biDomainMBeanName, "BIInstances");
                  biInstanceMBeanName = biInstanceMBeanNames[0]; // there should only be one
                  System.out.println("Found BI Instance MBean: " + biInstanceMBeanName);
    oracleInstanceMBeanNames = (ObjectName[])mbs.getAttribute(biDomainMBeanName, "OracleInstances");
    for (ObjectName oracleInstanceMBeanName : oracleInstanceMBeanNames) {
          System.out.println("Found Oracle Instance MBean: " + oracleInstanceMBeanName);
      }
             }
    private void displayStatus() throws Exception {
       String status = (String)mbs.getAttribute(biInstanceMBeanName, "ServiceStatus");
       System.out.println("Status is: " + status);
    }
    private void lock() throws Exception {
       System.out.println("Locking domain ...");
       Object[] args = new Object[]{};
       String[] sig  = new String[]{};
       mbs.invoke(biDomainMBeanName, "lock", args, sig);
       System.out.println("Locked domain OK");
    }
    private void commit() throws Exception {
       System.out.println("Committing changes ...");
       Object[] args = new Object[]{};
       String[] sig  = new String[]{};
       mbs.invoke(biDomainMBeanName, "commit", args, sig);
       System.out.println("Committed changes OK");
    }
        
    private ObjectName findMatchingOracleInstanceMBean() throws Exception {
       for (ObjectName oracleInstanceMBeanName : oracleInstanceMBeanNames) {
         String oracleInstanceId =  (String)mbs.getAttribute(oracleInstanceMBeanName, "Id");
         if (oracleInstanceId.equals(oracleInstanceName)) {
             return oracleInstanceMBeanName;
         }
    }
    throw new RuntimeException("Cannot find oracle instance: " + oracleInstanceName);
    }
    
    private void scaleOut(ObjectName oracleInstanceMBeanName) throws Exception {
       ObjectName[] biInstanceDeploymentMBeanNames = (ObjectName[])mbs.getAttribute(oracleInstanceMBeanName, "BIInstanceDeployments");
       ObjectName biInstanceDeploymentMBeanName = biInstanceDeploymentMBeanNames[0]; // there should only be one
       System.out.println("Found BI Instance Deployment MBean: " + biInstanceDeploymentMBeanName);
            
       int numBIServers = (Integer)mbs.getAttribute(biInstanceDeploymentMBeanName, "NumBIServers");
       System.out.println("Found Num BI Servers: " + numBIServers);
       System.out.println("Setting Num BI Servers to: " + newNumBIServers);
       mbs.setAttribute(biInstanceDeploymentMBeanName, new Attribute("NumBIServers", newNumBIServers));
     }
        
    private void stopAll() throws Exception {
       System.out.println("Stopping instance ...");
       Object[] args = new Object[]{};
       String[] sig  = new String[]{};
       mbs.invoke(biInstanceMBeanName, "stop", args, sig);
       System.out.println("Stopped instance OK");
    }
     
    private void startAll() throws Exception {
       System.out.println("Starting instance ...");
       Object[] args = new Object[]{};
       String[] sig  = new String[]{};
       mbs.invoke(biInstanceMBeanName, "start", args, sig);
       System.out.println("Started instance OK");
    }
     
          public static void main(String[] args) throws Exception {
                     MBeanAPIExample4ScaleOut example = new    MBeanAPIExample4ScaleOut(args);
                     example.connect();
                     example.displayStatus();
                     ObjectName oiMBeanName = example.findMatchingOracleInstanceMBean();
                     example.lock();
                     example.scaleOut(oiMBeanName);
                     example.commit();
                     example.stopAll();
                     example.startAll();
                     example.displayStatus();
          }
    }
    
  2. \<wlserver>\server\libフォルダに移動し、クラス名と必要な引数を指定してJavaプログラムを実行します。

    例:

    java <JavaClassName> <host> <port> <username> <password> <oracleInstanceName> <newNumBIServers>

  3. \<wlserver>\server\libフォルダに移動し、クラス・パス、クラス名および必要な引数を指定してJavaプログラムを実行します。

    java -classpath <JavaClassName> <host> <port> <username> <password> <oracleInstanceName> <newNumBIServers>

    例:

    java -classpath <MW_HOME>wls_10.3/server/lib/wjmxclient.jar com.oracle.bi.example.MBeanAPIExample4ScaleOut localhost 7001 user1 password1 instance1 3

    コマンド・ウィンドウ(およびログ・ファイル)に、次のようなプロンプトとメッセージが表示されます。

    Connecting using URL: service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.domainruntime ...
    Connected OK
    Found BI Instance MBean:
    oracle.biee.admin:type=BIDomain.BIInstance,biInstance=coreapplication,group=Service
    Found Oracle Instance MBean: oracle.biee.admin:oracleInstance=instance1,type=BIDomain.OracleInstance,group=Service
    Status is: PARTIALLY_STARTED
    Locking domain ...
    Locked domain OK
    Found BI Instance Deployment MBean: oracle.biee.admin:oracleInstance=instance1,type=BIDomain.OracleInstance.BIInstanceDeployment,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 Oracle BI Systems Management APIを使用したメトリックの取得

Fusion Middleware Controlのメトリック・ブラウザを使用する以外に、ダイナミック・モニタリング・サービス(DMS)やWLSTコマンドを使用してOracle Business Intelligenceのメトリックを表示することもできます。この項では、これらの方法について説明します。

22.3.5.1 ダイナミック・モニタリング・サービスを使用したメトリックの取得

ダイナミック・モニタリング・サービス(DMS)を使用して、Oracle Business Intelligenceのメトリックを表示できます。このサービスにアクセスするには、次のURLを使用します。

http://<host>:7001/dms

左側のペインのメトリック表リストから「非J2EEメトリック」を選択してOracle Business Intelligenceのメトリックを表示します。これは、Fusion Middleware Controlのメトリック・ブラウザで表示されるものと同じリストです。

ダイナミック・モニタリング・サービスを使用することで、メトリックのスナップショットを迅速に取得できます。Microsoft Excelスプレッドシートを使用したWeb問合せのソースとして特定のメトリックのURLを指定し、このWeb問合せに対して、アーカイブ・シートに値をコピーする処理と一定期間ループで問合せを更新する処理を自動的に実行するマクロを結合します。

たとえば、ダイナミック・モニタリング・サービスを使用して、Oracle_BI_Generalというメトリック表の詳細を表示するとします。メトリック表リストでOracle_BI_Generalリンクをクリックすると、画面の右側にこの表が表示されます。このメトリック表は、Active_Execute_RequestsやTotal_Sessionsなどのいくつかのモニター値で構成されています。メトリック・ブラウザに表示されたこの表の情報をWLSTコマンドの一部として使用できます。

WLSTコマンドを使用したDMSメトリックへのアクセスの詳細は、『Oracle Fusion Middleware WebLogic Scripting Tool コマンド リファレンス』のDMSカスタムWLSTコマンドに関する章を参照してください。

22.3.5.2 WLTSコマンドを使用したメトリックの取得

WLSTコマンドを使用して、Oracle Business Intelligenceのメトリックを取得できます。

WLSTコマンドを使用してメトリックを取得するには:

  1. MW_HOME/ORACLE_HOME/common/binディレクトリに移動します。

  2. WLSTユーティリティを実行します。

  3. 次の例のように、connectコマンドを使用してOracle BIシステムに接続します。

    connect('user','password','t3://<host>:7001')

  4. 次のプロンプトが表示されたら、オンライン・モードになっています。

    wls:/bifoundation_domain/serverConfig>

これで、DMSカスタムWLSTコマンドを対話的に使用できるようになりました。たとえば、先頭にOracle_BIが付くすべてのメトリック表を表示するには、次のコマンドを入力します。

wls:/bifoundation_domain/serverConfig> displayMetricTables('Oracle_BI*')

このコマンドでは、Oracle BIのメトリックごとにデータの長大なリストが生成されます。そのため、Oracle_BI_Generalなどの特定のメトリック表に焦点を絞ったほうが役立ちます。次のコマンドでは、次に示すサンプルのような出力が表示されます。

wls:/bifoundation_domain/serverConfig> displayMetricTables('Oracle_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
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:/instance1/coreapplication_obis1
Queries/sec.value:      0
ServerName:     /instance1/coreapplication_obis1
Succeeded_Initblock_Execution_Ratio_as_%.value: 0
Succeeded_Logins_Ratio_as_%.value:      7
Total_sessions.value:   0

WLSTのスクリプト作成機能を使用してDMSコマンドをJythonスクリプトに組み込み、必要なメトリックをファイルに格納できます。次にこのようなスクリプトの例を示します。

# 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 
connect('biadmin','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 = str(SimpleDateFormat("dd-MMM-yyyy_HH-mm-ss").format(Date()))
output_filename = start_time + "_" + output_file_metric_ref + "_dump.txt"
#
# Open the file and write summary of metric to be dumped
file = open(output_filename,'w')
print >>file, "Start Metric Dump of: " + str(metric_table) + " : " + str(metric_of_interest) + " at " + str(SimpleDateFormat("dd-MMM-yyyy HH-mm-ss").format(Date()))
#
#
# 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
# interest is tested for and only the value of that metric is output to file.
#
counter = 0
while counter <= sample_length:
    results = displayMetricTables(metric_table)
    for table in results:
        name = table.get('Table')
        rows = table.get('Rows')
    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.get(columnName)
        if columnName == metric_of_interest:
            print >>file, str(SimpleDateFormat("dd-MMM-yyyy HH-mm-ss-SSS").format(Date())) + "," + str(value)
    counter = counter + 1
file.close()
disconnect()

「Oracle_BI_Thread_Pool」などの一部のOracle BIメトリック表は、実際には2つのディメンションで構成される表です。「Oracle_BI_Thread_Pool」表では、「Server」や「Usage_Tracking」などの様々な「名前」のメトリック値の問合せを実行できます。この場合、必要なメトリック値をファイルにエクスポートするには、前のスクリプト例のループで使用しているロジックを、2つのディメンションを扱うように変更する必要があります。次のスクリプト例では、このような場合の処理方法の1つを示しています。

# 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
connect('biadmin','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._Request/sec.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 = str(SimpleDateFormat("dd-MMM-yyyy_HH-mm-ss").format(Date()))
output_filename = start_time + "_" + output_file_metric_ref + "_dump.txt"
#
# Open the file and write summary of metric to be dumped
file = open(output_filename,'w')
print >>file, "Start Metric Dump of: " + str(metric_table) + " : " + str(metric_of_interest) + " for Category: " + str(category_of_interest) + " at " + str(SimpleDateFormat("dd-MMM-yyyy HH-mm-ss").format(Date()))
#
#
counter = 0
while counter <= sample_length:
    results = displayMetricTables(metric_table)
    for table in results:
        name = table.get('Table')
        rows = table.get('Rows')
    rowCollection = rows.values()
    iter = rowCollection.iterator()
    while iter.hasNext():
        row = iter.next()
        if row.containsValue(category_of_interest):
            rowType = row.getCompositeType()
            keys = rowType.keySet()
            keyIter = keys.iterator()
            while keyIter.hasNext():
                columnName = keyIter.next()
                value = row.get(columnName)
                if columnName == metric_of_interest:
                    print >>file, str(SimpleDateFormat("dd-MMM-yyyy HH-mm-ss-SSS").format(Date())) + "," + str(value)
    counter = counter + 1
file.close()
disconnect()

22.4 Oracle BI Systems Management APIのJMX管理MBeanおよびメソッドの説明

この項では、WLSTスクリプトおよびJavaプログラムを使用したシステム管理タスクの実行に使用する、Oracle BI Systems Management APIのJMX管理MBeanを示します。コードから管理MBeanとその属性およびメソッドを参照する必要があります。この項では管理MBeanのリストを示します。各管理MBeanで利用できる属性およびメソッドについては、JavaDocページで説明しています。

たとえば、WebブラウザでJavaDocファイルを表示し、管理MBean EmailConfigurationMBeanをクリックします。すると、関連する属性とメソッドがすべて表示されるため、その中の適切な属性名とメソッド名をWLSTスクリプトまたはJavaプログラムで使用できます。

次のディレクトリにあるJavaDocファイルを参照してください。

ORACLE_HOME/doc/javadoc/bifoundation/jmxapi/index.html

表22-1は、Oracle BI Systems Management APIのJMX管理MBeanを示しています。

表22-1 Oracle BI Systems Management APIのJMX管理MBean

管理MBean 説明

AvailabilityConfigurationMBean

Oracle Business Intelligenceのプロセスの可用性に影響するいくつかのオプションを構成するためのMBeanインタフェースを提供します。

BIComponentMBean

BIドメインのコンポーネントのMBeanインタフェースを定義します。

BIDomainMBean

BIドメインを管理するためのMBeanインタフェースを定義します。

BIInstanceDeploymentMBean

Oracleインスタンスへのシステム・コンポーネントのデプロイメント(プロビジョニング)について記述するMBeanインスタンスを定義します。

BIInstanceMBean

システム・コンポーネントを管理するためのMBeanを定義します。

BILogConfigurationMBean

Oracle Business Intelligenceのログ・ファイルの設定およびレベルを管理するためのMBeanを定義します。

BISizeAgeLogConfigurationMBean

問合せログ・ファイルの設定を管理するためのMBeanインタフェースを定義します。

EmailConfigurationMBean

システム・コンポーネントの電子メールの構成を管理するためのMBeanインタフェースを定義します。

MarketingConfigurationMBean

システム・コンポーネントのマーケティング構成を管理するためのMBeanインタフェースを定義します。

OracleInstanceMBean

Oracleインタフェースを管理するためのMBeanインタフェースを定義します。

PerformanceConfigurationMBean

システム・コンポーネントのパフォーマンス構成を管理するためのMBeanインタフェースを定義します。

PresentationConfigurationMBean

システム・コンポーネントのプレゼンテーション構成を管理するためのMBeanインタフェースを定義します。

PresentationServerConfigurationMBean

プレゼンテーション・サービスの構成を管理するためのMBeanインタフェースを定義します。

ScaleOutSupportMBean

ドメインのスケールアウトをサポートする操作を提供します。

SchedulerDatabaseMBean

スケジューラのデータベース接続設定を管理するためのMBeanインタフェースを定義します。

SecurityConfigurationMBean

システム・コンポーネントの集中セキュリティ構成を管理するためのMBeanインタフェースを定義します。

ServerConfigurationMBean

Oracle BIサーバーに関連する設定を管理するためのMBeanインタフェースを定義します。


MBeanブラウザを使用して管理MBeanにアクセスすることもできます。詳細は、第2.4項「Fusion Middleware Control MBeanブラウザによるOracle Business Intelligence JMX MBeansの管理」を参照してください。