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會隨着操做系統的啓動數據庫。數據庫