Saturday 17 January 2009

Performance Gathering of your Oracle Portal

Oracle Portal is doing marvels.
You had it rolled out or you are in the development state. You would like to have some people access the portal . Now you want to know the performance of your portal. Here is where Oracle has come with some Portal performance scripts that will help you gather the necessary information of your portal.

Below are the steps that you need to do to get the performance pretty running.

Step 1 - Ensure you are familiar with this site (http://www.oracle.com/technology/products/ias/portal/performance_10g1014.html)
You may also have a look at the readme of the scripts

Step 2 - Download the scripts
You will have to download these scripts and place it in a directory of your Portal server.

Installation of Performance Scripts

a) Copy the Zip file to a directory within the server and uninstall the directory into a location within the server (D:\Ajai\portal_performance\perf).

b) In a database within the server or a different database ( if one is available which is recommended), do the necessary activities.

a. Create tablespace to load the tables.
create tablespace OWA_PERF_LOG datafile 'D:\ORACLE\ORADATA\AJ10GDB\OWA_PERF_LOG01.DBF' size 50M autoextend on extent management local segment space management auto;

b. Create tablespace to load the Indexes.
create tablespace OWA_PERF_LOG_INDEX datafile 'D:\ORACLE\ORADATA\AJ10GDB\OWA_PERF_LOG_INDEX01.DBF' size 50M autoextend on extent management local segment space management auto;

c. Create tablespace to load the Materialized Views.
create tablespace OWA_PERF_LOG_MAT_VIEWS datafile 'D:\ORACLE\ORADATA\AJ10GDB\OWA_PERF_LOG_MAT_VIEWS01.DBF' size 50M autoextend on extent management local segment space management auto;

d. Create a default tablespace for the owa_perf user.
create tablespace OWA_PERF_TBS datafile 'D:\ORACLE\ORADATA\AJ10GDB\OWA_PERF_TBS01.DBF' size 50M autoextend on extent management local segment space management auto;

e. Grant proper privileges to this user.
GRANT RESOURCE, CREATE SESSION, CREATE MATERIALIZED VIEW, CREATE SYNONYM TO owa_perf;

f. Go to the Directory where the zip file has been unzipped and install from the directory of perf.
cd D:\Ajai\portal_performance\perf

sqlplus owa_perf/owa_perf@AJ10GDB


g. Install the scripts from this directory. During installation, the script will ask to enter value 1, value 2. Leave both the values as blank, if partitioning is not required. Give proper names for the tablespaces when prompted.
Below example shows how the scripts are installed.
@install/install.sql
Enter value for 1:
Enter value for 2:
Enter value for table_tablespace: OWA_PERF_LOG
Enter value for index_tablespace: OWA_PERF_LOG_INDEX
Enter value for mview_tablespace: OWA_PERF_LOG_MAT_VIEWS

This will install the performance related tables into the database.

Changes required on the server to enable logging

a) Make changes to httpd.conf file. Ensure you have a backup of the file before making any changes to the configuration.
Internal Application Server – D:\oracle\dmzportal\Apache\Apache\conf\httpd.conf

1) Change from

#
ErrorLog "D:\oracle\oramidtier\Apache\Apache\bin\rotatelogs logs/error_log 43200"
#

To

#
# ErrorLog "D:\oracle\oramidtier\Apache\Apache\bin\rotatelogs logs/error_log 43200"
ErrorLog D:\oracle\oramidtier\Apache\Apache\logs\error_log
#


2) Set the LogLevel to info.

#
LogLevel info
OraLogMode odl
#




External Application Server - D:\oracle\dmzportal\Apache\Apache\conf\httpd.conf


1) Change from

#
ErrorLog "D:\oracle\dmzportal\Apache\Apache\bin\rotatelogs logs/error_log 43200"
#

To

#
# ErrorLog "D:\oracle\dmzportal\Apache\Apache\bin\rotatelogs logs/error_log 43200"
ErrorLog D:\oracle\dmzportal\Apache\Apache\logs\error_log
#


2) Set the LogLevel to info.

#
LogLevel info
OraLogMode odl
#

b) Make changes to web.xml file
Ensure you have a backup of the file before making any changes to the configuration. Ensure the logmode is set to perf for the different servlets and pages in the web.xml directory. This is required for the information to be logged accordingly. The same changes have to be made to the Internal and External Application Server.

Internal Application Server – D:\oracle\oramidtier\j2ee\OC4J_Portal\applications\portal\portal\WEB-INF\web.xml
External Application Server – D:\oracle\dmzportal\j2ee\OC4J_Portal\applications\portal\portal\WEB-INF\web.xml


e.g.


RepositoryServlet
oracle.webdb.repository.servlet.RepositoryServlet

logmode
perf




PortalServlet
oracle.webdb.portal.servlet.PortalServlet

logmode
perf




page
oracle.webdb.page.ParallelServlet

logmode
perf




c) Make changes to orion-web.xml file
Ensure you have a backup of the file before making any changes to the configuration. Ensure the directory names are specific to the web provider in the orion-web.xml file.

Internal Application Server – D:\oracle\oramidtier\j2ee\OC4J_Portal\application-deployments\portal\portal\orion-web.xml
External Application Server – D:\oracle\dmzportal\j2ee\OC4J_Portal\application-deployments\portal\portal\orion-web.xml

e.g.







d) Make changes to Oracle Application Server Web Cache
Changes has to be made to the Oracle Applications Server Web Cache so that the access logs are getting logged into the logs properly.

I. Start the Oracle Web Cache Manager by the URL given below.
Internal Application Server – http://int_portal.ajdomain.com:9400/webcacheadmin
External Application Server – http://ext_portal.ajdomain.com:9400/webcacheadmin

