Oracle重做日志成员(文件)-新增、删除

前端之家收集整理的这篇文章主要介绍了Oracle重做日志成员(文件)-新增、删除前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

分别给日志组1/2各增加一个成员

sql> alter database add logfile member
2 'C:\ORACEL\BASE\ORADATA\ORCL\REDO04.LOG' to group 1,
3 'C:\ORACEL\BASE\ORADATA\ORCL\REDO05.LOG' to group 2;
Database altered
查看
sql> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIVED STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- -------- ---------------- ------------- ----------- ------------ -----------
1 1 13 52428800 512 2 NO INACTIVE 21995736819 2017-9-21 9 21995740613 2017-9-21 1
2 1 14 52428800 512 2 NO CURRENT 21995740613 2017-9-21 1 281474976710
3 1 12 52428800 512 1 NO INACTIVE 21995708930 2017-9-21 7 21995736819 2017-9-21 9


删除
删除前查看是否当前组 如果是则不能删除 进行切换 alter system switch logfile;

查看 state 为current的是当前组
QL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIVED STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- -------- ---------------- ------------- ----------- ------------ -----------
1 1 13 52428800 512 2 NO INACTIVE 21995736819 2017-9-21 9 21995740613 2017-9-21 1
2 1 14 52428800 512 2 NO CURRENT 21995740613 2017-9-21 1 281474976710
3 1 12 52428800 512 1 NO INACTIVE 21995708930 2017-9-21 7 21995736819 2017-9-21 9


删除 group 1 的一个文件

sql> alter database drop logfile member 'C:\ORACEL\BASE\ORADATA\ORCL\REDO04.LOG';
Database altered

查看确认是否删除 sql> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIVED STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME ---------- ---------- ---------- ---------- ---------- ---------- -------- ---------------- ------------- ----------- ------------ ----------- 1 1 13 52428800 512 1 NO INACTIVE 21995736819 2017-9-21 9 21995740613 2017-9-21 1 2 1 14 52428800 512 2 NO CURRENT 21995740613 2017-9-21 1 281474976710 3 1 12 52428800 512 1 NO INACTIVE 21995708930 2017-9-21 7 21995736819 2017-9-21 9 sql>

猜你在找的Oracle相关文章