diff --git a/.gitignore b/.gitignore index 516397d59..890453648 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ shared-assets/bastion-py-script/.oci/ shared-assets/bastion-py-script/temp/ temp/ app-dev/app-integration-and-automation/oracle-integration-cloud/01-oic-connectivity-agent/README_tmp.html +.DS_Store diff --git a/manageability-and-operations/observability-and-manageability/database-management/README.md b/manageability-and-operations/observability-and-manageability/database-management/README.md index 86909a6f7..14fd80bb5 100644 --- a/manageability-and-operations/observability-and-manageability/database-management/README.md +++ b/manageability-and-operations/observability-and-manageability/database-management/README.md @@ -14,6 +14,7 @@ Reviewed: 27.09.2024 - [Database Management Demo](https://www.youtube.com/watch?v=3k9jrkOlBkc) - [OCI Database Management PDB Support](https://learnoci.cloud/oci-database-management-new-features-announced-f9991cba2cc2) - [How to enable OCI Observability for OCI native database deploy](https://medium.com/@erikasciunzi/enable-observability-for-oci-native-database-deploy-235484953e46) +- [Creating Metric Extensions for Oracle Database using OCI Database Management Service](./custom-metrics/README.md) # Useful Links diff --git a/manageability-and-operations/observability-and-manageability/database-management/custom-metrics/README.md b/manageability-and-operations/observability-and-manageability/database-management/custom-metrics/README.md new file mode 100644 index 000000000..876bdc0a0 --- /dev/null +++ b/manageability-and-operations/observability-and-manageability/database-management/custom-metrics/README.md @@ -0,0 +1,30 @@ +# Creating Metric Extensions for Oracle Database using OCI Database Management Service + +Metric extensions are useful when the metric you are looking for does not exist out of the box. In such cases, you can create your own custom metric and use it for monitoring your database. + +This guide explains how to create metric extensions step by step. + +## What Are Metric Extensions? + +**Metric extensions** are custom, user-defined, SQL-based metrics collected by OCI Database Management. They supplement standard metrics, providing additional insights (for example, error counts, job statuses, or resource KPIs not tracked by default). + +## Note +[Metric extensions](https://docs.oracle.com/en-us/iaas/database-management/doc/work-metric-extensions.html#DBMGM-GUID-6D5E80AA-ABA5-4FBA-A63F-106CEE39C3F7) are currently available **only for External Databases**. Therefore, if your database is an OCI database (as in this case, Oracle Base Database), it must be registered in Database Management as an External Database. + +## Prerequisites + +- OCI tenancy with Database Management enabled. +- Target Oracle Database registered in Database Management as an [External Database](https://docs.oracle.com/en-us/iaas/database-management/doc/external-database-related-prerequisite-tasks.html#DBMGM-GUID-84B74F18-F672-4DDC-8505-ACF249293D64). +- Required [policies](https://docs.oracle.com/en-us/iaas/database-management/doc/perform-general-oracle-cloud-infrastructure-prerequisite-tasks.html#DBMGM-GUID-DCC3067D-5123-468E-A938-D310CC685674) in place. + +## Step-by-Step Guide + +See [Implementation Steps](./create_metric_extension.md) for details. + +## License + +Copyright (c) 2025 Oracle and/or its affiliates. + +Licensed under the Universal Permissive License (UPL), Version 1.0. + +See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details. \ No newline at end of file diff --git a/manageability-and-operations/observability-and-manageability/database-management/custom-metrics/create_metric_extension.md b/manageability-and-operations/observability-and-manageability/database-management/custom-metrics/create_metric_extension.md new file mode 100644 index 000000000..18edcba90 --- /dev/null +++ b/manageability-and-operations/observability-and-manageability/database-management/custom-metrics/create_metric_extension.md @@ -0,0 +1,212 @@ +# Implementation Steps + +
Steps | +Description | +Notes | +
---|---|---|
1 | +
+Navigate to Database Management +
![]() |
++Ensure that Database Management is already enabled for your target database before proceeding with metric extension creation. + | +
2 | +
+Create a Metric Extension at the CDB Level +
+ +
+Use this when the target level is CDB. + +![]() + ![]() + |
+
+The SQL must return only one value to represent the metric point on the graph. It must be a numeric value. +The unit field must be a valid unit: percent , count , seconds , MB , etc.
+ |
+
3 | +
+Test the Metric Extension +
![]() + It may take a few seconds to a couple of minutes to complete the test and return the results. Once you see “Success,” the results will be displayed. +![]() + Note the Test ID here. + |
+
+The metric extension will fail if: +- The SQL is invalid. +- Required privileges are missing. +- Output columns or data types are incorrect. + +It is recommended to log in to the database and test your SQL query beforehand to ensure it is valid and returns the expected data. + |
+
4 | +
+Verify Metric in Monitoring Service +
![]() + ![]() + You will be able to view the metric in the chart above. + |
+
+During the testing phase, use the namespace ending with appmgmt_test to verify that the metric is working as expected before publishing.
+ |
+
5 | +
+Publish the Metric +
![]() + The metric extension will now be listed on the main page of Metric Extensions as shown: +![]() + |
++Publishing makes the metric extension available for enabling on target databases in production. + | +
6 | +
+Enable the Metric Extension +
![]() + ![]() + ![]() + This may take some time to execute. After you see success, check back after at least 5–6 minutes to see at least two metric points on the Metrics Explorer graph, as shown below. + |
++Allow sufficient time for metric collection to start. Initial data points may take 5–6 minutes to appear in the monitoring system. + | +
7 | +
+View Metrics in Monitoring Service +
![]() + Click on Update Chart and review the graph: +![]() + Click on Show Data Table to see the metric values clearly: +![]() + |
+
+After publishing, use the appmgmt namespace (not the test namespace) to view production metrics data.
+ |
+
8 | +
+Create a Metric Extension at the PDB Level — % Storage Used in SYSTEM Tablespace in PDB + +
+Use this when the target level is PDB. +
![]() + Select Pluggable DB for PDB-level queries. Test, publish, and enable as before. +![]() + |
++For PDB-level metrics, ensure you select "Pluggable DB" as the target level and that the SQL query is appropriate for the PDB context. + | +
9 | +
+View PDB Metrics +
![]() + Click Update to view the captured metrics. +![]() + |
++PDB-level metrics will appear under the same monitoring namespace but will be specific to the pluggable database context. + | +
percent
, count
, seconds
, MB
, etc.
+- The metric extension will fail if:
+ - The SQL is invalid.
+ - Required privileges are missing.
+ - Output columns or types are incorrect.
+
+Here is an example of an error that would occur with an incorrect SQL query during the test phase: