• No results found

Oracle troubleshooting

N/A
N/A
Protected

Academic year: 2021

Share "Oracle troubleshooting"

Copied!
128
0
0

Loading.... (view fulltext now)

Full text

(1)THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Activity Guide. D61523GC20. Edition 2.0. March 2011. D72555. Oracle University and Sentra inversiones y servicios LTDA use only. Oracle WebLogic Server 11g: Diagnostics and Troubleshooting.

(2) Disclaimer This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. Restricted Rights Notice If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract. Trademark Notice Oracle and Java are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.. Author Bill Bell Technical Contributors and Reviewers Will Lyons, TJ Palazzolo, Serge Moiseev This book was published using:. Oracle Tutor. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Copyright © 2011, Oracle and/or its affiliates. All rights reserved..

(3) Practices for Lesson 1 .....................................................................................................................................1-1 Practices for Lesson 1....................................................................................................................................1-2 Practices for Lesson 2 .....................................................................................................................................2-1 Practices for Lesson 2....................................................................................................................................2-2 Practice 2-1: Connecting to the Classroom Grid ............................................................................................2-3 Practice 2-2: Developing a Custom Monitoring Script ....................................................................................2-5 Solution Instructions .......................................................................................................................................2-9 Practices for Lesson 3 .....................................................................................................................................3-1 Practices for Lesson 3....................................................................................................................................3-2 Practice 3-1: Using Guardian to Evaluate a Domain ......................................................................................3-3 Solution Instructions .......................................................................................................................................3-7 Practices for Lesson 4 .....................................................................................................................................4-1 Practices for Lesson 4....................................................................................................................................4-2 Practice 4-1: Harvesting Diagnostic Metrics ...................................................................................................4-3 Solution Instructions .......................................................................................................................................4-8 Practice 4-2: Monitoring Diagnostic Metrics ...................................................................................................4-9 Practices for Lesson 5 .....................................................................................................................................5-1 Practices for Lesson 5....................................................................................................................................5-2 Practice 5-1: Configuring and Monitoring Diagnostic Events .........................................................................5-3 Solution Instructions .......................................................................................................................................5-6 Practice 5-2: Tracing a Client Request ...........................................................................................................5-7 Solution Instructions .......................................................................................................................................5-11 Practices for Lesson 6 .....................................................................................................................................6-1 Practices for Lesson 6....................................................................................................................................6-2 Practice 6-1: Troubleshooting a Running JVM ...............................................................................................6-3 Practice 6-2: Troubleshooting Applications on JRockit ..................................................................................6-7 Practices for Lesson 7 .....................................................................................................................................7-1 Practices for Lesson 7....................................................................................................................................7-2 Practice 7-1: Investigating Classpath Problems .............................................................................................7-3 Practices for Lesson 8 .....................................................................................................................................8-1 Practices for Lesson 8....................................................................................................................................8-2 Practice 8-1: Investigating Server Problems ..................................................................................................8-3 Solution Instructions .......................................................................................................................................8-7 Practices for Lesson 9 .....................................................................................................................................9-1 Practices for Lesson 9....................................................................................................................................9-2 Practice 9-1: Investigating JDBC Problems ...................................................................................................9-3 Solution Instructions .......................................................................................................................................9-8 Practices for Lesson 10 ...................................................................................................................................10-1 Practices for Lesson 10..................................................................................................................................10-2 Practice 10-1: Investigating JMS Problems ....................................................................................................10-3 Solution Instructions .......................................................................................................................................10-10. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Oracle WebLogic Server 11g: Diagnostics and Troubleshooting Table of Contents i. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Table of Contents.

(4) Practices for Lesson 12 ...................................................................................................................................12-1 Practices for Lesson 12..................................................................................................................................12-2 Practice 12-1: Investigating Node Manager Problems ...................................................................................12-3 Solution Instructions .......................................................................................................................................12-8 Practices for Lesson 13 ...................................................................................................................................13-1 Practices for Lesson 13..................................................................................................................................13-2 Practice 13-1: Investigating Proxy Problems ..................................................................................................13-3 Solution Instructions .......................................................................................................................................13-7 Practice 13-2: Investigating Cluster Replication Problems .............................................................................13-8. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Oracle WebLogic Server 11g: Diagnostics and Troubleshooting Table of Contents ii. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 11 ...................................................................................................................................11-1 Practices for Lesson 11..................................................................................................................................11-2 Practice 11-1: Investigating SSL Problems ....................................................................................................11-3 Solution Instructions .......................................................................................................................................11-9 Practice 11-2: Investigating Security Realm Problems ...................................................................................11-10 Solution Instructions .......................................................................................................................................11-15.

(5) THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Chapter 1. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1. Chapter 1 - Page 1. Oracle University and Sentra inversiones y servicios LTDA use only. Practices for Lesson 1.

(6) Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 1. Practices Overview. There are no practices for this lesson.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1. Chapter 1 - Page 2.

(7) THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Chapter 2. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2. Chapter 2 - Page 1. Oracle University and Sentra inversiones y servicios LTDA use only. Practices for Lesson 2.

(8) Practices Overview In the practices for this lesson, you connect to your practice machine for the first time. You then write a WLST script to monitor a running server.. Naming Conventions The instructions for the course practices use variable names to refer to frequently used locations on your file system. Some of these are also defined as Linux environment variables. Other variable names will be introduced in later practices as needed. Variable Path <MIDDLEWARE_HOME> /u01/app/oracle/Middleware/11.1.1 <WEBLOGIC_HOME>. <MIDDLEWARE_HOME>/wlserver_10.3. <STUDENT>. /home/oracle/wls11g_trouble. <CURRENT_LAB>. <STUDENT>/labs/LabXX_YY, where XX_YY is the current practice number. <LAB_WORK>. <STUDENT>/work. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2 Chapter 2 - Page 2. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 2.

