Skip to content

Redo Log File Information (vlogfile.sql)

This script queries Oracle views to provide database information via the vlogfile.sql script.

rem vlogfile.sql
rem
ttitle 'Redo Log Files'
rem
col group# format 99 heading 'GROUP'
col status format a7 heading 'STATUS'
col member format a66 heading 'FILE NAME'
rem
select group#, status, member
from v$logfile;

This simple but essential script displays information about all redo log files in the database, showing the log group numbers, file status, and physical file paths. It’s fundamental for redo log management, configuration verification, and troubleshooting redo log issues.

  • Complete Log File Inventory: Shows all redo log files in the database
  • Group Organization: Displays which group each file belongs to
  • Status Information: Shows current status of each log file
  • Physical Locations: Lists complete file paths for each redo log member
  • Simple Format: Clean, easy-to-read output
@vlogfile.sql

No parameters required - shows all redo log files.

SELECT on V$LOGFILE
Redo Log Files
GROUP STATUS FILE NAME
----- ------- ------------------------------------------------------------------
1 /u01/oradata/PROD/redo01a.log
1 /u02/oradata/PROD/redo01b.log
2 /u01/oradata/PROD/redo02a.log
2 /u02/oradata/PROD/redo02b.log
3 /u01/oradata/PROD/redo03a.log
3 /u02/oradata/PROD/redo03b.log
4 INVALID /u01/oradata/PROD/redo04a.log
4 /u02/oradata/PROD/redo04b.log
  • GROUP: Redo log group number
  • STATUS: Status of the log file member
  • FILE NAME: Complete path to the physical redo log file
  • Empty status: File is valid and available
  • Normal operation: File can be used for redo generation
  • Healthy state: No issues with the file
  • File problem: Physical file has issues
  • Potential causes: Disk failure, file corruption, permission problems
  • Impact: Group may still function if other members are valid
  • Out of sync: File is behind other group members
  • Recovery needed: File needs to be synchronized
  • Temporary state: Usually resolves after log switch
  • File removed: Physical file has been deleted
  • Administrative action: File was intentionally removed
  • Recovery required: File needs to be recreated or dropped
-- Standard configuration shows:
-- Multiple groups (typically 3-4 minimum)
-- Multiple members per group (2+ for redundancy)
-- Even distribution across storage devices
-- Each group should have:
-- At least 2 members for redundancy
-- Members on different physical devices
-- Members on different controllers/storage arrays
-- Look for:
-- Files spread across multiple mount points
-- Balanced I/O distribution
-- Separation from data files
  1. Configuration Verification

    • Verify redo log setup after installation
    • Confirm redundancy configuration
    • Validate file locations
  2. Troubleshooting

    • Identify failed or invalid redo log files
    • Locate missing or corrupted files
    • Diagnose redo log issues
  3. Maintenance Planning

    • Plan redo log file movements
    • Assess storage requirements
    • Schedule redo log maintenance
  4. Documentation

    • Document current redo log configuration
    • Create deployment specifications
    • Support disaster recovery planning
-- Combine with V$LOG for complete picture:
SELECT l.group#, l.sequence#, l.bytes/1024/1024 mb,
l.status group_status, lf.member, lf.status file_status
FROM v$log l, v$logfile lf
WHERE l.group# = lf.group#
ORDER BY l.group#, lf.member;
-- Check redo log sizes:
SELECT group#, bytes/1024/1024 size_mb, members
FROM v$log
ORDER BY group#;
-- See which group is currently active:
SELECT group#, sequence#, status, first_change#
FROM v$log
WHERE status = 'CURRENT';
-- Add members for redundancy:
ALTER DATABASE ADD LOGFILE MEMBER
'/u03/oradata/PROD/redo01c.log' TO GROUP 1;
-- Remove invalid or problematic members:
ALTER DATABASE DROP LOGFILE MEMBER
'/u01/oradata/PROD/redo04a.log';
-- Add new redo log groups:
ALTER DATABASE ADD LOGFILE GROUP 5
('/u01/oradata/PROD/redo05a.log',
'/u02/oradata/PROD/redo05b.log') SIZE 1G;
-- Steps to resolve INVALID status:
-- 1. Check physical file existence
-- 2. Verify file permissions
-- 3. Check disk space and errors
-- 4. Consider dropping and recreating member
-- If files are missing:
-- 1. Check if files were accidentally deleted
-- 2. Restore from backup if possible
-- 3. Drop missing members if group has other valid members
-- 4. Add new members to maintain redundancy
-- If redo performance is poor:
-- 1. Check file locations (different devices?)
-- 2. Verify adequate size to avoid frequent switches
-- 3. Consider adding more groups
-- 4. Check storage subsystem performance
  • Minimum 2 members: Each group should have at least 2 members
  • Different devices: Members on separate physical storage
  • Different controllers: Avoid single points of failure
  • Adequate size: Large enough to avoid frequent log switches
  • Consistent sizing: All groups should be the same size
  • Growth planning: Size for expected transaction volume
  • Fast storage: Redo logs should be on fast, dedicated storage
  • Separate from data: Don’t mix with data files
  • Raw devices: Consider raw devices or ASM for performance
-- Monitor for:
-- Invalid or stale log files
-- Missing redundancy (single member groups)
-- Uneven group sizes
-- Files on inappropriate storage
-- Create alerts for:
-- Status != '' (any error status)
-- Groups with only one valid member
-- Log switch frequency issues
-- Use with related scripts:
-- V$LOG for group status and activity
-- V$LOG_HISTORY for switch patterns
-- Alert log for redo-related errors
-- Correlate with:
-- Log file sync wait events
-- Log file parallel write waits
-- Archive log performance
  1. Run vlogfile.sql to check file status
  2. Verify all groups have multiple members
  3. Check for any INVALID status files
  4. Validate file locations and storage distribution
  1. Document current configuration
  2. Plan for storage changes or upgrades
  3. Schedule redo log maintenance windows
  4. Prepare for disaster recovery scenarios