A couple of interesting Oracle views:
a)To view information on log files:
SELECT * FROM v$log;b)To view information on log file history:
SELECT thread#, first_change#, TO_CHAR(first_time,’MM-DD-YY HH12:MIPM’),next_change# FROM v$log_history;
Operations on Oracle log files :
1. Forcing log file switches:ALTER SYSTEM switch logfile;or
ALTER SYSTEM checkpoint;2. Clear A Log File If It Has Become Corrupt:
ALTER DATABASE CLEAR LOGFILE GROUP group_number;3. This statement overcomes two situations where dropping redo logs is not possible: If there are only two log groups and if the corrupt redo log file belongs to the current group:
ALTER DATABASE CLEAR LOGFILE GROUP 4;4. Clear A Log File If It Has Become Corrupt And Avoid Archiving:
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP group_number;5. Use this version of clearing a log file if the corrupt log file has not been archived:
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 3;6. Privileges Related To Managing Log Files:
ALTER DATABASE7. Init File Parameters Related To Log Files:
ALTER SYSTEM
log_checkpoint_timeout … set to 0
8. Managing Log File Members:
ALTER DATABASE ADD LOGFILE MEMBER ‘log_member_path_and_name’ TO GROUP group_number;9. Adding log file group members:
ALTER DATABASE ADD LOGFILE MEMBER ‘/oracle/dbs/log2b.rdo’ TO GROUP 2;10. Droping log file group members:
ALTER DATABASE DROP LOGFILE MEMBER log_member_path_and_name’;11. To create a new group of online redo log files, use the SQL statement ALTER DATABASE with the ADD LOGFILE clause:
ALTER DATABASE DROP LOGFILE MEMBER ‘/oracle/dbs/log3c.rdo’;
The following statement adds a new group of redo Oracle log files to the database:
ALTER DATABASE ADD LOGFILE (‘/oracle/dbs/log1c.rdo’, ‘/ oracle/dbs/log2c.rdo’) SIZE 500K;