(9) Duration: 10 minutes Skills Learned At the end of this practice, you should be able to: • Identity your classroom virtual machine (VM) instance • Connect to a classroom virtual machine by using an NX client • Establish an NX session Overview Oracle University employs a Grid VM infrastructure to allow students to work with complex lab environments from anywhere in the world. You will be assigned a specific Linux VM instance on this Grid for you to perform the subsequent course practices. In this practice, you use NoMachine, an NX client, to interact with this remote VM as if it were running on your local machine. Instructions 1. Obtain your VM hostname, username, and password from your instructor. Grid hosts are typically of the form egNNNN.us.oracle.com. 2. From the Windows Start menu, select All Programs > NX Client for Windows > NX Connection Wizard. 3. Click Next. 4. Enter the following values (NNNN is your assigned VM instance number):. 5.. 6.. Field. Value. Session. egNNNN. Host. egNNNN.us.oracle.com. Click Next. Select the GNOME option and click Next.. Click Finish. The NX Login window appears. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2 Chapter 2 - Page 3. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 2-1: Connecting to the Classroom Grid.

(10) Enter your assigned Username and Password. Confirm that your new session, egNNNN, is selected. Click Login.. 8.. Confirm that your VM Linux desktop is displayed. Additional Notes: − When you leave your remove session, click the “X” in the top-right corner of the window. You do not need to Terminate your remote session, instead you may choose Disconnect, which leaves programs running on the remote system. You may leave programs running on the remote system for the duration of the course. − After a period of inactivity, your remote session may lock. If this occurs, you must simply enter your Password to resume the session.. Solution Instructions No solution exists for this practice.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2 Chapter 2 - Page 4. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. 7..

(11) Duration: 35 minutes Skills Learned At the end of this practice, you should be able to: • Navigate the WLS runtime MBean hierarchy • Retrieve and display MBean attributes • Use loop and condition Jython constructs Overview The Oracle Medical Records Java EE application, abbreviated MedRec, provides patients with the ability to view current and previous medical examinations and prescriptions over the Web. MedRec, like all Java EE applications, is dependent on various server resources. These resources include JDBC data sources, JMS queues and topics, and shared libraries. In this practice, you develop a custom WLST script that periodically monitors the health of the MedRec application, its host server, and its supporting resources. The MedRec domain infrastructure used in this practice is depicted in the following diagram:. Instructions 1. Initialize the MedRec server infrastructure. a. Launch the Lab Framework command shell by executing the <STUDENT>/bin/prompt.sh file. Tip: Remember that you can refer to the Naming Conventions section earlier in this guide for the definition of variables such as <STUDENT>. b. c.. Change the current directory to <CURRENT_LAB>. Execute the following: ant setup_exercise Note: When the Ant script completes its work you will see the message “BUILD SUCCESSFUL” in the Lab Framework command shell. Important: You must log in to each WebLogic Server as it comes up (see below). The Lab Framework creates files and folders in your <LAB_WORK> directory. The framework: − Starts the Oracle database and loads the MedRec schema − Creates a skeleton MedRec domain from a template Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2 Chapter 2 - Page 5. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 2-2: Developing a Custom Monitoring Script.

(12) − − − − − 2.. Creates a JDBC data source Creates a JMS server and module Creates a work manager Deploys the shared libraries Deploys the MedRec application. − Copies a test client to <LAB_WORK>, which you will use in a later practice. Connect to the server runtime MBean hierarchy. a. Create a new folder: <LAB_WORK>/scripts. b. Launch an editor and create a new file: <LAB_WORK>/scripts/monitorMedRec.py. c.. 3.. Use the connect() WLST command to connect to the MedRecSvr1 managed server (port 7021). Tip: Remember, the three arguments you will be using with connect() are an adminlevel username, password, and server URL. Each argument must be delimited (for example in single quotes). The protocol of the URL, if omitted, defaults to t3, which is what you want. d. Use the serverRuntime() command to switch to the server’s runtime hierarchy. Print server, application, and data source MBean attributes. a. Create a new while loop whose contents iterate indefinitely, as shown below. while 1: # Loop contents here. b.. Tip: Remember that in Jython, you use whitespace (a tab, for example) to denote the contents of a loop or condition. Within the loop, locate this server’s ThreadPoolRuntime MBean and retrieve its throughput attribute. For example: threadPool = getMBean('/ThreadPoolRuntime/ThreadPoolRuntime') throughput = threadPool.getThroughput(). c.. Similarly, retrieve the status attribute of the following application MBean: /ApplicationRuntimes/medrec/ComponentRuntimes/MedRecSvr1_/medrec Tip: This MBean represents the Web module with the context path /medrec, found in the enterprise application medrec.ear.. d. e.. f.. Get the value of the openSessionsCurrentCount attribute from the same MBean. Retrieve the following MBean: /JDBCServiceRuntime/MedRecSvr1/JDBCDataSourceRuntimeMBeans/ MedRecGlobalDataSourceXA. Get the following attributes from this MBean: state numAvailable activeConnectionsCurrentCount Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2 Chapter 2 - Page 6. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. − Starts the administration server and a managed server (be sure to log in as weblogic/Welcome1 as each server boots).

(13) Print all the collected attributes. Tip: You can convert numeric values to text by using either of the following techniques: print 'Text ', num print 'Text ' + str(num) Tip: Optionally, you can format floating point values such as throughput by using code like the following: print '%.1f'%(throughput). h.. Add the following import statement to the top of the file: import time as jythontime. i.. Add a 1 second pause within the while loop: jythontime.sleep(1). 4.. Tip: Alternatively, you can call the equivalent operation in the Java language: Thread.sleep(1000). j. Save your script. Monitor the server without any load. a. Locate your Lab Framework prompt or start a new one. Navigate to <LAB_WORK>/scripts. b. Use WLST to run your new script: java weblogic.WLST monitorMedRec.py c.. 5.. Confirm that the current status of the application is DEPLOYED and the state of the data source is Running. Correct any errors. Tip: If you need it, a completed script can be found at <CURRENT_LAB>/solution. Tip: If you must restart your servers at any point in the course, use the startWebLogic.sh and startServer1.sh scripts found in your domain. d. Leave the script running. Monitor the server under load. a. Launch a second Lab Framework prompt by using <STUDENT>/bin/prompt.sh.. b. Navigate to <LAB_WORK>/client. c. d.. e.. Execute the runclient.sh script. Note: You may ignore any warnings in the MedRecSvr1 window about logging. Return to your monitoring script output. Confirm that the number of active sessions has increased by 1. The data source active connections may have increased by 1 as well. After the client completes its execution, if the number of active connections went to 1, it should return to 0. Note: You may not see the active database connections go up. It is very possible that a database connection is retrieved, used, and returned within the 1 second sleep time. Execute the runclients.sh script. This script simulates 10 concurrent users.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2 Chapter 2 - Page 7. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. g..

