Metrics Related WLST Commands

Diagnosing and Tuning Oracle Reports 24-25 In 11g, job level tracing for an individual report does not exist. Instead, users can only search for a job in Enterprise Manager based on the job’s ECID. ■ For Oracle Reports Servlet rwservlet, specify tracing options in the logging xml file present at the following location: FMW_HOMEuser_ projectsdomainsdomainnameconfigfmwconfigserversWLS_ REPORTSlogging.xml ■ For Oracle Reports Bridge tracing, specify tracing options in Oracle Enterprise Manager. You can also manually specify the tracing options in the logging.xml file present at the following location: ORACLE_ INSTANCEconfigReportsBridgeComponentReportsBridgeNamelo gging.xml Following is the outline of the information output to the logging file. Example 24–1 Oracle Reports Builder +------------------------------------------+ | Report Builder Profiler statistics | +------------------------------------------+ Total Elapsed Time: 8.00 seconds Reports Time: 7.00 seconds 87.50 of TOTAL ORACLE Time: 1.00 seconds 12.50 of TOTAL UPI: 0.00 seconds SQL: 1.00 seconds TOTAL CPU Time used by process: NA In Example 24–1 , focus your tuning efforts on time formatting Reports Time the data rather than on querying and fetching it. Table 24–18 Oracle Reports Builder Field Description Total Elapsed Time Time spent in executing the report. Reports Time Time spent in formatting the retrieved data. Also displayed as a percentage of Total Elapsed Time. ORACLE Time Time spent in retrieving the data. Also displayed as a percentage of Total Elapsed Time. UPI SQL queries only. Time spent in establishing a database connection, then parsing and executing the SQL. SQL Time taken by the database server to fetch the data percent of time spent executing SRW.DO_SQL statements, EXEC_SQL statements, PLSQL cursors, and so on. Note: If your data source is a non-SQL data source such as Text or an XML pluggable data source, the values for ORACLE Time, UPI, and SQL display as 0. 24-26 Publishing Reports to the Web with Oracle Reports Services

24.3.8 RW_SERVER_JOB_QUEUE Table

