Showing posts with label Database 11g. Show all posts
Showing posts with label Database 11g. Show all posts

Wednesday, December 15, 2010

How to delete the online redo log files and add the new logs

select * from v$log; 
select * from v$logfile;

alter database add logfile group 1 ('/d01/testdb/test/log3a.log','/d01/testdb/test/log4e.log') size 100m;

alter database add logfile member '/d01/testdb/test/log5e.log ' to group 1;
 For Deleting redo log files it shouldn’t be active the redo log file what we are going to be delete it. In this types cases we use to switch the log file to another log file.
 alter system switch logfile    - it forces to switch to the another redo log file

alter database drop logfile member ‘/d01/testdb/test/log5e.log ’;

alter database drop logfile group 4;

 Renaming Log files
1. Shut down the database
2. Go to the OS level and change the redo log file names – mv log3a.log log3b.log
3. startup mount
4. alter database rename file ‘/d01/testdb/test/log3a.log’ to '/d01/testdb/test/log3b.log';
5. alter database open;

Clearing Redo log files:
alter database clear logfile group 1;