熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

如何調整oracleredologfile日志文件的大小

2022-06-13   來源: Oracle 

  當前使用的日志是不能刪除的

  SQL> col member for a

  SQL> select * from v$logfile;

  GROUP# STATUS  TYPE    MEMBER                         IS_

  

           ONLINE  /data/dbstat/redodbf       NO

   STALE   ONLINE  /data/dbstat/redolog        NO

           ONLINE  /data/dbstat/redolog        NO

  SQL> alter database drop logfile group ;

  alter database drop logfile group

  *

  ERROR at line :

  ORA: log is current log for instance dbstat (thread ) cannot drop

  ORA: online log thread : /data/dbstat/redolog

  Inactive的刪除後增加新的日志文件

  SQL> alter database drop logfile group ;

  Database altered

  SQL> alter database add logfile group (/data/dbstat/redodbf) size M reuse;

  Database altered

  SQL> select * from v$logfile;

  GROUP# STATUS  TYPE    MEMBER                         IS_

  

           ONLINE  /data/dbstat/redodbf       NO

           ONLINE  /data/dbstat/redodbf       NO

           ONLINE  /data/dbstat/redolog        NO

  SQL> set linesize

  SQL> select * from v$Log;

  GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME

  

                                YES UNUSED                      

                                  NO  CURRENT                 ::

                                YES UNUSED                      

  切換日志組當current變成非活動時(inactive)將其刪除

  SQL> alter system switch logfile;

  System altered

  SQL> alter database drop logfile group ;

  alter database drop logfile group

  *

  ERROR at line :

  ORA: log needed for crash recovery of instance dbstat (thread )

  ORA: online log thread : /data/dbstat/redolog

  SQL> alter system switch logfile;

  System altered

  SQL> select * from v$Log;

  GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME

  

                               NO  ACTIVE                  ::

                                  NO  ACTIVE                  ::

                               NO  CURRENT                 ::

  SQL> alter system checkpoint;

  System altered

  SQL> select * from v$Log;

  GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME

  

                               NO  INACTIVE                ::

                                  NO  INACTIVE                ::

                               NO  CURRENT                 ::

  SQL> alter database drop logfile group ;

  Database altered

  SQL> alter database add logfile group (/data/dbstat/redodbf) size M;

  Database altered

  SQL> select * from v$log;

  GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME

  

                               NO  INACTIVE                ::

                                YES UNUSED                      

                               NO  CURRENT                 ::


From:http://tw.wingwit.com/Article/program/Oracle/201311/17226.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.