From 1f86508288d6d7467727bd474a11faf111844312 Mon Sep 17 00:00:00 2001 From: SGolikov Date: Mon, 11 Jan 2021 11:33:29 +0300 Subject: [PATCH 01/10] Update README.md Added additional comments for DATA_SOURCE_NAME; Added mandatory environment variables for systemd integration --- README.md | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3033665a..08448b19 100644 --- a/README.md +++ b/README.md @@ -88,30 +88,58 @@ for your operating system. Only the basic version is required for execution. # Running -Ensure that the environment variable DATA_SOURCE_NAME is set correctly before starting. For Example: +Ensure that the environment variable DATA_SOURCE_NAME is set correctly before starting. +DATA_SOURCE_NAME should be in Oracle EZCONNECT format: + https://docs.oracle.com/en/database/oracle/oracle-database/19/netag/configuring-naming-methods.html#GUID-B0437826-43C1-49EC-A94D-B650B6A4A6EE +19c Oracle Client supports enhanced EZCONNECT, you are able to failover to standby DB or gather some heavy metrics from active standby DB and specify some additional parameters. Within 19c client you are able to connect 12c primary/standby DB too :) + +For Example: ```bash # export Oracle location: export DATA_SOURCE_NAME=system/password@oracle-sid # or using a complete url: export DATA_SOURCE_NAME=user/password@//myhost:1521/service +# 19c client for primary/standby configuration +export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/service +# 19c client for primary/standby configuration with options +export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/service?connect_timeout=5&transport_connect_timeout=3&retry_count=3 # Then run the exporter /path/to/binary/oracledb_exporter --log.level error --web.listen-address 0.0.0.0:9161 ``` # Integration with System D +Create **oracledb_exporter** user with disabled login and **oracledb_exporter** group +mkdir /etc/etc/oracledb_exporter +chown root:oracledb_exporter /etc/etc/oracledb_exporter +chmod 775 /etc/etc/oracledb_exporter +Put config files to **/etc/etc/oracledb_exporter** +Put binary to **/usr/local/bin** + Create file **/etc/systemd/system/oracledb_exporter.service** with the following content: - [Unit] - Description=Service for oracle telemetry client - After=network.target - [Service] - Type=oneshot - #User=oracledb_exporter - ExecStart=/path/of/the/oracledb_exporter --log.level error --web.listen-address 0.0.0.0:9161 - [Install] - WantedBy=multi-user.target +```bash +[Unit] +Description=Service for oracle telemetry client +After=network.target +[Service] +Type=oneshot +#!!! Set your values and uncomment +#User=oracledb_exporter +#Group=oracledb_exporter +#Environment="DATA_SOURCE_NAME=dbsnmp/Bercut01@//primaryhost:1521,standbyhost:1521/myservice?transport_connect_timeout=5&retry_count=3" +#Environment="LD_LIBRARY_PATH=/u01/app/oracle/product/19.0.0/dbhome_1/lib" +#Environment="ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1" +#Environment="CUSTOM_METRICS=/etc/oracledb_exporter/custom-metrics.toml" +ExecStart=/usr/local/bin/oracledb_exporter \ + --default.metrics "/etc/oracledb_exporter/default-metrics.toml" + --log.level error --web.listen-address 0.0.0.0:9161 +[Install] +WantedBy=multi-user.target +``` + + Then tell System D to read files: @@ -478,4 +506,4 @@ The root cause is Oracle's reaction of quering ASM-related views without ASM use ``` $ find $ORACLE_BASE/diag/rdbms -name '*.tr[cm]' -mtime +14 -delete -``` \ No newline at end of file +``` From 2c15a912fa36f85944f6e674e6a7c606bc5603b2 Mon Sep 17 00:00:00 2001 From: SGolikov Date: Mon, 11 Jan 2021 11:36:04 +0300 Subject: [PATCH 02/10] Update README.md Readme.md formating issues --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 08448b19..9ee4c7bf 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ for your operating system. Only the basic version is required for execution. Ensure that the environment variable DATA_SOURCE_NAME is set correctly before starting. DATA_SOURCE_NAME should be in Oracle EZCONNECT format: + https://docs.oracle.com/en/database/oracle/oracle-database/19/netag/configuring-naming-methods.html#GUID-B0437826-43C1-49EC-A94D-B650B6A4A6EE 19c Oracle Client supports enhanced EZCONNECT, you are able to failover to standby DB or gather some heavy metrics from active standby DB and specify some additional parameters. Within 19c client you are able to connect 12c primary/standby DB too :) From bc1bebf67881fe4c6ef84651a577c8284453b262 Mon Sep 17 00:00:00 2001 From: SGolikov Date: Mon, 11 Jan 2021 11:39:52 +0300 Subject: [PATCH 03/10] Update README.md --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9ee4c7bf..19ddf2bb 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,7 @@ for your operating system. Only the basic version is required for execution. # Running Ensure that the environment variable DATA_SOURCE_NAME is set correctly before starting. -DATA_SOURCE_NAME should be in Oracle EZCONNECT format: - +DATA_SOURCE_NAME should be in Oracle EZCONNECT format: https://docs.oracle.com/en/database/oracle/oracle-database/19/netag/configuring-naming-methods.html#GUID-B0437826-43C1-49EC-A94D-B650B6A4A6EE 19c Oracle Client supports enhanced EZCONNECT, you are able to failover to standby DB or gather some heavy metrics from active standby DB and specify some additional parameters. Within 19c client you are able to connect 12c primary/standby DB too :) @@ -111,12 +110,12 @@ export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/servic # Integration with System D -Create **oracledb_exporter** user with disabled login and **oracledb_exporter** group -mkdir /etc/etc/oracledb_exporter -chown root:oracledb_exporter /etc/etc/oracledb_exporter -chmod 775 /etc/etc/oracledb_exporter -Put config files to **/etc/etc/oracledb_exporter** -Put binary to **/usr/local/bin** +Create **oracledb_exporter** user with disabled login and **oracledb_exporter** group +mkdir /etc/etc/oracledb_exporter +chown root:oracledb_exporter /etc/etc/oracledb_exporter +chmod 775 /etc/etc/oracledb_exporter +Put config files to **/etc/etc/oracledb_exporter** +Put binary to **/usr/local/bin** Create file **/etc/systemd/system/oracledb_exporter.service** with the following content: From f5d73944f4876477fd5a3e92eb6c5af3fce7e3b4 Mon Sep 17 00:00:00 2001 From: SGolikov Date: Mon, 11 Jan 2021 11:41:52 +0300 Subject: [PATCH 04/10] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 19ddf2bb..491d9fc4 100644 --- a/README.md +++ b/README.md @@ -110,12 +110,12 @@ export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/servic # Integration with System D -Create **oracledb_exporter** user with disabled login and **oracledb_exporter** group -mkdir /etc/etc/oracledb_exporter -chown root:oracledb_exporter /etc/etc/oracledb_exporter -chmod 775 /etc/etc/oracledb_exporter -Put config files to **/etc/etc/oracledb_exporter** -Put binary to **/usr/local/bin** +Create **oracledb_exporter** user with disabled login and **oracledb_exporter** group\ +mkdir /etc/etc/oracledb_exporter\ +chown root:oracledb_exporter /etc/etc/oracledb_exporter\ +chmod 775 /etc/etc/oracledb_exporter\ +Put config files to **/etc/etc/oracledb_exporter**\ +Put binary to **/usr/local/bin**\ Create file **/etc/systemd/system/oracledb_exporter.service** with the following content: From d5599f5477c23d1b52755944ce09fbb6edde271f Mon Sep 17 00:00:00 2001 From: SGolikov Date: Mon, 11 Jan 2021 11:43:17 +0300 Subject: [PATCH 05/10] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 491d9fc4..10b75724 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ for your operating system. Only the basic version is required for execution. Ensure that the environment variable DATA_SOURCE_NAME is set correctly before starting. DATA_SOURCE_NAME should be in Oracle EZCONNECT format: - https://docs.oracle.com/en/database/oracle/oracle-database/19/netag/configuring-naming-methods.html#GUID-B0437826-43C1-49EC-A94D-B650B6A4A6EE + https://docs.oracle.com/en/database/oracle/oracle-database/19/netag/configuring-naming-methods.html#GUID-B0437826-43C1-49EC-A94D-B650B6A4A6EE 19c Oracle Client supports enhanced EZCONNECT, you are able to failover to standby DB or gather some heavy metrics from active standby DB and specify some additional parameters. Within 19c client you are able to connect 12c primary/standby DB too :) For Example: @@ -112,10 +112,10 @@ export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/servic Create **oracledb_exporter** user with disabled login and **oracledb_exporter** group\ mkdir /etc/etc/oracledb_exporter\ -chown root:oracledb_exporter /etc/etc/oracledb_exporter\ -chmod 775 /etc/etc/oracledb_exporter\ -Put config files to **/etc/etc/oracledb_exporter**\ -Put binary to **/usr/local/bin**\ +chown root:oracledb_exporter /etc/etc/oracledb_exporter +chmod 775 /etc/etc/oracledb_exporter +Put config files to **/etc/etc/oracledb_exporter** +Put binary to **/usr/local/bin** Create file **/etc/systemd/system/oracledb_exporter.service** with the following content: From fbd15637f2df15fa146b135b3cc056574f791381 Mon Sep 17 00:00:00 2001 From: SGolikov Date: Mon, 11 Jan 2021 11:44:26 +0300 Subject: [PATCH 06/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10b75724..18427dfd 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ Type=oneshot #Environment="ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1" #Environment="CUSTOM_METRICS=/etc/oracledb_exporter/custom-metrics.toml" ExecStart=/usr/local/bin/oracledb_exporter \ - --default.metrics "/etc/oracledb_exporter/default-metrics.toml" + --default.metrics "/etc/oracledb_exporter/default-metrics.toml" \ --log.level error --web.listen-address 0.0.0.0:9161 [Install] WantedBy=multi-user.target From bd73f02af4e4ed9e706b1789f2ad9e7a1e949c2b Mon Sep 17 00:00:00 2001 From: SGolikov Date: Mon, 11 Jan 2021 11:46:05 +0300 Subject: [PATCH 07/10] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18427dfd..914e0223 100644 --- a/README.md +++ b/README.md @@ -132,8 +132,8 @@ Type=oneshot #Environment="LD_LIBRARY_PATH=/u01/app/oracle/product/19.0.0/dbhome_1/lib" #Environment="ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1" #Environment="CUSTOM_METRICS=/etc/oracledb_exporter/custom-metrics.toml" -ExecStart=/usr/local/bin/oracledb_exporter \ - --default.metrics "/etc/oracledb_exporter/default-metrics.toml" \ +ExecStart=/usr/local/bin/oracledb_exporter \ + --default.metrics "/etc/oracledb_exporter/default-metrics.toml" \ --log.level error --web.listen-address 0.0.0.0:9161 [Install] WantedBy=multi-user.target From 3fd8df31a669796a2c90f52b327acdd18d966bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=BE=D0=BB=D0=B8=D0=BA=D0=BE=D0=B2=20=D0=A1=D0=B5?= =?UTF-8?q?=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 12 Mar 2021 19:52:54 +0300 Subject: [PATCH 08/10] Fixed /etc path; Add ASM instance connection example --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 914e0223..c67fcdbc 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,8 @@ export DATA_SOURCE_NAME=user/password@//myhost:1521/service export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/service # 19c client for primary/standby configuration with options export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/service?connect_timeout=5&transport_connect_timeout=3&retry_count=3 +# 19c client for ASM instance connection (requires SYSDBA) +export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/+ASM?as=sysdba # Then run the exporter /path/to/binary/oracledb_exporter --log.level error --web.listen-address 0.0.0.0:9161 ``` @@ -111,10 +113,10 @@ export DATA_SOURCE_NAME=user/password@//primaryhost:1521,standbyhost:1521/servic # Integration with System D Create **oracledb_exporter** user with disabled login and **oracledb_exporter** group\ -mkdir /etc/etc/oracledb_exporter\ -chown root:oracledb_exporter /etc/etc/oracledb_exporter -chmod 775 /etc/etc/oracledb_exporter -Put config files to **/etc/etc/oracledb_exporter** +mkdir /etc/oracledb_exporter\ +chown root:oracledb_exporter /etc/oracledb_exporter +chmod 775 /etc/oracledb_exporter +Put config files to **/etc/oracledb_exporter** Put binary to **/usr/local/bin** Create file **/etc/systemd/system/oracledb_exporter.service** with the following content: @@ -128,7 +130,7 @@ Type=oneshot #!!! Set your values and uncomment #User=oracledb_exporter #Group=oracledb_exporter -#Environment="DATA_SOURCE_NAME=dbsnmp/Bercut01@//primaryhost:1521,standbyhost:1521/myservice?transport_connect_timeout=5&retry_count=3" +#Environment="DATA_SOURCE_NAME=dbsnmp/password@//primaryhost:1521,standbyhost:1521/myservice?transport_connect_timeout=5&retry_count=3" #Environment="LD_LIBRARY_PATH=/u01/app/oracle/product/19.0.0/dbhome_1/lib" #Environment="ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1" #Environment="CUSTOM_METRICS=/etc/oracledb_exporter/custom-metrics.toml" From 012c3283c0756103e577f1ed07c5fc589922990a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=BE=D0=BB=D0=B8=D0=BA=D0=BE=D0=B2=20=D0=A1=D0=B5?= =?UTF-8?q?=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 12 Mar 2021 19:53:26 +0300 Subject: [PATCH 09/10] Linux System D configuration example --- systemd-example/oracleasm_exporter.service | 24 +++++++++++++++++ systemd-example/oracledb_exporter.service | 30 ++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 systemd-example/oracleasm_exporter.service create mode 100644 systemd-example/oracledb_exporter.service diff --git a/systemd-example/oracleasm_exporter.service b/systemd-example/oracleasm_exporter.service new file mode 100644 index 00000000..d3d10601 --- /dev/null +++ b/systemd-example/oracleasm_exporter.service @@ -0,0 +1,24 @@ +[Unit] +Description=Service for oracle asm telemetry client +After=network-online.target + +[Service] +Type=simple +Environment="DATA_SOURCE_NAME=asmsnmp/password@//host:1521/+ASM?as=sysdba" +Environment="LD_LIBRARY_PATH=/u01/app/oracle/product/19.0.0/dbhome_1/lib" +Environment="ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1" +User=oracledb_exporter +Group=oracledb_exporter +ExecStart=/usr/local/bin/oracledb_exporter \ + --default.metrics "/etc/oracledb_exporter/default-asm-metrics.toml" \ + --log.level "error" \ + --web.listen-address 0.0.0.0:9163 \ + --log.format "logger:syslog?appname=oracleasm_exporter&local=7" + +KillMode=process +RemainAfterExit=no +Restart=on-failure +RestartSec=5s + +[Install] +WantedBy=multi-user.target diff --git a/systemd-example/oracledb_exporter.service b/systemd-example/oracledb_exporter.service new file mode 100644 index 00000000..b58b274c --- /dev/null +++ b/systemd-example/oracledb_exporter.service @@ -0,0 +1,30 @@ +# +# Ansible managed +# + +[Unit] +Description=Service for oracle telemetry client +After=network-online.target + +[Service] +Type=simple +Environment="DATA_SOURCE_NAME=dbsnmp/password@//host:1521/service?transport_connect_timeout=5&retry_count=3" +Environment="LD_LIBRARY_PATH=/u01/app/oracle/product/19.0.0/dbhome_1/lib" +Environment="ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1" +#Environment="PATH=$PATH:/u01/app/oracle/product/19.0.0/dbhome_1/bin" +#Environment="TNS_ADMIN=/u01/app/oracle/product/19.0.0/dbhome_1/network/admin" +User=oracledb_exporter +Group=oracledb_exporter +ExecStart=/usr/local/bin/oracledb_exporter \ + --default.metrics "/etc/oracledb_exporter/default-metrics.toml" \ + --log.level "error" \ + --web.listen-address 0.0.0.0:9161 \ + --log.format "logger:syslog?appname=oracledb_exporter&local=7" + +KillMode=process +RemainAfterExit=no +Restart=on-failure +RestartSec=5s + +[Install] +WantedBy=multi-user.target From 918f3bad9bf9900cf9fff5fe4044551761727511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=BE=D0=BB=D0=B8=D0=BA=D0=BE=D0=B2=20=D0=A1=D0=B5?= =?UTF-8?q?=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 12 Mar 2021 20:44:48 +0300 Subject: [PATCH 10/10] few ASM instance metric template: diskgroup size & usage; asm disks i/o stats (can be summarized by diskgroup using Prometheus GraphQL) --- default-asm-metrics.toml | 139 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 default-asm-metrics.toml diff --git a/default-asm-metrics.toml b/default-asm-metrics.toml new file mode 100644 index 00000000..e8900932 --- /dev/null +++ b/default-asm-metrics.toml @@ -0,0 +1,139 @@ +[[metric]] +context = "diskgroup_size" +labels = [ "inst_id", "node_name" , "instance_name", "diskgroup_name" ] +metricsdesc = { total = "Total size of ASM disk group in MB.", free = "Free space available on ASM disk group in MB." } +request = ''' +SELECT instance_number AS inst_id, + host_name AS node_name, + instance_name, + name AS diskgroup_name, + total_mb * 1024 * 1024 AS total, + free_mb * 1024 * 1024 AS free + FROM v$asm_diskgroup_stat, v$instance +''' +ignorezeroresult = true + +[[metric]] +context = "asmuptime" +labels = [ "inst_id", "node_name", "instance_name"] +metricsdesc = { uptime = "ASM uptime" } +request = ''' +SELECT instance_number AS inst_id, + host_name AS node_name, + instance_name, + (SYSDATE - startup_time) * 86400 AS uptime + FROM v$instance +''' + +#[[metric]] +#context = "asm_dg_stat" +#labels = [ "inst_id", "diskgroup_name", "node_name", "instance_name" ] +#metricsdesc = { reads = "Total number of I/O read requests for the DG.", writes = "Total number of I/O write requests for the DG.", bytes_read = "Total number of bytes read from the DG", bytes_written = "Total number of bytes written from the DG", iops = "Total number of I/O requests for the DG" } +#metricstype = { reads = "counter", writes = "counter", bytes_read = "counter", bytes_written = "counter", iops = "counter" } +#request = ''' +# SELECT i.instance_number AS inst_id, +# i.host_name AS node_name, +# i.instance_name, +# g.name AS diskgroup_name, +# SUM (ds.reads) AS reads, +# SUM (ds.writes) AS writes, +# SUM (ds.bytes_read) AS bytes_read, +# SUM (ds.bytes_written) AS bytes_written, +# SUM (ds.reads + ds.writes) AS iops +# FROM v$asm_disk_stat ds, v$asm_diskgroup_stat g, v$instance i +# WHERE ds.mount_status = 'CACHED' AND ds.group_number = g.group_number +#GROUP BY i.instance_number, +# i.host_name, +# i.instance_name, +# g.name +#''' + +[[metric]] +context = "asm_disk_stat" +labels = [ "inst_id", "node_name", "instance_name", "diskgroup_name", "disk_number", "failgroup", "path" ] +metricsdesc = { reads = "Total number of I/O read requests for the DG.", writes = "Total number of I/O write requests for the DG.", read_time = "Total I/O time (in hundreths of a second) for read requests for the disk", write_time = "Total I/O time (in hundreths of a second) for write requests for the disk", bytes_read = "Total number of bytes read from the DG", bytes_written = "Total number of bytes written from the DG", iops = "Total number of I/O requests for the DG" } +metricstype = { reads = "counter", writes = "counter", bytes_read = "counter", read_time = "counter", write_time = "counter", bytes_written = "counter", iops = "counter" } +request = ''' + SELECT i.instance_number AS inst_id, + i.host_name AS node_name, + i.instance_name, + g.name AS diskgroup_name, + ds.disk_number AS disk_number, + ds.failgroup AS failgroup, + ds.reads AS reads, + ds.writes AS writes, + ds.read_time * 1000 AS read_time, + ds.write_time * 1000 AS write_time, + ds.bytes_read AS bytes_read, + ds.bytes_written AS bytes_written, + REGEXP_REPLACE (ds.PATH, '.*/\', '\') AS PATH, + ds.reads + ds.writes AS iops + FROM v$asm_disk_stat ds, v$asm_diskgroup_stat g, v$instance i + WHERE ds.mount_status = 'CACHED' AND ds.group_number = g.group_number +''' + +[[metric]] +context = "asm_space_consumers" +labels = [ "inst_id", "diskgroup_name", "node_name", "instance_name", "sid", "file_type" ] +metricsdesc = { size_mb = "Total space usage by db by file_type" , files = "Number of files by db by type" } +request = ''' + SELECT i.instance_number AS inst_id, + i.host_name AS node_name, + i.instance_name, + gname AS diskgroup_name, + dbname AS sid, + file_type, + ROUND (SUM (space) / 1024 / 1024) size_mb, + COUNT (*) AS files + FROM v$instance i, + (SELECT gname, + REGEXP_SUBSTR (full_alias_path, + '[[:alnum:]_]*', + 1, + 4) dbname, + file_type, + space, + aname, + system_created, + alias_directory + FROM ( SELECT CONCAT ('+' || gname, + SYS_CONNECT_BY_PATH (aname, '/')) + full_alias_path, + system_created, + alias_directory, + file_type, + space, + LEVEL, + gname, + aname + FROM (SELECT b.name gname, + a.parent_index pindex, + a.name aname, + a.reference_index rindex, + a.system_created, + a.alias_directory, + c.TYPE file_type, + c.space + FROM v$asm_alias a, v$asm_diskgroup b, v$asm_file c + WHERE a.group_number = b.group_number + AND a.group_number = c.group_number(+) + AND a.file_number = c.file_number(+) + AND a.file_incarnation = c.incarnation(+)) + START WITH (MOD (pindex, POWER (2, 24))) = 0 + AND rindex IN + (SELECT a.reference_index + FROM v$asm_alias a, v$asm_diskgroup b + WHERE a.group_number = + b.group_number + AND (MOD (a.parent_index, + POWER (2, 24))) = + 0) + CONNECT BY PRIOR rindex = pindex) + WHERE NOT file_type IS NULL AND system_created = 'Y') +GROUP BY i.instance_number, + i.host_name, + i.instance_name, + gname, + dbname, + file_type +'''