(14) g.. Return to your monitoring script output. Confirm that the number of active sessions has increased by 10. Also, depending on the responsiveness of the server and database, you may witness the number of data source connections increase as well. Kill the monitoring script.. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. f.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2 Chapter 2 - Page 8.

(15) 1.. Launch the Lab Framework command shell by executing the <STUDENT>/bin/prompt.sh file.. 2. 3.. Change the current directory to <CURRENT_LAB>. Execute the following: ant setup_solution The Lab Framework performs the same tasks as described in the “Initialize the MedRec server infrastructure” section. The solution monitoring script can be found at <CURRENT_LAB>/solution/monitorMedRec.py.. 4.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2 Chapter 2 - Page 9. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Solution Instructions.

(16) Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2. Chapter 2 - Page 10.

(17) THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Chapter 3. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3. Chapter 3 - Page 1. Oracle University and Sentra inversiones y servicios LTDA use only. Practices for Lesson 3.

(18) Practices Overview In this practice you will use Guardian to evaluate an existing domain. Naming Conventions In addition to the variable names listed earlier, these practices use the following variable name to refer to a frequently used location on your file system. This value is also defined as a Linux environment variable. Variable. Path. <GUARDIAN_HOME> /u01/app/oracle/Guardian/10.3.2. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3 Chapter 3 - Page 2. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 3.

(19) Duration: 35 minutes Skills Learned At the end of this practice, you should be able to: • Update Guardian with newer problem signatures • Deploy the Guardian agent to a domain • Activate and inventory a domain • Use Guardian to evaluate a domain for problems • Correct a problem identified by Guardian Overview Regularly running Oracle Guardian allows you to quickly detect and fix common problems with your domain’s configuration. Guardian consists of two parts: a graphical interface and an agent that runs on every server in your domain. In this practice, you activate the Guardian agent within your domain, and then use the Guardian tool to connect to and evaluate your domain. You also use this opportunity to correct a problem detected by Guardian. Normally, you would use your Oracle Support account to download the latest Guardian problem signatures from the Web, but due to the constraints of the lab environment, a signature pack has already been downloaded for you. Tip: Unless otherwise indicated, all labs require the MedRecDomain domain. If you do not have this domain, follow the Solution Instructions for the “Developing a Custom Monitoring Script” practice. Instructions 1. Initialize the lab environment. a. Start your administration server, if not already started. b. Launch a Lab Framework command shell, if not already open. c. Change the current directory to <CURRENT_LAB>. d. Execute the following: ant setup_exercise The Lab Framework updates the MedRecDomain domain with a configuration problem that Guardian will later detect. 2. Update and launch Guardian. a. Locate the <GUARDIAN_HOME>/repository/archives directory. Rename the file weblogic-signatures.jar to weblogic-signatures.jar.old.. b. Locate the <CURRENT_LAB>/resources/weblogic-signatures.jar file. Copy this file. c. Paste the newer signature file into the <GUARDIAN_HOME>/repository/archives directory.. d. e.. Why? You are replacing the signature file that came with the Guardian installation with a later signature file. Launch a Terminal and navigate to <GUARDIAN_HOME>. Execute the following: export PATH=$MIDDLEWARE_HOME/jdk160_18/bin:$PATH ./guardian Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3 Chapter 3 - Page 3. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 3-1: Using Guardian to Evaluate a Domain.

(20) 3.. When prompted, enter the following new Workspace: <LAB_WORK>/guardianWorkspace. Then click Finish.. Tip: Replace <LAB_WORK> with the actual path. Deploy the Guardian agent. a. Launch a Web browser and access the WLS administration console: http://localhost:7020/console b. Log in as weblogic/Welcome1 and Lock the console. c.. In the Domain Structure panel, click the domain name, MedRecDomain.. d. e. f. g.. Select the Enable Oracle Guardian Agent check box and click Save. Activate your changes. Kill (Ctrl + c) your administration and managed servers. Launch two Terminals and restart the servers: cd /home/oracle/wls11g_trouble/work/domains/MedRecDomain ./startWebLogic.sh cd /home/oracle/wls11g_trouble/work/domains/MedRecDomain ./startServer1.sh. 4.. Tip: Alternatively, open two tabs within a single Terminal window. Tip: To avoid supplying credentials each time a server is started, recall that you can optionally create a boot.properties file for each of your servers. Activate and inventory a domain. a. Return to the Guardian application. b. On the main toolbar, click Activate.. c. d.. 5.. Enter the location and credentials of your administration server and click Finish. An initial domain inventory is generated and displayed. Browse the contents of the Servers and JDBC sections. Evaluate a domain. a. Click the Evaluate button on the toolbar. The Evaluation Wizard appears. b. Confirm that MedRecDomain is selected and enter the Domain Credentials. c. In the Bundle column, select the All Signatures option. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3 Chapter 3 - Page 4. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. f..

(21) e.. Select the Create Shortcut check box. Click Finish. When the evaluation finishes, an evaluation summary is generated and displayed. Confirm that you have at least one Detected Signature. For example:. f.. 6.. Locate and select the signature concerning HTTP POST. Tip: To avoid scrolling, maximize the evaluation summary panel. g. Read the details of this problem signature in the Description section. If time permits at the end of the practice, you can read about any remaining detected signatures as well. Resolve a detected problem. a. Return to the console and Lock it. Tip: You will have to log in again since the admin server has been restarted. b. Locate and select the MedRecSvr1 server. c. Click the Protocols > HTTP tab. d. Set the value of Max Post Size to 1048576. Click Save.. e. f. g. h. i. j.. Why? The value of -1 means an unlimited post size. You are setting it to a more reasonable 1 MB. Repeat the previous steps to update the Max Post Size of the MedRecAdmSvr server. Activate your changes. Note: You may ignore any errors in the server windows. Kill and restart your servers. Return to Guardian. Select File > Close All. Click the Shortcut Explorer tab.. k. l.. Double-click the shortcut for MedRecDomain. Perform another evaluation. Verify that the HTTP POST (MaxPostSize) problem is no longer detected. m. When you are finished with the practice, do the following: Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3 Chapter 3 - Page 5. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. d..

(22) Exit Guardian. Use the console to disable the Guardian agent for the domain. Restart both servers.. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. 1) 2) 3). Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3 Chapter 3 - Page 6.

