oracle dblinik 表快速同步
Posted zfzf1
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle dblinik 表快速同步相关的知识,希望对你有一定的参考价值。
create public database link link_mm_dev
connect to stl identified by fosssit
using ‘(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.111)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = fossdbsb)
)
)‘;
--1 link_mm_dev dblink名称
--2 %MM% 外部数据库 需要的表
declare
num number(1);
begin
for v_row in (select t.table_name
from [email protected]_mm_dev t
where t.table_name like ‘%MM%‘) loop
select count(1)
into num
from user_tables t
where t.table_name = v_row.table_name;
if num > 0 then
execute immediate ‘drop table ‘ || v_row.table_name;
num:=0;
end if;
execute immediate ‘create table ‘ || v_row.table_name ||
‘ as select * from ‘ || v_row.table_name||‘@link_mm_dev‘;
end loop;
end;
以上是关于oracle dblinik 表快速同步的主要内容,如果未能解决你的问题,请参考以下文章