lab3 - monitoring performance using enterprise manager database express › technetwork › cn ›...

24
Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 1 Lab3 - Monitoring Performance Using Enterprise Manager Database Express Contents Monitoring Performance Using Enterprise Manager Database Express ..................... 1 Overview................................................................................................................................ 2 Configuring the HTTP Port for CDB and PDB ................................................................... 3 Accessing the Database Home Page at CDB level ........................................................... 6 Generate Workload on the Database ................................................................................. 8 View the EM Express Performance Page .......................................................................... 9 Explore the Activity Tab for a Time Window .................................................................... 11 Explore the Workload Tab for a Time Window ................................................................ 15 Explore the Activity Tab for a Specific SQL ID Within a Time Window.......................... 18 Accessing the Database Home Page at PDB level ......................................................... 19 Explore the Tablespace Storage Information Page for PDB .......................................... 21 Disable EM Express for CDB and PDB ............................................................................ 23 Summary ............................................................................................................................. 24

Upload: others

Post on 27-Jun-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 1

Lab3 - Monitoring Performance Using Enterprise Manager Database Express

Contents

Monitoring Performance Using Enterprise Manager Database Express ..................... 1

Overview................................................................................................................................ 2

Configuring the HTTP Port for CDB and PDB ................................................................... 3

Accessing the Database Home Page at CDB level ........................................................... 6

Generate Workload on the Database ................................................................................. 8

View the EM Express Performance Page .......................................................................... 9

Explore the Activity Tab for a Time Window .................................................................... 11

Explore the Workload Tab for a Time Window ................................................................ 15

Explore the Activity Tab for a Specific SQL ID Within a Time Window .......................... 18

Accessing the Database Home Page at PDB level ......................................................... 19

Explore the Tablespace Storage Information Page for PDB .......................................... 21

Disable EM Express for CDB and PDB ............................................................................ 23

Summary ............................................................................................................................. 24

Page 2: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 2

Overview

Purpose

This HOL covers how to enable Enterprise Manager Database Express (also referred to in this HOL as EM Express) and how to monitor database performance using Enterprise Manager Database Express

Time to Complete

Approximately 60 minutes

Introduction

Enterprise Manager Database Express is a new feature in Oracle Database 12c. It ships with the database and replaces the former Enterprise Manager Database Control product. It does not require a separate installation, and provides a lightweight way to perform common analysis and actions in an intuitive graphical environment instead of using command lines.

Page 3: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 3

Configuring the HTTP Port for CDB and PDB

You can access Enterprise Manager Database Express using the URL that was displayed during installation. The default port used is 5011. In case you want to use a different port, you need to configure the port using the dynamic protocol registration method. After the HTTP port is configured, you use it to access Enterprise Manager Express. In this HOL, you will configure Enterprise Manager Database Express to run on port 8080 for CDB.

Open a terminal window by double clicking the terminal icon in the desktop.

.

Verify that the listener is started by executing the lsnrctl status command.

[oracle@db12c ~] lsnrctl status

The EM express can be enabled in the CDB level. Log in to SQL*Plus as the SYSDBA user and verify that the DISPATCHERS parameter in the initialization parameter file includes the PROTOCOL=TCP attribute.

Page 4: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 4

[oracle@db12c ~] sqlplus / as sysdba

SQL> show parameter dispatchers

Execute the DBMS_XDB.setHTTPPort procedure to set the HTTP port for Enterprise Manager Express.

SQL> exec dbms_xdb.setHTTPPort(8080)

SQL> exit

Pluggable database can have its individual EM express instance. We can configure it almost the same as configure it in the CDB. Log in to PDB1 as sysdba and execute dbms_xdb.setHTTPPort procedure. Please note that we should use a difference port number other than the port number used by CDB. Also make sure PDB1 is opened before you run the procedure.

[oracle@db12c ~] sqlplus sys/oracle@pdb1 as sysdba

SQL> exec dbms_xdb.setHTTPPort(8081)

Page 5: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 5

Exit SQL*Plus and terminal.

Page 6: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 6

Accessing the Database Home Page at CDB level