(23) There is no solution for this practice. If you only partially completed the practice instructions, however, then you need to undo what you have done by following these steps: 1. Launch the Lab Framework command shell by executing the <STUDENT>/bin/prompt.sh file. 2. 3.. Change the current directory to <CURRENT_LAB>. Execute the following: ant setup_solution The Lab Framework: −. Makes a backup copy of your current work. − −. Starts database and WebLogic servers, if not already started Disables the Guardian agent. −. Updates server protocol settings. −. (Re)deploys the MedRec application. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3 Chapter 3 - Page 7. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Solution Instructions.

(24) Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3. Chapter 3 - Page 8.

(25) THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Chapter 4. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4. Chapter 4 - Page 1. Oracle University and Sentra inversiones y servicios LTDA use only. Practices for Lesson 4.

(26) Practices Overview In these practices you will set up WebLogic Diagnostic Framework harvesters, watches, and notifications. You will also use the Monitoring Dashboard to view diagnostic information as charts and graphs.. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 4. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4 Chapter 4 - Page 2.

(27) Duration: 40 minutes Skills Learned At the end of this practice, you should be able to: • Setup an existing JMS queue for diagnostic notifications • Create a system diagnostic module • Configure metric collectors for several MBean types • Trigger notifications under various MBean watch conditions • Access diagnostic archives and inspect recorded metrics Overview Patients have reported intermittent problems with the MedRec application. Before contacting the development team and starting to troubleshoot, however, the IT group would like to get more insight into the server and application. The WebLogic Diagnostics Framework (WLDF) allows you to collect and record server and application metrics over time for later analysis. WLDF also supports watch conditions that can trigger notifications, such as posting a JMS message or sending an SNMP trap. In this practice, you configure a new system-wide WLDF module along with several metric collectors (harvesters), watches, and notifications. The diagnostic configuration is shown in the following diagram:. Instructions 1. Create a JMS queue for diagnostic notifications. a. Copy the following file to <LAB_WORK>/client: <CURRENT_LAB>/resources/runclients.sh Overwrite any previous version of the file. b. Launch a Lab Framework command shell, if not already open. c. Navigate to <CURRENT_LAB>/resources and execute the createWLDFQueue.py WLST script. d. Access the admin console. e. From the Domain Structure panel, select Services > Messaging > JMS Modules. f. Select the MedRec-jms module. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4 Chapter 4 - Page 3. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 4-1: Harvesting Diagnostic Metrics.

(28) 2.. 3.. Confirm that a new queue is available named WLDFNotificationQueue. Note its JNDI Name:. Create a system diagnostic module. a. Lock the console. b. From the Domain Structure panel, select Diagnostics > Diagnostic Modules. c. Click New. d. Name the module MedRecDiagnostics and click OK. e. Edit the new module. f. Click the Targets tab. g. Select MedRecSvr1 and click Save. Define a metric collector (harvester). a. Click the Configuration > Collected Metrics tab. b. Set the Sampling Period to 30000 (30 seconds) and click Save. c. Click the New button. d. Click Next. Note: Since this diagnostic module is targeted to a managed server, only the Server Runtime MBeans apply. e. From the select box, select the weblogic.management.runtime. JDBCConnectionPoolRuntimeMBean option. Click Next. f. Move the following attributes from the Available column to the Chosen column: ActiveConnectionsCurrentCount CurrCapacity LeakedConnectionCount Click Next. g. Note the available values for Collected Instances, but make no selection. Click Finish. Note: If you do not identify specific MBean instances, WLDF collects the selected attributes from all available instances. h. Click New once again. i. Repeat this process to define the following additional metric: Field. Value. MBean Server Location. ServerRuntime. MBean Type. weblogic.management.runtime. WebAppComponentRuntimeMBean Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4 Chapter 4 - Page 4. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. g..

(29) Collected Instances. Select the option that contains the text: Name=MedRecSvr1/medrec, ServerRuntime=MedRecSvr1. Create a diagnostic JMS notification. a. Click the Configuration > Watches and Notifications tab. b. Click the Notifications tab at the bottom of the screen.. c. d. e. f.. 5.. OpenSessionsCurrentCount. Click New. For the Type field, select the JMS Message option. Click Next. Enter JMSNotification as the Notification Name, and click Next. Enter the following values: Field. Value. JMS Destination JNDI Name. com.medrec.jms.WLDFNotificationQueu e. Connection Factory JNDI Name. weblogic.jms.XAConnectionFactory. Click Finish. Tip: Be sure you type these values exactly as shown. Create diagnostic watches. a. Click the Watches tab at the bottom of the screen. Then click New. b. Enter JDBCWatch for the Watch Name, and confirm that the Watch Type is Collected Metrics. Click Next. c. Click the Add Expressions button. d. Click Next. e. Select the same JDBCConnectionPoolRuntimeMBean that is being collected and click Next. f. Click Next to watch all instances of this MBean. g. Enter the following values: Field. Value. Message Attribute. ActiveConnectionsCurrentCoun t. Operator. >. Value. 1. Click Finish. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4 Chapter 4 - Page 5. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. 4.. Collected Attributes.

(30) k.. 6.. Click Next. Select the Use a Manual Reset Alarm option and click Next. Move the JMSNotification option from the Available column to the Chosen column. Click Finish. Repeat this process to configure a second watch for the Web application metric being collected: Field. Value. Watch Name. SessionWatch. Watch Type. Collected Metrics. MBean Server Location. ServerRuntime. MBean Type. weblogic.management.runtime. WebAppComponentRuntimeMBean. Instance. Select the option that contains the text: Name=MedRecSvr1/medrec, ServerRuntime=MedRecSvr1. Message Attribute. OpenSessionsCurrentCount. Operator. >. Value. 10. Config Watch Alarm. Use a manual reset alarm. Chosen. JMSNotification. l. Activate your changes. Trigger WLDF notifications. a. From a Lab Framework prompt, execute <LAB_WORK>/client/runclients.sh. Note: The test clients require a few minutes to finish. Recall that the metric collector is running every 30 seconds. b. From the administration console, return to the MedRec-jms JMS module. Tip: Remember that you can return to a prior screen by using the breadcrumb trail at the top of the console. c. Click the WLDFNotificationQueue. d. Click the Monitoring tab. e. Confirm that at least one message has been added to the queue.. f.. Tip: If there are no current messages try running the test client again. Locate the shell running MedRecSvr1. Confirm that the watch notification was also written to the server log. For example: Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4 Chapter 4 - Page 6. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. h. i. j..

