Discover Undocumented V$ Views (vnew.sql)
Discover Undocumented V$ Views
Section titled “Discover Undocumented V$ Views”This script discovers Oracle V$ views that exist in the database but aren’t officially documented in the data dictionary. It’s an excellent tool for finding new Oracle features and undocumented functionality.
Script: vnew.sql
Section titled “Script: vnew.sql”rem vnew.sqlremselect substr( name, 3 ) from v$fixed_table where type = 'VIEW'minusselect substr( view_name, 4 ) from sys.dba_views where owner = 'SYS' and view_name like 'V_$%'/
What This Script Does
Section titled “What This Script Does”This script uses a MINUS
operation to find V$ views that exist in Oracle’s internal fixed table registry (v$fixed_table
) but aren’t documented in the official data dictionary view (dba_views
). These are typically:
- New features in recent Oracle versions not yet documented
- Undocumented views for internal Oracle operations
- Diagnostic views available but not publicly documented
- Beta features included in the database
-- Run the script to find undocumented views@vnew.sql
-- To get more details about discovered views, try:-- (Replace VIEW_NAME with an actual view found)DESC V$VIEW_NAME;SELECT * FROM V$VIEW_NAME WHERE ROWNUM <= 5;
Required Privileges
Section titled “Required Privileges”- SELECT privilege on
V$FIXED_TABLE
- SELECT privilege on
DBA_VIEWS
- Typically requires DBA role or equivalent
Sample Output
Section titled “Sample Output”SUBSTR(NAME,3)--------------ASM_DISK_IOSTATASM_DISK_STAT_SUMMARYBACKUP_ASYNC_IOCLUSTER_INTERCONNECTSCON_SYSMETRICDATABASE_BLOCK_CORRUPTIONDIAG_ALERT_EXTFLUSH_HISTOGRAMHM_CHECK_PARAMMEMORY_CURRENT_RESIZE_OPSPERSISTENT_QMN_CACHEQUARANTINERESTORE_POINT_LOGSQL_BIND_DATASTREAMS_POOL_ADVICETEMPSEG_USAGETRANSACTION_ENQUEUEXS_SESSION_NS_ATTRIBUTES
Understanding the Results
Section titled “Understanding the Results”Types of Undocumented Views
Section titled “Types of Undocumented Views”Performance and Diagnostics:
- Views ending in
_STAT
,_IOSTAT
,_ADVICE
- Memory and resource monitoring views
- Performance tuning and analysis views
New Features:
- ASM (Automatic Storage Management) related views
- Streams and replication views
- Pluggable Database (PDB) related views
Internal Operations:
- Backup and recovery operation views
- Database maintenance views
- Lock and transaction management views
Common Use Cases
Section titled “Common Use Cases”1. Discover New Oracle Version Features
Section titled “1. Discover New Oracle Version Features”-- Find views that might be new in your Oracle versionSELECT substr(name, 3) AS undocumented_viewFROM v$fixed_tableWHERE type = 'VIEW'MINUSSELECT substr(view_name, 4)FROM sys.dba_viewsWHERE owner = 'SYS' AND view_name LIKE 'V_$%'ORDER BY 1;
2. Explore ASM-Related Views
Section titled “2. Explore ASM-Related Views”-- Find undocumented ASM viewsSELECT substr(name, 3) AS asm_viewFROM v$fixed_tableWHERE type = 'VIEW' AND UPPER(name) LIKE '%ASM%'MINUSSELECT substr(view_name, 4)FROM sys.dba_viewsWHERE owner = 'SYS' AND view_name LIKE 'V_$%' AND UPPER(view_name) LIKE '%ASM%';
3. Find Memory-Related Diagnostic Views
Section titled “3. Find Memory-Related Diagnostic Views”-- Find undocumented memory viewsSELECT substr(name, 3) AS memory_viewFROM v$fixed_tableWHERE type = 'VIEW' AND (UPPER(name) LIKE '%MEMORY%' OR UPPER(name) LIKE '%SGA%' OR UPPER(name) LIKE '%PGA%')MINUSSELECT substr(view_name, 4)FROM sys.dba_viewsWHERE owner = 'SYS' AND view_name LIKE 'V_$%' AND (UPPER(view_name) LIKE '%MEMORY%' OR UPPER(view_name) LIKE '%SGA%' OR UPPER(view_name) LIKE '%PGA%');
4. Investigate Specific Undocumented Views
Section titled “4. Investigate Specific Undocumented Views”-- After finding an interesting view, explore its structure-- Replace 'UNDOCUMENTED_VIEW' with actual view nameDESC V$UNDOCUMENTED_VIEW;
-- Sample a few rows to understand the dataSELECT * FROM V$UNDOCUMENTED_VIEW WHERE ROWNUM <= 10;
-- Count total rowsSELECT COUNT(*) FROM V$UNDOCUMENTED_VIEW;
Practical Examples
Section titled “Practical Examples”Example 1: Exploring V$ASM_DISK_IOSTAT
Section titled “Example 1: Exploring V$ASM_DISK_IOSTAT”-- This view provides detailed ASM disk I/O statisticsSELECT disk_group_name, disk_name, reads, writes, read_bytes, write_bytes, read_time, write_timeFROM v$asm_disk_iostatWHERE reads > 0 OR writes > 0;
Example 2: Using V$MEMORY_CURRENT_RESIZE_OPS
Section titled “Example 2: Using V$MEMORY_CURRENT_RESIZE_OPS”-- Shows current memory resize operationsSELECT component, oper_type, oper_mode, initial_size, target_size, final_size, status, start_timeFROM v$memory_current_resize_ops;
Example 3: Checking V$SQL_BIND_DATA
Section titled “Example 3: Checking V$SQL_BIND_DATA”-- Provides bind variable data for SQL statementsSELECT sql_id, position, datatype_string, value_string, value_anydataFROM v$sql_bind_dataWHERE sql_id = '&sql_id';
Oracle Version Considerations
Section titled “Oracle Version Considerations”Oracle 12c and Later
Section titled “Oracle 12c and Later”- Many PDB (Pluggable Database) related views
- Enhanced ASM monitoring views
- Improved memory management views
Oracle 19c and Later
Section titled “Oracle 19c and Later”- Machine learning related views
- Autonomous database features
- Enhanced security and audit views
Oracle 21c and Later
Section titled “Oracle 21c and Later”- Blockchain and immutable table views
- Enhanced JSON functionality views
- Graph database related views
Caution and Best Practices
Section titled “Caution and Best Practices”Important Warnings
Section titled “Important Warnings”- Undocumented Features: These views are not officially supported
- Version Dependencies: Views may disappear in future Oracle versions
- No Documentation: Oracle doesn’t provide official documentation
- Stability: Structure and content may change without notice
- Support: Oracle Support may not help with undocumented views
Best Practices
Section titled “Best Practices”- Development Only: Use primarily in development/test environments
- Document Findings: Keep notes on useful undocumented views
- Version Testing: Test across Oracle versions before relying on them
- Alternative Solutions: Always have documented alternatives
- Regular Checks: Periodically verify views still exist
Integration with Other Discovery Scripts
Section titled “Integration with Other Discovery Scripts”This script works well with:
- Advanced Parameters View (xparmall.run) - For undocumented parameters
- Fixed View Definitions (vfixview.sql) - For understanding internal views
- Database Health Check (db.sql) - For comprehensive analysis
Advanced Usage
Section titled “Advanced Usage”Create a Monitoring Script
Section titled “Create a Monitoring Script”-- Save this as monitor_new_views.sqlSET PAGESIZE 1000SET LINESIZE 120COLUMN view_name FORMAT A40COLUMN discovered_date FORMAT A12
SELECT substr(name, 3) AS view_name, SYSDATE AS discovered_dateFROM v$fixed_tableWHERE type = 'VIEW'MINUSSELECT substr(view_name, 4), SYSDATEFROM sys.dba_viewsWHERE owner = 'SYS' AND view_name LIKE 'V_$%'ORDER BY 1;
Create Documentation Template
Section titled “Create Documentation Template”-- For each discovered view, run this templatePROMPT ========================================PROMPT Analyzing undocumented view: V$&view_namePROMPT ========================================
DESC V$&view_name;
PROMPT Sample data:SELECT * FROM V$&view_name WHERE ROWNUM <= 5;
PROMPT Row count:SELECT COUNT(*) AS total_rows FROM V$&view_name;
This script is invaluable for Oracle professionals who want to stay on the cutting edge of Oracle technology and discover hidden gems within the database.