1、redo
--查看日志组
select * from v$log;
members: 日志组成员数
archived: 归档,写满的日志的备份
status:
active:实例恢复需要
inactive:实例恢复不需要
current:当前正在用的
unused:还没有使用到的
first_change#
表示系统从哪个点开始日志记录在这个文件
scn:system change number
select current_scn from v$database;
select dbms_flashback.get_system_change_number from dual;
--查看日志
select * from v$logfile;
STATUS 列的常见值:
INVALID 表明该文件不可访问。
STALE 表明该文件内容不完全,例如正在添加一个日志文件成员。
DELETED 表明该文件已不再使用。
In general, the stale status of a redo log member should not be a cause
for great concern, unless you observe that this happens frequently or
systematically. Keep in mind that a stale log is not necessarily an
invalid log, but more of an "in-doubt" one. Once the corresponding redo
group becomes the current one again, the stale status will go away by
itself.
--查看日志历史
select * from v$log_history;
日志操作
--删除日志组
select * from v$log;
alter database drop logfile group 1;
--增加日志组
alter database add logfile group 1
('E:\oracle\product\10.2.0\oradata\mydb\redo0101.log','E:\oracle\product\10.2.0\oradata\mydb\redo0102.log') size 20M;
--删除增加第2组
--查看日志组
select * from v$log;
members: 日志组成员数
archived: 归档,写满的日志的备份
status:
active:实例恢复需要
inactive:实例恢复不需要
current:当前正在用的
unused:还没有使用到的
first_change#
表示系统从哪个点开始日志记录在这个文件
scn:system change number
select current_scn from v$database;
select dbms_flashback.get_system_change_number from dual;
--查看日志
select * from v$logfile;
STATUS 列的常见值:
INVALID 表明该文件不可访问。
STALE 表明该文件内容不完全,例如正在添加一个日志文件成员。
DELETED 表明该文件已不再使用。
In general, the stale status of a redo log member should not be a cause
for great concern, unless you observe that this happens frequently or
systematically. Keep in mind that a stale log is not necessarily an
invalid log, but more of an "in-doubt" one. Once the corresponding redo
group becomes the current one again, the stale status will go away by
itself.
--查看日志历史
select * from v$log_history;
日志操作
--删除日志组
select * from v$log;
alter database drop logfile group 1;
--增加日志组
alter database add logfile group 1
('E:\oracle\product\10.2.0\oradata\mydb\redo0101.log','E:\oracle\product\10.2.0\oradata\mydb\redo0102.log') size 20M;
--删除增加第2组