(31) 7.. Within the message, find the collected value of either the JDBC or session MBean metric. g. Return to the console and Lock it. h. Navigate to your MedRecDiagnostics module. i. Update the module’s configuration and disable the metric collector. Tip: From the Configuration > Collected Metrics tab, uncheck Enabled. j. Similarly, disable the watch and notification component of the module. k. Activate your changes. Browse collected metrics by using the admin console. a. From the Domain Structure panel, select Diagnostics > Log Files. b. Locate and select the HarvestedDataArchive log file for the MedRecSvr1 server. Click View. c. Click the Customize this table link. d. For Time Interval, select Last 15 Minute(s). e. Under Column Display, update the Chosen column to contain only these fields: Date Attribute Value f. For Number of rows displayed per page, select 100. Click Apply. g. Browse the harvester entries. Verify that the four MBean attributes are being collected approximately every 30 seconds. h. Click Customize this table again. i. For WLDF Query Expression, enter the following: ATTRNAME = 'CurrCapacity' Click Apply. Tip: Be sure to use single quotes. j. Confirm that now only this attribute is displayed. k. Update the WLDF Query Expression again and replace it with the following: TYPE LIKE '%WebAppComponentRuntimeMBean' Tip: Be sure to use single quotes. l. Confirm that now only the OpenSessionsCurrentCount attribute is displayed.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4 Chapter 4 - Page 7. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. <Notice> <Diagnostics> ... <Watch 'SessionWatch' with severity 'Notice' on server 'MedRecSvr1' has triggered ....

(32) 1. 2. 3. 4.. If the <LAB_WORK>/domains/MedRecDomain location does not yet exist, follow the Solution Instructions for the “Developing a Custom Monitoring Script” practice. Launch the Lab Framework command shell by executing the file <STUDENT>/bin/prompt.sh. Change the current directory to <CURRENT_LAB>. Execute the following: ant setup_solution The Lab Framework: − Makes a backup copy of your current work −. Creates a JMS queue to receive WLDF notifications. − −. Creates a diagnostic module Creates metric collectors for two MBean types. − Creates a diagnostic notification − Creates a diagnostic watch Note that all solution WLDF components will be disabled by default.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4 Chapter 4 - Page 8. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Solution Instructions.

(33) Duration: 25 minutes Skills Learned At the end of this practice, you should be able to: • Access the Monitoring Dashboard • Monitor standard views in the Monitoring Dashboard • Define a custom view in the Monitoring Dashboard • Configure charts within a view Overview The WebLogic Server administration console provides a link to a dashboard that allows you to monitor diagnostic metrics and events. Values can be viewed over time as charts. Collections of related charts are known as views. In this practice, you experiment with the Monitoring Dashboard and monitor MBean attributes. The Monitoring Dashboard architecture is shown in the following diagram:. Instructions 1. Monitor standard views. a. Launch an admin console and log in. b. On the Home page, click the Monitoring Dashboard link (under Charts and Graphs). Tip: You may also enter the URL for the dashboard directly into a Web browser: http://localhost:7020/console/dashboard c. In the left panel, under the View List tab, locate the JVM Runtime Heap under Builtin Views. Select it.. d. e. f. g.. Then click the green Start button above the tabs to begin collecting data. Locate a Lab Framework command prompt or start a new one. Run <LAB_WORK>/client/runclients.sh to test the MedRec application. Return to the Monitoring Dashboard and view the heap statistics for MedRecSvr1. For example:. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4 Chapter 4 - Page 9. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 4-2: Monitoring Diagnostic Metrics.

(34) 3.. b.. c. d. e. f. g.. In the left panel, click the My Views folder. Click the drop-down menu arrow (below the tabs) and select New View. Type over the default name of the new view with: MedRec Diagnostics. Ensure the new view is selected and click the Metric Browser tab. In the Servers drop-down list, select MedRecSvr1, select Collected Metrics Only, and click the Go button. In the Types list of available MBeans on this server, locate and select JDBCConnectionPool. Under Instances, select MedRecGlobalDataSourceXA. Under Metrics, drag and drop the CurrCapacity (int) attribute onto the right panel. A new chart is created. To change the chart’s default name, click the menu down-arrow in the chart title bar and select Properties. For Chart Title enter JDBC Chart and click OK. Tip: If you see no data points in the chart, then you must set the time of the chart to include when the metrics were actually collected (rather than the default time): 1) Go to the admin console. 2) Under Diagnostics > Log Files, select HarvestedDataArchive for MedRecSvr1 and click View. Click Customize this table. For WLDF Query Expression, enter: ATTRNAME = 'CurrCapacity' and click Apply. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4 Chapter 4 - Page 10. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. 2.. h. Click the Stop All button to stop collecting this view’s MBean metrics. Reactivate the metric collector. a. Return to the administration console and Lock it. b. Locate and edit your existing diagnostics module, MedRecDiagnostics. c. Click the Configuration > Collected Metrics tab. d. Select the Enabled check box and click Save. e. Activate your changes. f. Kill and restart MedRecSvr1 to reset its runtime MBean attributes. g. To create more interesting data, from a Lab Framework prompt execute <LAB_WORK>/client/runclients.sh. Define a custom view for harvested metrics. a. Return to the Monitoring Dashboard..

(35) 5) At the top-right of the chart, click the down arrow for the menu and select Properties. 6) Under Time Range select Custom and enter the Start Time. Use the correct format. For example: in the log file if the Date field was "02/11/11 18:50:41 820" you would enter it here as: "02/11/2011 6:50:41 PM" Tip: Do not include the double quotes. 7) Enter a Duration of 5 minutes: 0 00:05 8) Click OK.. 4.. 9) You may wish to zoom out by clicking the Zoom Out button. h. Also drag and drop the ActiveConnectionsCurrentCount (int) attribute onto the same chart to create a second graph in a different color. Work with charts and graphs in real time. a. In the Monitoring Dashboard, click the View List tab and create another custom view. Name it MedRec Sessions. Select the new, empty view. b. Click the Metric Browser tab. In the Servers drop-down list, select MedRecSvr1, make sure Collected Metrics Only is NOT checked, and click the Go button. c. In the Types list of available MBeans on this server, locate and select WebAppComponent. d. Under Instances, select MedRecSvr1_/medrec, medrec. e. Under Metrics, drag and drop the OpenSessionsCurrentCount (int) attribute onto the right panel. f. Click the menu down-arrow in the chart title bar and select Properties. For Chart Title enter Sessions Chart and click OK. g.. Retest the MedRec application by using runclients.sh. While the script is still running return to the Monitoring Dashboard.. h.. 5.. Click the green Start button and collect data for a few minutes. Re-run the clients script if you wish. Tip: Mouse over a specific data point to view its value and timestamp. Deactivate metric collection. a. Stop All views, if any are still running. b. Close the Monitoring Dashboard. c. Return to the administration console and disable your diagnostic module’s metric collector once again.. Solution Instructions No solution exists for this practice.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4 Chapter 4 - Page 11. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. 3) Make note of the information in the Date field of the first CurrCapacity Attribute. 4) Return to the Monitoring Dashboard..

