Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]

Search This Blog

Friday, September 4, 2015

ADD/DROP Redo logfile groups:



ADD/DROP Redo logfile groups:


SHAIKDB>select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
    1        1 INACTIVE
    2        1 CURRENT
    3        1 INACTIVE

SHAIKDB>alter database drop logfile group 1;

Database altered.

SHAIKDB>alter database drop logfile group 3;
alter database drop logfile group 3
*
ERROR at line 1:
ORA-01567: dropping log 3 would leave less than 2 log files for instance SHAIKDB (thread 1)
ORA-00312: online log 3 thread 1: '/u01/app/oracle/SHAIKDB/redo03.log'



SHAIKDB>alter database add logfile group 1('/u01/app/oracle/SHAIKDB/redo1.log','/u01/app/oracle/SHAIKDB/redo12.log') size 100m;

Database altered.

SHAIKDB>alter database drop logfile group 3;

Database altered.

SHAIKDB>alter database add logfile group 3 ('/u01/app/oracle/SHAIKDB/redo3.log','/u01/app/oracle/SHAIKDB/redo31.log') size 100m;

Database altered.

SHAIKDB>select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
    1        1 UNUSED
    2        1 CURRENT
    3        1 UNUSED

SHAIKDB>alter system archive log current;

System altered.

SHAIKDB>select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
    1        1 CURRENT
    2        1 ACTIVE
    3        1 UNUSED

SHAIKDB>alter system archive log current;

System altered.

SHAIKDB>select group#,thread#,status from v$log;

    GROUP#    THREAD# STATUS
---------- ---------- ----------------
    1        1 ACTIVE
    2        1 ACTIVE
    3        1 CURRENT

No comments: