oracle logfile 擴充套件
折騰日誌檔案,調整了一下大小,將每個日誌檔案調整為2G,副檔名取為dbf。
約略記錄一下步驟。
在用的是不能刪除的:
SQL> col member for a30
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------ ---
1 ONLINE /data1/dbstat/redo01.dbf NO
3 STALE ONLINE /data1/dbstat/redo3.log NO
2 ONLINE /data1/dbstat/redo2.log NO
SQL> alter database drop logfile group 2;
alter database drop logfile group 2
*
ERROR at line 1:
ORA-01623: log 2 is current log for instance dbstat (thread 1) - cannot drop
ORA-00312: online log 2 thread 1: '/data1/dbstat/redo2.log'
Inactive的刪除後,增加新的日誌檔案:
SQL> alter database drop logfile group 3;
Database altered.
SQL> alter database add logfile group 3 ('/data1/dbstat/redo03.dbf') size 2048M reuse;
Database altered.
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------ ---
1 ONLINE /data1/dbstat/redo01.dbf NO
3 ONLINE /data1/dbstat/redo03.dbf NO
2 ONLINE /data1/dbstat/redo2.log NO
SQL> set linesize 120
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 0 2147483648 1 YES UNUSED 0
2 1 11 52428800 1 NO CURRENT 203206 2009-09-17 18:56:08
3 1 0 2147483648 1 YES UNUSED 0
切換日誌組,當CURRENT變為非活動時(INACTIVE)將其刪除:
SQL> alter system switch logfile;
System altered.
SQL> alter database drop logfile group 2;
alter database drop logfile group 2
*
ERROR at line 1:
ORA-01624: log 2 needed for crash recovery of instance dbstat (thread 1)
ORA-00312: online log 2 thread 1: '/data1/dbstat/redo2.log'
SQL> alter system switch logfile;
System altered.
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 12 2147483648 1 NO ACTIVE 203704 2009-09-17 19:04:23
2 1 11 52428800 1 NO ACTIVE 203206 2009-09-17 18:56:08
3 1 13 2147483648 1 NO CURRENT 203710 2009-09-17 19:04:38
SQL> alter system checkpoint;
System altered.
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 12 2147483648 1 NO INACTIVE 203704 2009-09-17 19:04:23
2 1 11 52428800 1 NO INACTIVE 203206 2009-09-17 18:56:08
3 1 13 2147483648 1 NO CURRENT 203710 2009-09-17 19:04:38
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database add logfile group 2 ('/data1/dbstat/redo02.dbf') size 2048M;
Database altered.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 12 2147483648 1 NO INACTIVE 203704 2009-09-17 19:04:23
2 1 0 2147483648 1 YES UNUSED 0
3 1 13 2147483648 1 NO CURRENT 203710 2009-09-17 19:04:38
現在就可以應對大規模的日誌操作了。
約略記錄一下步驟。
在用的是不能刪除的:
SQL> col member for a30
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------ ---
1 ONLINE /data1/dbstat/redo01.dbf NO
3 STALE ONLINE /data1/dbstat/redo3.log NO
2 ONLINE /data1/dbstat/redo2.log NO
SQL> alter database drop logfile group 2;
alter database drop logfile group 2
*
ERROR at line 1:
ORA-01623: log 2 is current log for instance dbstat (thread 1) - cannot drop
ORA-00312: online log 2 thread 1: '/data1/dbstat/redo2.log'
Inactive的刪除後,增加新的日誌檔案:
SQL> alter database drop logfile group 3;
Database altered.
SQL> alter database add logfile group 3 ('/data1/dbstat/redo03.dbf') size 2048M reuse;
Database altered.
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------ ---
1 ONLINE /data1/dbstat/redo01.dbf NO
3 ONLINE /data1/dbstat/redo03.dbf NO
2 ONLINE /data1/dbstat/redo2.log NO
SQL> set linesize 120
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 0 2147483648 1 YES UNUSED 0
2 1 11 52428800 1 NO CURRENT 203206 2009-09-17 18:56:08
3 1 0 2147483648 1 YES UNUSED 0
切換日誌組,當CURRENT變為非活動時(INACTIVE)將其刪除:
SQL> alter system switch logfile;
System altered.
SQL> alter database drop logfile group 2;
alter database drop logfile group 2
*
ERROR at line 1:
ORA-01624: log 2 needed for crash recovery of instance dbstat (thread 1)
ORA-00312: online log 2 thread 1: '/data1/dbstat/redo2.log'
SQL> alter system switch logfile;
System altered.
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 12 2147483648 1 NO ACTIVE 203704 2009-09-17 19:04:23
2 1 11 52428800 1 NO ACTIVE 203206 2009-09-17 18:56:08
3 1 13 2147483648 1 NO CURRENT 203710 2009-09-17 19:04:38
SQL> alter system checkpoint;
System altered.
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 12 2147483648 1 NO INACTIVE 203704 2009-09-17 19:04:23
2 1 11 52428800 1 NO INACTIVE 203206 2009-09-17 18:56:08
3 1 13 2147483648 1 NO CURRENT 203710 2009-09-17 19:04:38
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database add logfile group 2 ('/data1/dbstat/redo02.dbf') size 2048M;
Database altered.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 12 2147483648 1 NO INACTIVE 203704 2009-09-17 19:04:23
2 1 0 2147483648 1 YES UNUSED 0
3 1 13 2147483648 1 NO CURRENT 203710 2009-09-17 19:04:38
現在就可以應對大規模的日誌操作了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28869493/viewspace-1979482/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE 擴充套件Oracle套件
- kotlin 擴充套件(擴充套件函式和擴充套件屬性)Kotlin套件函式
- WCF擴充套件:行為擴充套件Behavior Extension套件
- 【Kotlin】擴充套件屬性、擴充套件函式Kotlin套件函式
- Sanic 擴充套件套件
- 擴充套件工具套件
- 擴充套件歐幾里得套件
- DOM擴充套件套件
- 擴充套件ACL套件
- Lua擴充套件套件
- 照片擴充套件套件
- 擴充套件篇套件
- disable or 擴充套件套件
- 擴充套件表套件
- Mybatis擴充套件MyBatis套件
- centos安裝php的oracle擴充套件CentOSPHPOracle套件
- JMeter 擴充套件開發:擴充套件 TCP 取樣器JMeter套件TCP
- ?用Chrome擴充套件管理器, 管理你的擴充套件Chrome套件
- ASP.NET Core擴充套件庫之Http通用擴充套件ASP.NET套件HTTP
- php7安裝redis擴充套件和memcache擴充套件PHPRedis套件
- Oracle行資料擴充套件方法總結Oracle套件
- Oracle 11g對AWR的擴充套件Oracle套件
- 分類擴充套件套件
- 擴充套件表示式套件
- 新增php擴充套件PHP套件
- swift擴充套件ExtensionsSwift套件
- iOS 通知擴充套件iOS套件
- 可擴充套件性套件
- 19-擴充套件套件
- Nmap 擴充套件(四)套件
- Flask 自建擴充套件Flask套件
- 擴充套件包上傳套件
- DOM部分擴充套件套件
- 擴充套件知識套件
- php ubuntu 擴充套件PHPUbuntu套件
- greenplum擴充套件segment套件
- ios UIcolor擴充套件iOSUI套件
- 擴充套件BSGS/exBSGS套件