(36) Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4. Chapter 4 - Page 12.

(37) THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Chapter 5. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5. Chapter 5 - Page 1. Oracle University and Sentra inversiones y servicios LTDA use only. Practices for Lesson 5.

(38) Practices Overview In these practices you will set up application-level instrumentation and dye masks to filter diagnostic events.. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 5. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5 Chapter 5 - Page 2.

(39) Duration: 35 minutes Skills Learned At the end of this practice, you should be able to: • Use the console to generate and edit a deployment plan • Use the console to configure application instrumentation • Configure built-in diagnostic monitors • Define pointcuts for custom monitors • Inspect events found in diagnostic archives Overview A few patients have reported performance problems logging into the MedRec application. Before contacting the development team, however, you would like to gain more knowledge about how the MedRec login process works behind the scenes and also how it performs. The WLDF Instrumentation component allows you record diagnostic data when certain events occur within WLS or your application code. For example, you can automatically record the method arguments or stack trace whenever a specific Java class is executed. While some built-in instrumentation monitors can be configured at the server level, most built-in monitors and all custom monitors must be defined by using application deployment descriptors. In this practice, you create a basic diagnostic module and include it within the MedRec application. You then utilize a deployment plan to dynamically add diagnostic monitors to this module and to enable/disable them as needed. This practice’s diagnostic configuration is shown in the following diagram:. Instructions 1. Enable instrumentation on the server. a. If your domain does not include a diagnostic module, complete the Solution Instructions for the “Harvesting Diagnostic Metrics” practice. b. Launch the console and Lock it. c. Navigate to your diagnostics module, MedRecDiagnostics. d. Click the Configuration > Instrumentation tab. e. Select the Enabled check box. f. Save and Activate your changes. 2. Add a WLDF descriptor file to an application. a. Inspect the contents of the file <CURRENT_LAB>/resources/METAINF/weblogic-diagnostics.xml. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5 Chapter 5 - Page 3. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 5-1: Configuring and Monitoring Diagnostic Events.

(40) Launch a Lab Framework prompt and navigate to <CURRENT_LAB>/resources. Execute the following: jar uf <LAB_WORK>/applications/medrec.ear META-INF. d.. 3.. Using jar or the Linux Archive Manager, inspect medrec.ear and confirm that the file was added. e. Return to the console and Lock it. f. From the Domain Structure panel, click Deployments. g. Update the medrec application and Activate your changes. Generate a WLDF deployment plan by using the console. a. From the same Deployments table, select medrec. b. Click the Configuration > Instrumentation tab. c. Lock the console and click the Add Monitor From Library button. d. Move the EJB_Before_SessionEjbBusinessMethods option from the Available column to the Chosen column. Click OK. Because a deployment plan does not yet exist for this application, the Save Deployment Plan Assistant is launched.. e. Set the Path to <LAB_WORK>/applications/medrec-plan.xml. Click OK. 4.. 5.. Configure a standard EJB monitor. a. Return to the Configuration > Instrumentation tab and select your new monitor. b. Under Actions, move the StackDumpAction option from the Available column to the Chosen column. c. Click Save. Activate your changes. d. Return to the medrec application’s main configuration page and inspect the Overview tab. Confirm that a Deployment Plan is now assigned to the application. e. Inspect the generated plan file. The plan should dynamically add a new wldfinstrumentation-monitor element to the weblogic-diagnostics.xml descriptor, whose child elements resemble the following: Element. Value. name. EJB_Before_SessionEjbBusinessMethods. action. StackDumpAction. Tip: The console also generates a folder <LAB_WORK>/applications/plan, which you can delete. Test the application and inspect the generated EJB events. a. From a Lab Framework prompt, execute <LAB_WORK>/client/runclient.sh. Why? This script logs a user into the patient application and then views his/her history. b. Return to the admin console. From the Domain Structure panel, select Diagnostics > Log Files. c. Locate and select the EventsDataArchive log file for the MedRecSvr1 server. Click View. d. Click the Customize this table link. Under Column Display, remove from Chosen the columns Context ID, User ID, and Payload. Tip: The Payload column includes the stack trace at the time of the event. Later practices focus on analyzing stack traces. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5 Chapter 5 - Page 4. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. b. c..

(41) 6.. 7.. Click Apply. Browse the generated events. Locate events for the com.bea.medrec.repository.impl.PatientServiceImpl class. Which method do you think corresponds to a user logging in? Now we create a custom monitor that just focuses on this code. Define a custom monitor. a. Lock the admin console and once again edit the medrec application. Go to the Configuration > Instrumentation tab. b. Edit the EJB_Before_SessionEjbBusinessMethods monitor. Clear the Enabled check box and click Save. c. Use the browser’s back button or the console’s breadcrumb links to return back to the main Configuration > Instrumentation tab. d. Click the Add Custom Monitor button. e. Enter the following values: Field. Value. Monitor Name. DebugPatientService. Location Type. Around. Pointcut. execution(* *impl.PatientServiceImpl auth*(...)). Click OK. Tip: This pointcut expression includes all calls to methods that start with the name auth in classes that end with the name impl.PatientServiceImpl. f. Select your new monitor. g. Under Actions, move the TraceElapsedTimeAction option from the Available column to the Chosen column. Click Save. h. Update the medrec application again and Activate your changes. i. Inspect the plan file again and confirm that it now defines two monitors. Analyze the application. a. Execute runclient.sh again. b. Repeat the previous steps to view the latest data in EventsDataArchive. c. Add the Payload column back to the list of displayed attributes. d. Locate the events from the custom DebugPatientService monitor. Each TraceElapsedTime action generates two events, one before the method execution and one after. The latter event includes the total time (in nanoseconds) to perform the authentication.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5 Chapter 5 - Page 5. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. e. f. g..

