DG 配置standby redolog

2018-06-22

最佳性能模式可以忽略,如果要转为其它两种模式则要配置standby redolog.

1、重做日志:
SELECT GROUP#,THREAD#,SEQUENCE#,ARCHIVED,STATUS FROM V$STANDBY_LOG;

2、ORA-38500: USING CURRENT LOGFILE option not available without standby redo log

3、在主库和备库中创建日志组和redo log文件
分别在dg1和dg2上建立standby文件夹,用于standby Redo log
[oracle@dg1 ] $ mkdir /u02/oracle/oradata/db1/standby
[oracle@dg2 ] $ mkdir /u02/oracle/oradata/db1/standby
alter database add standby logfile group 4('/u02/oracle/oradata/db1/standy/redo_dg_021.log') SIZE 50M;
alter database add standby logfile group 5('/u02/oracle/oradata/db1/standy/redo_dg_022.log') SIZE 50M;
alter database add standby logfile group 6('/u02/oracle/oradata/db1/standy/redo_dg_023.log') SIZE 50M;
alter database add standby logfile group 7('/u02/oracle/oradata/db1/standy/redo_dg_024.log') SIZE 50M;
删除
alter database drop standby logfile group 4;
alter database drop standby logfile group 5;
alter database drop standby logfile group 6;
alter database drop standby logfile group 7;

select * from v$logfile;
alter system switch logfile;
select SEQUENCE#,applied,FIRST_TIME,NEXT_TIME from v$archived_log order by 1 desc;

select PROCESS,STATUS,SEQUENCE#,BLOCK# from V$MANAGED_STANDBY where process='LNS';
select PROCESS,CLIENT_PROCESS,SEQUENCE#,BLOCK# from V$MANAGED_STANDBY where PROCESS='RFS';

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

在主库查看日志组的数量和每个日志文件的大小
SQL> SELECT GROUP#, BYTES FROM V$LOG;
在备库查看日志组的数量和每个日志文件的大小
SQL> SELECT GROUP#, BYTES FROM V$STANDBY_LOG;

4、主库
select DATABASE_ROLE,SWITCHOVER_STATUS,OPEN_MODE from v$database;
备库
select DATABASE_ROLE,SWITCHOVER_STATUS,OPEN_MODE from v$database;
select sequence#,applied,first_time,next_time from v$archived_log;

5、备机日志:
select process,status from v$managed_standby;
ARCH CONNECTED
ARCH CONNECTED
ARCH CLOSING
ARCH CLOSING
ARCH CONNECTED
RFS IDLE
RFS IDLE
RFS IDLE

RFS远程文件接收进程
MRP0 -日志应用进程

分类:数据库 | 标签: |

相关日志

评论被关闭!