Logfiles in Oracle
Redo Log files in oracle
- A redo log is a file that is part of an Oracle database.
- When a transaction is committed, the transaction's details in the redo log buffer is written to a redo log file.
- ---It is another name is Online-redologfiles.
- As the Redo Log Buffer fills, the contents are written to Redo Log Files.
- This includes uncommitted transactions, undo segment data, and schema/object management information.
- During database recovery, information in Redo Log Files enable data that has not yet been written to datafiles to be recovered.
A Redo Log File stores Redo Records (also called redo log entries).
- Each record consists of "Change vectors" that store information about:
- changes made to a database block.
- undo block data.
- transaction table of undo segments.
Group status:-
- Unused – the Redo Log Group has never been used – this status only occurs for a newly added Redo Log Group.
- Current – The active Redo Log Group.it is currently writing lgwr to logfile.
- Active – the Redo Log Group is active, but not the current Group – it is needed for crash recovery and may be in use for block recovery. It may not yet be archived.
- Clearing – the Log is being recreated after an ALTER DATABASE CLEAR LOGFILE command.
- Clearing_Current – the current Redo Log Group is being cleared of a closed group.
- Inactive – The Group is not needed for Instance Recovery.
Member Status:-
- Invalid – the file cannot be accessed and needs to be dropped and recreated.
- Stale – the contents of the file are incomplete – drop it and recreate it.
- Deleted – the file is no longer in use – you can use operating system commands to delete the associated operating system file.
- Blank – the file is in use.
Managing size of Redologfile:-
Minimum size for an On-line Redo Log File is 4MB.
Maximum size and Default size depends on the operating system.
If you set logfile size in 4mb,the switch occur more than 10 mintues.
---you need to set target of switching logfile.
ALTER SYSTEM SET ARCHIVE_LAG_TARGET = 1200;Milli-seconds.
The database requires a minimum of two Logfile Group to guarantee.(if the database is in ARCHIVELOG mode).
And each group have minimum two member's,group have differnt information but member have same information with in a group
If archiving is disabled ( NOARCHIVELOG mode),
a filled redo log file is available after the changes recorded in it have been written to the datafiles.
If archiving is enabled (ARCHIVELOG mode),
a filled log file is available to LGWR after the changes recorded in it have been written to the datafiles and the file has been archived.
Adding Logfile Groups:-
alter database add logfile group 3 '/home/oracle/icici/log/log03a.log' size 10m;
Adding a member to alredy exits groups:-
alter database add logfile member '/home/oracle/icici/log/log03b.log' to group 3;
alter database add logfile member '/home/oracle/icici/log/log03b.log' to group 3,'/home/oracle/icici/log/log03c.log' to group 4;
Dropping Redo Log File Groups and Files:-
ALTER DATABASE DROP LOGFILE GROUP 3;
Drop LOGFILE member from Group
ALTER DATABASE DROP LOGFILE MEMBER' /u01/student/dbockstd/oradata/USER350redo01a.log';
Managing Redo log group's
SELECT group#, status FROM v$log;
select * from v$logfile;
Comments
Post a Comment