II. In the navigator pane, select "Logging and Diagnostics" > "Access Logs".
The Access Log page appears in the right pane.

III. In the Access Log page, under "Site-Specific Access Log Configuration", verify that the access_log is using the "End-User Performance Monitoring Format" format style, and that ESI Fragment Requests are being logged.

IV. If not, select it and hit the "Edit Selected" button.
Select "Yes" for "Enabled".
Select "Log" for "ESI Fragment Requests".
Select the "End-User Performance Monitoring Format" format style.
Choose "Submit".



V. In the Web Cache Manager main window, choose "Apply Changes".
.


VI. Restart Web Cache.



Ensure the above changes are being done to the Applications in the Internal Application Server and the External Applications Server.


e) Stop and Start the Middle Tier Services for the changes to take effect.
The Application Server Console and the opmn services have to be stopped and started for the changes to take effect.

Running of Performance Scripts

a) After starting the Oracle Portal, navigate through a few pages. This is to gather statistics on the pages that have been used for navigation.

b) Ensure that the performance scripts have access to the log files. If not, the log files will need to be copied to a location from where the performance scripts will have access. This is required to load the details from the log into the database.
Access to the error_log, access_log and application.log file are required. The scripts would require “perl utility” to load the details in the log to the database. Once loaded, data can be retrieved from the tables in the owa_perf schema which will help in analyzing the performance of the portal.

c) Create the necessary temp directory that will be required during the execution of the scripts. This is required to log the information during the loading activity by the sqlloader.

d) Ensure that proper path has been given and the environment variables have been set before loading the data from the logs into the database.
e.g.
set ORACLE_HOME=D:\oracle\orainfra
set ORACLE_SID=AJ10GDB
set PATH=D:\oracle\orainfra\OPatch;D:\oracle\orainfra\opmn\bin;D:\oracle\orainfra\perl\5.6.1\bin\MSWin32-x86;%PATH%

e) Ensure that you are in the directory from where the loadlogs.pl script is residing.
e.g.
cd D:\Ajai\portal_performance\perf\loader

f) Ensure that the parameters below are available before loading
1) version – 9.0.4
2) logical host name – (name identified as the logical host)
internal application server - aj_portal_internal.ajdomain.com
external application server – aj_portal_external.com
3) userid/pwd and tnsname for the database to get connected - owa_perf/owa_perf@AJ10GDB
4) Temp Directory (The directory where the temp files are written to) - D:\oracle\temp

g) Run the loadlogs.pl. Ensure that you are in the directory of the scripts/ loader, before running the scripts. Ensure that the parameters are proper when carrying out with the activity, else the script will fail to execute properly. The parameter –delete_old_logs are given to delete the existing logs into the database. If the logs are not being deleted, this parameter can be avoided. But this has to be done carefully, else duplicate entries will get loaded into the database.

E.g. Internal Application Server

perl loadlogs.pl -version 9.0.4 -logical_host aj_portal_internal.ajdomain.com -connection owa_perf/owa_perf@AJ10GDB -temp_dir D:\oracle\temp -webcache_logfile D:\oracle\oramidtier\webcache\logs\access_log -delete_old_logs

perl loadlogs.pl -logical_host aj_portal_internal.ajdomain.com -connection owa_perf/owa_perf@AJ10GDB -temp_dir D:\oracle\temp -http_logfile D:\oracle\oramidtier\Apache\Apache\logs\error_log -delete_old_logs

perl loadlogs.pl -logical_host aj_portal_internal.ajdomain.com_1 -connection owa_perf/owa_perf@AJ10GDB -temp_dir D:\oracle\temp -oc4j_logfile D:\oracle\oramidtier\j2ee\OC4J_Portal\application-deployments\portal\OC4J_Portal_default_island_1\application.log -delete_old_logs

perl loadlogs.pl -logical_host aj_portal_internal.ajdomain.com_2 -connection owa_perf/owa_perf@AJ10GDB -temp_dir D:\oracle\temp -oc4j_logfile D:\oracle\oramidtier\j2ee\OC4J_Portal\application-deployments\portal\OC4J_Portal_default_island_2\application.log -delete_old_logs


E.g. External Application Server

perl loadlogs.pl -version 9.0.4 -logical_host aj_portal_external.com -connection owa_perf/owa_perf@AJ10GDB -temp_dir D:\oracle\temp -webcache_logfile D:\oracle\dmzportal\webcache\logs\access_log -delete_old_logs

perl loadlogs.pl -logical_host aj_portal_external.com -connection owa_perf/owa_perf@AJ10GDB -temp_dir D:\oracle\temp -http_logfile D:\oracle\dmzportal\Apache\Apache\logs\error_log -delete_old_logs

perl loadlogs.pl -logical_host aj_portal_external.com_1 -connection owa_perf/owa_perf@AJ10GDB -temp_dir D:\oracle\temp -oc4j_logfile D:\oracle\dmzportal\j2ee\OC4J_Portal\application-deployments\portal\OC4J_Portal_default_island_1\application.log -delete_old_logs

perl loadlogs.pl -logical_host aj_portal_external.com_2 -connection owa_perf/owa_perf@AJ10GDB -temp_dir D:\oracle\temp -oc4j_logfile D:\oracle\dmzportal\j2ee\OC4J_Portal\application-deployments\portal\OC4J_Portal_default_island_2\application.log -delete_old_logs

The above scripts will load the data from the mentioned directories into the database.

h) Run the below command to get the reports generated from the logs that were loaded into the database.
cd D:\Ajai\portal_performance\perf\scripts

sqlplus owa_perf/owa_perf@AJ10GDB @reports.sql


i) To access the reports, double click on the reports.html directory that will load the reports. The reports.html will be in the scripts directory.
cd D:\Ajai\portal_performance\perf\scripts