9.7.2.2 CREATE DIAGPACK

Purpose

The CREATE DIAGPACK command creates a diagnostic package, which contains logs and traces that you can use to troubleshoot problems in your system. You can also send the package to Oracle Support, as needed.

Syntax

CREATE DIAGPACK packStartTime=time, [durationInHrs=duration]

or

CREATE DIAGPACK alertName=alertName

Usage Notes

When an alert occurs, a diagnostic package is created automatically. This package contains logs and traces related to the alert.

The CREATE DIAGPACK command enables you to generate diagnostic packages manually.

  • The packStartTime parameter specifies when to start collecting the logs and traces. The format of packStartTime is:

    yyyy_MM_ddTHH_mm_ss

    For example: 2015_07_07T09_00_00

    You can also specify the keyword now for packStartTime. The packStartTime cannot be in the future and cannot be older than 7 days. The value of packStartTime is used as part of the name of the diagnostic package.

  • The durationInHrs parameter specifies the number of hours of logs and traces to include in the diagnostic package. Valid values are from 1 (default) to 6.

    Every diagnostic package includes logs 1 hour before and 1 hour after the packStartTime. For example, if you specify a time of 12_00_00, then logs will collected from 11_00_00 to 13_00_00, unless the end time is in the future.

  • The alertName parameter specifies the alert name for which to create the diagnostic package. You can run the LIST ALERTHISTORY command to view the alert names.

Name of Diagnostic Packages

The name of the diagnostic package is formed as follows:

hostname + packStartTime + unique package ID

For example: scaqab04adm08_2016_05_17T11_58_54_5_1.tar.bz2

For alerts, the name of the diagnostic package is formed as:

hostname + timestamp of when the package was created + alert ID

For example: scaqab04adm08_2016_05_17T11_58_54_5_1.tar.bz

Location of Diagnostic Packages

The location of the diagnostic packages is /opt/oracle/dbserver/dbms/deploy/log.

Status of Diagnostic Packages

You can run the LIST DIAGPACK command to get a list of diagnostic packages in your system, and their status.

Privileges Needed to Create, List, and Download Diagnostic Packages

Users need to be granted roles before they can download the diagnostic packages. Use DBMCLI to grant the following privileges to a role:
  • Privilege to create diagnostic packages:

    grant privilege CREATE ON DIAGPACK to ROLE role 
  • Privilege to list diagnostic packages and check their status:

    grant privilege LIST ON DIAGPACK to ROLE role 
  • Privilege to download diagnostic packages:

    grant privilege DOWNLOAD ON DIAGPACK to ROLE role 

You can then grant the role to users. For example, if you named your role diagpack_role, the following command grants the role to the user fred.

DBMCLI> GRANT ROLE diagpack_role TO USER fred

During deployment, Oracle Exadata Deployment Assistant (OEDA) creates an Exadata storage software user called CELLDIAG. You can use this user to connect to a cell remotely using ExaCLI or REST API. This user has privileges to create, list, and download diagnostic packages.

Downloading Diagnostic Packages

You can download diagnostic packages using any of the following methods. Note that you need the DOWNLOAD ON DIAGPACK privilege before you can download diagnostic packages.
  • Using the REST API

    • To download the diagnostic package by name, use the following URL, where hostname specifies the host name of the server and diagpackname specifies the name of the diagnostic package. The URL must point to the secure socket port, which is 7879 by default:

      https://hostname:7879/diagpack/download?name=diagpackname

      If the user is not already logged in, the URL will prompt for a user name and password.

      Diagnostic packages can also be accessed at

      https://hostname:7879/diagpack

      For example:

      https://dbnode01.example.com:7879/diagpack

      The page then prompts the user to log in:

      User: fred
      Password: *******

      Based on the user's privileges, various sections of this page could be hidden. The form to create a new diagpack will not be shown if the user does not have the CREATE ON DIAGPACK privilege. Similarly, the list of alerts and their diagnostic packages will not be shown if the user does not have the LIST ON DIAGPACK privilege.

      To download the diagnostic package by alert name, use the following URL, where hostname specifies the host name of the server and alertName specifies the alert name of the diagnostic package:

      https://hostname:7879/diagpack/download?alert=alertName

      This is the same alert name that is used in AlertHistory. It looks like 1, 2, 3 for stateless alerts, and 1_1, 2_1, 3_1, 3_2 for stateful alerts.

  • Using the download ExaCLI command

    ExaCLI enables you to run CellCLI commands on storage nodes remotely from compute nodes. To run the download command, run the following commands on a compute node:

    1. Start up ExaCLI and connect to the cell containing the diagnostic pack. Use a command similar to the following where hostname specifies the host name of the cell:

      exacli -l celladministrator -c hostname
      Password=********
    2. Run the download command. Use a command similar to the following where name specifies the name of the diagnostic package to download, and destinationFolder specifies the directory where you want to save the downloaded diagnostic package:

      exacli> download diagpack name destinationFolder 
  • Getting the diagnostic package from the alert emails

    The alert emails include diagnostic packages for all alerts except INFO, CLEAR, and WARNING. Diagnostic packages are generated for critical alerts only.

Turning Off the Diagnostic Pack Attachment in Emails

To turn off the diagnostic pack attachment in emails, use the command alter dbserver diagPackEmailAttach=FALSE. The diagnostic packs are still generated and stored on the system. To download the diagnostic packs, see the section "Downloading Diagnostic Packages."

Examples

Example 9-33 Using "now" for packStartTime

This example creates a diagnostic package using NOW as the start time and the default duration of one hour.

The output is a single compressed file in the directory /opt/oracle/dbserver/dbms/deploy/log.

DBMCLI> create diagpack packStartTime="now"
    Processing: dm01db01_diag_2015_07_08T17_53_58_1
    Use 'list diagPack' to check its status.

Example 9-34 Specifying a duration

This example creates 3 diagnostic packages under /opt/oracle/dbserver/dbms/deploy/log:

  • The first package has a start time of 2015_07_07T09_00_00.

  • The second package has a start time of 2015_07_07T10_00_00.

  • The third package has a start time of 2015_07_07T11_00_00.

DBMCLI> create diagpack packStartTime="2015_07_07T09_00_00", durationInHrs=3
    Processing: dm01db01_diag_2015_07_07T09_00_00_1
    dm01db01_diag_2015_07_07T10_00_00_1 (In queue...)
    dm01db01_diag_2015_07_07T11_00_00_1 (In queue...)
    Use 'list diagPack' to check its status.