Tools for Analyzing Problems in Oracle Applications Jeff Slavitz (415)
High-level overview of: Oracle Diagnostics Oracle Diagnostics Oracle Application Manager Oracle Application Manager Statspack Statspack Tracing Tracing Working with support Other tools and resources Bring up questions as we go along Agenda
Oracle Diagnostics Users can run Diagnostics on their own! Diagnostics v2.x replaces/supplements standalone diagnostic tests Use for regression testing Write your own Diagnostics
Installing Oracle Diagnostics Note is the portal to Diagnostics knowledge. Instructions on how to install the latest Diagnostics pack (comes out monthly) Instructions on how to install the latest Diagnostics pack (comes out monthly) Diagnostic catalog showing a list of all diagnostics and their function Diagnostic catalog showing a list of all diagnostics and their function Update your Diagnostics regularly. You probably have a very old version.
What are Oracle Diagnostics? Diagnostics are divided into three categories: Setup Diagnostics Setup Diagnostics Examine profile values, general application setupExamine profile values, general application setup Data Collection Data Collection Examine invoice, customer, project, …Examine invoice, customer, project, … Activity Diagnostics Activity Diagnostics Examine a process – period closing, invoicing, …Examine a process – period closing, invoicing, …
Logging into Diagnostics Users with Sysadmin responsibility can login through Oracle Application Manager Everybody can login using the URL: /OA_HTML/jtfqalgn.htm
Click GO …
Click the Advanced tab …
…select an Application …
… then select a test from the column on the left.
Fill in parameters and click Run Test Some tests require a user to have a particular responsibility
When test is complete click View Report
Review report and messages. Some ‘problems’ found are really warnings.
Users can run Setup, Activity and Data Collection tests.
You can , print and save test output
Oracle Diagnostics Summary Available to end-users and DBAs Use for proactive and reactive testing Monthly updates from Support Customize with your own Diagnostics
Oracle Application Manager
Oracle Applications Manager Variety of monitoring, analysis and administration tools Wealth of information Workflow setup and monitoring Downtime management Spawns concurrent request ‘OAM Application Dashboard Collection’ (verify only one!)
Go to Rapid Install Portal page. Click Apps Logon Links.
Click ’Oracle Applications Manager’
and login ….
Alternatively, login from Sysadmin screen
Main OAM login screen
Click ‘Site Map’. This is the Administration screen.
Click ‘License Manager’ to license new products. Alternative to adlicmgr.sh
Click ‘Autoconfig’ to update your context file
Nicer interface than the old context editor
From the Site Map, this is the Monitoring screen.
Monitor SQL Activity
Monitor JServ usage
Monitor Database Sessions. Click on AUDSID...
… for details of a database session.
Concurrent Processing usage
Back to Site Map – Maintenance screen
Click Applied Patches and then Timing Details to find the details of a particular patch application (useful for upgrade timing!).
Click Timing Reports to view adadmin activity
Diagnostics and Repair screen
OAM Summary Lots of tools Lots of data Use site map to find tools that are useful to you Watch that you never have more than one OAM Application Dashboard Collection concurrent request running
Statspack
Statspack Creates permanently stored database performance statistical information Uses ‘snapshots’ to report on performance Adjust time between snapshots based on reporting needs General performance use long time (1 hour+) General performance use long time (1 hour+) Specific problem use short time (15 minutes) Specific problem use short time (15 minutes)
Installing Statspack Note is your portal to Statspack knowledge In init.ora set TIMED_STATISTICS=TRUE Create new tablespace for Statspack user Install Statspack connect / as sysdba connect / Creates the user PERFSTAT which owns all Statspack data
Running Statspack sqlplus perfstat/perfstat execute statspack.snap [wait some amount of time] execute statspack.snap Consider scheduling with cron or using $ORACLE_HOME/rdbms/admin/spauto.sql
Running Statspack For more detailed data collection specify a level when executing snap. 0 gathers general performance data 0 gathers general performance data 5 (default) additionally gathers info on high resource usage SQL statements 5 (default) additionally gathers info on high resource usage SQL statements 6 additionally gathers execution plan information for statements found in level 5 6 additionally gathers execution plan information for statements found in level 5 10 additionally gathers child latches 10 additionally gathers child latches
Running Statspack To specify a level: execute statspack.snap(i_snap_level=>10) There are other parameters: Capture data for a specific session only Capture data for a specific session only Define threshholds for which level 5 snaps consider high usage SQL statements Define threshholds for which level 5 snaps consider high usage SQL statements Set note for more detail on running ‘snap’.
Generating a Statspack Report Now you’ve got all this great data, now what? sqlplus perfstat/pwd Previously run snapshots will be displayed. You will be prompted for: The beginning snapshot Id The beginning snapshot Id The ending snapshot Id The ending snapshot Id The name of the report text file to be created The name of the report text file to be created Begin and End snapshots must not include an instance shutdown during that time period See note for more detail on spreport
Statspack Output spreport generates a LOT of output with a LOT of good information. Instance cache size Instance cache size Load profile (reads, writes, …) Load profile (reads, writes, …) Instance efficiency ratio (buffer hit %, buffer nowait %, …) Instance efficiency ratio (buffer hit %, buffer nowait %, …) Top 5 events and much more Top 5 events and much more See note for more detail
Statspack Summary Schedule on a regular basis to monitor general performance Review data with spreport on a regular basis Use when unknown system performance problem
Tracing
Tracing Records every SQL statement executed to a file Records timing information if TIMED_STATISTICS is true Allows you to see what is happening inside a report, concurrent program or form The easy part is getting the trace file Review note for more details
Tracing Tracing concurrent programs Tracing within Forms Tracing within Self-Service
Concurrent Program Tracing
Forms Tracing
Enable Trace, perform activity to be traced …
… and then disable trace
Self-Service Tracing Set profile option FND: Diagnostics to Yes at any level. Site allows everybody to do this. In Self-Service, click on Diagnostics icon Select Set Trace Level Execute process in Self-Service Click on Diagnostics icon to turn off trace
Now what? Trace file located in udump directory. Check init.ora for location or SELECT value FROM v$parameter WHERE name=‘user_dump_dest’ A single trace may result in multiple trace files, especially with self-service Use ‘tkprof’ to convert trace file to a more useful format
Tkprof Usage: tkprof tracefile outputfile [explain= ] [table= ] [print= ] [insert= ] [sys= ] [sort= ] [print= ] [insert= ] [sys= ] [sort= ] table=schema.tablename Use 'schema.tablename' with 'explain=' option. table=schema.tablename Use 'schema.tablename' with 'explain=' option. explain=user/password Connect to ORACLE and issue EXPLAIN PLAIN. explain=user/password Connect to ORACLE and issue EXPLAIN PLAIN. print=integer List only the first 'integer' SQL statements. print=integer List only the first 'integer' SQL statements. insert=filename List SQL and data inside INSERT statements. insert=filename List SQL and data inside INSERT statements. sys=no Do not list SQL statements run as user SYS. sys=no Do not list SQL statements run as user SYS. sort=option Sort options sort=option Sort options For example: tkprof inputfile outputfile explain=apps/xxx sort='(prsela,exeela,fchela)'
SQL Statement SELECT A.JOB_ID, A.ORGANIZATION_ID FROM PER_ASSIGNMENT_STATUS_TYPES S, PER_ASSIGNMENTS_F A, PA_IMPLEMENTATIONS I WHERE A.JOB_ID IS NOT NULL AND A.PRIMARY_FLAG = 'Y' AND TRUNC(:B2 ) BETWEEN TRUNC( A.EFFECTIVE_START_DATE ) AND TRUNC( A.EFFECTIVE_END_DATE ) AND A.PERSON_ID = :B1 AND A.BUSINESS_GROUP_ID = I.BUSINESS_GROUP_ID AND A.ASSIGNMENT_TYPE = 'E' AND S.PER_SYSTEM_STATUS = 'ACTIVE_ASSIGN' AND S.ASSIGNMENT_STATUS_TYPE_ID = A.ASSIGNMENT_STATUS_TYPE_ID Timing in CPU seconds call count cpu elapsed disk query current rows Parse Execute Fetch total Tkprof output
Execution Plan Rows Row Source Operation NESTED LOOPS 406 NESTED LOOPS 406 TABLE ACCESS FULL PA_IMPLEMENTATIONS_ALL 406 TABLE ACCESS FULL PA_IMPLEMENTATIONS_ALL 406 TABLE ACCESS BY INDEX ROWID PER_ALL_ASSIGNMENTS_F 406 TABLE ACCESS BY INDEX ROWID PER_ALL_ASSIGNMENTS_F INDEX RANGE SCAN PER_ASSIGNMENTS_F_FK1 (object id 42980) 406 TABLE ACCESS BY INDEX ROWID PER_ASSIGNMENT_STATUS_TYPES 406 TABLE ACCESS BY INDEX ROWID PER_ASSIGNMENT_STATUS_TYPES 406 INDEX UNIQUE SCAN PER_ASSIGNMENT_STATUS_TYPE_PK (object id 43099) 406 INDEX UNIQUE SCAN PER_ASSIGNMENT_STATUS_TYPE_PK (object id 43099) For more details on tkprof review note For more details on explain plan review note
Working with Support Help is just a phone call away
Working with Support Make the most out of Metalink search ability Use Advanced Search Use Advanced Search Enter exact text of error message Enter exact text of error message Specify form or report name, if known Specify form or report name, if known Search Technical Forums Search Technical Forums Open Service Request in parallel with trying to solve problem
Working with Support Recognize Support is busy Some problems are easier to solve than others Be nice – the Support community is small If problem is outside of analyst’s area of expertise help him realize that and request a SR transfer If analyst’s time zone is an issue, request a SR transfer
Working with Support If not getting prompt response you may need to more aggressively manage your SR Frequent updates to SR for status Frequent updates to SR for status Three updates without analyst response changes SR to immediate response required Three updates without analyst response changes SR to immediate response required You need to call 800 number to see if analyst is out, to ping analyst or to duty manage SR For repeated problems have your manager talk with the Oracle customer rep
Other Tools and Resources Third party products such as Foglight google asktom.oracle.com NorCalOAUG and OAUG events
Questions? Other tips and techniques? Want a copy of this presentation? Feel free to or call me … Jeff Slavitz (415)