Oracle categorizing alert log error messages We can find oracle alert log error messages by querying in v$diag_alert_ext where message_text LIKE '%ORA-%'. I want to categorize the error messages like

OS errors
DB errors
Listener errors

Local Listener Errors
Scan Listener Errors



Is it possible to do so by querying in the v$diag_alert_ext table? What is the way to do that?
From the Database Reference I see that the view V$DIAG_ALERT_EXT contains a MESSAGE_GROUP column. Maybe this column contains such kind of information.
I am not aware of a view that contains such information. I searched for *us.msg files in the $ORACLE_HOME directories  and subdirectories of a 12.2 installation by executing find $ORACLE_HOME -name '*us.msg' and found the file $ORACLE_HOME/rdbms/mesg/oraus.msg that contains error messages in increasing order of error number and often containing a comment lines that describes the type of the error numbers in the following range. I extracted these comment lines. The output is shown in the following code block. There are more captions in comments that have a format thast will not ber recognized by this grep command.

 grep '^/ [0-9]'  $ORACLE_HOME/rdbms/mesg/oraus.msg
/ 10 - 49 user session and session switching errors
/ 70 .. 90 generic debugger errors
/ 91 .. 95 ksm large_pool_size and large_pool_min_alloc size errors
/ 101 .. 149 shared server errors
/ 150 .. 159 Oracle*XA errors
/ 160 .. 199 Distributed transaction errors (continued)
/ 200 .. 249 control file management errors
/ 250 .. 299 archival & media recovery errors
/ 300..369 - Redo File errors
/ 370-389 kcb external errors
/ 390-399: more Redo log errors
/ 400-420: KCK errors
/ 436-439: Oracle licensing ercs
/ 440-460 Detached process startup errors
/ 469-525 Detached process death errors (signaled in foreground)
/ 00526-00565
/ 00570-00599 SQL*Connect Opening & Reading Files
/ 00710 - 00719 reserved for tablespace rename feature
/ 1070 - 1099: V6 program interface errors
/ 1100 to 1279: db file errors (continue at 63000)
/ 1384 - 1396 Reserved for 4K block size log file errors
/ 1490 - 1499 Analyze Parse and Execution Errors
/ 1500 - 1699 V6 Execution errors
/ 2040 .. 2099 - Reserved for distributed update
/ 2100 .. 2139 - Reserved for precompiler runtime (SQLLIB)
/ 2140 .. 2499 - V6 parser errors continued
/ 6571-6579 Reserved for Plsql functions called from Sql
/ 6581-6591 Reserved for European OEM Ports (contact: egroenen.nl)
/ 6600-6699 Reserved for more SQL*Net errors
/ 6700-6899 Reserved for TLI SQL*NET driver errors
/ 6900-6999 Reserved for more SQL*Net errors
/ 06609 is not used by the LU6.2 Driver.
/ 6700-6899 Reserved for TLI SQL*NET driver errors
/ 6900-6999 Reserved for more SQL*Net errors
/ 7000-7099 Reserved for SQL*CONNECT/DB2 errors
/ 7100-7199 Reserved for SQL*CONNECT/IMS errors
/ 7200 - 7499 Reserved for UNIX OSD errors
/ 7500-7999 VMS OSD ERRORS
/ 7700 - 7720: sksarch errors
/ 7721-7729 scg overflow errors
/ 7740 - 7760 error message file errors
/ 7820-7839  SSP error messages
/ 7840-7859 SLLF error messages
/ 7880 - 7889 Error message for sd
/ 8000 - 8174  Data layer error messages
/ 8175 - 8190 Discrete transaction error messages
/ 8200 - 8399 Reserved for NCUBE OSD errors
/ 8270 - 8273 Reserved nCUBE archival
/ 8273 - reserved nCUBE archival
/ 8320 - 8329 Reserved for scn.c
/ 8340-8359 Reserved for nCUBE redo server errors
/ 8362 - 8399 Reserved for nCUBE sosd errors (unassigned)
/ 8400 UTL_RAW and UTL_PG error and warning messages
/ 8401 - 8499 Reserved for APPC Gateway
/ 8500 - 8599 Reserved for Protocol Procedural Gateway for
/ 8600 - 8699 Reserved for ??? sql*connnect errors
/ 8700 - 8799 Reserved for ??? sql*connnect errors
/ 8800 - 8999 Reserved for Tandem sql*connnect errors
/ 9000 - 9099 Reserved for TERADATA sql*connnect errors
/ 9100 - 9199 Reserved for file-based sql*connnect errors
/ 9200 - 9499 Reserved for OS/2 and MSDOS OSD errors
/ 9500 - 9699 Reserved for MPE/XL OSD errors
/ 9700 - 9999 Reserved for UNIX OSD errors
/ 09720-09739 reserved for Philips MPX P9x00
/ 09786-09825 reserved for Loader V2.0
/ 10630-10639 Reserved for Online Segment Shrink
/ 09858-09859 Reserved For NeXT port
/ 09860-09869 Reserved For Oracle Europe
/ 10302 - 10318 Reserved for internal triggers
/ 10325 - 10335 reserved for recovery testing
/ 10530 -10540 reserved for lightweight threads
/ 10552 -10589 reserved for recoverable media/standby recovery
/ 10710 - 10729 are Reserved for BITMAP row sources
/ 10730 - 10800 general debugging events
/ 10780 - 10785  Reserved for LogMiner
/ 10786 - 10788  Reserved for ks*
/ 10789 - 10790 Reserved for LogMiner
/ 10791 - 10799  Reserved for Logical Standby
/ 10810 - 10825 Reserved for OLTP
/ 10826 - 10829 Reserved for upgrade/downgrade
/ 10830 - 10838 Reserved for sort and aggregation row sources
/ 10841 - 10849 Reserved for OCI
/ 10850 - 10869 Reserved for AQ
/ 10870 - 10879  Reserved for recovery layer
/ 10880 - 10882  Reserved for Java Virtual Machine
/ 10900 - 10924  Reserved for SPACE management
/ 10901 - used in 7.3.4 for disabling extent trimming for merge
/ 10970 - 10974 Reserved for Lob Access
/ 10975 - 10995 Reserved for Replication
/ 10996 - 10998 Reserved for ks*
/ 10999 End Pseudo-error debugging events
/ 11000 - 11999 Reserved for mvs sql*net errors
/ 12000 - 12099 Reserved for table materialized view errors
/ 12100 - 12299 Reserved for Net8 errors
/ 12150 - 12195   Reserved for OSN (Not to be used by TNS)
/ 12196 - 12285   NR errors reportable by OSN (returned by nricall())
/ 12286 - 12499   ---(Reserved)---
/ 12500 - 12699   See net12500.msg
/ 12196 - 12285 NR errors reportable to OSN.
/ 12300 - 12399 Reserved for Multiple Mounts
/ 12150 - 12285   See net12150.msg
/ 12286 - 12499   ---(Reserved)---
/ 12500 - 12530   NSG errors reportable by OSN (returned in cndo).
/ 12531 - 12629   NS (and NT errors reported as NS errors) reportable by OSN
/ 12630 - 12699   NA errors (returned by native services)
/ 12500 - 12530 Reserved for NSG errors reportable to OSN.
/ 12531 - 12629 ns errors reportable to osn:
/ 12606 - 12629 ns secondary errors
/ 12630 - 12699 Reserved for NA errors.
/ 12700 - 12999: Reserved.
/ 12700 - 12750 Reserved for NLS
/ 12751 - 12799 reserved for VOS
/ 12800 - 12893 Reserved for Parallel Query/Index Creation
/ 12857 - 12893 unused (parallel query/index creation messages)
/ 12874 - 12893 unused currently for PQ
/ 12894 - 12898 are reserved for asmcmd setsparseparent error messages.
/ 12899 - Stole this one for new "value too large" message
/ 12920 - 12939 reserved for database/tablespace force logging mode messages
/ 12930 - 12939 Reserved for 12c Nologging Standby Project.
/ 12940 - 12949 Reserved for server side DBVerify
/ 12950 - 12960 Reserved for Space Management
/ 12980 - 12999 Reserved for Drop Column
/ 13000 - 13499   (Reserved for Oracle Spatial)
/ 13000 - 13199   Spatial Data Option and Spatial Cartridge 8.0
/ 13200 - 13499   Spatial Cartridge 8.1.3
/ 13391 - 13499 for all GeoRaster errors
/ 13500 - 13999 reserved for Server Manageability Layer
/ 13500 - 13599 reserved for AWR
/ 13600 - 13699 reserved for the adv fmwk.
/ 13700 - 13749 reserved for the ADDM, ASH
/ 13800 - 13809 reserved for the SQL Tuning Base
/ 13810 - 13824 reserved for DBOP Monitor
/ 13825 - 13849 reserved for SQL profiles
/ 13850 - 13899 reserved for end-to-end tracing
/ 13900 - 13949 reserved for threshold-based alert
/ 13950 - 13969 reserved for MMON infrastructure
/ 13970-13998 reserved for common reporting framework
/ 14000 - 14999 reserved for Partitioned object project
/ 14000 - 14099 reserved for parsing new syntax introduced by the Partitioned
/ 14150-14249 reserved for parsing errors which may be generated
/ 14201-14239 reserved for errors which may be generated during
/ 14250-14349 reserved for errors which may be generated during
/ 14400 - 14499 reserved for execution errors introduced by the Partitioned
/ 14450 - 14499 reserved for execution errors introduced by the
/ 14601 - 14700 reserved for 9.0.2 partitioning project
/ 14650 - 14689 reserved for reference-partitioning project
/ 14690 - 14699 reserved for 32k varchar project
/ 14750 - 14799 reserved for interval-partitioning project
/ 14800 - 14849 Reserved for composite list/* partitioning
/ 14850 - 14869 Reserved for autolist partitioning
/ 14870 - 14889 Reserved for interval subpartitioning
/ 14900 - 14949 Reserved for KJAC error messages
/ 14950 - 14999 Reserved for KJAC PL/SQL error messages
/ 15000 - 15499 Reserved for Automatic Storage Management
/ 59000 - 59999 Reserved for Automatic Storage Management (e57000.msg)
/ 15000 - 15099 Used for ASM run-time errors
/ 15100 - 15179 Used for ASM SQL usage errors
/ 15180 - 15188 Used for ASMLIB related error messages
/ 15189 - 15199 Used for ASM tracing and testing errors
/ 15200 - 15206 ASM messages added in 10.2
/ 15210 - 15227 ASM SQL parsing messages added in 11.1
/ 15228 - 15229 Used for ASM testing errors
/ 15230 - 15250 ASM runtime error messages added in 11.1
/ 15252 - 15280 Reserved for TrailBlazer
/ 15380 - 15399 ASM File Group error messages
/ 15400 - 15439 ASM appliance error messages
/ 15430 - 15439 ASM Flex Disk Group Quota Group Messages
/ 15440 - 15499 ASM Volume Messages
/ 59000 - 59999 Reserved for Automatic Storage Management (e57000.msg)
/ 15500 - 15999 Reserved for Server Manageability Layer
/ 15500 - 15599 reserved for Workload Capture and Replay (KEC)
/ 15600 - 15649 reserved for Automated Maintenance Tasks (KET)
/ 15650 - 15699 reserved for Direct Access to Fixed Tables
/ 16000 - 16499 Reserved for ORACLE HOT STANDBY
/ 16100 - 16130 Reserved for Logical Standby
/ 16200 - 16374 Reserved for Logical Standby
/ 16375 - 16499 Reserved for Physical Standby
/ 16500 - 16699 Reserved for Data Guard Broker
/ 16700 - 16899 reserved for Data Guard Broker RSM errors
/ 16900 - 16949 Reserved for Data Guard Broker
/ 17000 - 17499 Reserved for JDBC
/ 17500 - 18000 Reserved for I/O subsystem
/ 17675-18000 Reserved for OFS
/ 18000 - 18099 Reserved for PLAN STABILITY
/ 19391 - 19399 are reserved for autonfs.
/ 19400 - 19499 are reserved for KOT.
/ 19500 - 19998 Reserved for Server Managed Recovery
/ 19830 - 19835: reserved for SQL Engine Errors:
/ 19926 - 19929: reserved for transport database errors
/ 21100 - 21299 Reserved for CORE
/ 21300 - 22799 Reserved for OI/KO/KG (object Interface and Subsystem)
/ 22800 - 22999 Reserved for object SQL:
/ 23000 - 23299 Reserved for object Management Subsystem (OMS)
/ 23300 - 24299 Reserved for errors from DBMS* pl/sql packages
/ 20000 - 20999 Reserved for callers of the
/ 21100 - 21299 Reserved for CORE
/ 21300 - 22799 Reserved for OI/KO/KG (object Interface and Subsystem)
/ 22275 to 22279 reserved for KOLL - LOBs
/ 22280 to 22299 reserved for LOBs - LBS(KOLB), DBMS_LOB(KKXL) and BFILE(KOLF)
/ 22799 IS THE MAXIMUM ERROR NUMBER for ORI/KO (object Interface and Subsystem)
/ 22800 - 22999 Reserved for object SQL:
/ 22999 IS THE MAXIMUM ERROR NUMBER for object SQL
/ 23000 - 23299 Reserved for object Management Subsystem (OMS)
/ 23300 - 24299 Reserved for errors from DBMS* pl/sql pakages
/ 24280 -24290 Reserved for DBMS_LOB (FILE) package
/ 24291 - 24299 Reserved for Sorted Hash Clusters
/ 24300 - 24999 Reserved for OCI/UPI/TTC/OPI/RPI/PSDs etc
/ 24500 - 24549 Reserved for OCI codepoint length semantics and UTF16
/ 24550 - 24574 Reserved for OCI et al Diagnosability
/ 24750 - 24800 Reserved for Transaction OCI
/ 24800 - 24849 Reserved for OCI Lob/File related Calls
/ 24850 - 24874 Reserved for Shared OCI
/ 24900 - 24939 Reserved for OCI Notification
/ 24940 - 24949 Reserved for Generic Notification
/ 24950 - 24959 Reserved for PL/SQL Notification
/ 25474 is reserved for dumping info
/ 25475 is reserved for debug mode
/ 26500 - 26649 Reserved for Replication (KN)
/ 26650 - 26999 Reserved for Log Based Replication Replication (KN)
/ 27000-27299 Reserved for Oracle8 Unix OSDs
/ 27000 - 27030 keep for SKGFQ (Also 27190-27229)
/ 27031 - 27099 keep for SKGFR (if more needed, allocate another range later)
/ 27100 - 27139 keep for SKGM
/ 27140-27189 RESERVED FOR SKGP
/ 27190 - 27229 reserved skgfq
/ 27231 - 27249 reserved for sskgof
/ 27250 - 27269 reserved for sm
/ 27270 - 27274 reserved for sz
/ 27300 - 27350 reserved for slos Error Reporting
/ 27351 - 27499 RESERVED FOR NEW DATABASE SCHEDULER
/ 27401 - 27410 Reserved for scheduler events
/ 27411 - 27420 Reserved for scheduler repeat interval errors
/ 27431 - 27500 Scheduler API errors continuation
/ 27500-27599 RESERVED FOR IPC ERRORS
/ 27600-27699 RESERVED FOR EXADATA (SAGE) and HOST/CELL ERRORS
/ 27700-27800 RESERVED FOR MGA
/ 27800-27900 RESERVED FOR EVENT NOTIFICATION (KSEVN)
/ 28000-28499 RESERVED FOR SECURITY RELATED ERRORS
/ 28060-28099 RESERVED FOR RADM (Real-time Application-controlled Data Masking)
/ 28065 is reserved for RADM internal error.
/ 28100-28149 RESERVED FOR FINE-GRAINED SECURITY
/ 28150-28199 RESERVED FOR N-TIER SECURITY
/ 28200-28230 RESERVED FOR THE APPLICATION ROLE
/ 28221-28230 RESERVED FOR PASSWORD/ACCOUNT ENHANCEMENT
/ 28230-28260 RESERVED FOR THE OBFUSCATION TOOLKIT
/ 28261-28270 RESERVED FOR APPLICATION CONTEXT
/ 28270-28290 RESERVED FOR PASSWORD AUTHENTICATED GLOBAL USER(KZAL)
/ 28290 - 28300 RESERVED FOR THE Kerberos Enterprise User Security
/ 28300 - 28329 RESERVED FOR THE ENTERPRISE USER SECURITY
/ 28330-28499 RESERVED FOR TRANSPARENT DATA ENCRYPTION
/ 28500-28749 RESERVED FOR THE HETEROGENEOUS SERVICES
/ 28575 - 28600 reserved for untrusted and distributed external procedures
/ 28700-28799 RESERVED FOR CODE-BASED ACCESS CONTROL
/ 29250-29299 RESERVED FOR MORE PL/SQL AND UTILITY PACKAGE ERRORS
/ 29300 - 29399 Reserved for errors from DBMS* pl/sql pakages.
/ 29300 - 29354 RESERVED FOR THE DBMS_SQL PACKAGE
/ 29355 - 29399 RESERVED FOR DBMS RESOURCE MANAGER PACKAGES
/ 29400 - 29469 Reserved for Oracle8 Data Cartridges
/ 29470 - 29489 RESERVED FOR THE DBMS_SQL PACKAGE
/ 29490 - 29499 RESERVED FOR THE DBMS_PARALLEL_EXECUTE PACKAGE
/ 29500 - 29699 Reserved for DDL and other integration for
/ 29700-29799 reserved for Global Enqueue Service
/ 29780 -29789 Reserved for Gpnp Generic modules
/ 29800 - 29999 Reserved for Extensible Indexing project
/ 30000 - 30010 Reserved 8.1 miscellaneous features
/ 30051 - 30059 Reserved for row versions query feature
/ 30060 - 30069 Reserved for Transaction layer internal tracing
/ 30070 - 30099 Reserved for datetime/interval feature
/ 30100-30134 Reserved for OCIExtract Cartridge Services
/ 30300 - 30330 reserved for transaction recovery
/ 30665 - 30675 are reserved for 12g SQL enhancements projects
/ 32791 - 32799 are reserved for 12g SQL enhancements projects
/ 32800 - 32999 are reserved for Messaging Gateway (MGW)
/ 65535 -  (MAX ERROR NUMBER; NONE CAN BE LARGER)
/ 32800 - 32999 reserved for Oracle Messaging Gateway (MGW)
/ 40001 - 40020 RESERVED FOR BLAST
/ 40021 - 40040 RESERVED FOR GLM
/ 40101 - 40180 Generic Errors Across All Data Mining Algorithms
/ 40181 - 40200 RESERVED FOR DBMS_DATA_MINING_TRANSFORM
/ 40201 - 40250 RESERVED FOR DBMS_DATA_MINING
/ 40251 - 40260 RESERVED FOR SVM
/ 40261 - 40270 RESERVED FOR NMF
/ 40271 - 40280 RESERVED FOR ABN
/ 40281 - 40300 RESERVED FOR DMF
/ 40301 - 40320 RESERVED FOR DECISION TREE CLASSIFICATION AND REGRESSION
/ 40321 - 40340 RESERVED FOR CLUSTERING MODELS
/ 40341 - 40360 RESERVED FOR MODEL MAINTENANCE UPGRADE/DOWNGRADE MESSAGES
/ 40361 - 40380 RESERVED FOR SECURITY (PRIVILEGE/AUDIT) MESSAGES
/ 40381 - 40500 RESERVED FOR PMML IMPORT
/ 40401 - 40420 RESERVED FOR SVD
/ 40421 - 40440 RESERVED FOR UNSTRUCTURED TEXT
/ 40441 - 40500 RESERVED FOR JSON
/ 40501 - 40550 Reserved for Recovery
/ 40551 - 40600 Reserved for JSON
/ 40581-40619 JSON data guide related
/ 40620-40700 JSON related
/ 40651 - 40700 JSON related
/ 41095 is reserved for tuning
/ 41096 is reserved for tuning component state handling
/ 41097 is reserved for tuning migratability checks
/ 41098 is reserved for tracing
/ 41099 is reserved for debug mode
/ 48000 - 48099 are reserved for diagnosability framework errors
/ 48100 - 48179 are reserved for ADS portable layer
/ 48180 - 48199 are reserved for ADS OSD layer
/ 48200 - 48299 are reserved for AMS layer
/ 48300 - 48389 are reserved for AMI layer
/ 48390 - 48389 are reserved for ADM layer
/ 48400 - 48499 are reserved for ADV layer
/ 48500- 48599 are reserved for AME layer
/ 48600 - 48699 for AMH layer
/ 48800 - 48899 are reserved for ADV layer
/ 48900- 48999 are reserved for UTS layer
/ 51000 - 51999 are reserved for HM, IR diagnosability framework errors
/ 51000 - 51099 for HM infrastructure related
/ 51100 - 51189 for IR infrastructure related
/ 51190 - 51199 for DBMS_IR package errors
/ 51200 - 51399 for DATA corruption checks (physical, logical)
/ 51400 - 51499 for ASM checks
/ 51500 - 51699 for Check Name, Descriptions and Parameter Descriptions
/ 51700 - 51749 for Report Framework (dbgx)
/ 51257 is available to be used
/ 51700 - 51749 for Report Framework (dbgx)
/ 53000 - 53199 : Reserved for repository errors
/ 53200 - 53209 General Errors
/ 53210 - 53229 Source Checking Errors
/ 53230 - 53249 Destination Checking Errors
/ 53250 - 53269 Other Parameter Checking Errors
/ 57000 - 58999 are reserved for TimesTen IMDB errors
/ 15000 - 15499 Reserved for Automatic Storage Management [continued from]
/ 59000 - 59999 Reserved for Automatic Storage Management
/ 59000 - 59299 ASM run-time error messages
/ 59300 - 59399 ASM SQL usage error messages
/ 59400 - 59499 ASM tracing and testing error messages
/ 59500 - 59599 Flex ASM and Member Cluster error messages
/ 59600 - 59699 ASM Flex Disk Group (File Group, Quota Group) error messages
/ 59700 - 59749 ASM Extended Disk Group error messages
/ 59750 - 59799 ASM appliance (ODA, EXADATA) error messages
/ 59800 - 59819 ASMLIB related error messages
/ 59820 - 59849 ASM Volume Messages
/ 60000 - 60999 are reserved for SPACE MANAGEMENT
/ 61001 - 62000 are reserved for ADE Virtual Folder (RNFS)
/ 62001 - 62005 are reserved for parameter properties
/ 62006 - 62009 are reserved for XML and object replication
/ 62010 - 62029 are reserved for DB Unicode Migration Assistant Kernel-Side
/ 62031 - 62080 are reserved for Vector Processing (IMA)
/ 62081 - 62130 are reserved for Vector Encoding (DSBs)
/ 62500 - 62549 are reserved for PATTERN MATCHING
/ 62550 - 62554 are reserved for the SQL Row Limiting clause
/ 62555 - 62599 are reserved for Polymorphic Table Function
/ 63000 - 63999 are reserved for DATABASE FILE ERRORS (cont. from 1100-1279)
/ 64201 - 64299 are reserved for LOB errors
/ 64300 - 64349 are reserved for ARCHIVE COMPRESSION
/ 64350 - 64399 are reserved for In-Memory Columnar (IMC)
/ 64400 - 64599 are reserved for XDB errors
/ 64610 - 64619 are reserved for PL/SQL package UTL_CALL_STACK
/ 65000 - 65399 are reserved for CONSOLIDATED DATABASES ERRORS
/ 65400 - 64450 are reserved for CLUSTERING clause
/ 65455 - 65466 reserved for family errors
/ 65470- 65499 reserved for LOST WRITE PROTECTION
/ 65501- 65529 reserved for LOB layer errors
/ 65530 - 65534 reserved for INDEX layer errors