oracle 19C 新特性 DML Redirection
Oracle 19C Active Data Guard新特性之DML重定向(DML Redirection)
通过在系统级或会话级设置ADG_REDIRECT_DML参数,启用DML重定向功能
设置方式(备库)
-- 会话级别
ALTER SESSION ENABLE ADG_REDIRECT_DML;
-- 系统级别
alter system ENABLE ADG_REDIRECT_DML;
1.
2.
3.
4.
使用
ALTER SESSION ENABLE ADG_REDIRECT_DML;
-- 然后就可以像主库一样执行DML语句
insert into table_name values(col1,col2);
......
commit;
1.
2.
3.
4.
5.
注意事项
ADG 中 DML 重定向新特性可能带来备库的安全管控问题,否则可能会破环主库的一致性。
在oracle 18c的时候,可以通过设置隐含参数实现相同的功能
alter session set "_enable_proxy_adg_redirect"=true;
-- 跟踪该会话
alter session set events '10046 trace name context forever ,level 12';
1.
2.
3.
这个DML操作实际是通过内部DB Link来重定向到主库执行的,然后通过日志再同步到备库。
GOAL
What is the use of database Link SYS.SYS_HUB and can it be deleted?
SOLUTION
This db link is used to route dml operations issued on read only instance to a read write instance where it can actually be executed.
It could be used in both cases(CDB/PDB and standalone database). The db link was defined to work in any setup in which read write and
read only instances are present.
If you are not using RW (Read Write (RW) instance is an instance in which read and write operations can be done. Select/Insert/Update/Delete)
/ RO (Read Only instance only allows read operations. Select) instance configuration, You can delete the db link with no side effects.