Oracle Database 26ai will be available on generic Linux platforms in January and soon on AIX and Windows
Data Dictionary Objects
ALL_LOG_GROUPS
GV_$LOGFILE
GV_$THREAD
CDB_LOG_GROUPS
GV_$LOGHIST
LOG$
DBA_LOG_GROUPS
GV_$INSTANCE_LOG_GROUP
USER_LOG_GROUPS
GV_$LOG
GV_$LOG_HISTORY
init File Parameters
log_checkpoint_timeout ... set to 0
Log Files With Redundancy
(Group with multiple members)
LOGFILE
GROUP 1 ('/u01/app/oracle/oradata/orabase/redo1a.log', '/u05/app/oracle/fast_recovery_area/orabase/onelinelog/redo1b.log') SIZE 2G,
GROUP 2 ('/u01/app/oracle/oradata/orabase/redo2a.log', '/u05/app/oracle/fast_recovery_area/orabase/onelinelog/redo2b.log') SIZE 2G,
GROUP 3 ('/u01/app/oracle/oradata/orabase/redo3a.log', '/u05/app/oracle/fast_recovery_area/orabase/onelinelog/redo3b.log') SIZE 2G,
GROUP 4 ('/u01/app/oracle/oradata/orabase/redo4a.log', '/u05/app/oracle/fast_recovery_area/orabase/onelinelog/redo4b.log') SIZE 2G,
Log File Sizing
As a rule-of-thumb one should try to balance archive logging between the following mutually exclusive criteria
The larger the log files the less frequent the log switches and the better performance
The smaller the log files the less risk of data loss in the event of log file corruption or a need to recover
The generally accepted balance point, in most organizations is archive log file switches once every 5 to 15 minutes: In other words 4 to 12 switches per hour.
Other advantages to consider in using the log file switch frequency recommended here, as opposed to fewer switches, are:
Fewer archivelog records and files to track
Fewer backup records for RMAN and backup software to track and maintain
Many backup appliances requires 1 file per set, so the more data that can backup at once the smaller the channel allocation overhead incurred and the faster backups and restores will take place
Status Privileges
Status
Description
active
The online redo log is active and required for instance recovery, but is not the log to which the database is currently writing. It may be in use for block recovery, and may or may not be archived.
clearing
The log is being re-created as an empty log after an ALTER DATABASE CLEAR LOGFILE statement. After the log is cleared, then the status changes to UNUSED.
clearing_current
The current log is being cleared of a closed thread. The log can stay in this status if there is some failure in the switch such as an I/O error writing the new log header.
current
The online redo log is active, that is, needed for instance recovery, and it is the log to which the database is currently writing. The redo log can be open or closed.
inactive
The log is no longer needed for instance recovery. It may be in use for media recovery, and may or may not be archived.
unused
The online redo log has never been written to.
Related System Privileges
ALTER DATABASE
ALTER SYSTEM
Managing Log File Groups
Add a redo log file group
ALTER DATABASE ADD LOGFILE
('<log_member_path_and_name>', '<log_member_path_and_name>')
SIZE <integer> <K | M | G>;
ALTER DATABASE ADD LOGFILE
('/u01/app/oracle/oradata/orabase/redo4a.log', '/u05/app/oracle/fast_recovery_area/orabase/onelinelog/redo4b.log') SIZE 2G;
Add a redo log file group and specifying the group number
ALTER DATABASE ADD LOGFILE GROUP <group_number>
('<log_member_path_and_name>') SIZE <integer> <K | M | G>;
ALTER DATABASE ADD LOGFILE GROUP 5 ('c:\temp\newlog1.log') SIZE 500M;
Relocate redo log files
ALTER DATABASE RENAME FILE '<existing_path_and_file_name>'
TO '<new_path_and_file_name>';
ALTER SYSTEM DUMP LOGFILE 'u01/app/oracle/product/oradata/orabase/redo01a.log' TIME MIN
250718034;
Related Queries
This query can be used to create a report giving a graphical view of dates and times of log file usage
set linesize 121
col 00 format 99
col 01 format 99
col 02 format 99
col 03 format 99
col 04 format 99
col 05 format 99
col 06 format 99
col 07 format 99
col 08 format 99
col 09 format 99
col 10 format 99
col 11 format 99
col 12 format 99
col 13 format 99
col 14 format 99
col 15 format 99
col 16 format 99
col 17 format 99
col 18 format 99
col 19 format 99
col 20 format 99
col 21 format 99
col 22 format 99
col 23 format 99
Redo Log generation rate query from Jonathan Lewis [Click Here]
SELECT TO_CHAR(first_time,'dd hh24:mi:ss') first_time,
ROUND(24 * 60 * (LEAD(first_time,1) OVER (ORDER BY first_time) - first_time),2) minutes
FROM v_$log_history
ORDER BY recid;
ALTER DATABASE CLEAR LOGFILE GROUP <group_number>;
-- this statement overcomes two situations where dropping redo logs is not possible: If there are only two log groups The corrupt redo log file belongs to the current group.
ALTER DATABASE CLEAR LOGFILE GROUP 4;
Clear A Log File If It Has Become Corrupt And Avoid Archiving
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP <group_number>;
-- use this version of clearing a log file if the corrupt log file has not been archived.