Redo log File :-
* Redo log files record all changes made to data and provide a recovery mechanism from a system or media failure.
* Redo log files are organized into groups
* An Oracle database requires at least two groups
* Each redo log within a group is called a member.
* Redo log files record all changes made to data and provide a recovery mechanism from a system or media failure.
* Redo log files are organized into groups
* An Oracle database requires at least two groups
* Each redo log within a group is called a member.
Online Redo log groups :-
* A set of identical copies of online redo log file is called an Online redo log group.
* Log writer writes same information to all online redolog files in a group.
* Oracle Server Needs minimum two online redo log group.
Online Redo log Member :-
* Each online redol og file in a group called Online redo log member.
* Each member in a group has a identical log sequence number and same size.
* The log sequence number is assigned each time the oracle server starts writing to a log group to identify each redo log file uniquely.
* The current log sequence number is stored in the control file and header of all data files.
Redo logs Work :-
* When you redo log file is full, Logwriter will move to the next Log group is called Log switch
* Checkpoint occurs
* Information written to Control files
Logwriter Writes Under the Condition
- When a transaction commits
- Redolog buffer becomes one-third full
- More than a megabytes of changed record in the redo log buffer
- Before database writer writer to the datafile.
Forcing Log switch and Checkpoints :-
* Log switches and checkpoints are automatically done at certain operation point of the database.
but a DBA force to log switch or checkpoint occur.
sql> alter system switch logfile;
sql> alter system checkpoint;
Archive mode
sql> archive log list;
database log mode noarchive
automatic archival disable
Change your database from noarchive mode to archive mode
Mount stage
sql> shutdown immediate
sql> startup mount
sql> archive log list;
sql> alter database archivelog;
database altered
sql> archive log list;
database log mode archive mode
automatice archival disabled
sql> archive log start;
If you want set instance level
sql> show parameter log_archive_start
value
false
sql> alter system set log_archive_start=true scope=spfile
system altered
sql> shutdown immediate
sql> startup
sql> archive log list;
Change your archive destination
sql> alter system set log_archive_dest = '\oracle\admin\{sid}' scope=spfile
shutdown and startup
sql> archive log list;
Adding Group and Member :-
sql>alter database add logfile group 3
'\oracle\oradata\{sid}\redo03a.log' size 5m;
sql> alter database drop logfile group 3;
adding member
sql>alter database add logfile member '\oracle\oradata\{sid}\redo03b.dbf to group 3;
sql>alter database drop logfile member '\oracle\oradata\{sid}\redo03b.log' ;
View :-
V$log
v$logfile
Group and member status :-
active - archived ,instance required
Inactive -- archived but instance not required
curretn -- currently log writer writes data in a the group
********* drop your group only inactive state,you cannot drop current state.
If you want to drop current state you sholud log switch logfile.
sql>select archiver from v$instance;
started
0 comments:
Post a Comment