Oacle 온라인 로그 그룹 과 로그 그룹 구성원 추가

5269 단어 Oracle
1. 로그 그룹 구성원 온라인 추가
SQL> alter database drop logfile member '/u01/app/oracle/oradata/orcl/redo01a.log';

Database altered.

SQL> alter database add logfile member '/u01/app/oracle/fast_recovery_area/orcl/redo01a.log' to group 1;

Database altered.

SQL> alter database add logfile member '/u01/app/oracle/fast_recovery_area/orcl/redo02a.log' to group 2;

Database altered.

SQL> alter database add logfile member '/u01/app/oracle/fast_recovery_area/orcl/redo03a.log' to group 3;

Database altered.

SQL> alter database add logfile group 4 ('/u01/app/oracle/oradata/orcl/redo04.log','/u01/app/oracle/fast_recovery_area/orcl/redo04a.log') size 100m;

Database altered.

SQL> alter database add logfile group 5 ('/u01/app/oracle/oradata/orcl/redo05.log','/u01/app/oracle/fast_recovery_area/orcl/redo05a.log') size 100m;

Database altered.
로 그 를 전환 할 때 Oacle 은 다음 상태 가 INACTIVE 인 로그 그룹 을 찾 습 니 다.
SQL> alter system switch logfile;

System altered.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE	  MEMBERS ARC STATUS	       FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
	 1	    1	      13  104857600	   512		2 NO  INACTIVE		      394447 15-JUN-16	     403542 15-JUN-16
	 2	    1	      14  104857600	   512		2 NO  ACTIVE		      403542 15-JUN-16	     403931 15-JUN-16
	 3	    1	      17  104857600	   512		2 NO  CURRENT		      403940 15-JUN-16	 2.8147E+14
	 4	    1	      15  104857600	   512		2 NO  ACTIVE		      403931 15-JUN-16	     403934 15-JUN-16
	 5	    1	      16  104857600	   512		2 NO  ACTIVE		      403934 15-JUN-16	     403940 15-JUN-16

SQL> alter system switch logfile;

System altered.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE	  MEMBERS ARC STATUS	       FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
	 1	    1	      18  104857600	   512		2 NO  CURRENT		      403948 15-JUN-16	 2.8147E+14
	 2	    1	      14  104857600	   512		2 NO  ACTIVE		      403542 15-JUN-16	     403931 15-JUN-16
	 3	    1	      17  104857600	   512		2 NO  ACTIVE		      403940 15-JUN-16	     403948 15-JUN-16
	 4	    1	      15  104857600	   512		2 NO  ACTIVE		      403931 15-JUN-16	     403934 15-JUN-16
	 5	    1	      16  104857600	   512		2 NO  ACTIVE		      403934 15-JUN-16	     403940 15-JUN-16

SQL> alter system switch logfile;

System altered.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE	  MEMBERS ARC STATUS	       FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
	 1	    1	      18  104857600	   512		2 NO  ACTIVE		      403948 15-JUN-16	     403958 15-JUN-16
	 2	    1	      19  104857600	   512		2 NO  CURRENT		      403958 15-JUN-16	 2.8147E+14
	 3	    1	      17  104857600	   512		2 NO  ACTIVE		      403940 15-JUN-16	     403948 15-JUN-16
	 4	    1	      15  104857600	   512		2 NO  INACTIVE		      403931 15-JUN-16	     403934 15-JUN-16
	 5	    1	      16  104857600	   512		2 NO  INACTIVE		      403934 15-JUN-16	     403940 15-JUN-16

SQL> alter system switch logfile;

System altered.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE	  MEMBERS ARC STATUS	       FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
	 1	    1	      18  104857600	   512		2 NO  ACTIVE		      403948 15-JUN-16	     403958 15-JUN-16
	 2	    1	      19  104857600	   512		2 NO  ACTIVE		      403958 15-JUN-16	     403962 15-JUN-16
	 3	    1	      17  104857600	   512		2 NO  ACTIVE		      403940 15-JUN-16	     403948 15-JUN-16
	 4	    1	      20  104857600	   512		2 NO  CURRENT		      403962 15-JUN-16	 2.8147E+14
	 5	    1	      16  104857600	   512		2 NO  INACTIVE		      403934 15-JUN-16	     403940 15-JUN-16
 2.              
   
  

, , CURRENT, 。

SQL> alter database drop logfile member '/u01/app/oracle/oradata/orcl/redo01a.log';
alter database drop logfile member '/u01/app/oracle/oradata/orcl/redo01a.log'
*
ERROR at line 1:
ORA-01609: log 1 is the current log for thread 1 - cannot drop members
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/orcl/redo01.log'
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/orcl/redo01a.log'
SQL> alter system switch logfile;

System altered.

SQL> alter database drop logfile member '/u01/app/oracle/oradata/orcl/redo01a.log';

Database altered.
로그 그룹 삭제;
ALTER DATABASE DROP LOGFILE GROUP N;--   N         ,      ,           。

좋은 웹페이지 즐겨찾기