是因为STANDBY FILE MANAGEMENT这个参数是manual状态,一般是设置成auto状态的
首先查询主备库的数据文件,使用下面这条语句查询
select file#,name from v$datafile;
然后对比主备库缺失的数据文件,并创建数据文件
alter database create datafile '/oracle/app/11.2.0/db_1/dbs/UNNAMED00100' as '/oradata/oracle/STANDBY/datafile/hiop_his.dbf';
然后开启同步,注意,也可以在trace日志里查看需要同步的数据文件,名称要一致,否则不能正常同步
alter database recover managed standby database disconnect from session;
设置参数为自动
alter system set standby_file_management=auto;
查询同步的数据文件时间戳
select to_char(checkpoint_time,'yyyy-mm-dd hh24:mi:ss') from v$datafile;
查看同步状态
select process,status,sequence# from v$managed_standby;
MPR0状态为applying_log就行了
show parameter standby_file_management;
select file#,name from v$datafile;
alter database create datafile '/oracle/app/11.2.0/db_1/dbs/UNNAMED00100' as '/oradata/oracle/STANDBY/datafile/hiop_his.dbf';
alter system set standby_file_management=auto;
alter system set standby_file_management=manual;
select to_char(checkpoint_time,'yyyy-mm-dd hh24:mi:ss') from v$datafile;
alter database recover managed standby database cancel;
alter database recover managed standby database disconnect from session;
select file#,name from v$datafile;
alter database create datafile '/oradata/oracle/STANDBY/datafile/hiop_his.dbf' as '/oradata/oracle/STANDBY/datafile/tsp_inpbill_310.dbf';
select process,status,sequence# from v$managed_standby;
select * from V$DATAGUARD_STATS;
alter database recover managed standby database using current logfile disconnect from session;
select switchover_status from v$database;
select group#,sequence#,first_change#,next_change#,status,used from v$standby_log;
select DATABASE_ROLE,SWITCHOVER_STATUS,OPEN_MODE from v$database;
select group#,bytes/1024/1024,status from v$standby_log;
SELECT GROUP#,THREAD#,SEQUENCE#,ARCHIVED,STATUS FROM V$STANDBY_LOG;
发表评论