[Oracle] oracle DG备库自动应用日志

oracle ADG物理备库在数据库重启后,不能自动对日志进行应用,可经过如下触发器来让数据库应用日志。
create or replace trigger dg_apply_log
  after startup on database
begin
  declare
    database_role varchar(20);
  begin
    select database_role
      into database_role
      from v$database;
   /* dbms_output.put_line('aa');*/
    if database_role = 'PHYSICAL STANDBY'
    then
      execute immediate 'alter database recover managed standby database using current logfile disconnect from session';
      dbms_output.put_line('bb');
    else
      dbms_output.put_line(database_role);
    end if;
  end;
end dg_apply_log;
/
——————————————————————————————————————————数据库

重庆思庄IT技术学习中心session

重庆思庄OCP认证培训班火热报名中,详情访问思庄网站咨询在线客服!1月OCP(周末+脱产)班正在面授,欢迎联系试听!oracle

相关文章
相关标签/搜索