Applications Systems

Register an Oracle database instance for DPA monitoring without entering the credentials of a privileged user

Register an Oracle database instance without entering the SYS user password or privileged user credentials into DPA or (optionally) creating database objects in the SYS schema.

First published date

8/18/2020 10:04 PM

Last published date

6/21/2023 4:05 PM

Overview

When you register an Oracle database instance for monitoring, the following changes are made to that instance:

  • The DPA monitoring user is created or configured to enable DPA to monitor the database instance. If DPA creates or configures the monitoring user, you must give DPA temporary access to the credentials of a user with the DBA role. 
  • A utility package is added, and execute permissions for that package are granted to the DPA monitoring user. If DPA creates the utility package, you must give DPA temporary access to the credentials of a user with the SYSDBA role (such as SYS).

To register an Oracle database without entering the credentials of a privileged user, you can create the monitoring user and add the utility package yourself.

  • If you have DPA 2021.1 or earlier, use the instructions in this article to register an Oracle database instance without entering the credentials of a privileged user into DPA. You can use mass registration or the DPA management API to register the instance.
    Note: If you have DPA 2020.2.1 and later versions, you can also (optionally) choose to register the instance without creating database objects in the SYS schema.
  • If you have DPA 2021.3 and later, you can use mass registration, the API, or a UI wizard to register an Oracle database without a privileged user:

Note: You must still know the password of a user with the SYSDBA role (such as SYS) in order to run the provided scripts. But you do not have to enter it into DPA.

Product section

Database Performance Analyzer

Cause

n/a

Resolution

How to register an Oracle database instance without entering the SYS password and (optionally) without creating objects in the SYS schema

Step 1: Create the monitoring user with the necessary permissions and the utility package

  1. Copy one of the following scripts to a file:

    • CreateMonUserOracleOptimized.sql

      This is the performance-optimized option. You can use this option with all supported versions of DPA. Using this option creates objects under the SYS schema. (See the "Requirements overview" section below for more information about the objects created.)  

    • CreateMonUserOracleReducedPermissions.sql

      You can use this option with DPA 2020.2.1 and later versions. This option does not create any objects under the SYS schema. (See the "Requirements overview" section below for more information about the objects created.) With this option, DPA cannot retrieve the names of Oracle control files. If a wait event is associated with a control file, the Top Files trends chart cannot display the control file name. Instead, the chart displays the placeholder "Control File(s)". All other DPA functionality is available

  2. Edit the script to update the user name and password values.
  3. Connect to the Oracle database as a user with the SYSDBA role (such as SYS), and run the script.

Step 2: Register the database instance without specifying a privileged user

If you use 2021.1 or earlier, use mass registration or the DPA management API as described below.

If you use DPA 2021.3 and later, you can use mass registration or the API as described below. Or you can use a wizard. To use a wizard, see Register an Oracle database instance in the DPA Administrator Guide.

When you use mass registration or the DPA API to register the database instance, omit the privileged user in the registration details.  

  • The following example is a segment of a JSON script that calls the DPA API to register an Oracle database instance without specifying a privileged user. Change the values to reflect your monitored database and the credentials of the monitoring user created in the previous step.

    {
      "databaseType": "ORACLE",
      "serverName": "127.0.0.1",
      "serviceNameOrSID": "SID",
      "port": 1521,
      "monitoringUser": "dpa_mon",
      "monitoringUserPassword": "Pa$$word1",
      "monitoringUserTableSpace": "USERS",
      "monitoringUserTempTableSpace": "TEMP",
      "displayName": "DatabaseName"
    }
  • The following shows an example of an Oracle mass registration spreadsheet used to register a database instance without specifying a privileged user. If you use the Oracle mass registration spreadsheet:

    • Leave the DBA Username and DBA Password columns empty.
    • In the Monitoring User and Monitoring User Password columns, enter the credentials of the monitoring user created in the previous step.
    • In the Create Monitoring User(Y/N) column, enter N.
    • Leave the SYS Password column empty.

  • The following shows an example of a spreadsheet for multiple database types used to register a SQL Server database instance without specifying a privileged user. If you use the spreadsheet for multiple database types:

    • Leave the Privileged User and Privileged User Password columns empty.
    • In the Monitoring User and Monitoring User Password columns, enter the credentials of the monitoring user created in the previous step.
    • In the Create Monitoring User (Y/N) column, enter N.
    • Leave the SYS Password column empty.

Monitoring user validation

During the registration, DPA validates that the monitoring user has the required permissions. By default, the registration fails if any mandatory permission is missing and displays a warning if optional permissions are missing. The same validations are also done when database connection details are updated.

