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;
/linux
以上只是在重启数据库的时候会触发,那么数据库的自动重启:
1.备库OS若是为windows,则能够选择服务自动启动。
2.若是备库OS为linux,则能够经过书写脚本部署定时任务,对数据库进行启动操做。
3.若是备库使用了GI,则GI会随着操做系统的启动数据库。数据库