How to check the maximum number of session connected

For the last days, I want to know the maximum number of sessions on a database or for each node of my RAC. The considered period is sysdate > AWR retention time select a.instance_number, current_utilization, end_interval_time from sys.wrh$_resource_limit a, sys.wrm$_snapshot b where a.resource_name like ‘%sessions%’ and a.snap_id = b.snap_id and a.instance_number = b.instance_number and a.instance_number […]

ASM Space used

I want to monitor space usage (free and used) on Oracle ASM diskgroups.   With v$ view and sql*Plus: SELECT name, free_mb, total_mb, free_mb/total_mb*100 as percentage FROM v$asm_diskgroup; NAME FREE_MB TOTAL_MB PERCENTAGE ———————————————————— ———- ———- ———- DATA 62532 1536216 4.07052133 MGMT 5760 42000 13.7142857 OCRVOTE 20144 20480 98.359375 RECOVER 441296 445496 99.0572306 With asmcmd: $ […]

How to convert rows to one column in SQL?

The goal is to convert all the row values in a column to a single concatenated list. You can change the space separated by comma or other csv like fields. Example of a result: ID ADDRESS id1 addres1 addres2 addres3 id2 addres4 id3 addres5 addres6 id4 addres7 addres8 addres9 addres10 addres11 select ID, max(decode(my_seq,1,ADDRESS)) || […]

How to generate DDL for db_links

Is there anyway to extract ddl for all database links in Oracle 18c/12c/11g and perhaps find the password of the connect string? YES you can! COLUMN Text FORMAT a2480 WORD_WRAPPED SET LONG 20000 LONGCHUNKSIZE 20000 PAGESIZE 0 LINESIZE 1000 FEEDBACK OFF VERIFY OFF TRIMSPOOL ON head off exec DBMS_METADATA.set_transform_param (DBMS_METADATA.session_transform, ‘SQLTERMINATOR’, true); exec DBMS_METADATA.set_transform_param (DBMS_METADATA.session_transform, ‘PRETTY’, […]