select GROUP# ,BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log; GROUP# SIZE_M STATUS  ..."/>
您好,登錄后才能下訂單哦!
1.SYS@ORCL>select GROUP# ,BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log;
GROUP# SIZE_M STATUS ARC
---------- ---------- ---------------- ---
1 50 INACTIVE YES
2 50 INACTIVE YES
3 50 CURRENT NO
2.刪除原有的日志組;(只操作狀態(tài)為inactive的日志組)
若要操作日志組為current時(shí),需先進(jìn)行日志切換:alter system switch logfile;
若為active時(shí),則可強(qiáng)制進(jìn)行檢查點(diǎn):alter system checkpoint;
SYS@ORCL>alter system switch logfile;
System altered.
SYS@ORCL>alter system checkpoint; --強(qiáng)制執(zhí)行檢查點(diǎn)
SYS@ORCL>select GROUP# ,BYTES/1024/1024 size_M,STATUS,ARCHIVED from v$log;
GROUP# SIZE_M STATUS ARC
---------- ---------- ---------------- ---
1 50 INACTIVE YES
2 50 INACTIVE YES
3 50 ACTIVE YES
SYS@ORCL>alter database drop logfile group 1;
Database altered.
SYS@ORCL>alter database drop logfile group 2;
Database altered.
---------------------------
刪除后還需要去指定目錄刪除日志文件,后才能建立文件,如制定別的名字的日志組,應(yīng)該沒有此限制。
---------------------------
3.添加3組大小為200M的日志組;
SYS@ORCL>alter database add logfile group 1 '/u01/app/oracle/oradata/orcl11g/redo01.log'size 200m;
Database altered.
SYS@ORCL>alter database add logfile group 2 '/u01/app/oracle/oradata/orcl11g/redo02.log'size 200m;
Database altered.
SYS@ORCL>alter database add logfile group 3 '/u01/app/oracle/oradata/orcl11g/redo03.log'size 200m;
4.給日志組添加成員
cd /u01/app/oracle/oradata/orcl11g/
mkdir redo_bak
SYS@ORCL>alter database add logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo01_b.log' to group 1;
Database altered.
SYS@ORCL>alter database add logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo02_b.log' to group 2;
Database altered.
SYS@ORCL>alter database add logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo03_b.log' to group 3;
Database altered.
5.刪除日志組成員
alter database drop logfile member '/u01/app/oracle/oradata/orcl11g/redo_bak/redo02_b.log';
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。