創(chuàng)建3個新的日志組
創(chuàng)新互聯(lián)是一家專注于成都網(wǎng)站建設(shè)、網(wǎng)站制作與策劃設(shè)計(jì),鄯善網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)十多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:鄯善等地區(qū)。鄯善做網(wǎng)站價(jià)格咨詢:13518219792
SQL> ALTER DATABASE ADD LOGFILE GROUP 4 ('/u01/app/oracle/oradata/orcl/redo06.log') SIZE 500M;
SQL> ALTER DATABASE ADD LOGFILE GROUP 5 ('/u01/app/oracle/oradata/orcl/redo05.log') SIZE 500M;
SQL> ALTER DATABASE ADD LOGFILE GROUP 6 ('/u01/app/oracle/oradata/orcl/redo06.log') SIZE 500M;
查看日志組
SQL> select * from v$logfile;
2.切換當(dāng)前日志到新的日志組
SQL> alter system switch logfile;
SQL> alter system switch logfile;
SQL> alter system switch logfile;
切到要刪除為INCACTIVE才行
SQL> select group#,sequence#,bytes,members,status from v$log;
GROUP# SEQUENCE# BYTES MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
1 139 52428800 1 INACTIVE
2 137 52428800 1 INACTIVE
3 138 52428800 1 INACTIVE
4 140 524288000 1 ACTIVE
5 141 524288000 1 CURRENT
6 136 524288000 1 INACTIVE
3.刪除舊的日志組
SQL> alter database drop logfile group 1;
Database altered.
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database drop logfile group 3;
查看是否刪除了日志組
SQL> select group#,sequence#,bytes,members,status from v$log;
GROUP# SEQUENCE# BYTES MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
4 140 524288000 1 INACTIVE
5 141 524288000 1 CURRENT
6 136 524288000 1 INACTIVE
4.操作系統(tǒng)刪除原日志組1、2、3中的文件
[oracle@oracle122 log]$ cd /u01/app/oracle/oradata/orcl
[oracle@oracle122 orcl]$
[oracle@oracle122 orcl]$ pwd
/u01/app/oracle/oradata/orcl
[oracle@oracle122 orcl]$ ls
control01.ctl example01.dbf redo01.log redo02.log redo03.log redo04.log redo05.log redo06.log sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf
[oracle@oracle122 orcl]$ rm -rf redo01.log
[oracle@oracle122 orcl]$ rm -rf redo02.log
[oracle@oracle122 orcl]$ rm -rf redo03.log
5.重建日志組1、2、3
SQL> ALTER DATABASE ADD LOGFILE GROUP 1 ('/u01/app/oracle/oradata/orcl/redo01.log') SIZE 500M;
SQL> ALTER DATABASE ADD LOGFILE GROUP 2 ('/u01/app/oracle/oradata/orcl/redo02.log') SIZE 500M;
SQL> ALTER DATABASE ADD LOGFILE GROUP 3 ('/u01/app/oracle/oradata/orcl/redo03.log') SIZE 500M;
7.刪除中間過渡用的日志組4、5、6 ,在刪除時查詢select group#,sequence#,bytes,members,status from v$log; 刪除組是否為INACTIVE,如果不是INACTIVE 就要執(zhí)行alter system switch logfile;
查詢看一下
SQL> select group#,sequence#,bytes,members,status from v$log;
GROUP# SEQUENCE# BYTES MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
1 148 524288000 1 CURRENT
2 143 524288000 1 INACTIVE
3 144 524288000 1 INACTIVE
4 146 524288000 1 INACTIVE
5 147 524288000 1 INACTIVE
6 145 524288000 1 INACTIVE
SQL> alter database drop logfile group 4;
Database altered.
SQL> alter database drop logfile group 5;
Database altered.
SQL> alter database drop logfile group 6;
Database altered.
8.到操作系統(tǒng)刪除組4、5、6
[oracle@oracle122 orcl]$ rm -rf redo04.log
[oracle@oracle122 orcl]$ rm -rf redo05.log
[oracle@oracle122 orcl]$ rm -rf redo06.log
9.備份當(dāng)前最新的控制文件
SQL> alter database backup controlfile to trace resetlogs ;
當(dāng)前文章:修改oracle重做日志文件大小
當(dāng)前路徑:http://aaarwkj.com/article42/isjdec.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營銷推廣、手機(jī)網(wǎng)站建設(shè)、網(wǎng)站策劃、自適應(yīng)網(wǎng)站、品牌網(wǎng)站建設(shè)、標(biāo)簽優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)