プライマリ・コンテンツに移動
Oracle® Fusion Middleware Oracle Business Intelligence Enterprise Editionシステム管理者ガイド
12c (12.2.1.1.0)
E77226-02
目次へ移動
目次

前
前へ
次
次へ

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

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

この項では、これらの方法について説明します。

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

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

このサービスにアクセスするには、次のURLを使用します。

http://<host>:<AdminServerのポート>/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メトリックへのアクセスの詳細は、WLSTコマンドを使用したメトリックの取得を参照してください。

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

WLSTを使用すると、システムに関するメトリックを収集できます。

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

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

  1. ORACLE_HOME/oracle_common/bin/ディレクトリに移動します。
  2. WLSTユーティリティを実行します。
  3. 次の例のように、connectコマンドを使用してOracle BIシステムに接続します。

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

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

    wls:/bi/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コマンドをPythonスクリプトに組み込み、必要なメトリック値をファイルに格納できます。次にこのようなスクリプトの例を示します。

# 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:9500')
#
# 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:9500')
#
# 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()