(42) 1. 2. 3. 4.. If the <LAB_WORK>/domains/MedRecDomain location does not yet exist, follow the Solution Instructions for the “Developing a Custom Monitoring Script” practice. Launch the Lab Framework command shell <STUDENT>/bin/prompt.sh file. Change the current directory to <CURRENT_LAB>. Execute the following: ant setup_solution The Lab Framework: − −. Makes a backup copy of your current work Runs the solution for the “Harvesting Diagnostic Metrics” practice.. − Enables instrumentation on the WLDF module − Deploys an updated MedRec application along with a deployment plan Note that all application-scoped WLDF components will be disabled by default.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5 Chapter 5 - Page 6. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Solution Instructions.

(43) Duration: 40 minutes Skills Learned At the end of this practice, you should be able to: • Enable server debug messages • Use context IDs to associate log entries with a request • Configure a Dye Injection monitor • Filter recorded events by using dye masks Overview When instrumentation is enabled on a diagnostic module, all WLDF events and log entries associated with a client request will be tagged with a unique context ID. These IDs allow administrators to trace all the diagnostic data for a specific request. In some troubleshooting cases, you may wish to go a step further and limit the conditions under which WLDF events are recorded. A diagnostic context ID supports various flags or “dyes” that allow you to filter the types of requests that trigger instrumentation data. In this practice, you use the console to locate context IDs and try to map them to specific MedRec application functionality. You also use this opportunity to experiment with the dye injection monitor and dye masks. The lab infrastructure is shown in the following diagram:. Instructions 1. Generate debug messages in the server log. a. If your domain does not include a diagnostic module, complete the Solution Instructions for the “Configuring and Monitoring Diagnostic Events” practice. b. Launch the console and Lock it. c. Locate and edit MedRecSvr1. d. Click the Debug tab. e. Locate the weblogic > servlet > internal debug scope.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5 Chapter 5 - Page 7. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 5-2: Tracing a Client Request.

(44) 3.. Tip: To avoid scrolling, under Customize this table you may want to reorder the columns so that Context ID and Class are displayed adjacently. h. Copy the last set of non-zero digits. In the example above, that would be “1e58c”. Correlate WLDF and server log messages. a. Use the console to view the ServerLog for MedRecSvr1. b. Once again, add the Context ID column to the chosen list of columns. Also increase the Number of Rows Displayed Per Page to 1000. c. Browse the recent log entries. Notice that some entries have been assigned context IDs while others have not. The latter are internal messages not associated with a client request. d. Click Customize this table again. e. For WLDF Query Expression, enter the following: CONTEXTID LIKE '%nnnnn' For nnnnn, paste the context ID fragment that you copied from the WLDF event. Tip: If you do not see any entries, click Customize this table again and change Time Interval to Last 15 minute(s) (or longer). Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5 Chapter 5 - Page 8. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. 2.. f. Select the check box for the internal scope and click the Enable button. g. Similarly, enable the weblogic > ejb > invoke debug scope. h. Activate your changes. View context IDs for WLDF records. a. Launch a second browser window and access the MedRec application: http://localhost:7021/medrec/index.action b. Under the Patient section, click the Login link. c. Log in as the user [email protected]/weblogic. Leave this browser session open. d. Return to the console and view EventsDataArchive for MedRecSvr1. e. Click Customize this table. f. Add the Context ID column to the chosen list, if not already chosen. Click Apply. g. Locate the Context ID for the latest event generated by your custom DebugPatientService monitor. For example:.

(45) Click Apply. Browse all the server debug messages associated with this login request. The Subsystem column should indicate “Http,” “HttpSessions,” and “EjbInvoke.”. h.. Using these log messages, try to answer the following question: Upon logging into the MedRec application, what is the name of the JSP file that executes? Return to the MedRec application. Click the Successfully logged in! Click here to continue link. Then click one of the listed patient Records.. i.. j. k.. 4.. Note the URL in the browser and the current time. Access the server log again and view the latest entries. You must remove your custom log filter criteria. l. Search the Web page contents for the text “viewRecordSummary.” Try to determine the context ID for the latest MedRec client request. m. Once again, use the WLDF Query Expression field to show only those log messages for this context ID. Browse the contents of these messages. n. Edit your MedRecSvr1 configuration again and Disable all debug attributes. Tip: You can use the check box in the table header to select all other check boxes at once. Configure the dye injection monitor to flag an IP address. a. Obtain the IP address of your Linux VM instance. From a Linux terminal, execute: /sbin/ifconfig. Tip: If your VM is bound to multiple IP addresses, you can use the previously generated debug messages to determine the actual IP being used. It is probably the first one listed. If you use the wrong one you will have to repeat these instructions and try the other ones. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5 Chapter 5 - Page 9. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. f. g..

(46) 5.. 6.. Return to the console and Lock it. Locate and edit your system diagnostic module, MedRecDiagnostics. Click the Configuration > Instrumentation tab. Click the Add/Remove button. Move the DyeInjection monitor from the Available column to the Chosen column. Click OK. g. Edit the new monitor. h. Under Properties, enter the following: ADDR1=your_IP_address i. Click Save. Activate your changes. Configure dye filtering for a monitor. a. Lock the console again. b. Edit the medrec application. c. Click the Configuration > Instrumentation tab. d. Click Add Monitor from Library. e. Add the monitor Servlet_Before_Session and click OK. f. Edit the new monitor. Enter or select the following values: Field. Value. Enabled. <checked>. Actions (Chosen). TraceAction. EnableDyeFiltering. <checked>. Dye Mask (Chosen). ADDR1. Click Save. g. Update the medrec application. Activate your changes. Test event filtering. a. Retest the MedRec application as done previously. b. Return to the console and view EventsDataArchive for MedRecSvr1. c. Using the Monitor column, confirm that events were recorded from the Servlet_Before_Session monitor. Tip: If the events are not shown, try setting the dye flag to another available IP address. d. Edit the MedRecDiagnostics module and select the DyeInjection monitor. e. Edit this monitor’s Properties. Change the ADDR1 flag to use some other arbitrary IP address. Tip: Alternatively, use another student’s IP address. f. Update the medrec application. Activate your changes. g. Test the application a final time. h. In the admin console, view the latest event data. Using the records’ timestamps, verify that there are no new events from the Servlet_Before_Session monitor. i. When you are finished with the practice, edit MedRecDiagnostics and disable the instrumentation component. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5 Chapter 5 - Page 10. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. b. c. d. e. f..