This behavior can be overridden by setting the advanced option MONITOR_VALIDATION_OVERRIDE to TRUE. This allows the registration to pass even if the X$KSUSE view is missing. Some mandatory requirements cannot be overridden because they are needed to perform the validations. See the "Requirements overview" section for details.

Requirements overview

The following sections describe the privileges and objects required for DPA monitoring. 

System privileges granted to the DPA monitoring user

These privileges are the same for both monitoring user creation methods.

PrivilegeMandatoryEffect on DPA monitoring if missing
CREATE SESSIONYes (cannot be overridden)DPA cannot connect to the instance. Registration fails.
SELECT ANY DICTIONARYYes (cannot be overridden)Registration fails with the message "Instance licensing information could not be retrieved."
If this privilege is removed on an already registered instance, polling fails.
CREATE TABLE and UNLIMITED TABLESPACENoThe 'Oracle Stale Statistics' alert does not work.
Live execution plans for queries are not available.
ANALYZE ANYNoRequired for table tuning when the advanced option INDEX_ANALYSIS_FLUSH_STATS (support option) is set to TRUE.

The following privilege is needed only when the performance-optimized creation method is used.

PrivilegeMandatoryEffect on DPA monitoring if missing
NoRequired to recreate the monitoring object during an upgrade. When an instance is registered using the performance-optimized creation method, objects are created in the SYS schema. During an upgrade, these objects might be dropped and will need to be recreated. 

Object privileges granted to the DPA monitoring user

These privileges are the same for both monitoring user creation methods.

PrivilegeObjectsMandatoryEffect on DPA monitoring if missing
SELECTV_$INSTANCE
V_$PARAMETER
Yes (cannot be overridden)Registration fails.
EXECUTEUTL_CON package (see details below)NoThe Kill Session functionality does not work.
Plans for queries with low execution cost might not be available.

The UTL_CON package

This package is required to kill sessions. Without it, the Kill Session option in the Real Time Sessions view does not work. It is also required to turn session tracing on or off to get plans for queries with zero or near-zero cost.

It is created under the SYS schema in both monitoring user creation methods, but it is not mandatory. For more detailed information, see What is UTL CON?

General database objects used for DPA monitoring

The following table describes the general objects used by the DPA monitoring user. How these objects are created (view or synonym in the SYS or monitoring user schema) depends on which method is used to create the monitoring user.

View nameMandatoryEffect on DPA monitoring if missing
X$KSUSEYes (can be overridden)Wait time for queries is not available.
X$KGLNA1NoSQL text for queries is not available.
X$KCCCFNoControl file names are not available.
X$KGLCURSORNoStatistics for queries are not available.
X$KCFIONoThe storage I/O data is not available.
X$DBGALERTEXTNoThe Oracle Alert Log Entries alert does not work.

Database objects when using the reduced-permission method

With the reduced-permission option, the views are created only in the monitoring user schema.

Warning: The X$KCCCF view, which DPA needs to retrieve the names of Oracle control file names, cannot be created using the reduced-permission option. If a wait event is associated with a control file, the Top Files trends chart cannot display the control file name. Instead, the chart displays the placeholder "Control File(s)".

View nameObject typeSchemaUsed for
X$KSUSEViewMonitoring userWait time
X$KGLNA1ViewMonitoring userSQL texts
X$KCCCFViewMonitoring userControl files
X$KGLCURSORViewMonitoring userSQL statistics
X$KCFIOViewMonitoring userStorage I/O
X$DBGALERTEXTViewMonitoring userOracle Alert Log Entries alert

Database objects when using the performance-optimized method

With the performance-optimized option, the views are created in the SYS schema with corresponding synonyms in the monitoring user schema.

View nameObject typeSchemaUsed for
X_$KSUSEViewSYSWait time
X_$KGLNA1ViewSYSSQL texts
X_$KCCCFViewSYSControl files
X_$KGLCURSORViewSYSSQL statistics
X_$KCFIOViewSYSStorage I/O
X_$DBGALERTEXTViewSYSOracle Alert Log Entries alert
X$KSUSESynonym to sys.X_$KSUSEMonitoring userWait time
X$KGLNA1Synonym to sys.X_$KGLNA1Monitoring userSQL texts
X$KCCCFSynonym to sys.X_$KCCCFMonitoring userControl files
X$KGLCURSORSynonym to sys.X_$KGLCURSORMonitoring userSQL statistics
X$KCFIOSynonym to sys.X_$KCFIOMonitoring userStorage I/O
X$DBGALERTEXTSynonym to sys.X_$DBGALERTEXTMonitoring userOracle Alert Log Entries alert


-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.