The Database Home page is the main database management page in Enterprise Manager Database Express. To access the Database Home page for CDB, double click the icon "EM Express for CDB" in the desktop, it will automatically open the EM login page (http://localhost:8080/em).

Log in to Enterprise Manager Database Express with an authorized CDB user account such as SYS. Enter the username (sys) and password (oracle in this HOL) in the appropriate fields and select as sysdba checkbox. Click Login.

The Database Home page for CDB is displayed.

Page 7: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 7

Page 8: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 8

Generate Workload on the Database

Click the Workload icon in the desktop.

It will call script /home/oracle/workload/wcr_demo_workload.sh to generate some workload.

Wait about 5-10 minutes for the script to complete.

Page 9: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 9

View the EM Express Performance Page

Get back to the web browser, select the Performance menu > Performance Hub option.

On the Performance Hub page, you should see a time window slider at the top right. Use the handles on the left and right edges of the window to pull the window over to an interesting time period of activity. Notice the grayed areas change in the charts to match the window slider.

Use the handles on the left and right edges of the window to pull the window over to an interesting time period of activity.

Page 10: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 10

Notice the grayed areas change in the charts to match the window slider.

Page 11: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 11

Explore the Activity Tab for a Time Window

Click the Activity tab to see details about the activity that occurred during the selected time window.

Click Wait Class > Session Identifiers > User ID to see the user IDs responsible for the workload.

Place the cursor on the largest area in the graph. It will turn the larget User ID(Should be scott@pdb1) workload into a highlighted yellow. Click to make this User ID a filter condition.

Page 12: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 12

You should now see that User ID's workload during the time window period. Other workloads will not be shown and will appear as blank space in the graphs. That allows you to focus on that single user. In this case the wait class including Commit, Scheduler and CPU(This may not all the same as in the real HOL environments).

Click the Wait Class drop-down list, and select Top Dimentions > Module to isolate the moduels the user was running.

Page 13: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 13

The modules the user was running are listed on the right, in the graph's legend. Click on the module "wcr_demo@db12c.." which represent to our workload .

Module now becomes a second filter condition, and shows its wait class.

Page 14: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 14

Remove the filter conditions. Click on the X on the right of each condition.

Page 15: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 15

Explore the Workload Tab for a Time Window

Click the Workload tab to see details about the workloads that occurred during the selected time window. The Workload tab has Workload Profile, Sessions, and Top SQL sections.

In the Workload Profile section, click Parse Calls to see graphically how parse calls behaved during the time window. You should see Hard Parses and overall Parse Counts.

Click Redo Size. You can see redo activity during, before, and after the time window.

Page 16: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 16

Click Open Cursors to see cursor activity.

In the Top SQL section we see the SQL IDs ranked from most to least activity.

Click the SQL ID in the Top SQL list.

Page 17: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 17

You can examine particulars about that SQL, including SQL Text, Users, Program, IO Bytes, and Buffer Gets etc.

Page 18: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 18

Explore the Activity Tab for a Specific SQL ID Within a Time Window

Click the Activity tab to see details for the specific SQL ID in the selected time window.

The context of the tabs is now centered on the specific SQL ID. You see that the SQL ID is now a filter condition, but this filter cannot be deleted because all the tabs now describe activity for that specific SQL ID.

Wait Class is the default activity displayed for this SQL ID. To see the user, click on the Wait Class drop-down list, then select Session Identifiers > User ID.

You can see details for this user's SQL ID in the Activity and the time window graph. Activity for this specific SQL ID is highlighted.

Page 19: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 19

Activity not related to this SQL ID is the blank area under the curves.

Accessing the Database Home Page at PDB level

To access the Database Home page for PDB1, click the icon "EM Express for PDB1" on the desktop, it will automatically open the EM login page (http://localhost:8081/em).

Page 20: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 20

Log in to Enterprise Manager Database Express with an authorized PDB1 user account such as SYS. Enter the username (sys) and password (oracle in this HOL) in the appropriate fields. Click Login.

The Database Home page for PDB1 is displayed.

Page 21: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 21

Explore the Tablespace Storage Information Page for PDB

Click the Storage tab, and then select Tablespaces.

You can check storage statistics for tablespaces such as Temp and Undo. These statistics are important for workload analysis.

Page 22: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 22

Click View > Expand All to see all the tablespaces plus all of the datafiles in each tablespace.

All tablespaces and their datafiles are now visible.

Click View > Flatten.

Page 23: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 23

You should now see only the datafiles and index files.

Close web browser to release system resource.

Disable EM Express for CDB and PDB You can disable EM Express by setting the HTTP Port to 0. Disable EX Express for CDB:

[oracle@db12c ~] sqlplus / as sysdba

SQL> exec dbms_xdb.setHTTPPort(0)

SQL> exit

Page 24: Lab3 - Monitoring Performance Using Enterprise Manager Database Express › technetwork › cn › community › ... · Lab3 - Monitoring Performance Using Enterprise Manager Database

Copyright ©2013, Oracle and/or its affiliates. All rights reserved. 24

Disable EX Express for PDB1: [oracle@db12c ~] sqlplus sys/oracle@pdb1 as sysdba

SQL> exec dbms_xdb.setHTTPPort(0)

SQL> exit

Summary

In this HOL, you have learned how to:

o Enable EM Database Express for CDB and PDB. o Navigate the Performance Hub pages on EM Database Express for

CDB and PDB. o Navigate the Tablespace Storage page on EM Database Express for

PDB.