Querying online log files sql> col member for a50sql> select group#,status,type,member From v$logfile; group# status ts type member---------- --------- --------- ------ -------------------------------------------------- 3 ONLINE /u01/app/oracle/oradata/king/redo03.log 2 ONLINE /u01/app/oracle/oradata/king/redo02.log 1 ONLINE &nbSp; /u01/app/oracle/oradata/king/redo01.log
Querying online log Groups sql> select group#,sequence#,members,bytes,status,archived from v$log; GROUP# SEQUENCE# MEMBERS bytes status archived---------- ---------- ---------- ------- --- --------- --------- 1 4 1 52428800 INACTIVE YES 2 5 1 52428800 INACTIVE YES 3 6 1&nbsP; 52428800 current no
Delete online log group sql> ALTER DATABASE drop logfile Group 1; Sql> host Rm-rf/u01/app/oracle/oradata/king/redo01.log Create an online log group sql> ALTER DATABASE add logfile Group 1 ('/u01/app/ Oracle/oradata/king/redo01a.log ', '/u01/app/oracle/oradata/king/redo01b.log ') size 50M;
sql> ALTER DATABASE drop logfile Group 2; Sql> host rm-rf/u01/app/oracle/oradata/king/redo02.logsql> ALTER DATABASE add logfile Group 2 ('/u01/app/oracle/ Oradata/king/redo02a.log ', '/u01/app/oracle/oradata/king/redo02b.log ') size 50M;
sql> alter system switch logfile; Sql> alter system checkpoint;
sql> ALTER DATABASE drop logfile Group 3; Sql> host rm-rf/u01/app/oracle/oradata/king/redo03.logsql> ALTER DATABASE add logfile Group 3 ('/u01/app/oracle/ Oradata/king/redo03a.log ', '/u01/app/oracle/oradata/king/redo03b.log ') size 50M;
sql> select group#,status,type,member from v$logfile; group# Status TS Type MEMBER---------- --------- --------------- -------------------------------------------------- 3 online /u01/app/oracle/oradata/king/ redo03a.log 2 online /u01/app/oracle/ oradata/king/redo02a.log 1 online /u01/app /oracle/oradata/king/redo01a.log 1 online /u01/app/oracle/oradata/king/ redo01b.log 2 online /u01/app/oracle/ oradata/king/redo02b.log 3 online /u01/app /oracle/oradata/king/redo03b.log
sql> select group#,sequence#,members,bytes,status,archived from v$log; GROUP# SEQUENCE# MEMBERS bytes status archived---------- ---------- ---------- ---------- --------- --------- 1 7 2 52428800 CURRENT NO 2 0 2 52428800 UNUSED YES 3 0 &nbsP;2 52428800 unused yes
Add an online log file to the log group sql> ALTER DATABASE add logfile member '/u01/app/oracle/oradata/king/redo01c.log ' to group 1, '/u01/app/ Oracle/oradata/king/redo02c.log ' to group 2, '/u01/app/oracle/oradata/king/redo03c.log ' to group 3;
sql> select group#,status,type,member from v$logfile; group# Status TS Type MEMBER---------- --------- --------------- -------------------------------------------------- 3 online /u01/app/oracle/oradata/king/ redo03a.log 2 online /u01/app/oracle/ oradata/king/redo02a.log 1 online /u01/app /oracle/oradata/king/redo01a.log 1 online /u01/app/oracle/oradata/king/ redo01b.log 2 online /u01/app/oracle/ oradata/king/redo02b.log 3 online /u01/app /oracle/oradata/king/redo03b.log 1 invalid online /u01/app/oracle/oradata/king/ redo01c.log 2 invalid online /u01/app/oracle/oradata/king/redo02c.log 3 invalid online /u01/ App/oracle/oradata/king/redo03c.log
sql> select group#,sequence#,members,bytes,status,archived from v$log; GROUP# SEQUENCE# MEMBERS bytes status archived---------- ---------- ---------- ---------- --------- --------- 1 7 3 52428800 CURRENT NO 2 0 3 52428800 UNUSED YES 3 0 &nbsP;3 52428800 unused yes
Delete the online log files in the log group sql> ALTER DATABASE drop logfile member '/u01/app/oracle/oradata/king/redo02c.log '; Sql> Host Rm-rf/u01/app/oracle/oradata/king/redo02c.log
sql> ALTER DATABASE drop logfile member '/u01/app/oracle/oradata/king/redo03c.log '; Sql> Host Rm-rf/u01/app/oracle/oradata/king/redo03c.log
sql> alter system switch logfile; Sql> alter system checkpoint;
sql> ALTER DATABASE drop logfile member '/u01/app/oracle/oradata/king/redo01c.log '; Sql> Host Rm-rf/u01/app/oracle/oradata/king/redo01c.log
Oracle Database Online log file management