oracle DG備庫自動應用日誌
最新
03-15
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;
/
以上只是在重啟資料庫的時候會觸發,那麼資料庫的自動重啟:
1。備庫OS如果為windows,則可以選擇服務自動啟動。
2.如果備庫OS為linux,則可以通過書寫腳本部署定時任務,對資料庫進行啟動操作。
3.如果備庫使用了GI,則GI會隨著操作系統的啟動資料庫。
TAG:思庄IT技術中心 |