oracle DG备库自动应用日志

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;
/

oracle DG备库自动应用日志以上只是在重启数据库的时候会触发,那么数据库的自动重启:
1.备库OS如果为windows,则可以选择服务自动启动。
2.如果备库OS为linux,则可以通过书写脚本部署定时任务,对数据库进行启动操作。
3.如果备库使用了GI,则GI会随着操作系统的启动数据库。

oracle DG备库自动应用日志

转载于:https://my.oschina.net/u/3761438/blog/1999684