The RW_SERVER_JOB_QUEUE table provides another window aside from that available through Enterprise Manager into the Reports Server job queues. The Reports Server posts information about the current report to the database when the job is enqueued and finished. This information is inserted into the RW_SERVER_JOB_QUEUE table that includes the following data: ■ The name of the job ■ The job submitter ■ The output format ■ The jobs current status ■ When the job was queued, started, and subsequently finished Table 24–19 lists and describes the information contained in the RW_SERVER_JOB_ QUEUE table: Table 24–19 Structure of the RW_SERVER_JOB_QUEUE Table Column Name Description JOB_QUEUE States whether the job listed is CURRENT, PAST, or SCHEDULED. JOB_ID System generated job identification number. JOB_TYPE Type of job, such as report, rwurl, and so on, as defined in the Reports Server configuration file, rwserver.conf. JOB_NAME Job submission name or file name if no value for JOBNAME is specified. STATUS_CODE Current status of job. See Table 24–20 for more information about status codes. STATUS_MESSAGE Full message text relating to status code includes error messages if report is terminated. See Table 24–20 for more information about status codes. COMMAND_LINE Complete command line submitted for this job submission. OWNER User who submitted the job. On the Web, the default user is the OS user who owns the Web server. DESTYPE Destination where report output is sent. DESNAME Name of the report output if not going to the Reports Server cache. SERVER Reports Server to which the report was submitted. QUEUED Date and time the job submission was received and queued by the given Reports Server. STARTED Date and time the job submission was run. FINISHED Date and time the submitted job completed. RUN_ELAPSE Elapsed time between started and finished time, in units of milliseconds. TOTAL_ELAPSE Elapsed time between queued and finished time, in units of milliseconds. LAST_RUN Date and time a scheduled job was last run. Diagnosing and Tuning Oracle Reports 24-27 Users can view this table if you grant them SELECT access. This will enable them to query the job submission of interest and determine the jobs current status. You can also give them a view of this data by implementing a Reports Server Queue screen. You can implement such a screen by creating a report based directly on this table. Doing so displays the queue report as a job submission by the user. Conversely, the real-time update of the table with the status of job submissions makes it very easy for administrators to know exactly how many concurrent users have requested jobs to be run on the Reports Server. NEXT_RUN Date and time a scheduled job will run. REPEAT_INTERVAL Frequency on which to run a job. REPEAT_PATTERN Repeat pattern for example, every minute, every hour, or every day. CACHE_KEY Cache key used to compare a request with an already cached result. The key is a string that uniquely indicates a report output result without considering the time the job was run. For example, if two requests have the same key, it means they will both generate the same output if they are running at the same time, although the outputs may be used for different purposes for example, sent to e-mail or saved to a file. CACHE_HIT Indicates whether the job result was fetched from cache instead of running itself. Table 24–20 Job Submission Status Codes Status Code Defined PLSQL Constant Description for Status Code 1 ENQUEUED Job is waiting in queue. 3 RUNNING Report is currently running. 4 FINISHED Job submission has completed successfully. This code will not change once set. 5 TERMINATED_W_ERR Job has ended with an error. 7 CANCELED Job was canceled by user request. 8 SERVER_SHUTDOWN Job was canceled due the Reports Server shutting down. 11 TRANSFERRED Job is transferred to another server in the cluster note: clustering was deprecated in 10g Release 2 10.1.2. This code will not change once set. In this case, the job is submitted to another Reports Server as a new job so that the user can query the new Reports Server for the new jobs status. 12 VOID_FINISHED Job is finished but output is void because of reaching limit of cache capacity. 13 ERROR_FINISHED Output is successfully generated but failed to send to destinations. 15 EXPIRED Scheduled report has expired. Table 24–19 Cont. Structure of the RW_SERVER_JOB_QUEUE Table Column Name Description 24-28 Publishing Reports to the Web with Oracle Reports Services By counting the number of entries in the RW_SERVER_JOB_QUEUE table that have a status code indicating that the job has been queued but not completed, it is possible to return an accurate number of the current active users on the server. For example, you could use the following query: SELECT Count FROM RW_SERVER_JOB_QUEUE WHERE STATUS_CODE IN 1, -- ENQUEUED 2, -- OPENING 3 -- RUNNING AND JOB_TYPE = Scheduled

24.3.8.1 Updating the Database with Queue Activity

The Reports Server job queue is implemented through the use of a PLSQL case API. It functions to update the queue table with the queue information as requests are made. This implementation is defined in the following path: ORACLE_HOME\reports\admin\sql\rw_server.sql This script is certified to worked against Oracle 10g database. To implement the queue, perform the following steps:

1. Load the rw_server.sql file to a database this file is included with your Oracle

Reports Services installation: ORACLE_HOME\reports\admin\sql. This creates a schema that owns the report queue information and has execute privileges on the server queue API. For backward compatibility with Oracle6i Reports, this also creates a view called RW_SERVER_QUEUE.

2. Set the repositoryconn property of the jobStatusRepository element in

the server configuration file ORACLE_ INSTANCE\config\ReportsServerComponent\server_ name\rwserver.conf for Standalone servers and DOMAIN_ HOMEconfigfmwconfigserversWLS_SERVER_ NAMEapplicationsreports_ versionconfigurationrwserver.conf for In-process servers to the connection string of the schema that owns the queue data. For more information, see Section 8.2.1.12, jobStatusRepository . Alternatively, you can set the jobstatusRepository in Oracle Enterprise Manager. When the server starts, it connects as the defined user and logs job submissions. Note: While the table contains the date and time a report was queued, run, and finished, it is not a good idea to use a query based on the fact that a job has a defined QUEUED and STARTED time but no FINISHED value. If a report ends due to an unexpected error, such as invalid input, then the FINISHED column remains NULL. However, the STATUS_CODE and STATUS_MESSAGE both indicate there has been a failure and list the cause of that failure. Note: Oracle Reports uses the dbconn property of the jobstatusrepository element to connect to the database when updating the log information about job queues