(47) 1. 2. 3. 4.. If the <LAB_WORK>/domains/MedRecDomain location does not yet exist, follow the Solution Instructions for the “Developing a Custom Monitoring Script” practice. Launch the Lab Framework command shell by executing the <STUDENT>/bin/prompt.sh file. Change the current directory to <CURRENT_LAB>. Execute the following: ant setup_solution The Lab Framework: − Makes a backup copy of your current work −. Runs the solution for the “Configuring and Monitoring Diagnostic Events” practice. − −. Disables debug flags, if enabled Adds a new dye injection monitor to the WLDF module. − Deploys the MedRec application by using an updated deployment plan Note that all WLDF components will be disabled by default. Note that the dye injection monitor will be configured with a dummy IP address.. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5 Chapter 5 - Page 11. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Solution Instructions.

(48) Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 5. Chapter 5 - Page 12.

(49) THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Chapter 6. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 6. Chapter 6 - Page 1. Oracle University and Sentra inversiones y servicios LTDA use only. Practices for Lesson 6.

(50) Practices Overview In these practices you will troubleshoot the Sun JVM by using a heap profile. You will also troubleshoot the JRockit JVM by using JRockit Mission Control.. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 6. Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 6 Chapter 6 - Page 2.

(51) Duration: 45 minutes Skills Learned At the end of this practice, you should be able to: • Start a server running in the Sun JVM • Perform and analyze a server thread dump • Configure JVM heap settings • Generate a heap profile by using the Sun JVM • Analyze a heap profile Overview Two of the most common troubleshooting scenarios in server software are server hangs (or very high response times) and memory leaks. Servers can hang for several reasons, including deadlocks and full CPU utilization. Memory leaks are less common in Java than other languages, but can occur when applications deliberately or accidentally create too much garbage (objects), or make objects ineligible for garbage collection by the JVM. For example, developers may place too many objects in the HTTP session scope, which by default are not eligible for garbage collection for at least 1 hour. WebLogic Server and the underlying JVM provide several tools to help troubleshoot these problems. In this practice, you investigate an application that seems to be hung, and use JVM thread dumps to help determine potential causes. Similarly, you investigate a possible memory leak with the aid of a JVM-generated heap profile. The lab infrastructure is depicted in the following diagram:. Instructions 1. Set up the practice. a. Locate a Lab Framework prompt or start a new one. Change directories to <CURRENT_LAB>. b. Execute the following: ant setup_exercise The Lab Framework deploys a new version of the MedRec application.. c.. Kill MedRecSvr1.. d.. Restart the server by using the following commands: export JAVA_VENDOR=Sun ./startServer1.sh. e.. Use the initial server output to confirm that the Sun JVM is being used: Java(TM) SE Runtime Environment (build ...) Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 6 Chapter 6 - Page 3. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 6-1: Troubleshooting a Running JVM.

(52) 2.. f.. From another Linux terminal enter the following: ps –ef | grep MedRecSvr1. g.. Make a note of the process ID for MedRecSvr1. For example: oracle 31578 31539 ... java -server -Xms256m -Xmx512m XX:MaxPermSize=128m -Dweblogic.Name=MedRecSvr1 .... Perform a thread dump under load. a. From the Lab Framework prompt, navigate to <LAB_WORK>/client. b.. c.. Execute the runclients.sh script. You will notice that the test client and, therefore, the application as well, seem to be taking an unusually long time to respond. While the test client continues to run, signal the MedRecSvr1 process to perform a thread dump: kill -3 <process ID>. d.. Locate the output for MedRecSvr1. Confirm the presence of a thread dump. For example: Full thread dump Java HotSpot(TM) Server VM ... Heap .... e.. Locate one or more threads that are currently running the MedRec application. For example: "[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'" ... ... at com.bea.medrec.... f.. 3.. From these thread details, can you determine which MedRec Java class or method may be responsible for the slow application? Tip: For those with some Java knowledge, the culprit code can also be found at <CURRENT_LAB>/resources. g. Allow the test client to finish, if still running. Tip: If you get tired of waiting, press Ctrl + C in the window where it is running. Trigger an "Out of Memory" error.. a. Execute the <LAB_WORK>/client/runadminclients.sh script.. b.. c.. This client tests a different portion of the MedRec application. Specifically, the part of the application that allows administrative users to manage patient accounts. Locate the output for MedRecSvr1 and verify that an OutOfMemoryError has been generated similar to the following: <Error> ... java.lang.OutOfMemoryError: Java heap space ... Use the stack trace to identify some possible culprits for the high memory usage in the MedRec application (com.bea.medrec.*). For example: Caused By: ... Copyright © 2011, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 6 Chapter 6 - Page 4. Oracle University and Sentra inversiones y servicios LTDA use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Java HotSpot(TM) Server VM (build ...).

References

Related documents

Covered Drugs, devices, or other Pharmacy services or supplies for which benefits are, or could upon proper claim be, provided under any present or future laws enacted by

Power and Glory and Thanksgiving be to my Lord Jesus Christ forever and ever... [3] Then Judas, which had betrayed him, when he saw that

A) Not more than the remaining life as determined from calculated corrosion rates B) Only at maximum intervals recommended in Table 2 for a given Class of piping C) At the

Therefore, this current study intends to explore how urban forms contribute to the formation and implementation of social life and/or livability among inhabitants, namely within

ERPM allows querying pre-configured LDAP compliant directories, such as Active Directory, Open LDAP, Oracle Internet Directory (OID), etc., to populate the systems

Relative to those entering work from education, having previously been unemployed nearly doubles this transition intensity (94 per cent increase). The effect is partially offset

Oracle 8i &amp; 9i Clients v7, v8, v9 Oracle Clients (ldap.ora ) (sqlnet.ora) Oracle Database Oracle Internet Directory Server Oracle 9i Names Server Proxy LDAP LDAP SQL NET SQL

Enter the LDAP Port on Oracle Internet Directory server. Enter the Oracle Internet Directory Administrator (orcladmin) Bind